From xen-changelog-bounces@lists.xen.org Mon Feb 02 08:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 08:11: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 1YIC68-0007Bo-FT; Mon, 02 Feb 2015 08:11:08 +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 1YIC65-0007BH-Ow
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:06 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	43/B2-02754-9113FC45; Mon, 02 Feb 2015 08:11:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1422864663!3797796!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32577 invoked from network); 2 Feb 2015 08:11:04 -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;
	2 Feb 2015 08: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 1YIC63-0006ty-L9
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC63-0001g1-Gl
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Message-Id: <E1YIC63-0001g1-Gl@xenbits.xen.org>
Date: Mon, 02 Feb 2015 08:11:03 +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] MSI: also reject resource with
	flags all clear
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1422864341 -3600
# Node ID aeb8696ffa4b562620b72d28cc6f2f6562b015d4
# Parent  778d332748c23366362c6af4b074b7ca530c4e68
MSI: also reject resource with flags all clear

When resource assignment fails, things may end up this way, and we want
to avoid using the resource in that case.

Derived from an upstream patch by Yijing Wang <wangyijing@huawei.com>.

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


diff -r 778d332748c2 -r aeb8696ffa4b drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Mon Feb 02 08:55:09 2015 +0100
+++ b/drivers/pci/msi-xen.c	Mon Feb 02 09:05:41 2015 +0100
@@ -204,7 +204,9 @@ static u64 find_table_base(struct pci_de
 	bar = reg & PCI_MSIX_FLAGS_BIRMASK;
 
 	flags = pci_resource_flags(dev, bar);
-	if (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET | IORESOURCE_BUSY))
+	if (!flags ||
+	     (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET |
+		       IORESOURCE_BUSY)))
 		return 0;
 
 	return pci_resource_start(dev, bar);

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

From xen-changelog-bounces@lists.xen.org Mon Feb 02 08:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 08:11: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 1YIC68-0007Bt-HX; Mon, 02 Feb 2015 08:11:08 +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 1YIC66-0007BJ-RJ
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:07 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	74/2E-25903-A113FC45; Mon, 02 Feb 2015 08:11:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422864664!11650896!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 875 invoked from network); 2 Feb 2015 08:11:04 -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;
	2 Feb 2015 08: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 1YIC63-0006u1-Sn
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC63-0001gG-Rq
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Message-Id: <E1YIC63-0001gG-Rq@xenbits.xen.org>
Date: Mon, 02 Feb 2015 08:11:03 +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] pvscsi: support suspend/resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 Juergen Gross <jgross@suse.com>
# Date 1422864594 -3600
# Node ID a3e3a5aea1a2aa30d7f45d9f69569bb3c7ca20e7
# Parent  aeb8696ffa4b562620b72d28cc6f2f6562b015d4
pvscsi: support suspend/resume

Up to now the pvscsi drivers haven't supported domain suspend and
resume. When a domain with an assigned pvscsi device was suspended
and resumed again, it was not able to use the device any more: trying
to do so resulted in hanging processes.

Support suspend and resume of pvscsi devices.

Signed-off-by: Juergen Gross <jgross@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsiback/xenbus.c
--- a/drivers/xen/scsiback/xenbus.c	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsiback/xenbus.c	Mon Feb 02 09:09:54 2015 +0100
@@ -167,33 +167,48 @@ static void scsiback_do_lun_hotplug(stru
 
 		switch (op) {
 		case VSCSIBACK_OP_ADD_OR_DEL_LUN:
-			if (device_state == XenbusStateInitialising) {
+			switch (device_state) {
+			case XenbusStateInitialising:
+			case XenbusStateConnected:
 				sdev = scsiback_get_scsi_device(&phy);
-				if (!sdev)
-					xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-							    "%d", XenbusStateClosed);
-				else {
-					err = scsiback_add_translation_entry(be->info, sdev, &vir);
-					if (!err) {
-						if (xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-								    "%d", XenbusStateInitialised)) {
-							printk(KERN_ERR "scsiback: xenbus_printf error %s\n", state_str);
-							scsiback_del_translation_entry(be->info, &vir);
-						}
-					} else {
-						scsi_device_put(sdev);
-						xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-								    "%d", XenbusStateClosed);
-					}
+				if (!sdev) {
+					xenbus_printf(XBT_NIL, dev->nodename,
+						      state_str,
+						      "%d", XenbusStateClosed);
+					break;
 				}
-			}
+				if (scsiback_add_translation_entry(be->info,
+								sdev, &vir)) {
+					scsi_device_put(sdev);
+					if (device_state == XenbusStateConnected)
+						break;
+					xenbus_printf(XBT_NIL, dev->nodename,
+						      state_str,
+						      "%d", XenbusStateClosed);
+					break;
+				}
+				if (!xenbus_printf(XBT_NIL, dev->nodename,
+						  state_str, "%d",
+						  XenbusStateInitialised))
+					break;
+				printk(KERN_ERR "scsiback: xenbus_printf error %s\n",
+				       state_str);
+				scsiback_del_translation_entry(be->info, &vir);
+				break;
 
-			if (device_state == XenbusStateClosing) {
-				if (!scsiback_del_translation_entry(be->info, &vir)) {
-					if (xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-							    "%d", XenbusStateClosed))
-						printk(KERN_ERR "scsiback: xenbus_printf error %s\n", state_str);
-				}
+			case XenbusStateClosing:
+				if (scsiback_del_translation_entry(be->info,
+								   &vir))
+					break;
+				if (xenbus_printf(XBT_NIL, dev->nodename,
+						  state_str, "%d",
+						  XenbusStateClosed))
+					printk(KERN_ERR "scsiback: xenbus_printf error %s\n",
+					       state_str);
+				break;
+
+			default:
+				break;
 			}
 			break;
 
diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsifront/common.h
--- a/drivers/xen/scsifront/common.h	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsifront/common.h	Mon Feb 02 09:09:54 2015 +0100
@@ -75,7 +75,9 @@
 
 struct vscsifrnt_shadow {
 	uint16_t next_free;
-	
+#define VSCSIIF_IN_USE		0x0fff
+#define VSCSIIF_NONE		0x0ffe
+
 	/* command between backend and frontend
 	 * VSCSIIF_ACT_SCSI_CDB or VSCSIIF_ACT_SCSI_RESET */
 	unsigned char act;
@@ -113,8 +115,12 @@ struct vscsifrnt_info {
 	struct task_struct *kthread;
 	wait_queue_head_t wq;
 	wait_queue_head_t wq_sync;
+	wait_queue_head_t wq_pause;
 	unsigned char waiting_resp;
 	unsigned char waiting_sync;
+	unsigned char waiting_pause;
+	unsigned char pause;
+	unsigned callers;
 };
 
 #define DPRINTK(_f, _a...)				\
@@ -124,6 +130,7 @@ struct vscsifrnt_info {
 int scsifront_xenbus_init(void);
 void scsifront_xenbus_unregister(void);
 int scsifront_schedule(void *data);
+void scsifront_finish_all(struct vscsifrnt_info *info);
 irqreturn_t scsifront_intr(int irq, void *dev_id, struct pt_regs *ptregs);
 
 
diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsifront/scsifront.c
--- a/drivers/xen/scsifront/scsifront.c	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsifront/scsifront.c	Mon Feb 02 09:09:54 2015 +0100
@@ -40,9 +40,9 @@ static int get_id_from_freelist(struct v
 	spin_lock_irqsave(&info->shadow_lock, flags);
 
 	free = info->shadow_free;
-	BUG_ON(free > VSCSIIF_MAX_REQS);
+	BUG_ON(free >= VSCSIIF_MAX_REQS);
 	info->shadow_free = info->shadow[free].next_free;
-	info->shadow[free].next_free = 0x0fff;
+	info->shadow[free].next_free = VSCSIIF_IN_USE;
 
 	info->shadow[free].wait_reset = 0;
 
@@ -188,27 +188,26 @@ static void scsifront_sync_cmd_done(stru
 	wake_up(&(info->shadow[id].wq_reset));
 }
 
+static void scsifront_do_response(struct vscsifrnt_info *info,
+				  vscsiif_response_t *ring_res)
+{
+	if (info->shadow[ring_res->rqid].act == VSCSIIF_ACT_SCSI_CDB)
+		scsifront_cdb_cmd_done(info, ring_res);
+	else
+		scsifront_sync_cmd_done(info, ring_res);
+}
 
-static int scsifront_cmd_done(struct vscsifrnt_info *info)
+static int scsifront_ring_drain(struct vscsifrnt_info *info)
 {
 	vscsiif_response_t *ring_res;
-
 	RING_IDX i, rp;
 	int more_to_do = 0;
-	unsigned long flags;
-
-	spin_lock_irqsave(info->host->host_lock, flags);
 
 	rp = info->ring.sring->rsp_prod;
 	rmb();
 	for (i = info->ring.rsp_cons; i != rp; i++) {
-		
 		ring_res = RING_GET_RESPONSE(&info->ring, i);
-
-		if (info->shadow[ring_res->rqid].act == VSCSIIF_ACT_SCSI_CDB)
-			scsifront_cdb_cmd_done(info, ring_res);
-		else
-			scsifront_sync_cmd_done(info, ring_res);
+		scsifront_do_response(info, ring_res);
 	}
 
 	info->ring.rsp_cons = i;
@@ -219,6 +218,18 @@ static int scsifront_cmd_done(struct vsc
 		info->ring.sring->rsp_event = i + 1;
 	}
 
+	return more_to_do;
+}
+
+static int scsifront_cmd_done(struct vscsifrnt_info *info)
+{
+	int more_to_do;
+	unsigned long flags;
+
+	spin_lock_irqsave(info->host->host_lock, flags);
+
+	more_to_do = scsifront_ring_drain(info);
+
 	info->waiting_sync = 0;
 
 	spin_unlock_irqrestore(info->host->host_lock, flags);
@@ -231,8 +242,23 @@ static int scsifront_cmd_done(struct vsc
 	return more_to_do;
 }
 
+void scsifront_finish_all(struct vscsifrnt_info *info)
+{
+	unsigned i;
+	struct vscsiif_response resp;
 
+	scsifront_ring_drain(info);
 
+	for (i = 0; i < VSCSIIF_MAX_REQS; i++) {
+		if (info->shadow[i].next_free != VSCSIIF_IN_USE)
+			continue;
+		resp.rqid = i;
+		resp.sense_len = 0;
+		resp.rslt = DID_RESET << 16;
+		resp.residual_len = 0;
+		scsifront_do_response(info, &resp);
+	}
+}
 
 int scsifront_schedule(void *data)
 {
@@ -359,6 +385,27 @@ big_to_sg:
 	return ref_cnt;
 }
 
+static int scsifront_enter(struct vscsifrnt_info *info)
+{
+	if (info->pause)
+		return 1;
+	info->callers++;
+	return 0;
+}
+
+static void scsifront_return(struct vscsifrnt_info *info)
+{
+	info->callers--;
+	if (info->callers)
+		return;
+
+	if (!info->waiting_pause)
+		return;
+
+	info->waiting_pause = 0;
+	wake_up(&info->wq_pause);
+}
+
 static int scsifront_queuecommand(struct scsi_cmnd *sc,
 				  void (*done)(struct scsi_cmnd *))
 {
@@ -368,6 +415,9 @@ static int scsifront_queuecommand(struct
 	int ref_cnt;
 	uint16_t rqid;
 
+	if (scsifront_enter(info))
+		return SCSI_MLQUEUE_HOST_BUSY;
+
 /* debug printk to identify more missing scsi commands
 	shost_printk(KERN_INFO "scsicmd: ", sc->device->host,
 		     "len=%u %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\n",
@@ -420,13 +470,16 @@ static int scsifront_queuecommand(struct
 
 	scsifront_do_request(info);
 
+	scsifront_return(info);
 	return 0;
 
 out_host_busy:
+	scsifront_return(info);
 	return SCSI_MLQUEUE_HOST_BUSY;
 
 out_fail_command:
 	done(sc);
+	scsifront_return(info);
 	return 0;
 }
 
@@ -451,7 +504,7 @@ static int scsifront_dev_reset_handler(s
 	spin_lock_irq(host->host_lock);
 #endif
 	while (RING_FULL(&info->ring)) {
-		if (err) {
+		if (err || info->pause) {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
 			spin_unlock_irq(host->host_lock);
 #endif
@@ -464,6 +517,11 @@ static int scsifront_dev_reset_handler(s
 		spin_lock_irq(host->host_lock);
 	}
 
+	if (scsifront_enter(info)) {
+		spin_unlock_irq(host->host_lock);
+		return FAILED;
+	}
+
 	ring_req      = scsifront_pre_request(info);
 	ring_req->act = VSCSIIF_ACT_SCSI_RESET;
 
@@ -502,6 +560,8 @@ static int scsifront_dev_reset_handler(s
 		err = FAILED;
 	}
 
+	scsifront_return(info);
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
 	spin_unlock_irq(host->host_lock);
 #endif
diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsifront/xenbus.c
--- a/drivers/xen/scsifront/xenbus.c	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsifront/xenbus.c	Mon Feb 02 09:09:54 2015 +0100
@@ -43,6 +43,20 @@
 
 extern struct scsi_host_template scsifront_sht;
 
+static void scsifront_free_ring(struct vscsifrnt_info *info)
+{
+	if (info->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(info->ring_ref,
+					(unsigned long)info->ring.sring);
+		info->ring_ref = GRANT_INVALID_REF;
+		info->ring.sring = NULL;
+	}
+
+	if (info->irq)
+		unbind_from_irqhandler(info->irq, info);
+	info->irq = 0;
+}
+
 static void scsifront_free(struct vscsifrnt_info *info)
 {
 	struct Scsi_Host *host = info->host;
@@ -55,16 +69,7 @@ static void scsifront_free(struct vscsif
 		scsi_remove_host(info->host);
 	}
 
-	if (info->ring_ref != GRANT_INVALID_REF) {
-		gnttab_end_foreign_access(info->ring_ref,
-					(unsigned long)info->ring.sring);
-		info->ring_ref = GRANT_INVALID_REF;
-		info->ring.sring = NULL;
-	}
-
-	if (info->irq)
-		unbind_from_irqhandler(info->irq, info);
-	info->irq = 0;
+	scsifront_free_ring(info);
 
 	scsi_host_put(info->host);
 }
@@ -196,7 +201,7 @@ static int scsifront_probe(struct xenbus
 		init_waitqueue_head(&(info->shadow[i].wq_reset));
 		info->shadow[i].wait_reset = 0;
 	}
-	info->shadow[VSCSIIF_MAX_REQS - 1].next_free = 0x0fff;
+	info->shadow[VSCSIIF_MAX_REQS - 1].next_free = VSCSIIF_NONE;
 
 	err = scsifront_init_ring(info);
 	if (err) {
@@ -208,6 +213,11 @@ static int scsifront_probe(struct xenbus
 	init_waitqueue_head(&info->wq_sync);
 	spin_lock_init(&info->shadow_lock);
 
+	info->pause = 0;
+	info->callers = 0;
+	info->waiting_pause = 0;
+	init_waitqueue_head(&info->wq_pause);
+
 	snprintf(name, DEFAULT_TASK_COMM_LEN, "vscsiif.%d", info->host->host_no);
 
 	info->kthread = kthread_run(scsifront_schedule, info, name);
@@ -240,6 +250,66 @@ free_sring:
 	return err;
 }
 
+static int scsifront_resume(struct xenbus_device *dev)
+{
+	struct vscsifrnt_info *info = dev->dev.driver_data;
+	struct Scsi_Host *host = info->host;
+	int err;
+
+	spin_lock_irq(host->host_lock);
+
+	/* finish all still pending commands */
+	scsifront_finish_all(info);
+
+	spin_unlock_irq(host->host_lock);
+
+	/* reconnect to dom0 */
+	scsifront_free_ring(info);
+	err = scsifront_init_ring(info);
+	if (err) {
+		dev_err(&dev->dev, "fail to resume %d\n", err);
+		scsifront_free(info);
+		return err;
+	}
+
+	xenbus_switch_state(dev, XenbusStateInitialised);
+
+	return 0;
+}
+
+static int scsifront_suspend(struct xenbus_device *dev)
+{
+	struct vscsifrnt_info *info = dev->dev.driver_data;
+	struct Scsi_Host *host = info->host;
+	int err = 0;
+
+	/* no new commands for the backend */
+	spin_lock_irq(host->host_lock);
+	info->pause = 1;
+	while (info->callers && !err) {
+		info->waiting_pause = 1;
+		info->waiting_sync = 0;
+		spin_unlock_irq(host->host_lock);
+		wake_up(&info->wq_sync);
+		err = wait_event_interruptible(info->wq_pause,
+					       !info->waiting_pause);
+		spin_lock_irq(host->host_lock);
+	}
+	spin_unlock_irq(host->host_lock);
+	return err;
+}
+
+static int scsifront_suspend_cancel(struct xenbus_device *dev)
+{
+	struct vscsifrnt_info *info = dev->dev.driver_data;
+	struct Scsi_Host *host = info->host;
+
+	spin_lock_irq(host->host_lock);
+	info->pause = 0;
+	spin_unlock_irq(host->host_lock);
+	return 0;
+}
+
 static int scsifront_remove(struct xenbus_device *dev)
 {
 	struct vscsifrnt_info *info = dev->dev.driver_data;
@@ -278,6 +348,7 @@ static int scsifront_disconnect(struct v
 
 #define VSCSIFRONT_OP_ADD_LUN	1
 #define VSCSIFRONT_OP_DEL_LUN	2
+#define VSCSIFRONT_OP_READD_LUN	3
 
 static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
 {
@@ -339,6 +410,11 @@ static void scsifront_do_lun_hotplug(str
 				}
 			}
 			break;
+		case VSCSIFRONT_OP_READD_LUN:
+			if (device_state == XenbusStateConnected)
+				xenbus_printf(XBT_NIL, dev->nodename, state_str,
+					      "%d", XenbusStateConnected);
+			break;
 		default:
 			break;
 		}
@@ -366,6 +442,13 @@ static void scsifront_backend_changed(st
 		break;
 
 	case XenbusStateConnected:
+		if (info->pause) {
+			scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_READD_LUN);
+			xenbus_switch_state(dev, XenbusStateConnected);
+			info->pause = 0;
+			return;
+		}
+
 		if (xenbus_read_driver_state(dev->nodename) ==
 			XenbusStateInitialised) {
 			scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);
@@ -407,7 +490,9 @@ MODULE_ALIAS("xen:vscsi");
 static DEFINE_XENBUS_DRIVER(scsifront, ,
 	.probe			= scsifront_probe,
 	.remove			= scsifront_remove,
-/* 	.resume			= scsifront_resume, */
+	.resume			= scsifront_resume,
+	.suspend		= scsifront_suspend,
+	.suspend_cancel		= scsifront_suspend_cancel,
 	.otherend_changed	= scsifront_backend_changed,
 );
 

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

From xen-changelog-bounces@lists.xen.org Mon Feb 02 08:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 08:11: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 1YIC68-0007Bo-FT; Mon, 02 Feb 2015 08:11:08 +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 1YIC65-0007BH-Ow
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:06 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	43/B2-02754-9113FC45; Mon, 02 Feb 2015 08:11:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1422864663!3797796!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32577 invoked from network); 2 Feb 2015 08:11:04 -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;
	2 Feb 2015 08: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 1YIC63-0006ty-L9
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC63-0001g1-Gl
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Message-Id: <E1YIC63-0001g1-Gl@xenbits.xen.org>
Date: Mon, 02 Feb 2015 08:11:03 +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] MSI: also reject resource with
	flags all clear
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1422864341 -3600
# Node ID aeb8696ffa4b562620b72d28cc6f2f6562b015d4
# Parent  778d332748c23366362c6af4b074b7ca530c4e68
MSI: also reject resource with flags all clear

When resource assignment fails, things may end up this way, and we want
to avoid using the resource in that case.

Derived from an upstream patch by Yijing Wang <wangyijing@huawei.com>.

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


diff -r 778d332748c2 -r aeb8696ffa4b drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Mon Feb 02 08:55:09 2015 +0100
+++ b/drivers/pci/msi-xen.c	Mon Feb 02 09:05:41 2015 +0100
@@ -204,7 +204,9 @@ static u64 find_table_base(struct pci_de
 	bar = reg & PCI_MSIX_FLAGS_BIRMASK;
 
 	flags = pci_resource_flags(dev, bar);
-	if (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET | IORESOURCE_BUSY))
+	if (!flags ||
+	     (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET |
+		       IORESOURCE_BUSY)))
 		return 0;
 
 	return pci_resource_start(dev, bar);

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

From xen-changelog-bounces@lists.xen.org Mon Feb 02 08:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 08:11: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 1YIC68-0007Bt-HX; Mon, 02 Feb 2015 08:11:08 +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 1YIC66-0007BJ-RJ
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:07 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	74/2E-25903-A113FC45; Mon, 02 Feb 2015 08:11:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422864664!11650896!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 875 invoked from network); 2 Feb 2015 08:11:04 -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;
	2 Feb 2015 08: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 1YIC63-0006u1-Sn
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC63-0001gG-Rq
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Message-Id: <E1YIC63-0001gG-Rq@xenbits.xen.org>
Date: Mon, 02 Feb 2015 08:11:03 +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] pvscsi: support suspend/resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 Juergen Gross <jgross@suse.com>
# Date 1422864594 -3600
# Node ID a3e3a5aea1a2aa30d7f45d9f69569bb3c7ca20e7
# Parent  aeb8696ffa4b562620b72d28cc6f2f6562b015d4
pvscsi: support suspend/resume

Up to now the pvscsi drivers haven't supported domain suspend and
resume. When a domain with an assigned pvscsi device was suspended
and resumed again, it was not able to use the device any more: trying
to do so resulted in hanging processes.

Support suspend and resume of pvscsi devices.

Signed-off-by: Juergen Gross <jgross@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsiback/xenbus.c
--- a/drivers/xen/scsiback/xenbus.c	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsiback/xenbus.c	Mon Feb 02 09:09:54 2015 +0100
@@ -167,33 +167,48 @@ static void scsiback_do_lun_hotplug(stru
 
 		switch (op) {
 		case VSCSIBACK_OP_ADD_OR_DEL_LUN:
-			if (device_state == XenbusStateInitialising) {
+			switch (device_state) {
+			case XenbusStateInitialising:
+			case XenbusStateConnected:
 				sdev = scsiback_get_scsi_device(&phy);
-				if (!sdev)
-					xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-							    "%d", XenbusStateClosed);
-				else {
-					err = scsiback_add_translation_entry(be->info, sdev, &vir);
-					if (!err) {
-						if (xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-								    "%d", XenbusStateInitialised)) {
-							printk(KERN_ERR "scsiback: xenbus_printf error %s\n", state_str);
-							scsiback_del_translation_entry(be->info, &vir);
-						}
-					} else {
-						scsi_device_put(sdev);
-						xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-								    "%d", XenbusStateClosed);
-					}
+				if (!sdev) {
+					xenbus_printf(XBT_NIL, dev->nodename,
+						      state_str,
+						      "%d", XenbusStateClosed);
+					break;
 				}
-			}
+				if (scsiback_add_translation_entry(be->info,
+								sdev, &vir)) {
+					scsi_device_put(sdev);
+					if (device_state == XenbusStateConnected)
+						break;
+					xenbus_printf(XBT_NIL, dev->nodename,
+						      state_str,
+						      "%d", XenbusStateClosed);
+					break;
+				}
+				if (!xenbus_printf(XBT_NIL, dev->nodename,
+						  state_str, "%d",
+						  XenbusStateInitialised))
+					break;
+				printk(KERN_ERR "scsiback: xenbus_printf error %s\n",
+				       state_str);
+				scsiback_del_translation_entry(be->info, &vir);
+				break;
 
-			if (device_state == XenbusStateClosing) {
-				if (!scsiback_del_translation_entry(be->info, &vir)) {
-					if (xenbus_printf(XBT_NIL, dev->nodename, state_str, 
-							    "%d", XenbusStateClosed))
-						printk(KERN_ERR "scsiback: xenbus_printf error %s\n", state_str);
-				}
+			case XenbusStateClosing:
+				if (scsiback_del_translation_entry(be->info,
+								   &vir))
+					break;
+				if (xenbus_printf(XBT_NIL, dev->nodename,
+						  state_str, "%d",
+						  XenbusStateClosed))
+					printk(KERN_ERR "scsiback: xenbus_printf error %s\n",
+					       state_str);
+				break;
+
+			default:
+				break;
 			}
 			break;
 
diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsifront/common.h
--- a/drivers/xen/scsifront/common.h	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsifront/common.h	Mon Feb 02 09:09:54 2015 +0100
@@ -75,7 +75,9 @@
 
 struct vscsifrnt_shadow {
 	uint16_t next_free;
-	
+#define VSCSIIF_IN_USE		0x0fff
+#define VSCSIIF_NONE		0x0ffe
+
 	/* command between backend and frontend
 	 * VSCSIIF_ACT_SCSI_CDB or VSCSIIF_ACT_SCSI_RESET */
 	unsigned char act;
@@ -113,8 +115,12 @@ struct vscsifrnt_info {
 	struct task_struct *kthread;
 	wait_queue_head_t wq;
 	wait_queue_head_t wq_sync;
+	wait_queue_head_t wq_pause;
 	unsigned char waiting_resp;
 	unsigned char waiting_sync;
+	unsigned char waiting_pause;
+	unsigned char pause;
+	unsigned callers;
 };
 
 #define DPRINTK(_f, _a...)				\
@@ -124,6 +130,7 @@ struct vscsifrnt_info {
 int scsifront_xenbus_init(void);
 void scsifront_xenbus_unregister(void);
 int scsifront_schedule(void *data);
+void scsifront_finish_all(struct vscsifrnt_info *info);
 irqreturn_t scsifront_intr(int irq, void *dev_id, struct pt_regs *ptregs);
 
 
diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsifront/scsifront.c
--- a/drivers/xen/scsifront/scsifront.c	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsifront/scsifront.c	Mon Feb 02 09:09:54 2015 +0100
@@ -40,9 +40,9 @@ static int get_id_from_freelist(struct v
 	spin_lock_irqsave(&info->shadow_lock, flags);
 
 	free = info->shadow_free;
-	BUG_ON(free > VSCSIIF_MAX_REQS);
+	BUG_ON(free >= VSCSIIF_MAX_REQS);
 	info->shadow_free = info->shadow[free].next_free;
-	info->shadow[free].next_free = 0x0fff;
+	info->shadow[free].next_free = VSCSIIF_IN_USE;
 
 	info->shadow[free].wait_reset = 0;
 
@@ -188,27 +188,26 @@ static void scsifront_sync_cmd_done(stru
 	wake_up(&(info->shadow[id].wq_reset));
 }
 
+static void scsifront_do_response(struct vscsifrnt_info *info,
+				  vscsiif_response_t *ring_res)
+{
+	if (info->shadow[ring_res->rqid].act == VSCSIIF_ACT_SCSI_CDB)
+		scsifront_cdb_cmd_done(info, ring_res);
+	else
+		scsifront_sync_cmd_done(info, ring_res);
+}
 
-static int scsifront_cmd_done(struct vscsifrnt_info *info)
+static int scsifront_ring_drain(struct vscsifrnt_info *info)
 {
 	vscsiif_response_t *ring_res;
-
 	RING_IDX i, rp;
 	int more_to_do = 0;
-	unsigned long flags;
-
-	spin_lock_irqsave(info->host->host_lock, flags);
 
 	rp = info->ring.sring->rsp_prod;
 	rmb();
 	for (i = info->ring.rsp_cons; i != rp; i++) {
-		
 		ring_res = RING_GET_RESPONSE(&info->ring, i);
-
-		if (info->shadow[ring_res->rqid].act == VSCSIIF_ACT_SCSI_CDB)
-			scsifront_cdb_cmd_done(info, ring_res);
-		else
-			scsifront_sync_cmd_done(info, ring_res);
+		scsifront_do_response(info, ring_res);
 	}
 
 	info->ring.rsp_cons = i;
@@ -219,6 +218,18 @@ static int scsifront_cmd_done(struct vsc
 		info->ring.sring->rsp_event = i + 1;
 	}
 
+	return more_to_do;
+}
+
+static int scsifront_cmd_done(struct vscsifrnt_info *info)
+{
+	int more_to_do;
+	unsigned long flags;
+
+	spin_lock_irqsave(info->host->host_lock, flags);
+
+	more_to_do = scsifront_ring_drain(info);
+
 	info->waiting_sync = 0;
 
 	spin_unlock_irqrestore(info->host->host_lock, flags);
@@ -231,8 +242,23 @@ static int scsifront_cmd_done(struct vsc
 	return more_to_do;
 }
 
+void scsifront_finish_all(struct vscsifrnt_info *info)
+{
+	unsigned i;
+	struct vscsiif_response resp;
 
+	scsifront_ring_drain(info);
 
+	for (i = 0; i < VSCSIIF_MAX_REQS; i++) {
+		if (info->shadow[i].next_free != VSCSIIF_IN_USE)
+			continue;
+		resp.rqid = i;
+		resp.sense_len = 0;
+		resp.rslt = DID_RESET << 16;
+		resp.residual_len = 0;
+		scsifront_do_response(info, &resp);
+	}
+}
 
 int scsifront_schedule(void *data)
 {
@@ -359,6 +385,27 @@ big_to_sg:
 	return ref_cnt;
 }
 
+static int scsifront_enter(struct vscsifrnt_info *info)
+{
+	if (info->pause)
+		return 1;
+	info->callers++;
+	return 0;
+}
+
+static void scsifront_return(struct vscsifrnt_info *info)
+{
+	info->callers--;
+	if (info->callers)
+		return;
+
+	if (!info->waiting_pause)
+		return;
+
+	info->waiting_pause = 0;
+	wake_up(&info->wq_pause);
+}
+
 static int scsifront_queuecommand(struct scsi_cmnd *sc,
 				  void (*done)(struct scsi_cmnd *))
 {
@@ -368,6 +415,9 @@ static int scsifront_queuecommand(struct
 	int ref_cnt;
 	uint16_t rqid;
 
+	if (scsifront_enter(info))
+		return SCSI_MLQUEUE_HOST_BUSY;
+
 /* debug printk to identify more missing scsi commands
 	shost_printk(KERN_INFO "scsicmd: ", sc->device->host,
 		     "len=%u %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\n",
@@ -420,13 +470,16 @@ static int scsifront_queuecommand(struct
 
 	scsifront_do_request(info);
 
+	scsifront_return(info);
 	return 0;
 
 out_host_busy:
+	scsifront_return(info);
 	return SCSI_MLQUEUE_HOST_BUSY;
 
 out_fail_command:
 	done(sc);
+	scsifront_return(info);
 	return 0;
 }
 
@@ -451,7 +504,7 @@ static int scsifront_dev_reset_handler(s
 	spin_lock_irq(host->host_lock);
 #endif
 	while (RING_FULL(&info->ring)) {
-		if (err) {
+		if (err || info->pause) {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
 			spin_unlock_irq(host->host_lock);
 #endif
@@ -464,6 +517,11 @@ static int scsifront_dev_reset_handler(s
 		spin_lock_irq(host->host_lock);
 	}
 
+	if (scsifront_enter(info)) {
+		spin_unlock_irq(host->host_lock);
+		return FAILED;
+	}
+
 	ring_req      = scsifront_pre_request(info);
 	ring_req->act = VSCSIIF_ACT_SCSI_RESET;
 
@@ -502,6 +560,8 @@ static int scsifront_dev_reset_handler(s
 		err = FAILED;
 	}
 
+	scsifront_return(info);
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
 	spin_unlock_irq(host->host_lock);
 #endif
diff -r aeb8696ffa4b -r a3e3a5aea1a2 drivers/xen/scsifront/xenbus.c
--- a/drivers/xen/scsifront/xenbus.c	Mon Feb 02 09:05:41 2015 +0100
+++ b/drivers/xen/scsifront/xenbus.c	Mon Feb 02 09:09:54 2015 +0100
@@ -43,6 +43,20 @@
 
 extern struct scsi_host_template scsifront_sht;
 
+static void scsifront_free_ring(struct vscsifrnt_info *info)
+{
+	if (info->ring_ref != GRANT_INVALID_REF) {
+		gnttab_end_foreign_access(info->ring_ref,
+					(unsigned long)info->ring.sring);
+		info->ring_ref = GRANT_INVALID_REF;
+		info->ring.sring = NULL;
+	}
+
+	if (info->irq)
+		unbind_from_irqhandler(info->irq, info);
+	info->irq = 0;
+}
+
 static void scsifront_free(struct vscsifrnt_info *info)
 {
 	struct Scsi_Host *host = info->host;
@@ -55,16 +69,7 @@ static void scsifront_free(struct vscsif
 		scsi_remove_host(info->host);
 	}
 
-	if (info->ring_ref != GRANT_INVALID_REF) {
-		gnttab_end_foreign_access(info->ring_ref,
-					(unsigned long)info->ring.sring);
-		info->ring_ref = GRANT_INVALID_REF;
-		info->ring.sring = NULL;
-	}
-
-	if (info->irq)
-		unbind_from_irqhandler(info->irq, info);
-	info->irq = 0;
+	scsifront_free_ring(info);
 
 	scsi_host_put(info->host);
 }
@@ -196,7 +201,7 @@ static int scsifront_probe(struct xenbus
 		init_waitqueue_head(&(info->shadow[i].wq_reset));
 		info->shadow[i].wait_reset = 0;
 	}
-	info->shadow[VSCSIIF_MAX_REQS - 1].next_free = 0x0fff;
+	info->shadow[VSCSIIF_MAX_REQS - 1].next_free = VSCSIIF_NONE;
 
 	err = scsifront_init_ring(info);
 	if (err) {
@@ -208,6 +213,11 @@ static int scsifront_probe(struct xenbus
 	init_waitqueue_head(&info->wq_sync);
 	spin_lock_init(&info->shadow_lock);
 
+	info->pause = 0;
+	info->callers = 0;
+	info->waiting_pause = 0;
+	init_waitqueue_head(&info->wq_pause);
+
 	snprintf(name, DEFAULT_TASK_COMM_LEN, "vscsiif.%d", info->host->host_no);
 
 	info->kthread = kthread_run(scsifront_schedule, info, name);
@@ -240,6 +250,66 @@ free_sring:
 	return err;
 }
 
+static int scsifront_resume(struct xenbus_device *dev)
+{
+	struct vscsifrnt_info *info = dev->dev.driver_data;
+	struct Scsi_Host *host = info->host;
+	int err;
+
+	spin_lock_irq(host->host_lock);
+
+	/* finish all still pending commands */
+	scsifront_finish_all(info);
+
+	spin_unlock_irq(host->host_lock);
+
+	/* reconnect to dom0 */
+	scsifront_free_ring(info);
+	err = scsifront_init_ring(info);
+	if (err) {
+		dev_err(&dev->dev, "fail to resume %d\n", err);
+		scsifront_free(info);
+		return err;
+	}
+
+	xenbus_switch_state(dev, XenbusStateInitialised);
+
+	return 0;
+}
+
+static int scsifront_suspend(struct xenbus_device *dev)
+{
+	struct vscsifrnt_info *info = dev->dev.driver_data;
+	struct Scsi_Host *host = info->host;
+	int err = 0;
+
+	/* no new commands for the backend */
+	spin_lock_irq(host->host_lock);
+	info->pause = 1;
+	while (info->callers && !err) {
+		info->waiting_pause = 1;
+		info->waiting_sync = 0;
+		spin_unlock_irq(host->host_lock);
+		wake_up(&info->wq_sync);
+		err = wait_event_interruptible(info->wq_pause,
+					       !info->waiting_pause);
+		spin_lock_irq(host->host_lock);
+	}
+	spin_unlock_irq(host->host_lock);
+	return err;
+}
+
+static int scsifront_suspend_cancel(struct xenbus_device *dev)
+{
+	struct vscsifrnt_info *info = dev->dev.driver_data;
+	struct Scsi_Host *host = info->host;
+
+	spin_lock_irq(host->host_lock);
+	info->pause = 0;
+	spin_unlock_irq(host->host_lock);
+	return 0;
+}
+
 static int scsifront_remove(struct xenbus_device *dev)
 {
 	struct vscsifrnt_info *info = dev->dev.driver_data;
@@ -278,6 +348,7 @@ static int scsifront_disconnect(struct v
 
 #define VSCSIFRONT_OP_ADD_LUN	1
 #define VSCSIFRONT_OP_DEL_LUN	2
+#define VSCSIFRONT_OP_READD_LUN	3
 
 static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
 {
@@ -339,6 +410,11 @@ static void scsifront_do_lun_hotplug(str
 				}
 			}
 			break;
+		case VSCSIFRONT_OP_READD_LUN:
+			if (device_state == XenbusStateConnected)
+				xenbus_printf(XBT_NIL, dev->nodename, state_str,
+					      "%d", XenbusStateConnected);
+			break;
 		default:
 			break;
 		}
@@ -366,6 +442,13 @@ static void scsifront_backend_changed(st
 		break;
 
 	case XenbusStateConnected:
+		if (info->pause) {
+			scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_READD_LUN);
+			xenbus_switch_state(dev, XenbusStateConnected);
+			info->pause = 0;
+			return;
+		}
+
 		if (xenbus_read_driver_state(dev->nodename) ==
 			XenbusStateInitialised) {
 			scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);
@@ -407,7 +490,9 @@ MODULE_ALIAS("xen:vscsi");
 static DEFINE_XENBUS_DRIVER(scsifront, ,
 	.probe			= scsifront_probe,
 	.remove			= scsifront_remove,
-/* 	.resume			= scsifront_resume, */
+	.resume			= scsifront_resume,
+	.suspend		= scsifront_suspend,
+	.suspend_cancel		= scsifront_suspend_cancel,
 	.otherend_changed	= scsifront_backend_changed,
 );
 

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

From xen-changelog-bounces@lists.xen.org Mon Feb 02 08:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 08:11: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 1YIC68-0007Bj-Ch; Mon, 02 Feb 2015 08:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC65-0007BI-Rs
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:06 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	B0/2F-02884-9113FC45; Mon, 02 Feb 2015 08:11:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-31.messagelabs.com!1422864663!11287103!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30526 invoked from network); 2 Feb 2015 08:11:04 -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;
	2 Feb 2015 08: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 1YIC63-0006tv-EE
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC63-0001fm-4A
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Message-Id: <E1YIC63-0001fm-4A@xenbits.xen.org>
Date: Mon, 02 Feb 2015 08: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] update to latest interface
	version (4.5.0)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1422863709 -3600
# Node ID 778d332748c23366362c6af4b074b7ca530c4e68
# Parent  578e5aea3cbb6a82fa445eb7b4ff0356ff3f4d5b
update to latest interface version (4.5.0)

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


diff -r 578e5aea3cbb -r 778d332748c2 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Mon Jan 19 11:51:46 2015 +0100
+++ b/drivers/xen/Kconfig	Mon Feb 02 08:55:09 2015 +0100
@@ -10,7 +10,7 @@ config XEN
 if XEN
 config XEN_INTERFACE_VERSION
 	hex
-	default 0x00040400
+	default 0x00040500
 
 menu "XEN"
 
@@ -348,6 +348,9 @@ choice
 	config XEN_COMPAT_040400_AND_LATER
 		bool "4.4.0 and later"
 
+	config XEN_COMPAT_040500_AND_LATER
+		bool "4.5.0 and later"
+
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
 
@@ -356,6 +359,7 @@ endchoice
 config XEN_COMPAT
 	hex
 	default 0xffffff if XEN_COMPAT_LATEST_ONLY
+	default 0x040500 if XEN_COMPAT_040500_AND_LATER
 	default 0x040400 if XEN_COMPAT_040400_AND_LATER
 	default 0x040300 if XEN_COMPAT_040300_AND_LATER
 	default 0x040200 if XEN_COMPAT_040200_AND_LATER
diff -r 578e5aea3cbb -r 778d332748c2 include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h	Mon Jan 19 11:51:46 2015 +0100
+++ b/include/xen/interface/xen-compat.h	Mon Feb 02 08:55:09 2015 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040400
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040500
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */

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

From xen-changelog-bounces@lists.xen.org Mon Feb 02 08:11:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 08:11: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 1YIC68-0007Bj-Ch; Mon, 02 Feb 2015 08:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC65-0007BI-Rs
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:06 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	B0/2F-02884-9113FC45; Mon, 02 Feb 2015 08:11:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-31.messagelabs.com!1422864663!11287103!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30526 invoked from network); 2 Feb 2015 08:11:04 -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;
	2 Feb 2015 08: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 1YIC63-0006tv-EE
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1YIC63-0001fm-4A
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 08:11:03 +0000
Message-Id: <E1YIC63-0001fm-4A@xenbits.xen.org>
Date: Mon, 02 Feb 2015 08: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] update to latest interface
	version (4.5.0)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1422863709 -3600
# Node ID 778d332748c23366362c6af4b074b7ca530c4e68
# Parent  578e5aea3cbb6a82fa445eb7b4ff0356ff3f4d5b
update to latest interface version (4.5.0)

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


diff -r 578e5aea3cbb -r 778d332748c2 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Mon Jan 19 11:51:46 2015 +0100
+++ b/drivers/xen/Kconfig	Mon Feb 02 08:55:09 2015 +0100
@@ -10,7 +10,7 @@ config XEN
 if XEN
 config XEN_INTERFACE_VERSION
 	hex
-	default 0x00040400
+	default 0x00040500
 
 menu "XEN"
 
@@ -348,6 +348,9 @@ choice
 	config XEN_COMPAT_040400_AND_LATER
 		bool "4.4.0 and later"
 
+	config XEN_COMPAT_040500_AND_LATER
+		bool "4.5.0 and later"
+
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
 
@@ -356,6 +359,7 @@ endchoice
 config XEN_COMPAT
 	hex
 	default 0xffffff if XEN_COMPAT_LATEST_ONLY
+	default 0x040500 if XEN_COMPAT_040500_AND_LATER
 	default 0x040400 if XEN_COMPAT_040400_AND_LATER
 	default 0x040300 if XEN_COMPAT_040300_AND_LATER
 	default 0x040200 if XEN_COMPAT_040200_AND_LATER
diff -r 578e5aea3cbb -r 778d332748c2 include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h	Mon Jan 19 11:51:46 2015 +0100
+++ b/include/xen/interface/xen-compat.h	Mon Feb 02 08:55:09 2015 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040400
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040500
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */

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

From xen-changelog-bounces@lists.xen.org Mon Feb 02 17:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 17: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 1YIKhK-0004rI-DP; Mon, 02 Feb 2015 17: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 1YIKhI-0004qy-TZ
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 17:22:05 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	90/92-10964-C32BFC45; Mon, 02 Feb 2015 17:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1422897722!12325171!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28182 invoked from network); 2 Feb 2015 17:22:03 -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;
	2 Feb 2015 17: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 1YIKhG-0004pN-H4
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 17:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIKhG-0005yK-0j
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 17:22:02 +0000
Date: Mon, 02 Feb 2015 17:22:02 +0000
Message-Id: <E1YIKhG-0005yK-0j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4b276b4ce49c8d70dd841ff885b900ec652b994
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 2 16:56:34 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
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 Feb 02 17:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2015 17: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 1YIKhK-0004rI-DP; Mon, 02 Feb 2015 17: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 1YIKhI-0004qy-TZ
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 17:22:05 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	90/92-10964-C32BFC45; Mon, 02 Feb 2015 17:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1422897722!12325171!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28182 invoked from network); 2 Feb 2015 17:22:03 -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;
	2 Feb 2015 17: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 1YIKhG-0004pN-H4
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 17:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIKhG-0005yK-0j
	for xen-changelog@lists.xensource.com; Mon, 02 Feb 2015 17:22:02 +0000
Date: Mon, 02 Feb 2015 17:22:02 +0000
Message-Id: <E1YIKhG-0005yK-0j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4b276b4ce49c8d70dd841ff885b900ec652b994
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 2 16:56:34 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
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 Feb 03 07:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07: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 1YIYKH-0003sM-Lu; Tue, 03 Feb 2015 07:55: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 1YIYKF-0003sG-G6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:11 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	61/32-02994-EDE70D45; Tue, 03 Feb 2015 07:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1422950108!10769501!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14721 invoked from network); 3 Feb 2015 07:55:09 -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 Feb 2015 07: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 1YIYK9-0004vJ-Eh
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYK8-000621-TA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:04 +0000
Date: Tue, 03 Feb 2015 07:55:04 +0000
Message-Id: <E1YIYK8-000621-TA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] make error codes a formal part of the
	ABI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81f559e97974d057f8498845185b0ac05dcc61f4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:41:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:41:50 2015 +0100

    make error codes a formal part of the ABI
    
    Now that we have two cases where patches against hvmloader got
    submitted needing to include the hypervisor's errno.h (for the host's
    system header not necessarily reflecting the correct numbers), take
    this as a strong sign that we need to make the error return values part
    of the hypervisor ABI (which de-fact they've always been).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/page.h      |    2 +-
 xen/include/asm-x86/multicall.h |   10 ++-
 xen/include/public/errno.h      |   93 +++++++++++++++++++++++++
 xen/include/xen/errno.h         |  143 ++++-----------------------------------
 4 files changed, 113 insertions(+), 135 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 53d4b63..3e7b0ae 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -2,7 +2,6 @@
 #define __ARM_PAGE_H__
 
 #include <xen/config.h>
-#include <xen/errno.h>
 #include <public/xen.h>
 #include <asm/processor.h>
 
@@ -83,6 +82,7 @@
 
 #ifndef __ASSEMBLY__
 
+#include <xen/errno.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 
diff --git a/xen/include/asm-x86/multicall.h b/xen/include/asm-x86/multicall.h
index a09ac5a..fcd0ea5 100644
--- a/xen/include/asm-x86/multicall.h
+++ b/xen/include/asm-x86/multicall.h
@@ -24,7 +24,7 @@
             "    callq *%%rax; "                             \
             "1:  movq  %%rax,%c4(%0)\n"                      \
             ".section .fixup,\"ax\"\n"                       \
-            "2:  movq  $-"STR(ENOSYS)",%%rax\n"              \
+            "2:  movq  %5,%%rax\n"                           \
             "    jmp   1b\n"                                 \
             ".previous\n"                                    \
             :                                                \
@@ -32,7 +32,8 @@
               "i" (offsetof(__typeof__(*_call), op)),        \
               "i" (offsetof(__typeof__(*_call), args)),      \
               "i" (sizeof(*(_call)->args)),                  \
-              "i" (offsetof(__typeof__(*_call), result))     \
+              "i" (offsetof(__typeof__(*_call), result)),    \
+              "i" (-ENOSYS)                                  \
               /* all the caller-saves registers */           \
             : "rax", "rcx", "rdx", "rsi", "rdi",             \
               "r8",  "r9",  "r10", "r11" );                  \
@@ -54,7 +55,7 @@
             "    callq *%%rax; "                             \
             "1:  movl  %%eax,%c4(%0)\n"                      \
             ".section .fixup,\"ax\"\n"                       \
-            "2:  movl  $-"STR(ENOSYS)",%%eax\n"              \
+            "2:  movl  %5,%%eax\n"                           \
             "    jmp   1b\n"                                 \
             ".previous\n"                                    \
             :                                                \
@@ -62,7 +63,8 @@
               "i" (offsetof(__typeof__(*_call), op)),        \
               "i" (offsetof(__typeof__(*_call), args)),      \
               "i" (sizeof(*(_call)->args)),                  \
-              "i" (offsetof(__typeof__(*_call), result))     \
+              "i" (offsetof(__typeof__(*_call), result)),    \
+              "i" (-ENOSYS)                                  \
               /* all the caller-saves registers */           \
             : "rax", "rcx", "rdx", "rsi", "rdi",             \
               "r8",  "r9",  "r10", "r11" )                   \
diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
new file mode 100644
index 0000000..9a7e411
--- /dev/null
+++ b/xen/include/public/errno.h
@@ -0,0 +1,93 @@
+#ifndef __XEN_PUBLIC_ERRNO_H__
+
+#ifndef __ASSEMBLY__
+
+#define XEN_ERRNO(name, value) XEN_##name = value,
+enum xen_errno {
+
+#else /* !__ASSEMBLY__ */
+
+#define XEN_ERRNO(name, value) .equ XEN_##name, value
+
+#endif /* __ASSEMBLY__ */
+
+/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
+/* ` enum errnoval { */
+
+#endif /* __XEN_PUBLIC_ERRNO_H__ */
+
+#ifdef XEN_ERRNO
+
+/*
+ * Values originating from x86 Linux. Please consider using respective
+ * values when adding new definitions here.
+ */
+
+XEN_ERRNO(EPERM,	 1)	/* Operation not permitted */
+XEN_ERRNO(ENOENT,	 2)	/* No such file or directory */
+XEN_ERRNO(ESRCH,	 3)	/* No such process */
+#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
+XEN_ERRNO(EINTR,	 4)	/* Interrupted system call */
+#endif
+XEN_ERRNO(EIO,		 5)	/* I/O error */
+XEN_ERRNO(ENXIO,	 6)	/* No such device or address */
+XEN_ERRNO(E2BIG,	 7)	/* Arg list too long */
+XEN_ERRNO(ENOEXEC,	 8)	/* Exec format error */
+XEN_ERRNO(EBADF,	 9)	/* Bad file number */
+XEN_ERRNO(ECHILD,	10)	/* No child processes */
+XEN_ERRNO(EAGAIN,	11)	/* Try again */
+XEN_ERRNO(ENOMEM,	12)	/* Out of memory */
+XEN_ERRNO(EACCES,	13)	/* Permission denied */
+XEN_ERRNO(EFAULT,	14)	/* Bad address */
+XEN_ERRNO(EBUSY,	16)	/* Device or resource busy */
+XEN_ERRNO(EEXIST,	17)	/* File exists */
+XEN_ERRNO(EXDEV,	18)	/* Cross-device link */
+XEN_ERRNO(ENODEV,	19)	/* No such device */
+XEN_ERRNO(EINVAL,	22)	/* Invalid argument */
+XEN_ERRNO(ENFILE,	23)	/* File table overflow */
+XEN_ERRNO(EMFILE,	24)	/* Too many open files */
+XEN_ERRNO(ENOSPC,	28)	/* No space left on device */
+XEN_ERRNO(EMLINK,	31)	/* Too many links */
+XEN_ERRNO(EDOM,		33)	/* Math argument out of domain of func */
+XEN_ERRNO(ERANGE,	34)	/* Math result not representable */
+XEN_ERRNO(EDEADLK,	35)	/* Resource deadlock would occur */
+XEN_ERRNO(ENAMETOOLONG,	36)	/* File name too long */
+XEN_ERRNO(ENOLCK,	37)	/* No record locks available */
+XEN_ERRNO(ENOSYS,	38)	/* Function not implemented */
+XEN_ERRNO(EBADRQC,	56)	/* Invalid request code */
+XEN_ERRNO(EBADSLT,	57)	/* Invalid slot */
+XEN_ERRNO(ENODATA,	61)	/* No data available */
+XEN_ERRNO(ETIME,	62)	/* Timer expired */
+XEN_ERRNO(EBADMSG,	74)	/* Not a data message */
+XEN_ERRNO(EOVERFLOW,	75)	/* Value too large for defined data type */
+XEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
+#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
+XEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
+#endif
+XEN_ERRNO(EUSERS,	87)	/* Too many users */
+XEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
+XEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
+XEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
+XEN_ERRNO(ENOBUFS,	105)	/* No buffer space available */
+XEN_ERRNO(EISCONN,	106)	/* Transport endpoint is already connected */
+XEN_ERRNO(ENOTCONN,	107)	/* Transport endpoint is not connected */
+XEN_ERRNO(ESHUTDOWN,	108)	/* Cannot send after transport endpoint shutdown */
+XEN_ERRNO(ETOOMANYREFS,	109)	/* Too many references: cannot splice */
+XEN_ERRNO(ETIMEDOUT,	110)	/* Connection timed out */
+
+#undef XEN_ERRNO
+#endif /* XEN_ERRNO */
+
+#ifndef __XEN_PUBLIC_ERRNO_H__
+#define __XEN_PUBLIC_ERRNO_H__
+
+/* ` } */
+
+#ifndef __ASSEMBLY__
+};
+#endif
+
+#define	XEN_EWOULDBLOCK	XEN_EAGAIN	/* Operation would block */
+#define	XEN_EDEADLOCK	XEN_EDEADLK	/* Resource deadlock would occur */
+
+#endif /*  __XEN_PUBLIC_ERRNO_H__ */
diff --git a/xen/include/xen/errno.h b/xen/include/xen/errno.h
index 39147be..3178466 100644
--- a/xen/include/xen/errno.h
+++ b/xen/include/xen/errno.h
@@ -1,137 +1,20 @@
-#ifndef _I386_ERRNO_H
-#define _I386_ERRNO_H
+#ifndef __XEN_ERRNO_H__
+#define __XEN_ERRNO_H__
 
-/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
-/* ` enum errnoval { */
+#include <public/errno.h>
 
-#define	EPERM		 1	/* Operation not permitted */
-#define	ENOENT		 2	/* No such file or directory */
-#define	ESRCH		 3	/* No such process */
-#define	EINTR		 4	/* Interrupted system call */
-#define	EIO		 5	/* I/O error */
-#define	ENXIO		 6	/* No such device or address */
-#define	E2BIG		 7	/* Arg list too long */
-#define	ENOEXEC		 8	/* Exec format error */
-#define	EBADF		 9	/* Bad file number */
-#define	ECHILD		10	/* No child processes */
-#define	EAGAIN		11	/* Try again */
-#define	ENOMEM		12	/* Out of memory */
-#define	EACCES		13	/* Permission denied */
-#define	EFAULT		14	/* Bad address */
-#define	ENOTBLK		15	/* Block device required */
-#define	EBUSY		16	/* Device or resource busy */
-#define	EEXIST		17	/* File exists */
-#define	EXDEV		18	/* Cross-device link */
-#define	ENODEV		19	/* No such device */
-#define	ENOTDIR		20	/* Not a directory */
-#define	EISDIR		21	/* Is a directory */
-#define	EINVAL		22	/* Invalid argument */
-#define	ENFILE		23	/* File table overflow */
-#define	EMFILE		24	/* Too many open files */
-#define	ENOTTY		25	/* Not a typewriter */
-#define	ETXTBSY		26	/* Text file busy */
-#define	EFBIG		27	/* File too large */
-#define	ENOSPC		28	/* No space left on device */
-#define	ESPIPE		29	/* Illegal seek */
-#define	EROFS		30	/* Read-only file system */
-#define	EMLINK		31	/* Too many links */
-#define	EPIPE		32	/* Broken pipe */
-#define	EDOM		33	/* Math argument out of domain of func */
-#define	ERANGE		34	/* Math result not representable */
-#define	EDEADLK		35	/* Resource deadlock would occur */
-#define	ENAMETOOLONG	36	/* File name too long */
-#define	ENOLCK		37	/* No record locks available */
-#define	ENOSYS		38	/* Function not implemented */
-#define	ENOTEMPTY	39	/* Directory not empty */
-#define	ELOOP		40	/* Too many symbolic links encountered */
-#define	EWOULDBLOCK	EAGAIN	/* Operation would block */
-#define	ENOMSG		42	/* No message of desired type */
-#define	EIDRM		43	/* Identifier removed */
-#define	ECHRNG		44	/* Channel number out of range */
-#define	EL2NSYNC	45	/* Level 2 not synchronized */
-#define	EL3HLT		46	/* Level 3 halted */
-#define	EL3RST		47	/* Level 3 reset */
-#define	ELNRNG		48	/* Link number out of range */
-#define	EUNATCH		49	/* Protocol driver not attached */
-#define	ENOCSI		50	/* No CSI structure available */
-#define	EL2HLT		51	/* Level 2 halted */
-#define	EBADE		52	/* Invalid exchange */
-#define	EBADR		53	/* Invalid request descriptor */
-#define	EXFULL		54	/* Exchange full */
-#define	ENOANO		55	/* No anode */
-#define	EBADRQC		56	/* Invalid request code */
-#define	EBADSLT		57	/* Invalid slot */
+#ifndef __ASSEMBLY__
 
-#define	EDEADLOCK	EDEADLK
+#define XEN_ERRNO(name, value) name = XEN_##name,
+enum {
+#include <public/errno.h>
+};
 
-#define	EBFONT		59	/* Bad font file format */
-#define	ENOSTR		60	/* Device not a stream */
-#define	ENODATA		61	/* No data available */
-#define	ETIME		62	/* Timer expired */
-#define	ENOSR		63	/* Out of streams resources */
-#define	ENONET		64	/* Machine is not on the network */
-#define	ENOPKG		65	/* Package not installed */
-#define	EREMOTE		66	/* Object is remote */
-#define	ENOLINK		67	/* Link has been severed */
-#define	EADV		68	/* Advertise error */
-#define	ESRMNT		69	/* Srmount error */
-#define	ECOMM		70	/* Communication error on send */
-#define	EPROTO		71	/* Protocol error */
-#define	EMULTIHOP	72	/* Multihop attempted */
-#define	EDOTDOT		73	/* RFS specific error */
-#define	EBADMSG		74	/* Not a data message */
-#define	EOVERFLOW	75	/* Value too large for defined data type */
-#define	ENOTUNIQ	76	/* Name not unique on network */
-#define	EBADFD		77	/* File descriptor in bad state */
-#define	EREMCHG		78	/* Remote address changed */
-#define	ELIBACC		79	/* Can not access a needed shared library */
-#define	ELIBBAD		80	/* Accessing a corrupted shared library */
-#define	ELIBSCN		81	/* .lib section in a.out corrupted */
-#define	ELIBMAX		82	/* Attempting to link in too many shared libraries */
-#define	ELIBEXEC	83	/* Cannot exec a shared library directly */
-#define	EILSEQ		84	/* Illegal byte sequence */
-#define	ERESTART	85	/* Interrupted system call should be restarted */
-#define	ESTRPIPE	86	/* Streams pipe error */
-#define	EUSERS		87	/* Too many users */
-#define	ENOTSOCK	88	/* Socket operation on non-socket */
-#define	EDESTADDRREQ	89	/* Destination address required */
-#define	EMSGSIZE	90	/* Message too long */
-#define	EPROTOTYPE	91	/* Protocol wrong type for socket */
-#define	ENOPROTOOPT	92	/* Protocol not available */
-#define	EPROTONOSUPPORT	93	/* Protocol not supported */
-#define	ESOCKTNOSUPPORT	94	/* Socket type not supported */
-#define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
-#define	EPFNOSUPPORT	96	/* Protocol family not supported */
-#define	EAFNOSUPPORT	97	/* Address family not supported by protocol */
-#define	EADDRINUSE	98	/* Address already in use */
-#define	EADDRNOTAVAIL	99	/* Cannot assign requested address */
-#define	ENETDOWN	100	/* Network is down */
-#define	ENETUNREACH	101	/* Network is unreachable */
-#define	ENETRESET	102	/* Network dropped connection because of reset */
-#define	ECONNABORTED	103	/* Software caused connection abort */
-#define	ECONNRESET	104	/* Connection reset by peer */
-#define	ENOBUFS		105	/* No buffer space available */
-#define	EISCONN		106	/* Transport endpoint is already connected */
-#define	ENOTCONN	107	/* Transport endpoint is not connected */
-#define	ESHUTDOWN	108	/* Cannot send after transport endpoint shutdown */
-#define	ETOOMANYREFS	109	/* Too many references: cannot splice */
-#define	ETIMEDOUT	110	/* Connection timed out */
-#define	ECONNREFUSED	111	/* Connection refused */
-#define	EHOSTDOWN	112	/* Host is down */
-#define	EHOSTUNREACH	113	/* No route to host */
-#define	EALREADY	114	/* Operation already in progress */
-#define	EINPROGRESS	115	/* Operation now in progress */
-#define	ESTALE		116	/* Stale NFS file handle */
-#define	EUCLEAN		117	/* Structure needs cleaning */
-#define	ENOTNAM		118	/* Not a XENIX named type file */
-#define	ENAVAIL		119	/* No XENIX semaphores available */
-#define	EISNAM		120	/* Is a named type file */
-#define	EREMOTEIO	121	/* Remote I/O error */
-#define	EDQUOT		122	/* Quota exceeded */
+#else /* !__ASSEMBLY__ */
 
-#define	ENOMEDIUM	123	/* No medium found */
-#define	EMEDIUMTYPE	124	/* Wrong medium type */
+#define XEN_ERRNO(name, value) .equ name, XEN_##name
+#include <public/errno.h>
 
-/* ` } */
+#endif /* __ASSEMBLY__ */
 
-#endif
+#endif /*  __XEN_ERRNO_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 Tue Feb 03 07:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07: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 1YIYKH-0003sM-Lu; Tue, 03 Feb 2015 07:55: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 1YIYKF-0003sG-G6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:11 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	61/32-02994-EDE70D45; Tue, 03 Feb 2015 07:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1422950108!10769501!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14721 invoked from network); 3 Feb 2015 07:55:09 -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 Feb 2015 07: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 1YIYK9-0004vJ-Eh
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYK8-000621-TA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:04 +0000
Date: Tue, 03 Feb 2015 07:55:04 +0000
Message-Id: <E1YIYK8-000621-TA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] make error codes a formal part of the
	ABI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81f559e97974d057f8498845185b0ac05dcc61f4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:41:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:41:50 2015 +0100

    make error codes a formal part of the ABI
    
    Now that we have two cases where patches against hvmloader got
    submitted needing to include the hypervisor's errno.h (for the host's
    system header not necessarily reflecting the correct numbers), take
    this as a strong sign that we need to make the error return values part
    of the hypervisor ABI (which de-fact they've always been).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/page.h      |    2 +-
 xen/include/asm-x86/multicall.h |   10 ++-
 xen/include/public/errno.h      |   93 +++++++++++++++++++++++++
 xen/include/xen/errno.h         |  143 ++++-----------------------------------
 4 files changed, 113 insertions(+), 135 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 53d4b63..3e7b0ae 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -2,7 +2,6 @@
 #define __ARM_PAGE_H__
 
 #include <xen/config.h>
-#include <xen/errno.h>
 #include <public/xen.h>
 #include <asm/processor.h>
 
@@ -83,6 +82,7 @@
 
 #ifndef __ASSEMBLY__
 
+#include <xen/errno.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 
diff --git a/xen/include/asm-x86/multicall.h b/xen/include/asm-x86/multicall.h
index a09ac5a..fcd0ea5 100644
--- a/xen/include/asm-x86/multicall.h
+++ b/xen/include/asm-x86/multicall.h
@@ -24,7 +24,7 @@
             "    callq *%%rax; "                             \
             "1:  movq  %%rax,%c4(%0)\n"                      \
             ".section .fixup,\"ax\"\n"                       \
-            "2:  movq  $-"STR(ENOSYS)",%%rax\n"              \
+            "2:  movq  %5,%%rax\n"                           \
             "    jmp   1b\n"                                 \
             ".previous\n"                                    \
             :                                                \
@@ -32,7 +32,8 @@
               "i" (offsetof(__typeof__(*_call), op)),        \
               "i" (offsetof(__typeof__(*_call), args)),      \
               "i" (sizeof(*(_call)->args)),                  \
-              "i" (offsetof(__typeof__(*_call), result))     \
+              "i" (offsetof(__typeof__(*_call), result)),    \
+              "i" (-ENOSYS)                                  \
               /* all the caller-saves registers */           \
             : "rax", "rcx", "rdx", "rsi", "rdi",             \
               "r8",  "r9",  "r10", "r11" );                  \
@@ -54,7 +55,7 @@
             "    callq *%%rax; "                             \
             "1:  movl  %%eax,%c4(%0)\n"                      \
             ".section .fixup,\"ax\"\n"                       \
-            "2:  movl  $-"STR(ENOSYS)",%%eax\n"              \
+            "2:  movl  %5,%%eax\n"                           \
             "    jmp   1b\n"                                 \
             ".previous\n"                                    \
             :                                                \
@@ -62,7 +63,8 @@
               "i" (offsetof(__typeof__(*_call), op)),        \
               "i" (offsetof(__typeof__(*_call), args)),      \
               "i" (sizeof(*(_call)->args)),                  \
-              "i" (offsetof(__typeof__(*_call), result))     \
+              "i" (offsetof(__typeof__(*_call), result)),    \
+              "i" (-ENOSYS)                                  \
               /* all the caller-saves registers */           \
             : "rax", "rcx", "rdx", "rsi", "rdi",             \
               "r8",  "r9",  "r10", "r11" )                   \
diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
new file mode 100644
index 0000000..9a7e411
--- /dev/null
+++ b/xen/include/public/errno.h
@@ -0,0 +1,93 @@
+#ifndef __XEN_PUBLIC_ERRNO_H__
+
+#ifndef __ASSEMBLY__
+
+#define XEN_ERRNO(name, value) XEN_##name = value,
+enum xen_errno {
+
+#else /* !__ASSEMBLY__ */
+
+#define XEN_ERRNO(name, value) .equ XEN_##name, value
+
+#endif /* __ASSEMBLY__ */
+
+/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
+/* ` enum errnoval { */
+
+#endif /* __XEN_PUBLIC_ERRNO_H__ */
+
+#ifdef XEN_ERRNO
+
+/*
+ * Values originating from x86 Linux. Please consider using respective
+ * values when adding new definitions here.
+ */
+
+XEN_ERRNO(EPERM,	 1)	/* Operation not permitted */
+XEN_ERRNO(ENOENT,	 2)	/* No such file or directory */
+XEN_ERRNO(ESRCH,	 3)	/* No such process */
+#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
+XEN_ERRNO(EINTR,	 4)	/* Interrupted system call */
+#endif
+XEN_ERRNO(EIO,		 5)	/* I/O error */
+XEN_ERRNO(ENXIO,	 6)	/* No such device or address */
+XEN_ERRNO(E2BIG,	 7)	/* Arg list too long */
+XEN_ERRNO(ENOEXEC,	 8)	/* Exec format error */
+XEN_ERRNO(EBADF,	 9)	/* Bad file number */
+XEN_ERRNO(ECHILD,	10)	/* No child processes */
+XEN_ERRNO(EAGAIN,	11)	/* Try again */
+XEN_ERRNO(ENOMEM,	12)	/* Out of memory */
+XEN_ERRNO(EACCES,	13)	/* Permission denied */
+XEN_ERRNO(EFAULT,	14)	/* Bad address */
+XEN_ERRNO(EBUSY,	16)	/* Device or resource busy */
+XEN_ERRNO(EEXIST,	17)	/* File exists */
+XEN_ERRNO(EXDEV,	18)	/* Cross-device link */
+XEN_ERRNO(ENODEV,	19)	/* No such device */
+XEN_ERRNO(EINVAL,	22)	/* Invalid argument */
+XEN_ERRNO(ENFILE,	23)	/* File table overflow */
+XEN_ERRNO(EMFILE,	24)	/* Too many open files */
+XEN_ERRNO(ENOSPC,	28)	/* No space left on device */
+XEN_ERRNO(EMLINK,	31)	/* Too many links */
+XEN_ERRNO(EDOM,		33)	/* Math argument out of domain of func */
+XEN_ERRNO(ERANGE,	34)	/* Math result not representable */
+XEN_ERRNO(EDEADLK,	35)	/* Resource deadlock would occur */
+XEN_ERRNO(ENAMETOOLONG,	36)	/* File name too long */
+XEN_ERRNO(ENOLCK,	37)	/* No record locks available */
+XEN_ERRNO(ENOSYS,	38)	/* Function not implemented */
+XEN_ERRNO(EBADRQC,	56)	/* Invalid request code */
+XEN_ERRNO(EBADSLT,	57)	/* Invalid slot */
+XEN_ERRNO(ENODATA,	61)	/* No data available */
+XEN_ERRNO(ETIME,	62)	/* Timer expired */
+XEN_ERRNO(EBADMSG,	74)	/* Not a data message */
+XEN_ERRNO(EOVERFLOW,	75)	/* Value too large for defined data type */
+XEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
+#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
+XEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
+#endif
+XEN_ERRNO(EUSERS,	87)	/* Too many users */
+XEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
+XEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
+XEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
+XEN_ERRNO(ENOBUFS,	105)	/* No buffer space available */
+XEN_ERRNO(EISCONN,	106)	/* Transport endpoint is already connected */
+XEN_ERRNO(ENOTCONN,	107)	/* Transport endpoint is not connected */
+XEN_ERRNO(ESHUTDOWN,	108)	/* Cannot send after transport endpoint shutdown */
+XEN_ERRNO(ETOOMANYREFS,	109)	/* Too many references: cannot splice */
+XEN_ERRNO(ETIMEDOUT,	110)	/* Connection timed out */
+
+#undef XEN_ERRNO
+#endif /* XEN_ERRNO */
+
+#ifndef __XEN_PUBLIC_ERRNO_H__
+#define __XEN_PUBLIC_ERRNO_H__
+
+/* ` } */
+
+#ifndef __ASSEMBLY__
+};
+#endif
+
+#define	XEN_EWOULDBLOCK	XEN_EAGAIN	/* Operation would block */
+#define	XEN_EDEADLOCK	XEN_EDEADLK	/* Resource deadlock would occur */
+
+#endif /*  __XEN_PUBLIC_ERRNO_H__ */
diff --git a/xen/include/xen/errno.h b/xen/include/xen/errno.h
index 39147be..3178466 100644
--- a/xen/include/xen/errno.h
+++ b/xen/include/xen/errno.h
@@ -1,137 +1,20 @@
-#ifndef _I386_ERRNO_H
-#define _I386_ERRNO_H
+#ifndef __XEN_ERRNO_H__
+#define __XEN_ERRNO_H__
 
-/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
-/* ` enum errnoval { */
+#include <public/errno.h>
 
-#define	EPERM		 1	/* Operation not permitted */
-#define	ENOENT		 2	/* No such file or directory */
-#define	ESRCH		 3	/* No such process */
-#define	EINTR		 4	/* Interrupted system call */
-#define	EIO		 5	/* I/O error */
-#define	ENXIO		 6	/* No such device or address */
-#define	E2BIG		 7	/* Arg list too long */
-#define	ENOEXEC		 8	/* Exec format error */
-#define	EBADF		 9	/* Bad file number */
-#define	ECHILD		10	/* No child processes */
-#define	EAGAIN		11	/* Try again */
-#define	ENOMEM		12	/* Out of memory */
-#define	EACCES		13	/* Permission denied */
-#define	EFAULT		14	/* Bad address */
-#define	ENOTBLK		15	/* Block device required */
-#define	EBUSY		16	/* Device or resource busy */
-#define	EEXIST		17	/* File exists */
-#define	EXDEV		18	/* Cross-device link */
-#define	ENODEV		19	/* No such device */
-#define	ENOTDIR		20	/* Not a directory */
-#define	EISDIR		21	/* Is a directory */
-#define	EINVAL		22	/* Invalid argument */
-#define	ENFILE		23	/* File table overflow */
-#define	EMFILE		24	/* Too many open files */
-#define	ENOTTY		25	/* Not a typewriter */
-#define	ETXTBSY		26	/* Text file busy */
-#define	EFBIG		27	/* File too large */
-#define	ENOSPC		28	/* No space left on device */
-#define	ESPIPE		29	/* Illegal seek */
-#define	EROFS		30	/* Read-only file system */
-#define	EMLINK		31	/* Too many links */
-#define	EPIPE		32	/* Broken pipe */
-#define	EDOM		33	/* Math argument out of domain of func */
-#define	ERANGE		34	/* Math result not representable */
-#define	EDEADLK		35	/* Resource deadlock would occur */
-#define	ENAMETOOLONG	36	/* File name too long */
-#define	ENOLCK		37	/* No record locks available */
-#define	ENOSYS		38	/* Function not implemented */
-#define	ENOTEMPTY	39	/* Directory not empty */
-#define	ELOOP		40	/* Too many symbolic links encountered */
-#define	EWOULDBLOCK	EAGAIN	/* Operation would block */
-#define	ENOMSG		42	/* No message of desired type */
-#define	EIDRM		43	/* Identifier removed */
-#define	ECHRNG		44	/* Channel number out of range */
-#define	EL2NSYNC	45	/* Level 2 not synchronized */
-#define	EL3HLT		46	/* Level 3 halted */
-#define	EL3RST		47	/* Level 3 reset */
-#define	ELNRNG		48	/* Link number out of range */
-#define	EUNATCH		49	/* Protocol driver not attached */
-#define	ENOCSI		50	/* No CSI structure available */
-#define	EL2HLT		51	/* Level 2 halted */
-#define	EBADE		52	/* Invalid exchange */
-#define	EBADR		53	/* Invalid request descriptor */
-#define	EXFULL		54	/* Exchange full */
-#define	ENOANO		55	/* No anode */
-#define	EBADRQC		56	/* Invalid request code */
-#define	EBADSLT		57	/* Invalid slot */
+#ifndef __ASSEMBLY__
 
-#define	EDEADLOCK	EDEADLK
+#define XEN_ERRNO(name, value) name = XEN_##name,
+enum {
+#include <public/errno.h>
+};
 
-#define	EBFONT		59	/* Bad font file format */
-#define	ENOSTR		60	/* Device not a stream */
-#define	ENODATA		61	/* No data available */
-#define	ETIME		62	/* Timer expired */
-#define	ENOSR		63	/* Out of streams resources */
-#define	ENONET		64	/* Machine is not on the network */
-#define	ENOPKG		65	/* Package not installed */
-#define	EREMOTE		66	/* Object is remote */
-#define	ENOLINK		67	/* Link has been severed */
-#define	EADV		68	/* Advertise error */
-#define	ESRMNT		69	/* Srmount error */
-#define	ECOMM		70	/* Communication error on send */
-#define	EPROTO		71	/* Protocol error */
-#define	EMULTIHOP	72	/* Multihop attempted */
-#define	EDOTDOT		73	/* RFS specific error */
-#define	EBADMSG		74	/* Not a data message */
-#define	EOVERFLOW	75	/* Value too large for defined data type */
-#define	ENOTUNIQ	76	/* Name not unique on network */
-#define	EBADFD		77	/* File descriptor in bad state */
-#define	EREMCHG		78	/* Remote address changed */
-#define	ELIBACC		79	/* Can not access a needed shared library */
-#define	ELIBBAD		80	/* Accessing a corrupted shared library */
-#define	ELIBSCN		81	/* .lib section in a.out corrupted */
-#define	ELIBMAX		82	/* Attempting to link in too many shared libraries */
-#define	ELIBEXEC	83	/* Cannot exec a shared library directly */
-#define	EILSEQ		84	/* Illegal byte sequence */
-#define	ERESTART	85	/* Interrupted system call should be restarted */
-#define	ESTRPIPE	86	/* Streams pipe error */
-#define	EUSERS		87	/* Too many users */
-#define	ENOTSOCK	88	/* Socket operation on non-socket */
-#define	EDESTADDRREQ	89	/* Destination address required */
-#define	EMSGSIZE	90	/* Message too long */
-#define	EPROTOTYPE	91	/* Protocol wrong type for socket */
-#define	ENOPROTOOPT	92	/* Protocol not available */
-#define	EPROTONOSUPPORT	93	/* Protocol not supported */
-#define	ESOCKTNOSUPPORT	94	/* Socket type not supported */
-#define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
-#define	EPFNOSUPPORT	96	/* Protocol family not supported */
-#define	EAFNOSUPPORT	97	/* Address family not supported by protocol */
-#define	EADDRINUSE	98	/* Address already in use */
-#define	EADDRNOTAVAIL	99	/* Cannot assign requested address */
-#define	ENETDOWN	100	/* Network is down */
-#define	ENETUNREACH	101	/* Network is unreachable */
-#define	ENETRESET	102	/* Network dropped connection because of reset */
-#define	ECONNABORTED	103	/* Software caused connection abort */
-#define	ECONNRESET	104	/* Connection reset by peer */
-#define	ENOBUFS		105	/* No buffer space available */
-#define	EISCONN		106	/* Transport endpoint is already connected */
-#define	ENOTCONN	107	/* Transport endpoint is not connected */
-#define	ESHUTDOWN	108	/* Cannot send after transport endpoint shutdown */
-#define	ETOOMANYREFS	109	/* Too many references: cannot splice */
-#define	ETIMEDOUT	110	/* Connection timed out */
-#define	ECONNREFUSED	111	/* Connection refused */
-#define	EHOSTDOWN	112	/* Host is down */
-#define	EHOSTUNREACH	113	/* No route to host */
-#define	EALREADY	114	/* Operation already in progress */
-#define	EINPROGRESS	115	/* Operation now in progress */
-#define	ESTALE		116	/* Stale NFS file handle */
-#define	EUCLEAN		117	/* Structure needs cleaning */
-#define	ENOTNAM		118	/* Not a XENIX named type file */
-#define	ENAVAIL		119	/* No XENIX semaphores available */
-#define	EISNAM		120	/* Is a named type file */
-#define	EREMOTEIO	121	/* Remote I/O error */
-#define	EDQUOT		122	/* Quota exceeded */
+#else /* !__ASSEMBLY__ */
 
-#define	ENOMEDIUM	123	/* No medium found */
-#define	EMEDIUMTYPE	124	/* Wrong medium type */
+#define XEN_ERRNO(name, value) .equ name, XEN_##name
+#include <public/errno.h>
 
-/* ` } */
+#endif /* __ASSEMBLY__ */
 
-#endif
+#endif /*  __XEN_ERRNO_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 Tue Feb 03 07:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07: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 1YIYKQ-0003sr-P4; Tue, 03 Feb 2015 07:55: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 1YIYKP-0003sX-9A
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:21 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CB/7C-02750-8EE70D45; Tue, 03 Feb 2015 07:55:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1422950118!12423276!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30648 invoked from network); 3 Feb 2015 07:55:19 -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 Feb 2015 07:55: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 1YIYKM-0004vM-IG
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKM-00062d-Ge
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:18 +0000
Date: Tue, 03 Feb 2015 07:55:18 +0000
Message-Id: <E1YIYKM-00062d-Ge@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce domain_max_vcpus() helper
	and implement per arch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2f3dd9c8c6c0dabaac47e16ac47fbfc9fb695842
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:44:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:44:03 2015 +0100

    introduce domain_max_vcpus() helper and implement per arch
    
    This allows the common XEN_DOMCTL_max_vcpus handler to lose some x86-specific
    architecture knowledge.
    
    It turns out that Xen had the same magic number twice in-tree with different
    names (HVM_MAX_VCPUS and MAX_HVM_VCPUS).  This removes all use of
    MAX_HVM_VCPUS, and x86 uses HVM_MAX_VCPUS from the public headers.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domctl.c          |    3 +--
 xen/include/asm-arm/config.h |    1 -
 xen/include/asm-arm/domain.h |    5 +++++
 xen/include/asm-x86/config.h |    3 ---
 xen/include/asm-x86/domain.h |    3 +++
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index ee578c0..33ecd45 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -608,8 +608,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
-             (max > MAX_VIRT_CPUS) ||
-             (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
+             (max > domain_max_vcpus(d)) )
             break;
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 1b5a842..3b23e05 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -48,7 +48,6 @@
 #endif
 
 #define MAX_VIRT_CPUS 8
-#define MAX_HVM_VCPUS MAX_VIRT_CPUS
 
 #define asmlinkage /* Nothing needed */
 
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 8b7dd85..9018c6a 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -249,6 +249,11 @@ struct arch_vcpu
 void vcpu_show_execution_state(struct vcpu *);
 void vcpu_show_registers(const struct vcpu *);
 
+static inline unsigned int domain_max_vcpus(const struct domain *d)
+{
+    return MAX_VIRT_CPUS;
+}
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index ad52d5b..2fbd68d 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -67,9 +67,6 @@
 #define NR_CPUS 256
 #endif
 
-/* Maximum we can support with current vLAPIC ID mapping. */
-#define MAX_HVM_VCPUS 128
-
 /* Linkage for x86 */
 #define __ALIGN .align 16,0x90
 #define __ALIGN_STR ".align 16,0x90"
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 6a77a93..b233fbc 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -9,6 +9,7 @@
 #include <asm/e820.h>
 #include <asm/mce.h>
 #include <public/vcpu.h>
+#include <public/hvm/hvm_info_table.h>
 
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
 #define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
@@ -527,6 +528,8 @@ void domain_cpuid(struct domain *d,
                   unsigned int  *ecx,
                   unsigned int  *edx);
 
+#define domain_max_vcpus(d) (is_hvm_domain(d) ? HVM_MAX_VCPUS : MAX_VIRT_CPUS)
+
 #endif /* __ASM_DOMAIN_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 Tue Feb 03 07:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07: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 1YIYKQ-0003sr-P4; Tue, 03 Feb 2015 07:55: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 1YIYKP-0003sX-9A
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:21 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CB/7C-02750-8EE70D45; Tue, 03 Feb 2015 07:55:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1422950118!12423276!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30648 invoked from network); 3 Feb 2015 07:55:19 -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 Feb 2015 07:55: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 1YIYKM-0004vM-IG
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKM-00062d-Ge
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:18 +0000
Date: Tue, 03 Feb 2015 07:55:18 +0000
Message-Id: <E1YIYKM-00062d-Ge@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce domain_max_vcpus() helper
	and implement per arch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2f3dd9c8c6c0dabaac47e16ac47fbfc9fb695842
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:44:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:44:03 2015 +0100

    introduce domain_max_vcpus() helper and implement per arch
    
    This allows the common XEN_DOMCTL_max_vcpus handler to lose some x86-specific
    architecture knowledge.
    
    It turns out that Xen had the same magic number twice in-tree with different
    names (HVM_MAX_VCPUS and MAX_HVM_VCPUS).  This removes all use of
    MAX_HVM_VCPUS, and x86 uses HVM_MAX_VCPUS from the public headers.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domctl.c          |    3 +--
 xen/include/asm-arm/config.h |    1 -
 xen/include/asm-arm/domain.h |    5 +++++
 xen/include/asm-x86/config.h |    3 ---
 xen/include/asm-x86/domain.h |    3 +++
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index ee578c0..33ecd45 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -608,8 +608,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
-             (max > MAX_VIRT_CPUS) ||
-             (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
+             (max > domain_max_vcpus(d)) )
             break;
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 1b5a842..3b23e05 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -48,7 +48,6 @@
 #endif
 
 #define MAX_VIRT_CPUS 8
-#define MAX_HVM_VCPUS MAX_VIRT_CPUS
 
 #define asmlinkage /* Nothing needed */
 
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 8b7dd85..9018c6a 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -249,6 +249,11 @@ struct arch_vcpu
 void vcpu_show_execution_state(struct vcpu *);
 void vcpu_show_registers(const struct vcpu *);
 
+static inline unsigned int domain_max_vcpus(const struct domain *d)
+{
+    return MAX_VIRT_CPUS;
+}
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index ad52d5b..2fbd68d 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -67,9 +67,6 @@
 #define NR_CPUS 256
 #endif
 
-/* Maximum we can support with current vLAPIC ID mapping. */
-#define MAX_HVM_VCPUS 128
-
 /* Linkage for x86 */
 #define __ALIGN .align 16,0x90
 #define __ALIGN_STR ".align 16,0x90"
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 6a77a93..b233fbc 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -9,6 +9,7 @@
 #include <asm/e820.h>
 #include <asm/mce.h>
 #include <public/vcpu.h>
+#include <public/hvm/hvm_info_table.h>
 
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
 #define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
@@ -527,6 +528,8 @@ void domain_cpuid(struct domain *d,
                   unsigned int  *ecx,
                   unsigned int  *edx);
 
+#define domain_max_vcpus(d) (is_hvm_domain(d) ? HVM_MAX_VCPUS : MAX_VIRT_CPUS)
+
 #endif /* __ASM_DOMAIN_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 Tue Feb 03 07:55:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:55: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 1YIYKZ-0003ub-Sk; Tue, 03 Feb 2015 07:55: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 1YIYKY-0003uQ-Vu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:31 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	79/A2-02994-2FE70D45; Tue, 03 Feb 2015 07:55:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422950129!10810658!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5484 invoked from network); 3 Feb 2015 07:55:29 -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;
	3 Feb 2015 07:55: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 1YIYKW-0004vX-QN
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKW-000632-M8
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:28 +0000
Date: Tue, 03 Feb 2015 07:55:28 +0000
Message-Id: <E1YIYKW-000632-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: reduce the size of the
	poll_mask where possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b52512634913459cbf1f183e5b7223f01db468bb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:45:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:45:13 2015 +0100

    evtchn: reduce the size of the poll_mask where possible
    
    Use domain_max_vcpus(d) in preference to MAX_VIRT_CPUS when allocating the
    poll mask.  This allows x86 HVM guests to have a poll mask of 128 bits rather
    than 8k bits.
    
    While changing this, use xzalloc_array() in preference to xmalloc_array() to
    avoid needing the subsequent call to bitmap_zero().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/event_channel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index c0fbcea..4a52f69 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1264,13 +1264,13 @@ int evtchn_init(struct domain *d)
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
-    d->poll_mask = xmalloc_array(unsigned long, BITS_TO_LONGS(MAX_VIRT_CPUS));
+    d->poll_mask = xzalloc_array(unsigned long,
+                                 BITS_TO_LONGS(domain_max_vcpus(d)));
     if ( !d->poll_mask )
     {
         free_evtchn_bucket(d, d->evtchn);
         return -ENOMEM;
     }
-    bitmap_zero(d->poll_mask, MAX_VIRT_CPUS);
 #endif
 
     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 Tue Feb 03 07:55:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:55: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 1YIYKZ-0003ub-Sk; Tue, 03 Feb 2015 07:55: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 1YIYKY-0003uQ-Vu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:31 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	79/A2-02994-2FE70D45; Tue, 03 Feb 2015 07:55:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422950129!10810658!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5484 invoked from network); 3 Feb 2015 07:55:29 -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;
	3 Feb 2015 07:55: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 1YIYKW-0004vX-QN
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKW-000632-M8
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:28 +0000
Date: Tue, 03 Feb 2015 07:55:28 +0000
Message-Id: <E1YIYKW-000632-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: reduce the size of the
	poll_mask where possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b52512634913459cbf1f183e5b7223f01db468bb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:45:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:45:13 2015 +0100

    evtchn: reduce the size of the poll_mask where possible
    
    Use domain_max_vcpus(d) in preference to MAX_VIRT_CPUS when allocating the
    poll mask.  This allows x86 HVM guests to have a poll mask of 128 bits rather
    than 8k bits.
    
    While changing this, use xzalloc_array() in preference to xmalloc_array() to
    avoid needing the subsequent call to bitmap_zero().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/event_channel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index c0fbcea..4a52f69 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1264,13 +1264,13 @@ int evtchn_init(struct domain *d)
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
-    d->poll_mask = xmalloc_array(unsigned long, BITS_TO_LONGS(MAX_VIRT_CPUS));
+    d->poll_mask = xzalloc_array(unsigned long,
+                                 BITS_TO_LONGS(domain_max_vcpus(d)));
     if ( !d->poll_mask )
     {
         free_evtchn_bucket(d, d->evtchn);
         return -ENOMEM;
     }
-    bitmap_zero(d->poll_mask, MAX_VIRT_CPUS);
 #endif
 
     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 Tue Feb 03 07:55:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:55: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 1YIYKk-0003wO-VK; Tue, 03 Feb 2015 07:55:42 +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 1YIYKj-0003wB-ML
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:41 +0000
Received: from [85.158.139.211] by server-8.bemta-5.messagelabs.com id
	44/CB-03712-DFE70D45; Tue, 03 Feb 2015 07:55:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1422950139!5378452!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17994 invoked from network); 3 Feb 2015 07:55:40 -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 Feb 2015 07:55: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 1YIYKh-0004vd-3r
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKg-00064M-WF
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:39 +0000
Date: Tue, 03 Feb 2015 07:55:38 +0000
Message-Id: <E1YIYKg-00064M-WF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched/arinc653: remove MAX_VIRT_CPUS
	bounds check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f5ec57aeea210003b3b76a1e7a02fc65a81b82
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:46:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:46:10 2015 +0100

    sched/arinc653: remove MAX_VIRT_CPUS bounds check
    
    The arinc653 interface is capable of specifying a domain in the schedule (from
    the toolstack) before the domain itself exists, or is present in the cpupool
    (The domain is identified by UUID rather than domid). As a result, the
    schedule can't be validated at this point.
    
    The vcpu_id from userspace is only ever used to compare against a list of real
    vcpus available to the scheduler, which prevents ill-specified vcpus from
    actually being scheduled.
    
    Remove the MAX_VIRT_CPUS test, as it is not an appropriate bound for vcpu_id.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by Robert VanVossen <robert.vanvossen@dornerworks.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched_arinc653.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index 5f09ded..819b869 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -246,9 +246,8 @@ arinc653_sched_set(
 
     for ( i = 0; i < schedule->num_sched_entries; i++ )
     {
-        /* Check for a valid VCPU ID and run time. */
-        if ( (schedule->sched_entries[i].vcpu_id >= MAX_VIRT_CPUS)
-             || (schedule->sched_entries[i].runtime <= 0) )
+        /* Check for a valid run time. */
+        if ( schedule->sched_entries[i].runtime <= 0 )
             goto fail;
 
         /* Add this entry's run time to total run time. */
--
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 Tue Feb 03 07:55:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:55: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 1YIYKk-0003wO-VK; Tue, 03 Feb 2015 07:55:42 +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 1YIYKj-0003wB-ML
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:41 +0000
Received: from [85.158.139.211] by server-8.bemta-5.messagelabs.com id
	44/CB-03712-DFE70D45; Tue, 03 Feb 2015 07:55:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1422950139!5378452!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17994 invoked from network); 3 Feb 2015 07:55:40 -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 Feb 2015 07:55: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 1YIYKh-0004vd-3r
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKg-00064M-WF
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:39 +0000
Date: Tue, 03 Feb 2015 07:55:38 +0000
Message-Id: <E1YIYKg-00064M-WF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched/arinc653: remove MAX_VIRT_CPUS
	bounds check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f5ec57aeea210003b3b76a1e7a02fc65a81b82
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:46:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:46:10 2015 +0100

    sched/arinc653: remove MAX_VIRT_CPUS bounds check
    
    The arinc653 interface is capable of specifying a domain in the schedule (from
    the toolstack) before the domain itself exists, or is present in the cpupool
    (The domain is identified by UUID rather than domid). As a result, the
    schedule can't be validated at this point.
    
    The vcpu_id from userspace is only ever used to compare against a list of real
    vcpus available to the scheduler, which prevents ill-specified vcpus from
    actually being scheduled.
    
    Remove the MAX_VIRT_CPUS test, as it is not an appropriate bound for vcpu_id.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by Robert VanVossen <robert.vanvossen@dornerworks.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched_arinc653.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index 5f09ded..819b869 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -246,9 +246,8 @@ arinc653_sched_set(
 
     for ( i = 0; i < schedule->num_sched_entries; i++ )
     {
-        /* Check for a valid VCPU ID and run time. */
-        if ( (schedule->sched_entries[i].vcpu_id >= MAX_VIRT_CPUS)
-             || (schedule->sched_entries[i].runtime <= 0) )
+        /* Check for a valid run time. */
+        if ( schedule->sched_entries[i].runtime <= 0 )
             goto fail;
 
         /* Add this entry's run time to total run time. */
--
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 Tue Feb 03 07:55:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:55: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 1YIYKv-0003yR-42; Tue, 03 Feb 2015 07:55: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 1YIYKt-0003yC-Qg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:51 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	50/5E-02753-70F70D45; Tue, 03 Feb 2015 07:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950149!12388706!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21521 invoked from network); 3 Feb 2015 07:55:50 -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;
	3 Feb 2015 07:55:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKr-0004vj-H5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKr-00064k-8q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:49 +0000
Date: Tue, 03 Feb 2015 07:55:49 +0000
Message-Id: <E1YIYKr-00064k-8q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drop redundant MAX_VIRT_CPUS bounds
	checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d9e66702fd9e1cf7a8e7fa3b28879cd6f779bac5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:46:43 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:46:43 2015 +0100

    drop redundant MAX_VIRT_CPUS bounds checks
    
    In all 4 cases, visible in the context are bounds check against d->max_vcpus.
    Domain building will ensure that d->max_vcpus never exceeds an appropriate
    bound.  In the x86 case, different types of domains have different maxima for
    vcpus, making the checks wrong as opposed to simply redundant.
    
    For vpsci in ARM, 'vcpuid' is an unsigned type so could never be less than 0.
    
    For the common changes to do_{,compat}_vcpu_op(), these changes do result in a
    guest visible change, but only in so far as certain invalid vcpu ids will now
    fail with -ENOENT rather than -EINVAL.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vpsci.c       |    3 ---
 xen/arch/x86/domctl.c      |    4 ----
 xen/common/compat/domain.c |    3 ---
 xen/common/domain.c        |    3 ---
 4 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index 3f2a482..5d899be 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -37,9 +37,6 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     else
         vcpuid = target_cpu;
 
-    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
-        return PSCI_INVALID_PARAMETERS;
-
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
         return PSCI_INVALID_PARAMETERS;
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 82365a4..a1c5db0 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -541,10 +541,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = -EINVAL;
-        if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            break;
-
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 510843d..3ca4ef7 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -29,9 +29,6 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     struct vcpu *v;
     int rc = 0;
 
-    if ( vcpuid >= MAX_VIRT_CPUS )
-        return -EINVAL;
-
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
         return -ENOENT;
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e02823e..0b05681 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1146,9 +1146,6 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     struct vcpu_guest_context *ctxt;
     long rc = 0;
 
-    if ( vcpuid >= MAX_VIRT_CPUS )
-        return -EINVAL;
-
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
         return -ENOENT;
 
--
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 Tue Feb 03 07:55:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:55: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 1YIYKv-0003yR-42; Tue, 03 Feb 2015 07:55: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 1YIYKt-0003yC-Qg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:51 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	50/5E-02753-70F70D45; Tue, 03 Feb 2015 07:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950149!12388706!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21521 invoked from network); 3 Feb 2015 07:55:50 -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;
	3 Feb 2015 07:55:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKr-0004vj-H5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYKr-00064k-8q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:49 +0000
Date: Tue, 03 Feb 2015 07:55:49 +0000
Message-Id: <E1YIYKr-00064k-8q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drop redundant MAX_VIRT_CPUS bounds
	checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d9e66702fd9e1cf7a8e7fa3b28879cd6f779bac5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:46:43 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:46:43 2015 +0100

    drop redundant MAX_VIRT_CPUS bounds checks
    
    In all 4 cases, visible in the context are bounds check against d->max_vcpus.
    Domain building will ensure that d->max_vcpus never exceeds an appropriate
    bound.  In the x86 case, different types of domains have different maxima for
    vcpus, making the checks wrong as opposed to simply redundant.
    
    For vpsci in ARM, 'vcpuid' is an unsigned type so could never be less than 0.
    
    For the common changes to do_{,compat}_vcpu_op(), these changes do result in a
    guest visible change, but only in so far as certain invalid vcpu ids will now
    fail with -ENOENT rather than -EINVAL.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vpsci.c       |    3 ---
 xen/arch/x86/domctl.c      |    4 ----
 xen/common/compat/domain.c |    3 ---
 xen/common/domain.c        |    3 ---
 4 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index 3f2a482..5d899be 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -37,9 +37,6 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     else
         vcpuid = target_cpu;
 
-    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
-        return PSCI_INVALID_PARAMETERS;
-
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
         return PSCI_INVALID_PARAMETERS;
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 82365a4..a1c5db0 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -541,10 +541,6 @@ long arch_do_domctl(
     {
         struct vcpu *v;
 
-        ret = -EINVAL;
-        if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            break;
-
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 510843d..3ca4ef7 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -29,9 +29,6 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     struct vcpu *v;
     int rc = 0;
 
-    if ( vcpuid >= MAX_VIRT_CPUS )
-        return -EINVAL;
-
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
         return -ENOENT;
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e02823e..0b05681 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1146,9 +1146,6 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     struct vcpu_guest_context *ctxt;
     long rc = 0;
 
-    if ( vcpuid >= MAX_VIRT_CPUS )
-        return -EINVAL;
-
     if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
         return -ENOENT;
 
--
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 Tue Feb 03 07:56:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYL5-0003zs-76; Tue, 03 Feb 2015 07:56: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 1YIYL4-0003zc-56
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:02 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	75/8E-02753-11F70D45; Tue, 03 Feb 2015 07:56:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1422950159!12401026!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22592 invoked from network); 3 Feb 2015 07:56:00 -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;
	3 Feb 2015 07:56: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 1YIYL1-0004vs-N4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYL1-00065D-LK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:59 +0000
Date: Tue, 03 Feb 2015 07:55:59 +0000
Message-Id: <E1YIYL1-00065D-LK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't expose XSAVES capability to
	PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:47:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:47:56 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6abf1db..bd04dad 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -837,7 +837,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -855,7 +855,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -931,9 +931,19 @@ void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 5f3b161..d5f5e3b 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -320,12 +323,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 8d21349..4c690db 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -16,6 +16,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -40,6 +43,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct __packed __attribute__((aligned (64))) xsave_struct
--
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 Tue Feb 03 07:56:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYL5-0003zs-76; Tue, 03 Feb 2015 07:56: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 1YIYL4-0003zc-56
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:02 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	75/8E-02753-11F70D45; Tue, 03 Feb 2015 07:56:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1422950159!12401026!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22592 invoked from network); 3 Feb 2015 07:56:00 -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;
	3 Feb 2015 07:56: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 1YIYL1-0004vs-N4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYL1-00065D-LK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:55:59 +0000
Date: Tue, 03 Feb 2015 07:55:59 +0000
Message-Id: <E1YIYL1-00065D-LK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't expose XSAVES capability to
	PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:47:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:47:56 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6abf1db..bd04dad 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -837,7 +837,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -855,7 +855,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -931,9 +931,19 @@ void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 5f3b161..d5f5e3b 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -320,12 +323,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 8d21349..4c690db 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -16,6 +16,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -40,6 +43,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct __packed __attribute__((aligned (64))) xsave_struct
--
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 Tue Feb 03 07:56:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYLF-00041F-AA; Tue, 03 Feb 2015 07:56: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 1YIYLE-000415-8G
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:12 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EE/A2-02749-B1F70D45; Tue, 03 Feb 2015 07:56:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950170!11752773!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11920 invoked from network); 3 Feb 2015 07:56:10 -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;
	3 Feb 2015 07:56: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 1YIYLB-0004wR-Tr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLB-00065t-Sb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:09 +0000
Date: Tue, 03 Feb 2015 07:56:09 +0000
Message-Id: <E1YIYLB-00065t-Sb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correctly check for sub-leaf zero
	of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:48:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:48:40 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index bd04dad..a8d7bb6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -881,7 +881,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         }
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -916,7 +916,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
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 Tue Feb 03 07:56:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYLF-00041F-AA; Tue, 03 Feb 2015 07:56: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 1YIYLE-000415-8G
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:12 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EE/A2-02749-B1F70D45; Tue, 03 Feb 2015 07:56:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950170!11752773!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11920 invoked from network); 3 Feb 2015 07:56:10 -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;
	3 Feb 2015 07:56: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 1YIYLB-0004wR-Tr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLB-00065t-Sb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:09 +0000
Date: Tue, 03 Feb 2015 07:56:09 +0000
Message-Id: <E1YIYLB-00065t-Sb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correctly check for sub-leaf zero
	of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:48:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:48:40 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index bd04dad..a8d7bb6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -881,7 +881,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         }
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -916,7 +916,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
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 Tue Feb 03 07:56:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYLP-00042j-Ck; Tue, 03 Feb 2015 07:56:23 +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 1YIYLO-00042U-2d
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:22 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7E/D2-02749-52F70D45; Tue, 03 Feb 2015 07:56:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950180!11752801!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12373 invoked from network); 3 Feb 2015 07:56:21 -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;
	3 Feb 2015 07:56: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 1YIYLM-0004wX-4T
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLM-00066O-2Q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:20 +0000
Date: Tue, 03 Feb 2015 07:56:20 +0000
Message-Id: <E1YIYLM-00066O-2Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't open-code cpuid_count() in
	pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19aacf6c061af7e5c7672a818a773fecda224ad9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:49:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:49:04 2015 +0100

    x86: don't open-code cpuid_count() in pv_cpuid()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index a8d7bb6..322ebf4 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -861,10 +861,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         goto out;
     }
 
-    asm ( 
-        "cpuid"
-        : "=a" (a), "=b" (b), "=c" (c), "=d" (d)
-        : "0" (a), "1" (b), "2" (c), "3" (d) );
+    cpuid_count(a, c, &a, &b, &c, &d);
 
     if ( (regs->eax & 0x7fffffff) == 0x00000001 )
     {
--
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 Tue Feb 03 07:56:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYLP-00042j-Ck; Tue, 03 Feb 2015 07:56:23 +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 1YIYLO-00042U-2d
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:22 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7E/D2-02749-52F70D45; Tue, 03 Feb 2015 07:56:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950180!11752801!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12373 invoked from network); 3 Feb 2015 07:56:21 -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;
	3 Feb 2015 07:56: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 1YIYLM-0004wX-4T
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLM-00066O-2Q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:20 +0000
Date: Tue, 03 Feb 2015 07:56:20 +0000
Message-Id: <E1YIYLM-00066O-2Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't open-code cpuid_count() in
	pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19aacf6c061af7e5c7672a818a773fecda224ad9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:49:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:49:04 2015 +0100

    x86: don't open-code cpuid_count() in pv_cpuid()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index a8d7bb6..322ebf4 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -861,10 +861,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         goto out;
     }
 
-    asm ( 
-        "cpuid"
-        : "=a" (a), "=b" (b), "=c" (c), "=d" (d)
-        : "0" (a), "1" (b), "2" (c), "3" (d) );
+    cpuid_count(a, c, &a, &b, &c, &d);
 
     if ( (regs->eax & 0x7fffffff) == 0x00000001 )
     {
--
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 Tue Feb 03 07:56:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYLa-00044G-FK; Tue, 03 Feb 2015 07:56: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 1YIYLZ-000445-Gu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:33 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	DF/14-02639-03F70D45; Tue, 03 Feb 2015 07:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950190!12415316!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32055 invoked from network); 3 Feb 2015 07:56:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:56: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 1YIYLW-0004wf-9F
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLW-000676-8H
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:30 +0000
Date: Tue, 03 Feb 2015 07:56:30 +0000
Message-Id: <E1YIYLW-000676-8H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: dump full guest 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 de8d96927b7e82bd36ef14852f8f0c4f81a12dbc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:54:49 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:54:49 2015 +0100

    VMX: dump full guest state
    
    Several guest state fields did not get dumped so far. Where suitable
    (to reduce the amount of output) make some of the dumping conditional
    upon guest settings (this isn't required for correctness as vmr()
    already uses __vmread_safe(), i.e. it is fine to access non-existing
    fields).
    
    Move CR3_TARGET_* and TSC_OFFSET processing into the control state
    section, at once making the upper bound of CR3_TARGET_VALUEn printed
    depend on CR3_TARGET_COUNT (which architecturally can be higher than
    4).
    
    Also rename GUEST_PDPTRn to GUEST_PDPTEn (matching the SDM naming) and
    group them as well as CR3_TARGET_VALUEn similar to EOI_EXIT_BITMAP.
    
    Finally, drop casts - they haven't been needed anymore since the
    dropping of 32-bit support (and some of them were not really needed in
    the first place). Introduce vmr16() and vmr32() helper macros to avoid
    the "l" printk format modifier and at the same time validate that only
    16-/32-bit fields get accessed this way.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |  112 +++++++++++++++++++++---------------
 xen/arch/x86/hvm/vmx/vmx.c         |   12 ++--
 xen/arch/x86/hvm/vmx/vvmx.c        |   14 ++--
 xen/include/asm-x86/hvm/vmx/vmcs.h |   17 ++----
 4 files changed, 84 insertions(+), 71 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9d8033e..c5e6f88 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1395,6 +1395,16 @@ static inline unsigned long vmr(unsigned long field)
     return __vmread_safe(field, &val) ? val : 0;
 }
 
+#define vmr16(fld) ({             \
+    BUILD_BUG_ON((fld) & 0x6001); \
+    (uint16_t)vmr(fld);           \
+})
+
+#define vmr32(fld) ({                         \
+    BUILD_BUG_ON(((fld) & 0x6001) != 0x4000); \
+    (uint32_t)vmr(fld);                       \
+})
+
 static void vmx_dump_sel(char *name, uint32_t selector)
 {
     uint32_t sel, attr, limit;
@@ -1420,44 +1430,45 @@ static void vmx_dump_sel2(char *name, uint32_t lim)
 void vmcs_dump_vcpu(struct vcpu *v)
 {
     struct cpu_user_regs *regs = &v->arch.user_regs;
-    unsigned long long x;
+    uint32_t vmentry_ctl, vmexit_ctl;
+    unsigned long cr4;
+    uint64_t efer;
+    unsigned int i, n;
 
     if ( v == current )
         regs = guest_cpu_user_regs();
 
     vmx_vmcs_enter(v);
 
+    vmentry_ctl = vmr32(VM_ENTRY_CONTROLS),
+    vmexit_ctl = vmr32(VM_EXIT_CONTROLS);
+    cr4 = vmr(GUEST_CR4);
+    efer = vmr(GUEST_EFER);
+
     printk("*** Guest State ***\n");
-    printk("CR0: actual=0x%016llx, shadow=0x%016llx, gh_mask=%016llx\n",
-           (unsigned long long)vmr(GUEST_CR0),
-           (unsigned long long)vmr(CR0_READ_SHADOW), 
-           (unsigned long long)vmr(CR0_GUEST_HOST_MASK));
-    printk("CR4: actual=0x%016llx, shadow=0x%016llx, gh_mask=%016llx\n",
-           (unsigned long long)vmr(GUEST_CR4),
-           (unsigned long long)vmr(CR4_READ_SHADOW), 
-           (unsigned long long)vmr(CR4_GUEST_HOST_MASK));
-    printk("CR3: actual=0x%016llx, target_count=%d\n",
-           (unsigned long long)vmr(GUEST_CR3),
-           (int)vmr(CR3_TARGET_COUNT));
-    printk("     target0=%016llx, target1=%016llx\n",
-           (unsigned long long)vmr(CR3_TARGET_VALUE0),
-           (unsigned long long)vmr(CR3_TARGET_VALUE1));
-    printk("     target2=%016llx, target3=%016llx\n",
-           (unsigned long long)vmr(CR3_TARGET_VALUE2),
-           (unsigned long long)vmr(CR3_TARGET_VALUE3));
-    printk("RSP = 0x%016llx (0x%016llx)  RIP = 0x%016llx (0x%016llx)\n", 
-           (unsigned long long)vmr(GUEST_RSP),
-           (unsigned long long)regs->esp,
-           (unsigned long long)vmr(GUEST_RIP),
-           (unsigned long long)regs->eip);
-    printk("RFLAGS=0x%016llx (0x%016llx)  DR7 = 0x%016llx\n", 
-           (unsigned long long)vmr(GUEST_RFLAGS),
-           (unsigned long long)regs->eflags,
-           (unsigned long long)vmr(GUEST_DR7));
-    printk("Sysenter RSP=%016llx CS:RIP=%04x:%016llx\n",
-           (unsigned long long)vmr(GUEST_SYSENTER_ESP),
-           (int)vmr(GUEST_SYSENTER_CS),
-           (unsigned long long)vmr(GUEST_SYSENTER_EIP));
+    printk("CR0: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
+           vmr(GUEST_CR0), vmr(CR0_READ_SHADOW), vmr(CR0_GUEST_HOST_MASK));
+    printk("CR4: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
+           cr4, vmr(CR4_READ_SHADOW), vmr(CR4_GUEST_HOST_MASK));
+    printk("CR3 = 0x%016lx\n", vmr(GUEST_CR3));
+    if ( (v->arch.hvm_vmx.secondary_exec_control &
+          SECONDARY_EXEC_ENABLE_EPT) &&
+         (cr4 & X86_CR4_PAE) && !(efer & EFER_LMA) )
+    {
+        printk("PDPTE0 = 0x%016lx  PDPTE1 = 0x%016lx\n",
+               vmr(GUEST_PDPTE(0)), vmr(GUEST_PDPTE(1)));
+        printk("PDPTE2 = 0x%016lx  PDPTE3 = 0x%016lx\n",
+               vmr(GUEST_PDPTE(2)), vmr(GUEST_PDPTE(3)));
+    }
+    printk("RSP = 0x%016lx (0x%016lx)  RIP = 0x%016lx (0x%016lx)\n",
+           vmr(GUEST_RSP), regs->esp,
+           vmr(GUEST_RIP), regs->eip);
+    printk("RFLAGS=0x%08lx (0x%08lx)  DR7 = 0x%016lx\n",
+           vmr(GUEST_RFLAGS), regs->eflags,
+           vmr(GUEST_DR7));
+    printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
+           vmr(GUEST_SYSENTER_ESP),
+           vmr32(GUEST_SYSENTER_CS), vmr(GUEST_SYSENTER_EIP));
     vmx_dump_sel("CS", GUEST_CS_SELECTOR);
     vmx_dump_sel("DS", GUEST_DS_SELECTOR);
     vmx_dump_sel("SS", GUEST_SS_SELECTOR);
@@ -1468,18 +1479,21 @@ void vmcs_dump_vcpu(struct vcpu *v)
     vmx_dump_sel("LDTR", GUEST_LDTR_SELECTOR);
     vmx_dump_sel2("IDTR", GUEST_IDTR_LIMIT);
     vmx_dump_sel("TR", GUEST_TR_SELECTOR);
-    printk("Guest PAT = 0x%08x%08x\n",
-           (uint32_t)vmr(GUEST_PAT_HIGH), (uint32_t)vmr(GUEST_PAT));
-    x  = (unsigned long long)vmr(TSC_OFFSET_HIGH) << 32;
-    x |= (uint32_t)vmr(TSC_OFFSET);
-    printk("TSC Offset = %016llx\n", x);
-    x  = (unsigned long long)vmr(GUEST_IA32_DEBUGCTL_HIGH) << 32;
-    x |= (uint32_t)vmr(GUEST_IA32_DEBUGCTL);
-    printk("DebugCtl=%016llx DebugExceptions=%016llx\n", x,
-           (unsigned long long)vmr(GUEST_PENDING_DBG_EXCEPTIONS));
-    printk("Interruptibility=%04x ActivityState=%04x\n",
-           (int)vmr(GUEST_INTERRUPTIBILITY_INFO),
-           (int)vmr(GUEST_ACTIVITY_STATE));
+    if ( (vmexit_ctl & (VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_SAVE_GUEST_EFER)) ||
+         (vmentry_ctl & (VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER)) )
+        printk("EFER = 0x%016lx  PAT = 0x%016lx\n", efer, vmr(GUEST_PAT));
+    printk("PreemptionTimer = 0x%08x  SM Base = 0x%08x\n",
+           vmr32(GUEST_PREEMPTION_TIMER), vmr32(GUEST_SMBASE));
+    printk("DebugCtl = 0x%016lx  DebugExceptions = 0x%016lx\n",
+           vmr(GUEST_IA32_DEBUGCTL), vmr(GUEST_PENDING_DBG_EXCEPTIONS));
+    if ( vmentry_ctl & (VM_ENTRY_LOAD_PERF_GLOBAL_CTRL | VM_ENTRY_LOAD_BNDCFGS) )
+        printk("PerfGlobCtl = 0x%016lx  BndCfgS = 0x%016lx\n",
+               vmr(GUEST_PERF_GLOBAL_CTRL), vmr(GUEST_BNDCFGS));
+    printk("Interruptibility = %08x  ActivityState = %08x\n",
+           vmr32(GUEST_INTERRUPTIBILITY_INFO), vmr32(GUEST_ACTIVITY_STATE));
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY )
+        printk("InterruptStatus = %04x\n", vmr16(GUEST_INTR_STATUS));
 
     printk("*** Host State ***\n");
     printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
@@ -1516,9 +1530,7 @@ void vmcs_dump_vcpu(struct vcpu *v)
            (uint32_t)vmr(PIN_BASED_VM_EXEC_CONTROL),
            (uint32_t)vmr(CPU_BASED_VM_EXEC_CONTROL),
            (uint32_t)vmr(SECONDARY_VM_EXEC_CONTROL));
-    printk("EntryControls=%08x ExitControls=%08x\n",
-           (uint32_t)vmr(VM_ENTRY_CONTROLS),
-           (uint32_t)vmr(VM_EXIT_CONTROLS));
+    printk("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
     printk("ExceptionBitmap=%08x\n",
            (uint32_t)vmr(EXCEPTION_BITMAP));
     printk("VMEntry: intr_info=%08x errcode=%08x ilen=%08x\n",
@@ -1537,8 +1549,16 @@ void vmcs_dump_vcpu(struct vcpu *v)
            (uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
     printk("TPR Threshold = 0x%02x\n",
            (uint32_t)vmr(TPR_THRESHOLD));
+    printk("TSC Offset = 0x%016lx\n", vmr(TSC_OFFSET));
     printk("EPT pointer = 0x%08x%08x\n",
            (uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
+    n = vmr32(CR3_TARGET_COUNT);
+    for ( i = 0; i + 1 < n; i += 2 )
+        printk("CR3 target%u=%016lx target%u=%016lx\n",
+               i, vmr(CR3_TARGET_VALUE(i)),
+               i + 1, vmr(CR3_TARGET_VALUE(i + 1)));
+    if ( i < n )
+        printk("CR3 target%u=%016lx\n", i, vmr(CR3_TARGET_VALUE(i)));
     printk("Virtual processor ID = 0x%04x\n",
            (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 522892f..ed5e27a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1129,7 +1129,7 @@ static void vmx_set_interrupt_shadow(struct vcpu *v, unsigned int intr_shadow)
 static void vmx_load_pdptrs(struct vcpu *v)
 {
     unsigned long cr3 = v->arch.hvm_vcpu.guest_cr[3];
-    uint64_t *guest_pdptrs;
+    uint64_t *guest_pdptes;
     struct page_info *page;
     p2m_type_t p2mt;
     char *p;
@@ -1155,7 +1155,7 @@ static void vmx_load_pdptrs(struct vcpu *v)
 
     p = __map_domain_page(page);
 
-    guest_pdptrs = (uint64_t *)(p + (cr3 & ~PAGE_MASK));
+    guest_pdptes = (uint64_t *)(p + (cr3 & ~PAGE_MASK));
 
     /*
      * We do not check the PDPTRs for validity. The CPU will do this during
@@ -1165,10 +1165,10 @@ static void vmx_load_pdptrs(struct vcpu *v)
 
     vmx_vmcs_enter(v);
 
-    __vmwrite(GUEST_PDPTR0, guest_pdptrs[0]);
-    __vmwrite(GUEST_PDPTR1, guest_pdptrs[1]);
-    __vmwrite(GUEST_PDPTR2, guest_pdptrs[2]);
-    __vmwrite(GUEST_PDPTR3, guest_pdptrs[3]);
+    __vmwrite(GUEST_PDPTE(0), guest_pdptes[0]);
+    __vmwrite(GUEST_PDPTE(1), guest_pdptes[1]);
+    __vmwrite(GUEST_PDPTE(2), guest_pdptes[2]);
+    __vmwrite(GUEST_PDPTE(3), guest_pdptes[3]);
 
     vmx_vmcs_exit(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 9ccc03f..26611b3 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -881,11 +881,11 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_SYSENTER_EIP,
 };
 
-static const u16 gpdptr_fields[] = {
-    GUEST_PDPTR0,
-    GUEST_PDPTR1,
-    GUEST_PDPTR2,
-    GUEST_PDPTR3,
+static const u16 gpdpte_fields[] = {
+    GUEST_PDPTE(0),
+    GUEST_PDPTE(1),
+    GUEST_PDPTE(2),
+    GUEST_PDPTE(3),
 };
 
 /*
@@ -1173,7 +1173,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
 
     if ( nvmx_ept_enabled(v) && hvm_pae_enabled(v) &&
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
-        vvmcs_to_shadow_bulk(v, ARRAY_SIZE(gpdptr_fields), gpdptr_fields);
+        vvmcs_to_shadow_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
     regs->eip = __get_vvmcs(vvmcs, GUEST_RIP);
     regs->esp = __get_vvmcs(vvmcs, GUEST_RSP);
@@ -1348,7 +1348,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
 
     if ( nvmx_ept_enabled(v) && hvm_pae_enabled(v) &&
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
-        shadow_to_vvmcs_bulk(v, ARRAY_SIZE(gpdptr_fields), gpdptr_fields);
+        shadow_to_vvmcs_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
     vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n1vmcx);
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 6a99dca..3b16ee6 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -362,14 +362,8 @@ enum vmcs_field {
     GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
     GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
-    GUEST_PDPTR0                    = 0x0000280a,
-    GUEST_PDPTR0_HIGH               = 0x0000280b,
-    GUEST_PDPTR1                    = 0x0000280c,
-    GUEST_PDPTR1_HIGH               = 0x0000280d,
-    GUEST_PDPTR2                    = 0x0000280e,
-    GUEST_PDPTR2_HIGH               = 0x0000280f,
-    GUEST_PDPTR3                    = 0x00002810,
-    GUEST_PDPTR3_HIGH               = 0x00002811,
+    GUEST_PDPTE0                    = 0x0000280a,
+#define GUEST_PDPTE(n) (GUEST_PDPTE0 + (n) * 2) /* n = 0...3 */
     GUEST_BNDCFGS                   = 0x00002812,
     GUEST_BNDCFGS_HIGH              = 0x00002813,
     HOST_PAT                        = 0x00002c00,
@@ -424,7 +418,8 @@ enum vmcs_field {
     GUEST_TR_AR_BYTES               = 0x00004822,
     GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
     GUEST_ACTIVITY_STATE            = 0x00004826,
-    GUEST_SYSENTER_CS               = 0x0000482A,
+    GUEST_SMBASE                    = 0x00004828,
+    GUEST_SYSENTER_CS               = 0x0000482a,
     GUEST_PREEMPTION_TIMER          = 0x0000482e,
     HOST_SYSENTER_CS                = 0x00004c00,
     CR0_GUEST_HOST_MASK             = 0x00006000,
@@ -432,9 +427,7 @@ enum vmcs_field {
     CR0_READ_SHADOW                 = 0x00006004,
     CR4_READ_SHADOW                 = 0x00006006,
     CR3_TARGET_VALUE0               = 0x00006008,
-    CR3_TARGET_VALUE1               = 0x0000600a,
-    CR3_TARGET_VALUE2               = 0x0000600c,
-    CR3_TARGET_VALUE3               = 0x0000600e,
+#define CR3_TARGET_VALUE(n) (CR3_TARGET_VALUE0 + (n) * 2) /* n < CR3_TARGET_COUNT */
     EXIT_QUALIFICATION              = 0x00006400,
     GUEST_LINEAR_ADDRESS            = 0x0000640a,
     GUEST_CR0                       = 0x00006800,
--
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 Tue Feb 03 07:56:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYLa-00044G-FK; Tue, 03 Feb 2015 07:56: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 1YIYLZ-000445-Gu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:33 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	DF/14-02639-03F70D45; Tue, 03 Feb 2015 07:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950190!12415316!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32055 invoked from network); 3 Feb 2015 07:56:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:56: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 1YIYLW-0004wf-9F
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLW-000676-8H
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:30 +0000
Date: Tue, 03 Feb 2015 07:56:30 +0000
Message-Id: <E1YIYLW-000676-8H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: dump full guest 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 de8d96927b7e82bd36ef14852f8f0c4f81a12dbc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:54:49 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:54:49 2015 +0100

    VMX: dump full guest state
    
    Several guest state fields did not get dumped so far. Where suitable
    (to reduce the amount of output) make some of the dumping conditional
    upon guest settings (this isn't required for correctness as vmr()
    already uses __vmread_safe(), i.e. it is fine to access non-existing
    fields).
    
    Move CR3_TARGET_* and TSC_OFFSET processing into the control state
    section, at once making the upper bound of CR3_TARGET_VALUEn printed
    depend on CR3_TARGET_COUNT (which architecturally can be higher than
    4).
    
    Also rename GUEST_PDPTRn to GUEST_PDPTEn (matching the SDM naming) and
    group them as well as CR3_TARGET_VALUEn similar to EOI_EXIT_BITMAP.
    
    Finally, drop casts - they haven't been needed anymore since the
    dropping of 32-bit support (and some of them were not really needed in
    the first place). Introduce vmr16() and vmr32() helper macros to avoid
    the "l" printk format modifier and at the same time validate that only
    16-/32-bit fields get accessed this way.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |  112 +++++++++++++++++++++---------------
 xen/arch/x86/hvm/vmx/vmx.c         |   12 ++--
 xen/arch/x86/hvm/vmx/vvmx.c        |   14 ++--
 xen/include/asm-x86/hvm/vmx/vmcs.h |   17 ++----
 4 files changed, 84 insertions(+), 71 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9d8033e..c5e6f88 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1395,6 +1395,16 @@ static inline unsigned long vmr(unsigned long field)
     return __vmread_safe(field, &val) ? val : 0;
 }
 
+#define vmr16(fld) ({             \
+    BUILD_BUG_ON((fld) & 0x6001); \
+    (uint16_t)vmr(fld);           \
+})
+
+#define vmr32(fld) ({                         \
+    BUILD_BUG_ON(((fld) & 0x6001) != 0x4000); \
+    (uint32_t)vmr(fld);                       \
+})
+
 static void vmx_dump_sel(char *name, uint32_t selector)
 {
     uint32_t sel, attr, limit;
@@ -1420,44 +1430,45 @@ static void vmx_dump_sel2(char *name, uint32_t lim)
 void vmcs_dump_vcpu(struct vcpu *v)
 {
     struct cpu_user_regs *regs = &v->arch.user_regs;
-    unsigned long long x;
+    uint32_t vmentry_ctl, vmexit_ctl;
+    unsigned long cr4;
+    uint64_t efer;
+    unsigned int i, n;
 
     if ( v == current )
         regs = guest_cpu_user_regs();
 
     vmx_vmcs_enter(v);
 
+    vmentry_ctl = vmr32(VM_ENTRY_CONTROLS),
+    vmexit_ctl = vmr32(VM_EXIT_CONTROLS);
+    cr4 = vmr(GUEST_CR4);
+    efer = vmr(GUEST_EFER);
+
     printk("*** Guest State ***\n");
-    printk("CR0: actual=0x%016llx, shadow=0x%016llx, gh_mask=%016llx\n",
-           (unsigned long long)vmr(GUEST_CR0),
-           (unsigned long long)vmr(CR0_READ_SHADOW), 
-           (unsigned long long)vmr(CR0_GUEST_HOST_MASK));
-    printk("CR4: actual=0x%016llx, shadow=0x%016llx, gh_mask=%016llx\n",
-           (unsigned long long)vmr(GUEST_CR4),
-           (unsigned long long)vmr(CR4_READ_SHADOW), 
-           (unsigned long long)vmr(CR4_GUEST_HOST_MASK));
-    printk("CR3: actual=0x%016llx, target_count=%d\n",
-           (unsigned long long)vmr(GUEST_CR3),
-           (int)vmr(CR3_TARGET_COUNT));
-    printk("     target0=%016llx, target1=%016llx\n",
-           (unsigned long long)vmr(CR3_TARGET_VALUE0),
-           (unsigned long long)vmr(CR3_TARGET_VALUE1));
-    printk("     target2=%016llx, target3=%016llx\n",
-           (unsigned long long)vmr(CR3_TARGET_VALUE2),
-           (unsigned long long)vmr(CR3_TARGET_VALUE3));
-    printk("RSP = 0x%016llx (0x%016llx)  RIP = 0x%016llx (0x%016llx)\n", 
-           (unsigned long long)vmr(GUEST_RSP),
-           (unsigned long long)regs->esp,
-           (unsigned long long)vmr(GUEST_RIP),
-           (unsigned long long)regs->eip);
-    printk("RFLAGS=0x%016llx (0x%016llx)  DR7 = 0x%016llx\n", 
-           (unsigned long long)vmr(GUEST_RFLAGS),
-           (unsigned long long)regs->eflags,
-           (unsigned long long)vmr(GUEST_DR7));
-    printk("Sysenter RSP=%016llx CS:RIP=%04x:%016llx\n",
-           (unsigned long long)vmr(GUEST_SYSENTER_ESP),
-           (int)vmr(GUEST_SYSENTER_CS),
-           (unsigned long long)vmr(GUEST_SYSENTER_EIP));
+    printk("CR0: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
+           vmr(GUEST_CR0), vmr(CR0_READ_SHADOW), vmr(CR0_GUEST_HOST_MASK));
+    printk("CR4: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
+           cr4, vmr(CR4_READ_SHADOW), vmr(CR4_GUEST_HOST_MASK));
+    printk("CR3 = 0x%016lx\n", vmr(GUEST_CR3));
+    if ( (v->arch.hvm_vmx.secondary_exec_control &
+          SECONDARY_EXEC_ENABLE_EPT) &&
+         (cr4 & X86_CR4_PAE) && !(efer & EFER_LMA) )
+    {
+        printk("PDPTE0 = 0x%016lx  PDPTE1 = 0x%016lx\n",
+               vmr(GUEST_PDPTE(0)), vmr(GUEST_PDPTE(1)));
+        printk("PDPTE2 = 0x%016lx  PDPTE3 = 0x%016lx\n",
+               vmr(GUEST_PDPTE(2)), vmr(GUEST_PDPTE(3)));
+    }
+    printk("RSP = 0x%016lx (0x%016lx)  RIP = 0x%016lx (0x%016lx)\n",
+           vmr(GUEST_RSP), regs->esp,
+           vmr(GUEST_RIP), regs->eip);
+    printk("RFLAGS=0x%08lx (0x%08lx)  DR7 = 0x%016lx\n",
+           vmr(GUEST_RFLAGS), regs->eflags,
+           vmr(GUEST_DR7));
+    printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
+           vmr(GUEST_SYSENTER_ESP),
+           vmr32(GUEST_SYSENTER_CS), vmr(GUEST_SYSENTER_EIP));
     vmx_dump_sel("CS", GUEST_CS_SELECTOR);
     vmx_dump_sel("DS", GUEST_DS_SELECTOR);
     vmx_dump_sel("SS", GUEST_SS_SELECTOR);
@@ -1468,18 +1479,21 @@ void vmcs_dump_vcpu(struct vcpu *v)
     vmx_dump_sel("LDTR", GUEST_LDTR_SELECTOR);
     vmx_dump_sel2("IDTR", GUEST_IDTR_LIMIT);
     vmx_dump_sel("TR", GUEST_TR_SELECTOR);
-    printk("Guest PAT = 0x%08x%08x\n",
-           (uint32_t)vmr(GUEST_PAT_HIGH), (uint32_t)vmr(GUEST_PAT));
-    x  = (unsigned long long)vmr(TSC_OFFSET_HIGH) << 32;
-    x |= (uint32_t)vmr(TSC_OFFSET);
-    printk("TSC Offset = %016llx\n", x);
-    x  = (unsigned long long)vmr(GUEST_IA32_DEBUGCTL_HIGH) << 32;
-    x |= (uint32_t)vmr(GUEST_IA32_DEBUGCTL);
-    printk("DebugCtl=%016llx DebugExceptions=%016llx\n", x,
-           (unsigned long long)vmr(GUEST_PENDING_DBG_EXCEPTIONS));
-    printk("Interruptibility=%04x ActivityState=%04x\n",
-           (int)vmr(GUEST_INTERRUPTIBILITY_INFO),
-           (int)vmr(GUEST_ACTIVITY_STATE));
+    if ( (vmexit_ctl & (VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_SAVE_GUEST_EFER)) ||
+         (vmentry_ctl & (VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER)) )
+        printk("EFER = 0x%016lx  PAT = 0x%016lx\n", efer, vmr(GUEST_PAT));
+    printk("PreemptionTimer = 0x%08x  SM Base = 0x%08x\n",
+           vmr32(GUEST_PREEMPTION_TIMER), vmr32(GUEST_SMBASE));
+    printk("DebugCtl = 0x%016lx  DebugExceptions = 0x%016lx\n",
+           vmr(GUEST_IA32_DEBUGCTL), vmr(GUEST_PENDING_DBG_EXCEPTIONS));
+    if ( vmentry_ctl & (VM_ENTRY_LOAD_PERF_GLOBAL_CTRL | VM_ENTRY_LOAD_BNDCFGS) )
+        printk("PerfGlobCtl = 0x%016lx  BndCfgS = 0x%016lx\n",
+               vmr(GUEST_PERF_GLOBAL_CTRL), vmr(GUEST_BNDCFGS));
+    printk("Interruptibility = %08x  ActivityState = %08x\n",
+           vmr32(GUEST_INTERRUPTIBILITY_INFO), vmr32(GUEST_ACTIVITY_STATE));
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY )
+        printk("InterruptStatus = %04x\n", vmr16(GUEST_INTR_STATUS));
 
     printk("*** Host State ***\n");
     printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
@@ -1516,9 +1530,7 @@ void vmcs_dump_vcpu(struct vcpu *v)
            (uint32_t)vmr(PIN_BASED_VM_EXEC_CONTROL),
            (uint32_t)vmr(CPU_BASED_VM_EXEC_CONTROL),
            (uint32_t)vmr(SECONDARY_VM_EXEC_CONTROL));
-    printk("EntryControls=%08x ExitControls=%08x\n",
-           (uint32_t)vmr(VM_ENTRY_CONTROLS),
-           (uint32_t)vmr(VM_EXIT_CONTROLS));
+    printk("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
     printk("ExceptionBitmap=%08x\n",
            (uint32_t)vmr(EXCEPTION_BITMAP));
     printk("VMEntry: intr_info=%08x errcode=%08x ilen=%08x\n",
@@ -1537,8 +1549,16 @@ void vmcs_dump_vcpu(struct vcpu *v)
            (uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
     printk("TPR Threshold = 0x%02x\n",
            (uint32_t)vmr(TPR_THRESHOLD));
+    printk("TSC Offset = 0x%016lx\n", vmr(TSC_OFFSET));
     printk("EPT pointer = 0x%08x%08x\n",
            (uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
+    n = vmr32(CR3_TARGET_COUNT);
+    for ( i = 0; i + 1 < n; i += 2 )
+        printk("CR3 target%u=%016lx target%u=%016lx\n",
+               i, vmr(CR3_TARGET_VALUE(i)),
+               i + 1, vmr(CR3_TARGET_VALUE(i + 1)));
+    if ( i < n )
+        printk("CR3 target%u=%016lx\n", i, vmr(CR3_TARGET_VALUE(i)));
     printk("Virtual processor ID = 0x%04x\n",
            (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 522892f..ed5e27a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1129,7 +1129,7 @@ static void vmx_set_interrupt_shadow(struct vcpu *v, unsigned int intr_shadow)
 static void vmx_load_pdptrs(struct vcpu *v)
 {
     unsigned long cr3 = v->arch.hvm_vcpu.guest_cr[3];
-    uint64_t *guest_pdptrs;
+    uint64_t *guest_pdptes;
     struct page_info *page;
     p2m_type_t p2mt;
     char *p;
@@ -1155,7 +1155,7 @@ static void vmx_load_pdptrs(struct vcpu *v)
 
     p = __map_domain_page(page);
 
-    guest_pdptrs = (uint64_t *)(p + (cr3 & ~PAGE_MASK));
+    guest_pdptes = (uint64_t *)(p + (cr3 & ~PAGE_MASK));
 
     /*
      * We do not check the PDPTRs for validity. The CPU will do this during
@@ -1165,10 +1165,10 @@ static void vmx_load_pdptrs(struct vcpu *v)
 
     vmx_vmcs_enter(v);
 
-    __vmwrite(GUEST_PDPTR0, guest_pdptrs[0]);
-    __vmwrite(GUEST_PDPTR1, guest_pdptrs[1]);
-    __vmwrite(GUEST_PDPTR2, guest_pdptrs[2]);
-    __vmwrite(GUEST_PDPTR3, guest_pdptrs[3]);
+    __vmwrite(GUEST_PDPTE(0), guest_pdptes[0]);
+    __vmwrite(GUEST_PDPTE(1), guest_pdptes[1]);
+    __vmwrite(GUEST_PDPTE(2), guest_pdptes[2]);
+    __vmwrite(GUEST_PDPTE(3), guest_pdptes[3]);
 
     vmx_vmcs_exit(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 9ccc03f..26611b3 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -881,11 +881,11 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_SYSENTER_EIP,
 };
 
-static const u16 gpdptr_fields[] = {
-    GUEST_PDPTR0,
-    GUEST_PDPTR1,
-    GUEST_PDPTR2,
-    GUEST_PDPTR3,
+static const u16 gpdpte_fields[] = {
+    GUEST_PDPTE(0),
+    GUEST_PDPTE(1),
+    GUEST_PDPTE(2),
+    GUEST_PDPTE(3),
 };
 
 /*
@@ -1173,7 +1173,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
 
     if ( nvmx_ept_enabled(v) && hvm_pae_enabled(v) &&
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
-        vvmcs_to_shadow_bulk(v, ARRAY_SIZE(gpdptr_fields), gpdptr_fields);
+        vvmcs_to_shadow_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
     regs->eip = __get_vvmcs(vvmcs, GUEST_RIP);
     regs->esp = __get_vvmcs(vvmcs, GUEST_RSP);
@@ -1348,7 +1348,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
 
     if ( nvmx_ept_enabled(v) && hvm_pae_enabled(v) &&
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
-        shadow_to_vvmcs_bulk(v, ARRAY_SIZE(gpdptr_fields), gpdptr_fields);
+        shadow_to_vvmcs_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
     vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n1vmcx);
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 6a99dca..3b16ee6 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -362,14 +362,8 @@ enum vmcs_field {
     GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
     GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
-    GUEST_PDPTR0                    = 0x0000280a,
-    GUEST_PDPTR0_HIGH               = 0x0000280b,
-    GUEST_PDPTR1                    = 0x0000280c,
-    GUEST_PDPTR1_HIGH               = 0x0000280d,
-    GUEST_PDPTR2                    = 0x0000280e,
-    GUEST_PDPTR2_HIGH               = 0x0000280f,
-    GUEST_PDPTR3                    = 0x00002810,
-    GUEST_PDPTR3_HIGH               = 0x00002811,
+    GUEST_PDPTE0                    = 0x0000280a,
+#define GUEST_PDPTE(n) (GUEST_PDPTE0 + (n) * 2) /* n = 0...3 */
     GUEST_BNDCFGS                   = 0x00002812,
     GUEST_BNDCFGS_HIGH              = 0x00002813,
     HOST_PAT                        = 0x00002c00,
@@ -424,7 +418,8 @@ enum vmcs_field {
     GUEST_TR_AR_BYTES               = 0x00004822,
     GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
     GUEST_ACTIVITY_STATE            = 0x00004826,
-    GUEST_SYSENTER_CS               = 0x0000482A,
+    GUEST_SMBASE                    = 0x00004828,
+    GUEST_SYSENTER_CS               = 0x0000482a,
     GUEST_PREEMPTION_TIMER          = 0x0000482e,
     HOST_SYSENTER_CS                = 0x00004c00,
     CR0_GUEST_HOST_MASK             = 0x00006000,
@@ -432,9 +427,7 @@ enum vmcs_field {
     CR0_READ_SHADOW                 = 0x00006004,
     CR4_READ_SHADOW                 = 0x00006006,
     CR3_TARGET_VALUE0               = 0x00006008,
-    CR3_TARGET_VALUE1               = 0x0000600a,
-    CR3_TARGET_VALUE2               = 0x0000600c,
-    CR3_TARGET_VALUE3               = 0x0000600e,
+#define CR3_TARGET_VALUE(n) (CR3_TARGET_VALUE0 + (n) * 2) /* n < CR3_TARGET_COUNT */
     EXIT_QUALIFICATION              = 0x00006400,
     GUEST_LINEAR_ADDRESS            = 0x0000640a,
     GUEST_CR0                       = 0x00006800,
--
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 Tue Feb 03 07:56:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYLj-00045w-Js; Tue, 03 Feb 2015 07:56: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 1YIYLi-00045h-Ko
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:42 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DC/AC-02754-A3F70D45; Tue, 03 Feb 2015 07:56:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950200!11752871!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14316 invoked from network); 3 Feb 2015 07:56:41 -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;
	3 Feb 2015 07:56:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLg-0004wl-Ds
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLg-00068S-Cx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:40 +0000
Date: Tue, 03 Feb 2015 07:56:40 +0000
Message-Id: <E1YIYLg-00068S-Cx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: dump full host 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 954b961b797f9899a7249537460b55c573300b8b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:55:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:55:56 2015 +0100

    VMX: dump full host state
    
    A few host state fields did not get dumped so far. Where suitable (to
    reduce the amount of output) make some of the dumping conditional upon
    guest settings (this isn't required for correctness as vmr() already
    uses __vmread_safe(), i.e. it is fine to access non-existing fields).
    
    Also drop casts - many of them haven't been needed anymore since the
    dropping of 32-bit support.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |   49 ++++++++++++++++++------------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c5e6f88..4717a2b 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1496,34 +1496,27 @@ void vmcs_dump_vcpu(struct vcpu *v)
         printk("InterruptStatus = %04x\n", vmr16(GUEST_INTR_STATUS));
 
     printk("*** Host State ***\n");
-    printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
-           (unsigned long long)vmr(HOST_RSP),
-           (unsigned long long)vmr(HOST_RIP));
-    printk("CS=%04x DS=%04x ES=%04x FS=%04x GS=%04x SS=%04x TR=%04x\n",
-           (uint16_t)vmr(HOST_CS_SELECTOR),
-           (uint16_t)vmr(HOST_DS_SELECTOR),
-           (uint16_t)vmr(HOST_ES_SELECTOR),
-           (uint16_t)vmr(HOST_FS_SELECTOR),
-           (uint16_t)vmr(HOST_GS_SELECTOR),
-           (uint16_t)vmr(HOST_SS_SELECTOR),
-           (uint16_t)vmr(HOST_TR_SELECTOR));
-    printk("FSBase=%016llx GSBase=%016llx TRBase=%016llx\n",
-           (unsigned long long)vmr(HOST_FS_BASE),
-           (unsigned long long)vmr(HOST_GS_BASE),
-           (unsigned long long)vmr(HOST_TR_BASE));
-    printk("GDTBase=%016llx IDTBase=%016llx\n",
-           (unsigned long long)vmr(HOST_GDTR_BASE),
-           (unsigned long long)vmr(HOST_IDTR_BASE));
-    printk("CR0=%016llx CR3=%016llx CR4=%016llx\n",
-           (unsigned long long)vmr(HOST_CR0),
-           (unsigned long long)vmr(HOST_CR3),
-           (unsigned long long)vmr(HOST_CR4));
-    printk("Sysenter RSP=%016llx CS:RIP=%04x:%016llx\n",
-           (unsigned long long)vmr(HOST_SYSENTER_ESP),
-           (int)vmr(HOST_SYSENTER_CS),
-           (unsigned long long)vmr(HOST_SYSENTER_EIP));
-    printk("Host PAT = 0x%08x%08x\n",
-           (uint32_t)vmr(HOST_PAT_HIGH), (uint32_t)vmr(HOST_PAT));
+    printk("RIP = 0x%016lx (%ps)  RSP = 0x%016lx\n",
+           vmr(HOST_RIP), (void *)vmr(HOST_RIP), vmr(HOST_RSP));
+    printk("CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x TR=%04x\n",
+           vmr16(HOST_CS_SELECTOR), vmr16(HOST_SS_SELECTOR),
+           vmr16(HOST_DS_SELECTOR), vmr16(HOST_ES_SELECTOR),
+           vmr16(HOST_FS_SELECTOR), vmr16(HOST_GS_SELECTOR),
+           vmr16(HOST_TR_SELECTOR));
+    printk("FSBase=%016lx GSBase=%016lx TRBase=%016lx\n",
+           vmr(HOST_FS_BASE), vmr(HOST_GS_BASE), vmr(HOST_TR_BASE));
+    printk("GDTBase=%016lx IDTBase=%016lx\n",
+           vmr(HOST_GDTR_BASE), vmr(HOST_IDTR_BASE));
+    printk("CR0=%016lx CR3=%016lx CR4=%016lx\n",
+           vmr(HOST_CR0), vmr(HOST_CR3), vmr(HOST_CR4));
+    printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
+           vmr(HOST_SYSENTER_ESP),
+           vmr32(HOST_SYSENTER_CS), vmr(HOST_SYSENTER_EIP));
+    if ( vmexit_ctl & (VM_EXIT_LOAD_HOST_PAT | VM_EXIT_LOAD_HOST_EFER) )
+        printk("EFER = 0x%016lx  PAT = 0x%016lx\n", vmr(HOST_EFER), vmr(HOST_PAT));
+    if ( vmexit_ctl & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        printk("PerfGlobCtl = 0x%016lx\n",
+               vmr(HOST_PERF_GLOBAL_CTRL));
 
     printk("*** Control State ***\n");
     printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\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 Tue Feb 03 07:56:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56: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 1YIYLj-00045w-Js; Tue, 03 Feb 2015 07:56: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 1YIYLi-00045h-Ko
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:42 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DC/AC-02754-A3F70D45; Tue, 03 Feb 2015 07:56:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950200!11752871!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14316 invoked from network); 3 Feb 2015 07:56:41 -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;
	3 Feb 2015 07:56:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLg-0004wl-Ds
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLg-00068S-Cx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:40 +0000
Date: Tue, 03 Feb 2015 07:56:40 +0000
Message-Id: <E1YIYLg-00068S-Cx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: dump full host 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 954b961b797f9899a7249537460b55c573300b8b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:55:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:55:56 2015 +0100

    VMX: dump full host state
    
    A few host state fields did not get dumped so far. Where suitable (to
    reduce the amount of output) make some of the dumping conditional upon
    guest settings (this isn't required for correctness as vmr() already
    uses __vmread_safe(), i.e. it is fine to access non-existing fields).
    
    Also drop casts - many of them haven't been needed anymore since the
    dropping of 32-bit support.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |   49 ++++++++++++++++++------------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c5e6f88..4717a2b 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1496,34 +1496,27 @@ void vmcs_dump_vcpu(struct vcpu *v)
         printk("InterruptStatus = %04x\n", vmr16(GUEST_INTR_STATUS));
 
     printk("*** Host State ***\n");
-    printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
-           (unsigned long long)vmr(HOST_RSP),
-           (unsigned long long)vmr(HOST_RIP));
-    printk("CS=%04x DS=%04x ES=%04x FS=%04x GS=%04x SS=%04x TR=%04x\n",
-           (uint16_t)vmr(HOST_CS_SELECTOR),
-           (uint16_t)vmr(HOST_DS_SELECTOR),
-           (uint16_t)vmr(HOST_ES_SELECTOR),
-           (uint16_t)vmr(HOST_FS_SELECTOR),
-           (uint16_t)vmr(HOST_GS_SELECTOR),
-           (uint16_t)vmr(HOST_SS_SELECTOR),
-           (uint16_t)vmr(HOST_TR_SELECTOR));
-    printk("FSBase=%016llx GSBase=%016llx TRBase=%016llx\n",
-           (unsigned long long)vmr(HOST_FS_BASE),
-           (unsigned long long)vmr(HOST_GS_BASE),
-           (unsigned long long)vmr(HOST_TR_BASE));
-    printk("GDTBase=%016llx IDTBase=%016llx\n",
-           (unsigned long long)vmr(HOST_GDTR_BASE),
-           (unsigned long long)vmr(HOST_IDTR_BASE));
-    printk("CR0=%016llx CR3=%016llx CR4=%016llx\n",
-           (unsigned long long)vmr(HOST_CR0),
-           (unsigned long long)vmr(HOST_CR3),
-           (unsigned long long)vmr(HOST_CR4));
-    printk("Sysenter RSP=%016llx CS:RIP=%04x:%016llx\n",
-           (unsigned long long)vmr(HOST_SYSENTER_ESP),
-           (int)vmr(HOST_SYSENTER_CS),
-           (unsigned long long)vmr(HOST_SYSENTER_EIP));
-    printk("Host PAT = 0x%08x%08x\n",
-           (uint32_t)vmr(HOST_PAT_HIGH), (uint32_t)vmr(HOST_PAT));
+    printk("RIP = 0x%016lx (%ps)  RSP = 0x%016lx\n",
+           vmr(HOST_RIP), (void *)vmr(HOST_RIP), vmr(HOST_RSP));
+    printk("CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x TR=%04x\n",
+           vmr16(HOST_CS_SELECTOR), vmr16(HOST_SS_SELECTOR),
+           vmr16(HOST_DS_SELECTOR), vmr16(HOST_ES_SELECTOR),
+           vmr16(HOST_FS_SELECTOR), vmr16(HOST_GS_SELECTOR),
+           vmr16(HOST_TR_SELECTOR));
+    printk("FSBase=%016lx GSBase=%016lx TRBase=%016lx\n",
+           vmr(HOST_FS_BASE), vmr(HOST_GS_BASE), vmr(HOST_TR_BASE));
+    printk("GDTBase=%016lx IDTBase=%016lx\n",
+           vmr(HOST_GDTR_BASE), vmr(HOST_IDTR_BASE));
+    printk("CR0=%016lx CR3=%016lx CR4=%016lx\n",
+           vmr(HOST_CR0), vmr(HOST_CR3), vmr(HOST_CR4));
+    printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
+           vmr(HOST_SYSENTER_ESP),
+           vmr32(HOST_SYSENTER_CS), vmr(HOST_SYSENTER_EIP));
+    if ( vmexit_ctl & (VM_EXIT_LOAD_HOST_PAT | VM_EXIT_LOAD_HOST_EFER) )
+        printk("EFER = 0x%016lx  PAT = 0x%016lx\n", vmr(HOST_EFER), vmr(HOST_PAT));
+    if ( vmexit_ctl & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        printk("PerfGlobCtl = 0x%016lx\n",
+               vmr(HOST_PERF_GLOBAL_CTRL));
 
     printk("*** Control State ***\n");
     printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\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 Tue Feb 03 07:56:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYLu-00047X-Mr; Tue, 03 Feb 2015 07:56:54 +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 1YIYLt-00047E-C5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:53 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	9C/73-02749-44F70D45; Tue, 03 Feb 2015 07:56:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950210!12109838!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6208 invoked from network); 3 Feb 2015 07:56:51 -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;
	3 Feb 2015 07:56: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 1YIYLq-0004wv-Ms
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLq-00068q-Io
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:50 +0000
Date: Tue, 03 Feb 2015 07:56:50 +0000
Message-Id: <E1YIYLq-00068q-Io@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: dump further control 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 e9e32a0bf8b55fedb657b00d760ab340f16f2ef2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:56:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:56:33 2015 +0100

    VMX: dump further control state
    
    A few relevant control state fields did not get dumped so far; in
    particular, VM_ENTRY_INSTRUCTION_LEN got printed twice (instead of also
    printing VM_EXIT_INSTRUCTION_LEN). Where suitable (to reduce the amount
    of output) make some of the dumping conditional upon guest settings
    (this isn't required for correctness as vmr() already uses
    __vmread_safe(), i.e. it is fine to access non-existing fields).
    
    Also drop casts.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   54 +++++++++++++++++++++--------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |    3 ++
 2 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4717a2b..b397c65 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1520,31 +1520,35 @@ void vmcs_dump_vcpu(struct vcpu *v)
 
     printk("*** Control State ***\n");
     printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
-           (uint32_t)vmr(PIN_BASED_VM_EXEC_CONTROL),
-           (uint32_t)vmr(CPU_BASED_VM_EXEC_CONTROL),
-           (uint32_t)vmr(SECONDARY_VM_EXEC_CONTROL));
+           vmr32(PIN_BASED_VM_EXEC_CONTROL),
+           vmr32(CPU_BASED_VM_EXEC_CONTROL),
+           vmr32(SECONDARY_VM_EXEC_CONTROL));
     printk("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
-    printk("ExceptionBitmap=%08x\n",
-           (uint32_t)vmr(EXCEPTION_BITMAP));
+    printk("ExceptionBitmap=%08x PFECmask=%08x PFECmatch=%08x\n",
+           vmr32(EXCEPTION_BITMAP),
+           vmr32(PAGE_FAULT_ERROR_CODE_MASK),
+           vmr32(PAGE_FAULT_ERROR_CODE_MATCH));
     printk("VMEntry: intr_info=%08x errcode=%08x ilen=%08x\n",
-           (uint32_t)vmr(VM_ENTRY_INTR_INFO),
-           (uint32_t)vmr(VM_ENTRY_EXCEPTION_ERROR_CODE),
-           (uint32_t)vmr(VM_ENTRY_INSTRUCTION_LEN));
+           vmr32(VM_ENTRY_INTR_INFO),
+           vmr32(VM_ENTRY_EXCEPTION_ERROR_CODE),
+           vmr32(VM_ENTRY_INSTRUCTION_LEN));
     printk("VMExit: intr_info=%08x errcode=%08x ilen=%08x\n",
-           (uint32_t)vmr(VM_EXIT_INTR_INFO),
-           (uint32_t)vmr(VM_EXIT_INTR_ERROR_CODE),
-           (uint32_t)vmr(VM_ENTRY_INSTRUCTION_LEN));
-    printk("        reason=%08x qualification=%08x\n",
-           (uint32_t)vmr(VM_EXIT_REASON),
-           (uint32_t)vmr(EXIT_QUALIFICATION));
+           vmr32(VM_EXIT_INTR_INFO),
+           vmr32(VM_EXIT_INTR_ERROR_CODE),
+           vmr32(VM_EXIT_INSTRUCTION_LEN));
+    printk("        reason=%08x qualification=%016lx\n",
+           vmr32(VM_EXIT_REASON), vmr(EXIT_QUALIFICATION));
     printk("IDTVectoring: info=%08x errcode=%08x\n",
-           (uint32_t)vmr(IDT_VECTORING_INFO),
-           (uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
-    printk("TPR Threshold = 0x%02x\n",
-           (uint32_t)vmr(TPR_THRESHOLD));
+           vmr32(IDT_VECTORING_INFO), vmr32(IDT_VECTORING_ERROR_CODE));
     printk("TSC Offset = 0x%016lx\n", vmr(TSC_OFFSET));
-    printk("EPT pointer = 0x%08x%08x\n",
-           (uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
+    if ( (v->arch.hvm_vmx.exec_control & CPU_BASED_TPR_SHADOW) ||
+         (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT) )
+        printk("TPR Threshold = 0x%02x  PostedIntrVec = 0x%02x\n",
+               vmr32(TPR_THRESHOLD), vmr16(POSTED_INTR_NOTIFICATION_VECTOR));
+    if ( (v->arch.hvm_vmx.secondary_exec_control &
+          SECONDARY_EXEC_ENABLE_EPT) )
+        printk("EPT pointer = 0x%016lx  EPTP index = 0x%04x\n",
+               vmr(EPT_POINTER), vmr16(EPTP_INDEX));
     n = vmr32(CR3_TARGET_COUNT);
     for ( i = 0; i + 1 < n; i += 2 )
         printk("CR3 target%u=%016lx target%u=%016lx\n",
@@ -1552,8 +1556,14 @@ void vmcs_dump_vcpu(struct vcpu *v)
                i + 1, vmr(CR3_TARGET_VALUE(i + 1)));
     if ( i < n )
         printk("CR3 target%u=%016lx\n", i, vmr(CR3_TARGET_VALUE(i)));
-    printk("Virtual processor ID = 0x%04x\n",
-           (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         SECONDARY_EXEC_PAUSE_LOOP_EXITING )
+        printk("PLE Gap=%08x Window=%08x\n",
+               vmr32(PLE_GAP), vmr32(PLE_WINDOW));
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VMFUNC) )
+        printk("Virtual processor ID = 0x%04x VMfunc controls = %016lx\n",
+               vmr16(VIRTUAL_PROCESSOR_ID), vmr(VMFUNC_CONTROL));
 
     vmx_vmcs_exit(v);
 }
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 3b16ee6..ccb6263 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -213,6 +213,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
+#define SECONDARY_EXEC_ENABLE_VMFUNC            0x00002000
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 extern u32 vmx_secondary_exec_control;
 
@@ -306,6 +307,7 @@ extern u64 vmx_basic_msr;
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
     POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
+    EPTP_INDEX                      = 0x00000004,
     GUEST_ES_SELECTOR               = 0x00000800,
     GUEST_CS_SELECTOR               = 0x00000802,
     GUEST_SS_SELECTOR               = 0x00000804,
@@ -342,6 +344,7 @@ enum vmcs_field {
     APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     PI_DESC_ADDR                    = 0x00002016,
     PI_DESC_ADDR_HIGH               = 0x00002017,
+    VMFUNC_CONTROL                  = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
     EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
--
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 Tue Feb 03 07:56:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYLu-00047X-Mr; Tue, 03 Feb 2015 07:56:54 +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 1YIYLt-00047E-C5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:53 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	9C/73-02749-44F70D45; Tue, 03 Feb 2015 07:56:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950210!12109838!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6208 invoked from network); 3 Feb 2015 07:56:51 -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;
	3 Feb 2015 07:56: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 1YIYLq-0004wv-Ms
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYLq-00068q-Io
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:56:50 +0000
Date: Tue, 03 Feb 2015 07:56:50 +0000
Message-Id: <E1YIYLq-00068q-Io@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: dump further control 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 e9e32a0bf8b55fedb657b00d760ab340f16f2ef2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:56:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:56:33 2015 +0100

    VMX: dump further control state
    
    A few relevant control state fields did not get dumped so far; in
    particular, VM_ENTRY_INSTRUCTION_LEN got printed twice (instead of also
    printing VM_EXIT_INSTRUCTION_LEN). Where suitable (to reduce the amount
    of output) make some of the dumping conditional upon guest settings
    (this isn't required for correctness as vmr() already uses
    __vmread_safe(), i.e. it is fine to access non-existing fields).
    
    Also drop casts.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   54 +++++++++++++++++++++--------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |    3 ++
 2 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4717a2b..b397c65 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1520,31 +1520,35 @@ void vmcs_dump_vcpu(struct vcpu *v)
 
     printk("*** Control State ***\n");
     printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
-           (uint32_t)vmr(PIN_BASED_VM_EXEC_CONTROL),
-           (uint32_t)vmr(CPU_BASED_VM_EXEC_CONTROL),
-           (uint32_t)vmr(SECONDARY_VM_EXEC_CONTROL));
+           vmr32(PIN_BASED_VM_EXEC_CONTROL),
+           vmr32(CPU_BASED_VM_EXEC_CONTROL),
+           vmr32(SECONDARY_VM_EXEC_CONTROL));
     printk("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
-    printk("ExceptionBitmap=%08x\n",
-           (uint32_t)vmr(EXCEPTION_BITMAP));
+    printk("ExceptionBitmap=%08x PFECmask=%08x PFECmatch=%08x\n",
+           vmr32(EXCEPTION_BITMAP),
+           vmr32(PAGE_FAULT_ERROR_CODE_MASK),
+           vmr32(PAGE_FAULT_ERROR_CODE_MATCH));
     printk("VMEntry: intr_info=%08x errcode=%08x ilen=%08x\n",
-           (uint32_t)vmr(VM_ENTRY_INTR_INFO),
-           (uint32_t)vmr(VM_ENTRY_EXCEPTION_ERROR_CODE),
-           (uint32_t)vmr(VM_ENTRY_INSTRUCTION_LEN));
+           vmr32(VM_ENTRY_INTR_INFO),
+           vmr32(VM_ENTRY_EXCEPTION_ERROR_CODE),
+           vmr32(VM_ENTRY_INSTRUCTION_LEN));
     printk("VMExit: intr_info=%08x errcode=%08x ilen=%08x\n",
-           (uint32_t)vmr(VM_EXIT_INTR_INFO),
-           (uint32_t)vmr(VM_EXIT_INTR_ERROR_CODE),
-           (uint32_t)vmr(VM_ENTRY_INSTRUCTION_LEN));
-    printk("        reason=%08x qualification=%08x\n",
-           (uint32_t)vmr(VM_EXIT_REASON),
-           (uint32_t)vmr(EXIT_QUALIFICATION));
+           vmr32(VM_EXIT_INTR_INFO),
+           vmr32(VM_EXIT_INTR_ERROR_CODE),
+           vmr32(VM_EXIT_INSTRUCTION_LEN));
+    printk("        reason=%08x qualification=%016lx\n",
+           vmr32(VM_EXIT_REASON), vmr(EXIT_QUALIFICATION));
     printk("IDTVectoring: info=%08x errcode=%08x\n",
-           (uint32_t)vmr(IDT_VECTORING_INFO),
-           (uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
-    printk("TPR Threshold = 0x%02x\n",
-           (uint32_t)vmr(TPR_THRESHOLD));
+           vmr32(IDT_VECTORING_INFO), vmr32(IDT_VECTORING_ERROR_CODE));
     printk("TSC Offset = 0x%016lx\n", vmr(TSC_OFFSET));
-    printk("EPT pointer = 0x%08x%08x\n",
-           (uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
+    if ( (v->arch.hvm_vmx.exec_control & CPU_BASED_TPR_SHADOW) ||
+         (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT) )
+        printk("TPR Threshold = 0x%02x  PostedIntrVec = 0x%02x\n",
+               vmr32(TPR_THRESHOLD), vmr16(POSTED_INTR_NOTIFICATION_VECTOR));
+    if ( (v->arch.hvm_vmx.secondary_exec_control &
+          SECONDARY_EXEC_ENABLE_EPT) )
+        printk("EPT pointer = 0x%016lx  EPTP index = 0x%04x\n",
+               vmr(EPT_POINTER), vmr16(EPTP_INDEX));
     n = vmr32(CR3_TARGET_COUNT);
     for ( i = 0; i + 1 < n; i += 2 )
         printk("CR3 target%u=%016lx target%u=%016lx\n",
@@ -1552,8 +1556,14 @@ void vmcs_dump_vcpu(struct vcpu *v)
                i + 1, vmr(CR3_TARGET_VALUE(i + 1)));
     if ( i < n )
         printk("CR3 target%u=%016lx\n", i, vmr(CR3_TARGET_VALUE(i)));
-    printk("Virtual processor ID = 0x%04x\n",
-           (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         SECONDARY_EXEC_PAUSE_LOOP_EXITING )
+        printk("PLE Gap=%08x Window=%08x\n",
+               vmr32(PLE_GAP), vmr32(PLE_WINDOW));
+    if ( v->arch.hvm_vmx.secondary_exec_control &
+         (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VMFUNC) )
+        printk("Virtual processor ID = 0x%04x VMfunc controls = %016lx\n",
+               vmr16(VIRTUAL_PROCESSOR_ID), vmr(VMFUNC_CONTROL));
 
     vmx_vmcs_exit(v);
 }
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 3b16ee6..ccb6263 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -213,6 +213,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
 #define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
+#define SECONDARY_EXEC_ENABLE_VMFUNC            0x00002000
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 extern u32 vmx_secondary_exec_control;
 
@@ -306,6 +307,7 @@ extern u64 vmx_basic_msr;
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
     POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
+    EPTP_INDEX                      = 0x00000004,
     GUEST_ES_SELECTOR               = 0x00000800,
     GUEST_CS_SELECTOR               = 0x00000802,
     GUEST_SS_SELECTOR               = 0x00000804,
@@ -342,6 +344,7 @@ enum vmcs_field {
     APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     PI_DESC_ADDR                    = 0x00002016,
     PI_DESC_ADDR_HIGH               = 0x00002017,
+    VMFUNC_CONTROL                  = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
     EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
--
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 Tue Feb 03 07:57:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYM4-00048u-PT; Tue, 03 Feb 2015 07:57:04 +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 1YIYM3-00048e-Ak
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:03 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	3C/EC-02804-E4F70D45; Tue, 03 Feb 2015 07:57:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1422950221!5378722!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26711 invoked from network); 3 Feb 2015 07:57:01 -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 Feb 2015 07:57: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 1YIYM0-0004x4-Tp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYM0-00069J-Rb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:00 +0000
Date: Tue, 03 Feb 2015 07:57:00 +0000
Message-Id: <E1YIYM0-00069J-Rb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: drop VMCS *_HIGH enumerators
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0bccdfddad0fa26810fed5de069a57182ecdc810
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:57:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:57:27 2015 +0100

    VMX: drop VMCS *_HIGH enumerators
    
    Most of them have been unused since the dropping of 32-bit support, and
    the few remaining cases are more efficiently dealt with using a generic
    macro (and probably things should have been done that way from the
    beginning).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   12 ++++++------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   24 +-----------------------
 2 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 26611b3..91e6ae4 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -98,9 +98,9 @@ int nvmx_vcpu_initialise(struct vcpu *v)
          * Let them vmexit as usual.
          */
         set_bit(IO_BITMAP_A, vw);
-        set_bit(IO_BITMAP_A_HIGH, vw);
+        set_bit(VMCS_HIGH(IO_BITMAP_A), vw);
         set_bit(IO_BITMAP_B, vw);
-        set_bit(IO_BITMAP_B_HIGH, vw);
+        set_bit(VMCS_HIGH(IO_BITMAP_B), vw);
 
         unmap_domain_page(vr);
         unmap_domain_page(vw);
@@ -1761,15 +1761,15 @@ int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
     vmcs_encoding = reg_read(regs, decode.reg2);
     __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand);
 
-    switch ( vmcs_encoding )
+    switch ( vmcs_encoding & ~VMCS_HIGH(0) )
     {
-    case IO_BITMAP_A: case IO_BITMAP_A_HIGH:
+    case IO_BITMAP_A:
         okay = _map_io_bitmap(v, IO_BITMAP_A);
         break;
-    case IO_BITMAP_B: case IO_BITMAP_B_HIGH:
+    case IO_BITMAP_B:
         okay = _map_io_bitmap(v, IO_BITMAP_B);
         break;
-    case MSR_BITMAP: case MSR_BITMAP_HIGH:
+    case MSR_BITMAP:
         okay = _map_msr_bitmap(v);
         break;
     }
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ccb6263..88c4fab 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -304,6 +304,7 @@ extern u64 vmx_basic_msr;
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
 
 /* VMCS field encodings. */
+#define VMCS_HIGH(x) ((x) | 1)
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
     POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
@@ -325,56 +326,33 @@ enum vmcs_field {
     HOST_GS_SELECTOR                = 0x00000c0a,
     HOST_TR_SELECTOR                = 0x00000c0c,
     IO_BITMAP_A                     = 0x00002000,
-    IO_BITMAP_A_HIGH                = 0x00002001,
     IO_BITMAP_B                     = 0x00002002,
-    IO_BITMAP_B_HIGH                = 0x00002003,
     MSR_BITMAP                      = 0x00002004,
-    MSR_BITMAP_HIGH                 = 0x00002005,
     VM_EXIT_MSR_STORE_ADDR          = 0x00002006,
-    VM_EXIT_MSR_STORE_ADDR_HIGH     = 0x00002007,
     VM_EXIT_MSR_LOAD_ADDR           = 0x00002008,
-    VM_EXIT_MSR_LOAD_ADDR_HIGH      = 0x00002009,
     VM_ENTRY_MSR_LOAD_ADDR          = 0x0000200a,
-    VM_ENTRY_MSR_LOAD_ADDR_HIGH     = 0x0000200b,
     TSC_OFFSET                      = 0x00002010,
-    TSC_OFFSET_HIGH                 = 0x00002011,
     VIRTUAL_APIC_PAGE_ADDR          = 0x00002012,
-    VIRTUAL_APIC_PAGE_ADDR_HIGH     = 0x00002013,
     APIC_ACCESS_ADDR                = 0x00002014,
-    APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     PI_DESC_ADDR                    = 0x00002016,
-    PI_DESC_ADDR_HIGH               = 0x00002017,
     VMFUNC_CONTROL                  = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
-    EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
 #define EOI_EXIT_BITMAP(n) (EOI_EXIT_BITMAP0 + (n) * 2) /* n = 0...3 */
     VMREAD_BITMAP                   = 0x00002026,
-    VMREAD_BITMAP_HIGH              = 0x00002027,
     VMWRITE_BITMAP                  = 0x00002028,
-    VMWRITE_BITMAP_HIGH             = 0x00002029,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
-    GUEST_PHYSICAL_ADDRESS_HIGH     = 0x00002401,
     VMCS_LINK_POINTER               = 0x00002800,
-    VMCS_LINK_POINTER_HIGH          = 0x00002801,
     GUEST_IA32_DEBUGCTL             = 0x00002802,
-    GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
-    GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
-    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
-    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTE0                    = 0x0000280a,
 #define GUEST_PDPTE(n) (GUEST_PDPTE0 + (n) * 2) /* n = 0...3 */
     GUEST_BNDCFGS                   = 0x00002812,
-    GUEST_BNDCFGS_HIGH              = 0x00002813,
     HOST_PAT                        = 0x00002c00,
-    HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
-    HOST_EFER_HIGH                  = 0x00002c03,
     HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
-    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,
--
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 Tue Feb 03 07:57:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYM4-00048u-PT; Tue, 03 Feb 2015 07:57:04 +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 1YIYM3-00048e-Ak
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:03 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	3C/EC-02804-E4F70D45; Tue, 03 Feb 2015 07:57:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1422950221!5378722!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26711 invoked from network); 3 Feb 2015 07:57:01 -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 Feb 2015 07:57: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 1YIYM0-0004x4-Tp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYM0-00069J-Rb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:00 +0000
Date: Tue, 03 Feb 2015 07:57:00 +0000
Message-Id: <E1YIYM0-00069J-Rb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: drop VMCS *_HIGH enumerators
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0bccdfddad0fa26810fed5de069a57182ecdc810
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:57:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:57:27 2015 +0100

    VMX: drop VMCS *_HIGH enumerators
    
    Most of them have been unused since the dropping of 32-bit support, and
    the few remaining cases are more efficiently dealt with using a generic
    macro (and probably things should have been done that way from the
    beginning).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c        |   12 ++++++------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   24 +-----------------------
 2 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 26611b3..91e6ae4 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -98,9 +98,9 @@ int nvmx_vcpu_initialise(struct vcpu *v)
          * Let them vmexit as usual.
          */
         set_bit(IO_BITMAP_A, vw);
-        set_bit(IO_BITMAP_A_HIGH, vw);
+        set_bit(VMCS_HIGH(IO_BITMAP_A), vw);
         set_bit(IO_BITMAP_B, vw);
-        set_bit(IO_BITMAP_B_HIGH, vw);
+        set_bit(VMCS_HIGH(IO_BITMAP_B), vw);
 
         unmap_domain_page(vr);
         unmap_domain_page(vw);
@@ -1761,15 +1761,15 @@ int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
     vmcs_encoding = reg_read(regs, decode.reg2);
     __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand);
 
-    switch ( vmcs_encoding )
+    switch ( vmcs_encoding & ~VMCS_HIGH(0) )
     {
-    case IO_BITMAP_A: case IO_BITMAP_A_HIGH:
+    case IO_BITMAP_A:
         okay = _map_io_bitmap(v, IO_BITMAP_A);
         break;
-    case IO_BITMAP_B: case IO_BITMAP_B_HIGH:
+    case IO_BITMAP_B:
         okay = _map_io_bitmap(v, IO_BITMAP_B);
         break;
-    case MSR_BITMAP: case MSR_BITMAP_HIGH:
+    case MSR_BITMAP:
         okay = _map_msr_bitmap(v);
         break;
     }
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ccb6263..88c4fab 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -304,6 +304,7 @@ extern u64 vmx_basic_msr;
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
 
 /* VMCS field encodings. */
+#define VMCS_HIGH(x) ((x) | 1)
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
     POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
@@ -325,56 +326,33 @@ enum vmcs_field {
     HOST_GS_SELECTOR                = 0x00000c0a,
     HOST_TR_SELECTOR                = 0x00000c0c,
     IO_BITMAP_A                     = 0x00002000,
-    IO_BITMAP_A_HIGH                = 0x00002001,
     IO_BITMAP_B                     = 0x00002002,
-    IO_BITMAP_B_HIGH                = 0x00002003,
     MSR_BITMAP                      = 0x00002004,
-    MSR_BITMAP_HIGH                 = 0x00002005,
     VM_EXIT_MSR_STORE_ADDR          = 0x00002006,
-    VM_EXIT_MSR_STORE_ADDR_HIGH     = 0x00002007,
     VM_EXIT_MSR_LOAD_ADDR           = 0x00002008,
-    VM_EXIT_MSR_LOAD_ADDR_HIGH      = 0x00002009,
     VM_ENTRY_MSR_LOAD_ADDR          = 0x0000200a,
-    VM_ENTRY_MSR_LOAD_ADDR_HIGH     = 0x0000200b,
     TSC_OFFSET                      = 0x00002010,
-    TSC_OFFSET_HIGH                 = 0x00002011,
     VIRTUAL_APIC_PAGE_ADDR          = 0x00002012,
-    VIRTUAL_APIC_PAGE_ADDR_HIGH     = 0x00002013,
     APIC_ACCESS_ADDR                = 0x00002014,
-    APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     PI_DESC_ADDR                    = 0x00002016,
-    PI_DESC_ADDR_HIGH               = 0x00002017,
     VMFUNC_CONTROL                  = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
-    EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
 #define EOI_EXIT_BITMAP(n) (EOI_EXIT_BITMAP0 + (n) * 2) /* n = 0...3 */
     VMREAD_BITMAP                   = 0x00002026,
-    VMREAD_BITMAP_HIGH              = 0x00002027,
     VMWRITE_BITMAP                  = 0x00002028,
-    VMWRITE_BITMAP_HIGH             = 0x00002029,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
-    GUEST_PHYSICAL_ADDRESS_HIGH     = 0x00002401,
     VMCS_LINK_POINTER               = 0x00002800,
-    VMCS_LINK_POINTER_HIGH          = 0x00002801,
     GUEST_IA32_DEBUGCTL             = 0x00002802,
-    GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
-    GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
-    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
-    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTE0                    = 0x0000280a,
 #define GUEST_PDPTE(n) (GUEST_PDPTE0 + (n) * 2) /* n = 0...3 */
     GUEST_BNDCFGS                   = 0x00002812,
-    GUEST_BNDCFGS_HIGH              = 0x00002813,
     HOST_PAT                        = 0x00002c00,
-    HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
-    HOST_EFER_HIGH                  = 0x00002c03,
     HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
-    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,
--
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 Tue Feb 03 07:57:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYME-0004AQ-S6; Tue, 03 Feb 2015 07:57: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 1YIYMD-0004AE-HL
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:13 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	8E/05-02639-85F70D45; Tue, 03 Feb 2015 07:57:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950231!12389032!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31628 invoked from network); 3 Feb 2015 07:57:12 -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;
	3 Feb 2015 07:57: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 1YIYMB-0004xc-38
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMB-00069s-2G
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:11 +0000
Date: Tue, 03 Feb 2015 07:57:11 +0000
Message-Id: <E1YIYMB-00069s-2G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: use cached "current" where
	available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee533a31737eabb304461742cd6711b4bc9df365
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:58:06 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:58:06 2015 +0100

    VMX: use cached "current" where available
    
    ..., yielding better code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index ed5e27a..a5a59c4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1474,7 +1474,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
 
     if ( (_trap.vector == TRAP_page_fault) &&
          (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
-        current->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
+        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
 
     if ( nestedhvm_vcpu_in_guestmode(curr) )
         intr_info = vcpu_2_nvmx(curr).intr.intr_info;
@@ -1527,7 +1527,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     if ( (_trap.vector == TRAP_page_fault) &&
          (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
         HVMTRACE_LONG_2D(PF_INJECT, _trap.error_code,
-                         TRC_PAR_LONG(current->arch.hvm_vcpu.guest_cr[2]));
+                         TRC_PAR_LONG(curr->arch.hvm_vcpu.guest_cr[2]));
     else
         HVMTRACE_2D(INJ_EXC, _trap.vector, _trap.error_code);
 }
@@ -2814,7 +2814,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             if ( v->domain->debugger_attached )
             {
                 update_guest_eip(); /* Safe: INT3 */            
-                current->arch.gdbsx_vcpu_event = TRAP_int3;
+                v->arch.gdbsx_vcpu_event = TRAP_int3;
                 domain_pause_for_debugger();
                 break;
             }
@@ -3080,7 +3080,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         __vmread(EXIT_QUALIFICATION, &exit_qualification);
         vector = exit_qualification & 0xff;
 
-        vmx_handle_EOI_induced_exit(vcpu_vlapic(current), vector);
+        vmx_handle_EOI_induced_exit(vcpu_vlapic(v), vector);
         break;
     }
 
--
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 Tue Feb 03 07:57:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYME-0004AQ-S6; Tue, 03 Feb 2015 07:57: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 1YIYMD-0004AE-HL
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:13 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	8E/05-02639-85F70D45; Tue, 03 Feb 2015 07:57:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950231!12389032!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31628 invoked from network); 3 Feb 2015 07:57:12 -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;
	3 Feb 2015 07:57: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 1YIYMB-0004xc-38
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMB-00069s-2G
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:11 +0000
Date: Tue, 03 Feb 2015 07:57:11 +0000
Message-Id: <E1YIYMB-00069s-2G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: use cached "current" where
	available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee533a31737eabb304461742cd6711b4bc9df365
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 12:58:06 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:58:06 2015 +0100

    VMX: use cached "current" where available
    
    ..., yielding better code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index ed5e27a..a5a59c4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1474,7 +1474,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
 
     if ( (_trap.vector == TRAP_page_fault) &&
          (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
-        current->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
+        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
 
     if ( nestedhvm_vcpu_in_guestmode(curr) )
         intr_info = vcpu_2_nvmx(curr).intr.intr_info;
@@ -1527,7 +1527,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     if ( (_trap.vector == TRAP_page_fault) &&
          (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
         HVMTRACE_LONG_2D(PF_INJECT, _trap.error_code,
-                         TRC_PAR_LONG(current->arch.hvm_vcpu.guest_cr[2]));
+                         TRC_PAR_LONG(curr->arch.hvm_vcpu.guest_cr[2]));
     else
         HVMTRACE_2D(INJ_EXC, _trap.vector, _trap.error_code);
 }
@@ -2814,7 +2814,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             if ( v->domain->debugger_attached )
             {
                 update_guest_eip(); /* Safe: INT3 */            
-                current->arch.gdbsx_vcpu_event = TRAP_int3;
+                v->arch.gdbsx_vcpu_event = TRAP_int3;
                 domain_pause_for_debugger();
                 break;
             }
@@ -3080,7 +3080,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         __vmread(EXIT_QUALIFICATION, &exit_qualification);
         vector = exit_qualification & 0xff;
 
-        vmx_handle_EOI_induced_exit(vcpu_vlapic(current), vector);
+        vmx_handle_EOI_induced_exit(vcpu_vlapic(v), vector);
         break;
     }
 
--
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 Tue Feb 03 07:57:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYMO-0004Bn-Uf; Tue, 03 Feb 2015 07:57:24 +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 1YIYMN-0004BZ-NB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:23 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	43/FF-02809-36F70D45; Tue, 03 Feb 2015 07:57:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1422950241!3205506!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11219 invoked from network); 3 Feb 2015 07:57:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:57: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 1YIYML-0004xi-AS
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYML-0006AH-7n
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:21 +0000
Date: Tue, 03 Feb 2015 07:57:21 +0000
Message-Id: <E1YIYML-0006AH-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domain: improvements to
	switch_native() and switch_compat()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e6fc2db9f1231e2ed0ec5263c6aa6ff1db90c5f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:58:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:58:47 2015 +0100

    x86/domain: improvements to switch_native() and switch_compat()
    
    Both are called with known-good domains, making the NULL check redundant.
    Both also have open-coded forms of for_each_vcpu() which are replaced.
    
    switch_compat() is updated to propagate the error from set_compat_l4(), rather
    than automatically overriding with -ENOMEM.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c |   35 ++++++++++++-----------------------
 1 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c8832c6..50b361b 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -362,10 +362,8 @@ static inline int may_switch_mode(struct domain *d)
 
 int switch_native(struct domain *d)
 {
-    unsigned int vcpuid;
+    struct vcpu *v;
 
-    if ( d == NULL )
-        return -EINVAL;
     if ( !may_switch_mode(d) )
         return -EACCES;
     if ( !is_pv_32on64_domain(d) )
@@ -373,21 +371,16 @@ int switch_native(struct domain *d)
 
     d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
 
-    for ( vcpuid = 0; vcpuid < d->max_vcpus; vcpuid++ )
-    {
-        if (d->vcpu[vcpuid])
-            release_compat_l4(d->vcpu[vcpuid]);
-    }
+    for_each_vcpu( d, v )
+        release_compat_l4(v);
 
     return 0;
 }
 
 int switch_compat(struct domain *d)
 {
-    unsigned int vcpuid;
-
-    if ( d == NULL )
-        return -EINVAL;
+    struct vcpu *v;
+    int rc;
 
     if ( is_pvh_domain(d) )
     {
@@ -403,12 +396,9 @@ int switch_compat(struct domain *d)
 
     d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 1;
 
-    for ( vcpuid = 0; vcpuid < d->max_vcpus; vcpuid++ )
-    {
-        if ( (d->vcpu[vcpuid] != NULL) &&
-             (setup_compat_l4(d->vcpu[vcpuid]) != 0) )
+    for_each_vcpu( d, v )
+        if ( (rc = setup_compat_l4(v)) )
             goto undo_and_fail;
-    }
 
     domain_set_alloc_bitsize(d);
 
@@ -416,12 +406,11 @@ int switch_compat(struct domain *d)
 
  undo_and_fail:
     d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
-    while ( vcpuid-- != 0 )
-    {
-        if ( d->vcpu[vcpuid] != NULL )
-            release_compat_l4(d->vcpu[vcpuid]);
-    }
-    return -ENOMEM;
+    for_each_vcpu( d, v )
+        if ( !pagetable_is_null(v->arch.guest_table) )
+            release_compat_l4(v);
+
+    return rc;
 }
 
 int vcpu_initialise(struct vcpu *v)
--
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 Tue Feb 03 07:57:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYMO-0004Bn-Uf; Tue, 03 Feb 2015 07:57:24 +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 1YIYMN-0004BZ-NB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:23 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	43/FF-02809-36F70D45; Tue, 03 Feb 2015 07:57:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1422950241!3205506!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11219 invoked from network); 3 Feb 2015 07:57:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:57: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 1YIYML-0004xi-AS
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYML-0006AH-7n
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:21 +0000
Date: Tue, 03 Feb 2015 07:57:21 +0000
Message-Id: <E1YIYML-0006AH-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domain: improvements to
	switch_native() and switch_compat()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e6fc2db9f1231e2ed0ec5263c6aa6ff1db90c5f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:58:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:58:47 2015 +0100

    x86/domain: improvements to switch_native() and switch_compat()
    
    Both are called with known-good domains, making the NULL check redundant.
    Both also have open-coded forms of for_each_vcpu() which are replaced.
    
    switch_compat() is updated to propagate the error from set_compat_l4(), rather
    than automatically overriding with -ENOMEM.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c |   35 ++++++++++++-----------------------
 1 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c8832c6..50b361b 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -362,10 +362,8 @@ static inline int may_switch_mode(struct domain *d)
 
 int switch_native(struct domain *d)
 {
-    unsigned int vcpuid;
+    struct vcpu *v;
 
-    if ( d == NULL )
-        return -EINVAL;
     if ( !may_switch_mode(d) )
         return -EACCES;
     if ( !is_pv_32on64_domain(d) )
@@ -373,21 +371,16 @@ int switch_native(struct domain *d)
 
     d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
 
-    for ( vcpuid = 0; vcpuid < d->max_vcpus; vcpuid++ )
-    {
-        if (d->vcpu[vcpuid])
-            release_compat_l4(d->vcpu[vcpuid]);
-    }
+    for_each_vcpu( d, v )
+        release_compat_l4(v);
 
     return 0;
 }
 
 int switch_compat(struct domain *d)
 {
-    unsigned int vcpuid;
-
-    if ( d == NULL )
-        return -EINVAL;
+    struct vcpu *v;
+    int rc;
 
     if ( is_pvh_domain(d) )
     {
@@ -403,12 +396,9 @@ int switch_compat(struct domain *d)
 
     d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 1;
 
-    for ( vcpuid = 0; vcpuid < d->max_vcpus; vcpuid++ )
-    {
-        if ( (d->vcpu[vcpuid] != NULL) &&
-             (setup_compat_l4(d->vcpu[vcpuid]) != 0) )
+    for_each_vcpu( d, v )
+        if ( (rc = setup_compat_l4(v)) )
             goto undo_and_fail;
-    }
 
     domain_set_alloc_bitsize(d);
 
@@ -416,12 +406,11 @@ int switch_compat(struct domain *d)
 
  undo_and_fail:
     d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
-    while ( vcpuid-- != 0 )
-    {
-        if ( d->vcpu[vcpuid] != NULL )
-            release_compat_l4(d->vcpu[vcpuid]);
-    }
-    return -ENOMEM;
+    for_each_vcpu( d, v )
+        if ( !pagetable_is_null(v->arch.guest_table) )
+            release_compat_l4(v);
+
+    return rc;
 }
 
 int vcpu_initialise(struct vcpu *v)
--
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 Tue Feb 03 07:57:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYMd-0004Dr-3B; Tue, 03 Feb 2015 07:57:39 +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 1YIYMb-0004Dg-Sj
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:37 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	36/54-02749-17F70D45; Tue, 03 Feb 2015 07:57:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950251!12109992!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18524 invoked from network); 3 Feb 2015 07:57:32 -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;
	3 Feb 2015 07:57:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMV-0004xq-Fn
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMV-0006Aj-EN
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:31 +0000
Date: Tue, 03 Feb 2015 07:57:31 +0000
Message-Id: <E1YIYMV-0006Aj-EN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vlapic: express x2apic msr
	readability with a bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df39f487cc646774af130b856066c3c6538a0dc9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:59:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:59:14 2015 +0100

    x86/vlapic: express x2apic msr readability with a bitmap
    
    The x2apic MSR space is currently defined between 0x800 and 0x83f, which
    conveniently fits in a 64 bit wide bitmap.  This is far more efficient than
    the cascade comparisons generated by the switch statement, which can't be
    optimised because of the case ranges used for the ISR, TMR and IRR blocks.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Convert 0xffUL to ((1UL << (NR_VECTORS / 32)) - 1) and drop a couple of
    clearly superfluous parentheses.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vlapic.c |   50 +++++++++++++++++---------------------------
 1 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 72b6509..a91cee1 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -643,43 +643,31 @@ static int vlapic_read(
 
 int hvm_x2apic_msr_read(struct vcpu *v, unsigned int msr, uint64_t *msr_content)
 {
+    static const unsigned long readable[] =
+        {
+#define REG(x) (1UL << (APIC_ ## x >> 4))
+            REG(ID)    | REG(LVR)  | REG(TASKPRI) | REG(PROCPRI) |
+            REG(LDR)   | REG(SPIV) | REG(ESR)     | REG(ICR)     |
+            REG(CMCI)  | REG(LVTT) | REG(LVTTHMR) | REG(LVTPC)   |
+            REG(LVT0)  | REG(LVT1) | REG(LVTERR)  | REG(TMICT)   |
+            REG(TMCCT) | REG(TDCR) |
+#undef REG
+#define REGBLOCK(x) (((1UL << (NR_VECTORS / 32)) - 1) << (APIC_ ## x >> 4))
+            REGBLOCK(ISR) | REGBLOCK(TMR) | REGBLOCK(IRR)
+#undef REGBLOCK
+        };
     struct vlapic *vlapic = vcpu_vlapic(v);
-    uint32_t low, high = 0, offset = (msr - MSR_IA32_APICBASE_MSR) << 4;
+    uint32_t low, high = 0, reg = msr - MSR_IA32_APICBASE_MSR,
+        offset = reg << 4;
 
-    if ( !vlapic_x2apic_mode(vlapic) )
+    if ( !vlapic_x2apic_mode(vlapic) ||
+         (reg >= sizeof(readable) * 8) || !test_bit(reg, readable) )
         return X86EMUL_UNHANDLEABLE;
 
-    switch ( offset )
-    {
-    case APIC_ICR:
+    if ( offset == 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;
 
-    default:
-        return X86EMUL_UNHANDLEABLE;
-    }
+    vlapic_read_aligned(vlapic, offset, &low);
 
     *msr_content = (((uint64_t)high) << 32) | low;
 
--
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 Tue Feb 03 07:57:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYMd-0004Dr-3B; Tue, 03 Feb 2015 07:57:39 +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 1YIYMb-0004Dg-Sj
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:37 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	36/54-02749-17F70D45; Tue, 03 Feb 2015 07:57:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950251!12109992!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18524 invoked from network); 3 Feb 2015 07:57:32 -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;
	3 Feb 2015 07:57:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMV-0004xq-Fn
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMV-0006Aj-EN
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:31 +0000
Date: Tue, 03 Feb 2015 07:57:31 +0000
Message-Id: <E1YIYMV-0006Aj-EN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vlapic: express x2apic msr
	readability with a bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df39f487cc646774af130b856066c3c6538a0dc9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 22 12:59:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 12:59:14 2015 +0100

    x86/vlapic: express x2apic msr readability with a bitmap
    
    The x2apic MSR space is currently defined between 0x800 and 0x83f, which
    conveniently fits in a 64 bit wide bitmap.  This is far more efficient than
    the cascade comparisons generated by the switch statement, which can't be
    optimised because of the case ranges used for the ISR, TMR and IRR blocks.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Convert 0xffUL to ((1UL << (NR_VECTORS / 32)) - 1) and drop a couple of
    clearly superfluous parentheses.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vlapic.c |   50 +++++++++++++++++---------------------------
 1 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 72b6509..a91cee1 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -643,43 +643,31 @@ static int vlapic_read(
 
 int hvm_x2apic_msr_read(struct vcpu *v, unsigned int msr, uint64_t *msr_content)
 {
+    static const unsigned long readable[] =
+        {
+#define REG(x) (1UL << (APIC_ ## x >> 4))
+            REG(ID)    | REG(LVR)  | REG(TASKPRI) | REG(PROCPRI) |
+            REG(LDR)   | REG(SPIV) | REG(ESR)     | REG(ICR)     |
+            REG(CMCI)  | REG(LVTT) | REG(LVTTHMR) | REG(LVTPC)   |
+            REG(LVT0)  | REG(LVT1) | REG(LVTERR)  | REG(TMICT)   |
+            REG(TMCCT) | REG(TDCR) |
+#undef REG
+#define REGBLOCK(x) (((1UL << (NR_VECTORS / 32)) - 1) << (APIC_ ## x >> 4))
+            REGBLOCK(ISR) | REGBLOCK(TMR) | REGBLOCK(IRR)
+#undef REGBLOCK
+        };
     struct vlapic *vlapic = vcpu_vlapic(v);
-    uint32_t low, high = 0, offset = (msr - MSR_IA32_APICBASE_MSR) << 4;
+    uint32_t low, high = 0, reg = msr - MSR_IA32_APICBASE_MSR,
+        offset = reg << 4;
 
-    if ( !vlapic_x2apic_mode(vlapic) )
+    if ( !vlapic_x2apic_mode(vlapic) ||
+         (reg >= sizeof(readable) * 8) || !test_bit(reg, readable) )
         return X86EMUL_UNHANDLEABLE;
 
-    switch ( offset )
-    {
-    case APIC_ICR:
+    if ( offset == 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;
 
-    default:
-        return X86EMUL_UNHANDLEABLE;
-    }
+    vlapic_read_aligned(vlapic, offset, &low);
 
     *msr_content = (((uint64_t)high) << 32) | low;
 
--
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 Tue Feb 03 07:57:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYMk-0004F5-5q; Tue, 03 Feb 2015 07:57:46 +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 1YIYMi-0004Em-IY
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:44 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	31/E1-03219-77F70D45; Tue, 03 Feb 2015 07:57:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1422950261!11451293!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7285 invoked from network); 3 Feb 2015 07:57:42 -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;
	3 Feb 2015 07:57: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 1YIYMf-0004xv-Ll
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMf-0006Bz-KI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:41 +0000
Date: Tue, 03 Feb 2015 07:57:41 +0000
Message-Id: <E1YIYMf-0006Bz-KI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] make fls() and ffs() consistent across
	architectures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit efb0d962cd3a10f1595fc49c95574874f0a02ea0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 14:59:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 14:59:37 2015 +0100

    make fls() and ffs() consistent across architectures
    
    Their parameter types differed between ARM and x86.
    
    Along with generalizing the functions this fixes
    - x86's non-long functions having long parameter types
    - ARM's ffs() using a long intermediate variable
    - generic_fls64() being broken when the upper half of the input is
      non-zero
    - common (and in one case also ARM) code using fls() when flsl() was
      meant
    
    Also drop ARM's constant_fls() in favor of the identical generic_fls().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/page_alloc.c            |    6 ++--
 xen/common/xmalloc_tlsf.c          |    6 ++--
 xen/include/asm-arm/arm32/bitops.h |    2 +
 xen/include/asm-arm/arm64/bitops.h |   11 +++++++++
 xen/include/asm-arm/bitops.h       |   38 ++++-----------------------------
 xen/include/asm-x86/bitops.h       |   27 ++++++++++++++++++++---
 xen/include/xen/bitops.h           |   40 ++++++++++++++++++++++++++++++++---
 7 files changed, 83 insertions(+), 47 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 7b4092d..be6821b 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -278,7 +278,7 @@ unsigned long __init alloc_boot_pages(
 
 #define bits_to_zone(b) (((b) < (PAGE_SHIFT + 1)) ? 1 : ((b) - PAGE_SHIFT))
 #define page_to_zone(pg) (is_xen_heap_page(pg) ? MEMZONE_XEN :  \
-                          (fls(page_to_mfn(pg)) ? : 1))
+                          (flsl(page_to_mfn(pg)) ? : 1))
 
 typedef struct page_list_head heap_by_zone_and_order_t[NR_ZONES][MAX_ORDER+1];
 static heap_by_zone_and_order_t *_heap[MAX_NUMNODES];
@@ -1259,7 +1259,7 @@ void __init end_boot_allocator(void)
     {
 #ifdef CONFIG_X86
         dma_bitsize = min_t(unsigned int,
-                            fls(NODE_DATA(0)->node_spanned_pages) - 1
+                            flsl(NODE_DATA(0)->node_spanned_pages) - 1
                             + PAGE_SHIFT - 2,
                             32);
 #else
@@ -1544,7 +1544,7 @@ static unsigned int __read_mostly xenheap_bits;
 
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT;
+    xenheap_bits = flsl(mfn) + PAGE_SHIFT;
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index a5769c9..b13317e 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -138,9 +138,9 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
     }
     else
     {
-        t = (1 << (fls(*r) - 1 - MAX_LOG2_SLI)) - 1;
+        t = (1 << (flsl(*r) - 1 - MAX_LOG2_SLI)) - 1;
         *r = *r + t;
-        *fl = fls(*r) - 1;
+        *fl = flsl(*r) - 1;
         *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
         *fl -= FLI_OFFSET;
         /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
@@ -164,7 +164,7 @@ static inline void MAPPING_INSERT(unsigned long r, int *fl, int *sl)
     }
     else
     {
-        *fl = fls(r) - 1;
+        *fl = flsl(r) - 1;
         *sl = (r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
         *fl -= FLI_OFFSET;
     }
diff --git a/xen/include/asm-arm/arm32/bitops.h b/xen/include/asm-arm/arm32/bitops.h
index 0d05258..8be3564 100644
--- a/xen/include/asm-arm/arm32/bitops.h
+++ b/xen/include/asm-arm/arm32/bitops.h
@@ -15,6 +15,8 @@ extern int _test_and_change_bit(int nr, volatile void * p);
 #define test_and_clear_bit(n,p)   _test_and_clear_bit(n,p)
 #define test_and_change_bit(n,p)  _test_and_change_bit(n,p)
 
+#define flsl fls
+
 /*
  * Little endian assembly bitops.  nr = 0 -> byte 0 bit 0.
  */
diff --git a/xen/include/asm-arm/arm64/bitops.h b/xen/include/asm-arm/arm64/bitops.h
index b43931d..6bf1922 100644
--- a/xen/include/asm-arm/arm64/bitops.h
+++ b/xen/include/asm-arm/arm64/bitops.h
@@ -32,6 +32,17 @@ static /*__*/always_inline unsigned long __ffs(unsigned long word)
  */
 #define ffz(x)  __ffs(~(x))
 
+static inline int flsl(unsigned long x)
+{
+        int ret;
+
+        if (__builtin_constant_p(x))
+               return generic_flsl(x);
+
+        asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
+        return BITS_PER_LONG - ret;
+}
+
 /* Based on linux/include/asm-generic/bitops/find.h */
 
 #ifndef find_next_bit
diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
index 25f96c8..f2bb031 100644
--- a/xen/include/asm-arm/bitops.h
+++ b/xen/include/asm-arm/bitops.h
@@ -99,46 +99,17 @@ static inline int test_bit(int nr, const volatile void *addr)
         return 1UL & (p[BIT_WORD(nr)] >> (nr & (BITS_PER_WORD-1)));
 }
 
-static inline int constant_fls(int x)
-{
-        int r = 32;
-
-        if (!x)
-                return 0;
-        if (!(x & 0xffff0000u)) {
-                x <<= 16;
-                r -= 16;
-        }
-        if (!(x & 0xff000000u)) {
-                x <<= 8;
-                r -= 8;
-        }
-        if (!(x & 0xf0000000u)) {
-                x <<= 4;
-                r -= 4;
-        }
-        if (!(x & 0xc0000000u)) {
-                x <<= 2;
-                r -= 2;
-        }
-        if (!(x & 0x80000000u)) {
-                x <<= 1;
-                r -= 1;
-        }
-        return r;
-}
-
 /*
  * On ARMv5 and above those functions can be implemented around
  * the clz instruction for much better code efficiency.
  */
 
-static inline int fls(int x)
+static inline int fls(unsigned int x)
 {
         int ret;
 
         if (__builtin_constant_p(x))
-               return constant_fls(x);
+               return generic_fls(x);
 
         asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
         ret = BITS_PER_LONG - ret;
@@ -146,7 +117,8 @@ static inline int fls(int x)
 }
 
 
-#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
+#define ffs(x) ({ unsigned int __t = (x); fls(__t & -__t); })
+#define ffsl(x) ({ unsigned long __t = (x); flsl(__t & -__t); })
 
 /**
  * find_first_set_bit - find the first set bit in @word
@@ -157,7 +129,7 @@ static inline int fls(int x)
  */
 static inline unsigned int find_first_set_bit(unsigned long word)
 {
-        return ffs(word) - 1;
+        return ffsl(word) - 1;
 }
 
 /**
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 3e9ca00..099a74c 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -401,7 +401,7 @@ static inline unsigned int find_first_set_bit(unsigned long word)
  *
  * This is defined the same way as the libc and compiler builtin ffs routines.
  */
-static inline int ffs(unsigned long x)
+static inline int ffsl(unsigned long x)
 {
     long r;
 
@@ -412,13 +412,24 @@ static inline int ffs(unsigned long x)
     return (int)r+1;
 }
 
+static inline int ffs(unsigned int x)
+{
+    int r;
+
+    asm ( "bsf %1,%0\n\t"
+          "jnz 1f\n\t"
+          "mov $-1,%0\n"
+          "1:" : "=r" (r) : "rm" (x));
+    return r + 1;
+}
+
 /**
  * fls - find last bit set
  * @x: the word to search
  *
  * This is defined the same way as ffs.
  */
-static inline int fls(unsigned long x)
+static inline int flsl(unsigned long x)
 {
     long r;
 
@@ -429,8 +440,16 @@ static inline int fls(unsigned long x)
     return (int)r+1;
 }
 
-#define ffs64 ffs
-#define fls64 fls
+static inline int fls(unsigned int x)
+{
+    int r;
+
+    asm ( "bsr %1,%0\n\t"
+          "jnz 1f\n\t"
+          "mov $-1,%0\n"
+          "1:" : "=r" (r) : "rm" (x));
+    return r + 1;
+}
 
 /**
  * hweightN - returns the hamming weight of a N-bit word
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 6054155..cb56f24 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -70,20 +70,52 @@ static __inline__ int generic_fls(int x)
     return r;
 }
 
+#if BITS_PER_LONG == 64
+
+static inline int generic_ffsl(unsigned long x)
+{
+    return !x || (u32)x ? generic_ffs(x) : generic_ffs(x >> 32) + 32;
+}
+
+static inline int generic_flsl(unsigned long x)
+{
+    u32 h = x >> 32;
+
+    return h ? generic_fls(h) + 32 : generic_fls(x);
+}
+
+#else
+# define generic_ffsl generic_ffs
+# define generic_flsl generic_fls
+#endif
+
 /*
  * Include this here because some architectures need generic_ffs/fls in
  * scope
  */
 #include <asm/bitops.h>
 
-
+#if BITS_PER_LONG == 64
+# define fls64 flsl
+# define ffs64 ffsl
+#else
+# ifndef ffs64
+static inline int generic_ffs64(__u64 x)
+{
+    return !x || (__u32)x ? ffs(x) : ffs(x >> 32) + 32;
+}
+#  define ffs64 generic_ffs64
+# endif
+# ifndef fls64
 static inline int generic_fls64(__u64 x)
 {
     __u32 h = x >> 32;
-    if (h)
-        return fls(x) + 32;
-    return fls(x);
+
+    return h ? fls(h) + 32 : fls(x);
 }
+#  define fls64 generic_fls64
+# endif
+#endif
 
 static __inline__ int get_bitmask_order(unsigned int 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 Tue Feb 03 07:57:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYMk-0004F5-5q; Tue, 03 Feb 2015 07:57:46 +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 1YIYMi-0004Em-IY
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:44 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	31/E1-03219-77F70D45; Tue, 03 Feb 2015 07:57:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1422950261!11451293!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7285 invoked from network); 3 Feb 2015 07:57:42 -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;
	3 Feb 2015 07:57: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 1YIYMf-0004xv-Ll
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMf-0006Bz-KI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:41 +0000
Date: Tue, 03 Feb 2015 07:57:41 +0000
Message-Id: <E1YIYMf-0006Bz-KI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] make fls() and ffs() consistent across
	architectures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit efb0d962cd3a10f1595fc49c95574874f0a02ea0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 14:59:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 14:59:37 2015 +0100

    make fls() and ffs() consistent across architectures
    
    Their parameter types differed between ARM and x86.
    
    Along with generalizing the functions this fixes
    - x86's non-long functions having long parameter types
    - ARM's ffs() using a long intermediate variable
    - generic_fls64() being broken when the upper half of the input is
      non-zero
    - common (and in one case also ARM) code using fls() when flsl() was
      meant
    
    Also drop ARM's constant_fls() in favor of the identical generic_fls().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/page_alloc.c            |    6 ++--
 xen/common/xmalloc_tlsf.c          |    6 ++--
 xen/include/asm-arm/arm32/bitops.h |    2 +
 xen/include/asm-arm/arm64/bitops.h |   11 +++++++++
 xen/include/asm-arm/bitops.h       |   38 ++++-----------------------------
 xen/include/asm-x86/bitops.h       |   27 ++++++++++++++++++++---
 xen/include/xen/bitops.h           |   40 ++++++++++++++++++++++++++++++++---
 7 files changed, 83 insertions(+), 47 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 7b4092d..be6821b 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -278,7 +278,7 @@ unsigned long __init alloc_boot_pages(
 
 #define bits_to_zone(b) (((b) < (PAGE_SHIFT + 1)) ? 1 : ((b) - PAGE_SHIFT))
 #define page_to_zone(pg) (is_xen_heap_page(pg) ? MEMZONE_XEN :  \
-                          (fls(page_to_mfn(pg)) ? : 1))
+                          (flsl(page_to_mfn(pg)) ? : 1))
 
 typedef struct page_list_head heap_by_zone_and_order_t[NR_ZONES][MAX_ORDER+1];
 static heap_by_zone_and_order_t *_heap[MAX_NUMNODES];
@@ -1259,7 +1259,7 @@ void __init end_boot_allocator(void)
     {
 #ifdef CONFIG_X86
         dma_bitsize = min_t(unsigned int,
-                            fls(NODE_DATA(0)->node_spanned_pages) - 1
+                            flsl(NODE_DATA(0)->node_spanned_pages) - 1
                             + PAGE_SHIFT - 2,
                             32);
 #else
@@ -1544,7 +1544,7 @@ static unsigned int __read_mostly xenheap_bits;
 
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT;
+    xenheap_bits = flsl(mfn) + PAGE_SHIFT;
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index a5769c9..b13317e 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -138,9 +138,9 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
     }
     else
     {
-        t = (1 << (fls(*r) - 1 - MAX_LOG2_SLI)) - 1;
+        t = (1 << (flsl(*r) - 1 - MAX_LOG2_SLI)) - 1;
         *r = *r + t;
-        *fl = fls(*r) - 1;
+        *fl = flsl(*r) - 1;
         *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
         *fl -= FLI_OFFSET;
         /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
@@ -164,7 +164,7 @@ static inline void MAPPING_INSERT(unsigned long r, int *fl, int *sl)
     }
     else
     {
-        *fl = fls(r) - 1;
+        *fl = flsl(r) - 1;
         *sl = (r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
         *fl -= FLI_OFFSET;
     }
diff --git a/xen/include/asm-arm/arm32/bitops.h b/xen/include/asm-arm/arm32/bitops.h
index 0d05258..8be3564 100644
--- a/xen/include/asm-arm/arm32/bitops.h
+++ b/xen/include/asm-arm/arm32/bitops.h
@@ -15,6 +15,8 @@ extern int _test_and_change_bit(int nr, volatile void * p);
 #define test_and_clear_bit(n,p)   _test_and_clear_bit(n,p)
 #define test_and_change_bit(n,p)  _test_and_change_bit(n,p)
 
+#define flsl fls
+
 /*
  * Little endian assembly bitops.  nr = 0 -> byte 0 bit 0.
  */
diff --git a/xen/include/asm-arm/arm64/bitops.h b/xen/include/asm-arm/arm64/bitops.h
index b43931d..6bf1922 100644
--- a/xen/include/asm-arm/arm64/bitops.h
+++ b/xen/include/asm-arm/arm64/bitops.h
@@ -32,6 +32,17 @@ static /*__*/always_inline unsigned long __ffs(unsigned long word)
  */
 #define ffz(x)  __ffs(~(x))
 
+static inline int flsl(unsigned long x)
+{
+        int ret;
+
+        if (__builtin_constant_p(x))
+               return generic_flsl(x);
+
+        asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
+        return BITS_PER_LONG - ret;
+}
+
 /* Based on linux/include/asm-generic/bitops/find.h */
 
 #ifndef find_next_bit
diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
index 25f96c8..f2bb031 100644
--- a/xen/include/asm-arm/bitops.h
+++ b/xen/include/asm-arm/bitops.h
@@ -99,46 +99,17 @@ static inline int test_bit(int nr, const volatile void *addr)
         return 1UL & (p[BIT_WORD(nr)] >> (nr & (BITS_PER_WORD-1)));
 }
 
-static inline int constant_fls(int x)
-{
-        int r = 32;
-
-        if (!x)
-                return 0;
-        if (!(x & 0xffff0000u)) {
-                x <<= 16;
-                r -= 16;
-        }
-        if (!(x & 0xff000000u)) {
-                x <<= 8;
-                r -= 8;
-        }
-        if (!(x & 0xf0000000u)) {
-                x <<= 4;
-                r -= 4;
-        }
-        if (!(x & 0xc0000000u)) {
-                x <<= 2;
-                r -= 2;
-        }
-        if (!(x & 0x80000000u)) {
-                x <<= 1;
-                r -= 1;
-        }
-        return r;
-}
-
 /*
  * On ARMv5 and above those functions can be implemented around
  * the clz instruction for much better code efficiency.
  */
 
-static inline int fls(int x)
+static inline int fls(unsigned int x)
 {
         int ret;
 
         if (__builtin_constant_p(x))
-               return constant_fls(x);
+               return generic_fls(x);
 
         asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
         ret = BITS_PER_LONG - ret;
@@ -146,7 +117,8 @@ static inline int fls(int x)
 }
 
 
-#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
+#define ffs(x) ({ unsigned int __t = (x); fls(__t & -__t); })
+#define ffsl(x) ({ unsigned long __t = (x); flsl(__t & -__t); })
 
 /**
  * find_first_set_bit - find the first set bit in @word
@@ -157,7 +129,7 @@ static inline int fls(int x)
  */
 static inline unsigned int find_first_set_bit(unsigned long word)
 {
-        return ffs(word) - 1;
+        return ffsl(word) - 1;
 }
 
 /**
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 3e9ca00..099a74c 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -401,7 +401,7 @@ static inline unsigned int find_first_set_bit(unsigned long word)
  *
  * This is defined the same way as the libc and compiler builtin ffs routines.
  */
-static inline int ffs(unsigned long x)
+static inline int ffsl(unsigned long x)
 {
     long r;
 
@@ -412,13 +412,24 @@ static inline int ffs(unsigned long x)
     return (int)r+1;
 }
 
+static inline int ffs(unsigned int x)
+{
+    int r;
+
+    asm ( "bsf %1,%0\n\t"
+          "jnz 1f\n\t"
+          "mov $-1,%0\n"
+          "1:" : "=r" (r) : "rm" (x));
+    return r + 1;
+}
+
 /**
  * fls - find last bit set
  * @x: the word to search
  *
  * This is defined the same way as ffs.
  */
-static inline int fls(unsigned long x)
+static inline int flsl(unsigned long x)
 {
     long r;
 
@@ -429,8 +440,16 @@ static inline int fls(unsigned long x)
     return (int)r+1;
 }
 
-#define ffs64 ffs
-#define fls64 fls
+static inline int fls(unsigned int x)
+{
+    int r;
+
+    asm ( "bsr %1,%0\n\t"
+          "jnz 1f\n\t"
+          "mov $-1,%0\n"
+          "1:" : "=r" (r) : "rm" (x));
+    return r + 1;
+}
 
 /**
  * hweightN - returns the hamming weight of a N-bit word
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 6054155..cb56f24 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -70,20 +70,52 @@ static __inline__ int generic_fls(int x)
     return r;
 }
 
+#if BITS_PER_LONG == 64
+
+static inline int generic_ffsl(unsigned long x)
+{
+    return !x || (u32)x ? generic_ffs(x) : generic_ffs(x >> 32) + 32;
+}
+
+static inline int generic_flsl(unsigned long x)
+{
+    u32 h = x >> 32;
+
+    return h ? generic_fls(h) + 32 : generic_fls(x);
+}
+
+#else
+# define generic_ffsl generic_ffs
+# define generic_flsl generic_fls
+#endif
+
 /*
  * Include this here because some architectures need generic_ffs/fls in
  * scope
  */
 #include <asm/bitops.h>
 
-
+#if BITS_PER_LONG == 64
+# define fls64 flsl
+# define ffs64 ffsl
+#else
+# ifndef ffs64
+static inline int generic_ffs64(__u64 x)
+{
+    return !x || (__u32)x ? ffs(x) : ffs(x >> 32) + 32;
+}
+#  define ffs64 generic_ffs64
+# endif
+# ifndef fls64
 static inline int generic_fls64(__u64 x)
 {
     __u32 h = x >> 32;
-    if (h)
-        return fls(x) + 32;
-    return fls(x);
+
+    return h ? fls(h) + 32 : fls(x);
 }
+#  define fls64 generic_fls64
+# endif
+#endif
 
 static __inline__ int get_bitmask_order(unsigned int 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 Tue Feb 03 07:57:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYMu-0004GY-8O; Tue, 03 Feb 2015 07:57:56 +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 1YIYMs-0004GE-72
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:54 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	29/70-02753-18F70D45; Tue, 03 Feb 2015 07:57:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950272!7005260!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8957 invoked from network); 3 Feb 2015 07:57:52 -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;
	3 Feb 2015 07:57:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMp-0004y2-T9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMp-0006CR-R2
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:51 +0000
Date: Tue, 03 Feb 2015 07:57:51 +0000
Message-Id: <E1YIYMp-0006CR-R2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: fix fls()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e9c1747a25763c66de4a06923946c59a9f043069
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:02:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:02:39 2015 +0100

    arm64: fix fls()
    
    It using CLZ on a 64-bit register while specifying the input operand as
    only 32 bits wide is wrong: An operand intentionally shrunk down to 32
    bits at the source level doesn't imply respective zero extension also
    happens at the machine instruction level, and hence the wrong result
    could get returned.
    
    Add suitable inline assembly abstraction so that the function can
    remain shared between arm32 and arm64. The need to include asm_defns.h
    in bitops.h makes it necessary to adjust processor.h though - it is
    generally wrong to include public headers without making sure that
    integer types are properly defined. (I didn't innvestigate or try
    whether the possible alternative of moving the public/arch-arm.h
    inclusion down in the file would also work.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/asm_defns.h |    9 +++++++++
 xen/include/asm-arm/bitops.h    |    7 ++++---
 xen/include/asm-arm/processor.h |    5 +++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/xen/include/asm-arm/asm_defns.h b/xen/include/asm-arm/asm_defns.h
index 36e72ff..02be83e 100644
--- a/xen/include/asm-arm/asm_defns.h
+++ b/xen/include/asm-arm/asm_defns.h
@@ -7,6 +7,15 @@
 #endif
 #include <asm/processor.h>
 
+/* For generic assembly code: use macros to define operand sizes. */
+#if defined(CONFIG_ARM_32)
+# define __OP32
+#elif defined(CONFIG_ARM_64)
+# define __OP32 "w"
+#else
+# error "unknown ARM variant"
+#endif
+
 #endif /* __ARM_ASM_DEFNS_H__ */
 /*
  * Local variables:
diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
index f2bb031..bda8898 100644
--- a/xen/include/asm-arm/bitops.h
+++ b/xen/include/asm-arm/bitops.h
@@ -9,6 +9,8 @@
 #ifndef _ARM_BITOPS_H
 #define _ARM_BITOPS_H
 
+#include <asm/asm_defns.h>
+
 /*
  * Non-atomic bit manipulation.
  *
@@ -111,9 +113,8 @@ static inline int fls(unsigned int x)
         if (__builtin_constant_p(x))
                return generic_fls(x);
 
-        asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
-        ret = BITS_PER_LONG - ret;
-        return ret;
+        asm("clz\t%"__OP32"0, %"__OP32"1" : "=r" (ret) : "r" (x));
+        return 32 - ret;
 }
 
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index b7ef817..fcd26fb 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -3,6 +3,9 @@
 
 #include <asm/cpregs.h>
 #include <asm/sysregs.h>
+#ifndef __ASSEMBLY__
+#include <xen/types.h>
+#endif
 #include <public/arch-arm.h>
 
 /* MIDR Main ID Register */
@@ -220,8 +223,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/types.h>
-
 struct cpuinfo_arm {
     union {
         uint32_t bits;
--
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 Tue Feb 03 07:57:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:57: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 1YIYMu-0004GY-8O; Tue, 03 Feb 2015 07:57:56 +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 1YIYMs-0004GE-72
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:54 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	29/70-02753-18F70D45; Tue, 03 Feb 2015 07:57:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950272!7005260!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8957 invoked from network); 3 Feb 2015 07:57:52 -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;
	3 Feb 2015 07:57:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMp-0004y2-T9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYMp-0006CR-R2
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:57:51 +0000
Date: Tue, 03 Feb 2015 07:57:51 +0000
Message-Id: <E1YIYMp-0006CR-R2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: fix fls()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e9c1747a25763c66de4a06923946c59a9f043069
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:02:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:02:39 2015 +0100

    arm64: fix fls()
    
    It using CLZ on a 64-bit register while specifying the input operand as
    only 32 bits wide is wrong: An operand intentionally shrunk down to 32
    bits at the source level doesn't imply respective zero extension also
    happens at the machine instruction level, and hence the wrong result
    could get returned.
    
    Add suitable inline assembly abstraction so that the function can
    remain shared between arm32 and arm64. The need to include asm_defns.h
    in bitops.h makes it necessary to adjust processor.h though - it is
    generally wrong to include public headers without making sure that
    integer types are properly defined. (I didn't innvestigate or try
    whether the possible alternative of moving the public/arch-arm.h
    inclusion down in the file would also work.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/asm_defns.h |    9 +++++++++
 xen/include/asm-arm/bitops.h    |    7 ++++---
 xen/include/asm-arm/processor.h |    5 +++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/xen/include/asm-arm/asm_defns.h b/xen/include/asm-arm/asm_defns.h
index 36e72ff..02be83e 100644
--- a/xen/include/asm-arm/asm_defns.h
+++ b/xen/include/asm-arm/asm_defns.h
@@ -7,6 +7,15 @@
 #endif
 #include <asm/processor.h>
 
+/* For generic assembly code: use macros to define operand sizes. */
+#if defined(CONFIG_ARM_32)
+# define __OP32
+#elif defined(CONFIG_ARM_64)
+# define __OP32 "w"
+#else
+# error "unknown ARM variant"
+#endif
+
 #endif /* __ARM_ASM_DEFNS_H__ */
 /*
  * Local variables:
diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
index f2bb031..bda8898 100644
--- a/xen/include/asm-arm/bitops.h
+++ b/xen/include/asm-arm/bitops.h
@@ -9,6 +9,8 @@
 #ifndef _ARM_BITOPS_H
 #define _ARM_BITOPS_H
 
+#include <asm/asm_defns.h>
+
 /*
  * Non-atomic bit manipulation.
  *
@@ -111,9 +113,8 @@ static inline int fls(unsigned int x)
         if (__builtin_constant_p(x))
                return generic_fls(x);
 
-        asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
-        ret = BITS_PER_LONG - ret;
-        return ret;
+        asm("clz\t%"__OP32"0, %"__OP32"1" : "=r" (ret) : "r" (x));
+        return 32 - ret;
 }
 
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index b7ef817..fcd26fb 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -3,6 +3,9 @@
 
 #include <asm/cpregs.h>
 #include <asm/sysregs.h>
+#ifndef __ASSEMBLY__
+#include <xen/types.h>
+#endif
 #include <public/arch-arm.h>
 
 /* MIDR Main ID Register */
@@ -220,8 +223,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/types.h>
-
 struct cpuinfo_arm {
     union {
         uint32_t bits;
--
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 Tue Feb 03 07:58:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYN4-0004I3-BB; Tue, 03 Feb 2015 07:58: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 1YIYN3-0004Ho-2N
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:05 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	B4/C3-02991-C8F70D45; Tue, 03 Feb 2015 07:58:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1422950282!11614847!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10485 invoked from network); 3 Feb 2015 07:58:03 -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;
	3 Feb 2015 07:58: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 1YIYN0-0004ye-8j
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYN0-0006DU-2W
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:02 +0000
Date: Tue, 03 Feb 2015 07:58:02 +0000
Message-Id: <E1YIYN0-0006DU-2W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: replace plain number in
	hvm_combine_hw_exceptions()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81db678e4dff0a398fecb59fb92fa41df9954e9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:03:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:03:28 2015 +0100

    x86/HVM: replace plain number in hvm_combine_hw_exceptions()
    
    While doing so also take care of #VE here (even if we don't make use of
    it yet). Note that contributory_exceptions, other than the original
    0x7c01 constant, doesn't include #PF anymore, but the check where the
    variable is used is after one that already filtered out #PF.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: TIm Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/hvm.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c7984d1..24f3333 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -205,6 +205,16 @@ int hvm_event_needs_reinjection(uint8_t type, uint8_t vector)
  */
 uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
 {
+    const unsigned int contributory_exceptions =
+        (1 << TRAP_divide_error) |
+        (1 << TRAP_invalid_tss) |
+        (1 << TRAP_no_segment) |
+        (1 << TRAP_stack_error) |
+        (1 << TRAP_gp_fault);
+    const unsigned int page_faults =
+        (1 << TRAP_page_fault) |
+        (1 << TRAP_virtualisation);
+
     /* Exception during double-fault delivery always causes a triple fault. */
     if ( vec1 == TRAP_double_fault )
     {
@@ -213,11 +223,12 @@ uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
     }
 
     /* Exception during page-fault delivery always causes a double fault. */
-    if ( vec1 == TRAP_page_fault )
+    if ( (1u << vec1) & page_faults )
         return TRAP_double_fault;
 
     /* Discard the first exception if it's benign or if we now have a #PF. */
-    if ( !((1u << vec1) & 0x7c01u) || (vec2 == TRAP_page_fault) )
+    if ( !((1u << vec1) & contributory_exceptions) ||
+         ((1u << vec2) & page_faults) )
         return vec2;
 
     /* Cannot combine the exceptions: double fault. */
--
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 Tue Feb 03 07:58:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYN4-0004I3-BB; Tue, 03 Feb 2015 07:58: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 1YIYN3-0004Ho-2N
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:05 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	B4/C3-02991-C8F70D45; Tue, 03 Feb 2015 07:58:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1422950282!11614847!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10485 invoked from network); 3 Feb 2015 07:58:03 -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;
	3 Feb 2015 07:58: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 1YIYN0-0004ye-8j
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYN0-0006DU-2W
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:02 +0000
Date: Tue, 03 Feb 2015 07:58:02 +0000
Message-Id: <E1YIYN0-0006DU-2W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: replace plain number in
	hvm_combine_hw_exceptions()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81db678e4dff0a398fecb59fb92fa41df9954e9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:03:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:03:28 2015 +0100

    x86/HVM: replace plain number in hvm_combine_hw_exceptions()
    
    While doing so also take care of #VE here (even if we don't make use of
    it yet). Note that contributory_exceptions, other than the original
    0x7c01 constant, doesn't include #PF anymore, but the check where the
    variable is used is after one that already filtered out #PF.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: TIm Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/hvm.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c7984d1..24f3333 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -205,6 +205,16 @@ int hvm_event_needs_reinjection(uint8_t type, uint8_t vector)
  */
 uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
 {
+    const unsigned int contributory_exceptions =
+        (1 << TRAP_divide_error) |
+        (1 << TRAP_invalid_tss) |
+        (1 << TRAP_no_segment) |
+        (1 << TRAP_stack_error) |
+        (1 << TRAP_gp_fault);
+    const unsigned int page_faults =
+        (1 << TRAP_page_fault) |
+        (1 << TRAP_virtualisation);
+
     /* Exception during double-fault delivery always causes a triple fault. */
     if ( vec1 == TRAP_double_fault )
     {
@@ -213,11 +223,12 @@ uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
     }
 
     /* Exception during page-fault delivery always causes a double fault. */
-    if ( vec1 == TRAP_page_fault )
+    if ( (1u << vec1) & page_faults )
         return TRAP_double_fault;
 
     /* Discard the first exception if it's benign or if we now have a #PF. */
-    if ( !((1u << vec1) & 0x7c01u) || (vec2 == TRAP_page_fault) )
+    if ( !((1u << vec1) & contributory_exceptions) ||
+         ((1u << vec2) & page_faults) )
         return vec2;
 
     /* Cannot combine the exceptions: double fault. */
--
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 Tue Feb 03 07:58:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYND-0004JP-Dk; Tue, 03 Feb 2015 07:58:15 +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 1YIYND-0004JI-1O
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:15 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	72/58-02898-69F70D45; Tue, 03 Feb 2015 07:58:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1422950292!11614901!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11805 invoked from network); 3 Feb 2015 07:58:13 -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;
	3 Feb 2015 07:58:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNA-0004yk-F0
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNA-0006Dx-Dw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:12 +0000
Date: Tue, 03 Feb 2015 07:58:12 +0000
Message-Id: <E1YIYNA-0006Dx-Dw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: replace plain numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf9112514ed535e4aa30760d03add6708a7dc9c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:04:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:04:26 2015 +0100

    x86/traps: replace plain numbers
    
    ... making the code better document itself. No functional change
    intended.
    
    Note that for now (as we don't support RTM yet) DR_STATUS_RESERVED_ONE
    and its users don't take DR_NOT_RTM into consideration yet.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c           |    8 ++++----
 xen/include/asm-x86/debugreg.h |    2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 322ebf4..ec324b0 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -531,9 +531,9 @@ static void instruction_done(
     regs->eflags &= ~X86_EFLAGS_RF;
     if ( bpmatch || (regs->eflags & X86_EFLAGS_TF) )
     {
-        current->arch.debugreg[6] |= bpmatch | 0xffff0ff0;
+        current->arch.debugreg[6] |= bpmatch | DR_STATUS_RESERVED_ONE;
         if ( regs->eflags & X86_EFLAGS_TF )
-            current->arch.debugreg[6] |= 0x4000;
+            current->arch.debugreg[6] |= DR_STEP;
         do_guest_trap(TRAP_debug, regs, 0);
     }
 }
@@ -3872,8 +3872,8 @@ long set_debugreg(struct vcpu *v, unsigned int reg, unsigned long value)
          * DR6: Bits 4-11,16-31 reserved (set to 1).
          *      Bit 12 reserved (set to 0).
          */
-        value &= 0xffffefff; /* reserved bits => 0 */
-        value |= 0xffff0ff0; /* reserved bits => 1 */
+        value &= ~DR_STATUS_RESERVED_ZERO; /* reserved bits => 0 */
+        value |=  DR_STATUS_RESERVED_ONE;  /* reserved bits => 1 */
         if ( v == curr ) 
             write_debugreg(6, value);
         break;
diff --git a/xen/include/asm-x86/debugreg.h b/xen/include/asm-x86/debugreg.h
index a5b2838..c57914e 100644
--- a/xen/include/asm-x86/debugreg.h
+++ b/xen/include/asm-x86/debugreg.h
@@ -21,6 +21,8 @@
 #define DR_STEP         (0x4000)        /* single-step */
 #define DR_SWITCH       (0x8000)        /* task switch */
 #define DR_NOT_RTM      (0x10000)       /* clear: #BP inside RTM region */
+#define DR_STATUS_RESERVED_ZERO (~0xffffeffful) /* Reserved, read as zero */
+#define DR_STATUS_RESERVED_ONE  0xffff0ff0ul /* Reserved, read as one */
 
 /* Now define a bunch of things for manipulating the control register.
    The top two bytes of the control register consist of 4 fields of 4
--
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 Tue Feb 03 07:58:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYND-0004JP-Dk; Tue, 03 Feb 2015 07:58:15 +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 1YIYND-0004JI-1O
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:15 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	72/58-02898-69F70D45; Tue, 03 Feb 2015 07:58:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1422950292!11614901!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11805 invoked from network); 3 Feb 2015 07:58:13 -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;
	3 Feb 2015 07:58:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNA-0004yk-F0
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNA-0006Dx-Dw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:12 +0000
Date: Tue, 03 Feb 2015 07:58:12 +0000
Message-Id: <E1YIYNA-0006Dx-Dw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: replace plain numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf9112514ed535e4aa30760d03add6708a7dc9c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:04:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:04:26 2015 +0100

    x86/traps: replace plain numbers
    
    ... making the code better document itself. No functional change
    intended.
    
    Note that for now (as we don't support RTM yet) DR_STATUS_RESERVED_ONE
    and its users don't take DR_NOT_RTM into consideration yet.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c           |    8 ++++----
 xen/include/asm-x86/debugreg.h |    2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 322ebf4..ec324b0 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -531,9 +531,9 @@ static void instruction_done(
     regs->eflags &= ~X86_EFLAGS_RF;
     if ( bpmatch || (regs->eflags & X86_EFLAGS_TF) )
     {
-        current->arch.debugreg[6] |= bpmatch | 0xffff0ff0;
+        current->arch.debugreg[6] |= bpmatch | DR_STATUS_RESERVED_ONE;
         if ( regs->eflags & X86_EFLAGS_TF )
-            current->arch.debugreg[6] |= 0x4000;
+            current->arch.debugreg[6] |= DR_STEP;
         do_guest_trap(TRAP_debug, regs, 0);
     }
 }
@@ -3872,8 +3872,8 @@ long set_debugreg(struct vcpu *v, unsigned int reg, unsigned long value)
          * DR6: Bits 4-11,16-31 reserved (set to 1).
          *      Bit 12 reserved (set to 0).
          */
-        value &= 0xffffefff; /* reserved bits => 0 */
-        value |= 0xffff0ff0; /* reserved bits => 1 */
+        value &= ~DR_STATUS_RESERVED_ZERO; /* reserved bits => 0 */
+        value |=  DR_STATUS_RESERVED_ONE;  /* reserved bits => 1 */
         if ( v == curr ) 
             write_debugreg(6, value);
         break;
diff --git a/xen/include/asm-x86/debugreg.h b/xen/include/asm-x86/debugreg.h
index a5b2838..c57914e 100644
--- a/xen/include/asm-x86/debugreg.h
+++ b/xen/include/asm-x86/debugreg.h
@@ -21,6 +21,8 @@
 #define DR_STEP         (0x4000)        /* single-step */
 #define DR_SWITCH       (0x8000)        /* task switch */
 #define DR_NOT_RTM      (0x10000)       /* clear: #BP inside RTM region */
+#define DR_STATUS_RESERVED_ZERO (~0xffffeffful) /* Reserved, read as zero */
+#define DR_STATUS_RESERVED_ONE  0xffff0ff0ul /* Reserved, read as one */
 
 /* Now define a bunch of things for manipulating the control register.
    The top two bytes of the control register consist of 4 fields of 4
--
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 Tue Feb 03 07:58:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYNO-0004LH-J0; Tue, 03 Feb 2015 07:58: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 1YIYNN-0004LA-Fw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:25 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	86/62-03168-0AF70D45; Tue, 03 Feb 2015 07:58:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950302!12415575!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8095 invoked from network); 3 Feb 2015 07:58:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:58:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNK-0004yq-Mw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNK-0006EQ-JR
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:22 +0000
Date: Tue, 03 Feb 2015 07:58:22 +0000
Message-Id: <E1YIYNK-0006EQ-JR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: replace plain numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a661fe8f0a1a2df99d5328d06d1eef42ef117ac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:05:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:05:08 2015 +0100

    VMX: replace plain numbers
    
    ... making the code better document itself. No functional change
    intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        |   37 +++++++++++++++++++++++++------------
 xen/arch/x86/hvm/vmx/vvmx.c       |   18 ++++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h |    4 +++-
 3 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a5a59c4..8612601 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1406,7 +1406,9 @@ static void __vmx_inject_exception(int trap, int type, int error_code)
      *   VM entry]", PRM Vol. 3, 22.6.1 (Interruptibility State).
      */
 
-    intr_fields = (INTR_INFO_VALID_MASK | (type<<8) | trap);
+    intr_fields = INTR_INFO_VALID_MASK |
+                  MASK_INSR(type, INTR_INFO_INTR_TYPE_MASK) |
+                  MASK_INSR(trap, INTR_INFO_VECTOR_MASK);
     if ( error_code != HVM_DELIVER_NO_ERROR_CODE ) {
         __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
         intr_fields |= INTR_INFO_DELIVER_CODE_MASK;
@@ -1430,7 +1432,9 @@ void vmx_inject_extint(int trap, uint8_t source)
                                      PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_EXT_INTR_MASK ) {
             nvmx_enqueue_n2_exceptions (v, 
-               INTR_INFO_VALID_MASK | (X86_EVENTTYPE_EXT_INTR<<8) | trap,
+               INTR_INFO_VALID_MASK |
+               MASK_INSR(X86_EVENTTYPE_EXT_INTR, INTR_INFO_INTR_TYPE_MASK) |
+               MASK_INSR(trap, INTR_INFO_VECTOR_MASK),
                HVM_DELIVER_NO_ERROR_CODE, source);
             return;
         }
@@ -1449,7 +1453,9 @@ void vmx_inject_nmi(void)
                                      PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_NMI_EXITING ) {
             nvmx_enqueue_n2_exceptions (v, 
-               INTR_INFO_VALID_MASK | (X86_EVENTTYPE_NMI<<8) | TRAP_nmi,
+               INTR_INFO_VALID_MASK |
+               MASK_INSR(X86_EVENTTYPE_NMI, INTR_INFO_INTR_TYPE_MASK) |
+               MASK_INSR(TRAP_nmi, INTR_INFO_VECTOR_MASK),
                HVM_DELIVER_NO_ERROR_CODE, hvm_intsrc_nmi);
             return;
         }
@@ -1487,7 +1493,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
         if ( guest_cpu_user_regs()->eflags & X86_EFLAGS_TF )
         {
             __restore_debug_registers(curr);
-            write_debugreg(6, read_debugreg(6) | 0x4000);
+            write_debugreg(6, read_debugreg(6) | DR_STEP);
         }
         if ( cpu_has_monitor_trap_flag )
             break;
@@ -1502,7 +1508,8 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     }
 
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
-         (((intr_info >> 8) & 7) == X86_EVENTTYPE_HW_EXCEPTION) )
+         (MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) ==
+          X86_EVENTTYPE_HW_EXCEPTION) )
     {
         _trap.vector = hvm_combine_hw_exceptions(
             (uint8_t)intr_info, _trap.vector);
@@ -1517,7 +1524,9 @@ static void vmx_inject_trap(struct hvm_trap *trap)
          nvmx_intercepts_exception(curr, _trap.vector, _trap.error_code) )
     {
         nvmx_enqueue_n2_exceptions (curr, 
-            INTR_INFO_VALID_MASK | (_trap.type<<8) | _trap.vector,
+            INTR_INFO_VALID_MASK |
+            MASK_INSR(_trap.type, INTR_INFO_INTR_TYPE_MASK) |
+            MASK_INSR(_trap.vector, INTR_INFO_VECTOR_MASK),
             _trap.error_code, hvm_intsrc_none);
         return;
     }
@@ -1976,8 +1985,11 @@ static int vmx_cr_access(unsigned long exit_qualification)
     }
     case VMX_CONTROL_REG_ACCESS_TYPE_LMSW: {
         unsigned long value = curr->arch.hvm_vcpu.guest_cr[0];
-        /* LMSW can: (1) set bits 0-3; (2) clear bits 1-3. */
-        value = (value & ~0xe) | ((exit_qualification >> 16) & 0xf);
+
+        /* LMSW can (1) set PE; (2) set or clear MP, EM, and TS. */
+        value = (value & ~(X86_CR0_MP|X86_CR0_EM|X86_CR0_TS)) |
+                (VMX_CONTROL_REG_ACCESS_DATA(exit_qualification) &
+                 (X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS));
         HVMTRACE_LONG_1D(LMSW, value);
         return hvm_set_cr0(value);
     }
@@ -2803,7 +2815,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              */
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
-            write_debugreg(6, exit_qualification | 0xffff0ff0);
+            write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
                 goto exit_and_crash;
             domain_pause_for_debugger();
@@ -2872,8 +2884,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
         case TRAP_nmi:
-            if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
-                 (X86_EVENTTYPE_NMI << 8) )
+            if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) !=
+                 X86_EVENTTYPE_NMI )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
             /* Already handled above. */
@@ -2924,7 +2936,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
          *  - TSW is a vectored event due to a SW exception or SW interrupt.
          */
         inst_len = ((source != 3) ||        /* CALL, IRET, or JMP? */
-                    (idtv_info & (1u<<10))) /* IntrType > 3? */
+                    (MASK_EXTR(idtv_info, INTR_INFO_INTR_TYPE_MASK)
+                     > 3)) /* IntrType > 3? */
             ? get_instruction_length() /* Safe: SDM 3B 23.2.4 */ : 0;
         if ( (source == 3) && (idtv_info & INTR_INFO_DELIVER_CODE_MASK) )
             __vmread(IDT_VECTORING_ERROR_CODE, &ecode);
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 91e6ae4..ac6e3b3 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1272,7 +1272,7 @@ static void sync_exception_state(struct vcpu *v)
     if ( !(nvmx->intr.intr_info & INTR_INFO_VALID_MASK) )
         return;
 
-    switch ( (nvmx->intr.intr_info & INTR_INFO_INTR_TYPE_MASK) >> 8 )
+    switch ( MASK_EXTR(nvmx->intr.intr_info, INTR_INFO_INTR_TYPE_MASK) )
     {
     case X86_EVENTTYPE_EXT_INTR:
         /* rename exit_reason to EXTERNAL_INTERRUPT */
@@ -1327,10 +1327,10 @@ static void nvmx_update_apicv(struct vcpu *v)
         ppr = vlapic_set_ppr(vlapic);
         WARN_ON((ppr & 0xf0) != (vector & 0xf0));
 
-        status = vector << 8;
+        status = vector << VMX_GUEST_INTR_STATUS_SVI_OFFSET;
         rvi = vlapic_has_pending_irq(v);
         if ( rvi != -1 )
-            status |= rvi & 0xff;
+            status |= rvi & VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK;
 
         __vmwrite(GUEST_INTR_STATUS, status);
     }
@@ -2161,7 +2161,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     case EXIT_REASON_EXCEPTION_NMI:
     {
         unsigned long intr_info;
-        u32 valid_mask = (X86_EVENTTYPE_HW_EXCEPTION << 8) |
+        u32 valid_mask = MASK_INSR(X86_EVENTTYPE_HW_EXCEPTION,
+                                  INTR_INFO_INTR_TYPE_MASK) |
                          INTR_INFO_VALID_MASK;
         u64 exec_bitmap;
         int vector;
@@ -2350,8 +2351,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         u32 mask = 0;
 
         __vmread(EXIT_QUALIFICATION, &exit_qualification);
-        cr = exit_qualification & 0xf;
-        write = (exit_qualification >> 4) & 3;
+        cr = VMX_CONTROL_REG_ACCESS_NUM(exit_qualification);
+        write = VMX_CONTROL_REG_ACCESS_TYPE(exit_qualification);
         /* also according to guest exec_control */
         ctrl = __n2_exec_control(v);
 
@@ -2443,8 +2444,9 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                 u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
 
                 __vmread(CR0_READ_SHADOW, &old_val);
-                old_val &= 0xf;
-                val = (exit_qualification >> 16) & 0xf;
+                old_val &= X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS;
+                val = VMX_CONTROL_REG_ACCESS_DATA(exit_qualification) &
+                      (X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS);
                 changed_bits = old_val ^ val;
                 if ( changed_bits & cr0_gh_mask )
                     nvcpu->nv_vmexit_pending = 1;
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index c8bb548..91c5e18 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -207,8 +207,10 @@ static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 # define VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR 1
 # define VMX_CONTROL_REG_ACCESS_TYPE_CLTS        2
 # define VMX_CONTROL_REG_ACCESS_TYPE_LMSW        3
- /* 10:8 - general purpose register operand */
+ /* 11:8 - general purpose register operand */
 #define VMX_CONTROL_REG_ACCESS_GPR(eq)  (((eq) >> 8) & 0xf)
+ /* 31:16 - LMSW source data */
+#define VMX_CONTROL_REG_ACCESS_DATA(eq)  ((uint32_t)(eq) >> 16)
 
 /*
  * Access Rights
--
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 Tue Feb 03 07:58:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYNO-0004LH-J0; Tue, 03 Feb 2015 07:58: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 1YIYNN-0004LA-Fw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:25 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	86/62-03168-0AF70D45; Tue, 03 Feb 2015 07:58:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950302!12415575!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8095 invoked from network); 3 Feb 2015 07:58:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:58:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNK-0004yq-Mw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNK-0006EQ-JR
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:22 +0000
Date: Tue, 03 Feb 2015 07:58:22 +0000
Message-Id: <E1YIYNK-0006EQ-JR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: replace plain numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a661fe8f0a1a2df99d5328d06d1eef42ef117ac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:05:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:05:08 2015 +0100

    VMX: replace plain numbers
    
    ... making the code better document itself. No functional change
    intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        |   37 +++++++++++++++++++++++++------------
 xen/arch/x86/hvm/vmx/vvmx.c       |   18 ++++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h |    4 +++-
 3 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a5a59c4..8612601 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1406,7 +1406,9 @@ static void __vmx_inject_exception(int trap, int type, int error_code)
      *   VM entry]", PRM Vol. 3, 22.6.1 (Interruptibility State).
      */
 
-    intr_fields = (INTR_INFO_VALID_MASK | (type<<8) | trap);
+    intr_fields = INTR_INFO_VALID_MASK |
+                  MASK_INSR(type, INTR_INFO_INTR_TYPE_MASK) |
+                  MASK_INSR(trap, INTR_INFO_VECTOR_MASK);
     if ( error_code != HVM_DELIVER_NO_ERROR_CODE ) {
         __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
         intr_fields |= INTR_INFO_DELIVER_CODE_MASK;
@@ -1430,7 +1432,9 @@ void vmx_inject_extint(int trap, uint8_t source)
                                      PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_EXT_INTR_MASK ) {
             nvmx_enqueue_n2_exceptions (v, 
-               INTR_INFO_VALID_MASK | (X86_EVENTTYPE_EXT_INTR<<8) | trap,
+               INTR_INFO_VALID_MASK |
+               MASK_INSR(X86_EVENTTYPE_EXT_INTR, INTR_INFO_INTR_TYPE_MASK) |
+               MASK_INSR(trap, INTR_INFO_VECTOR_MASK),
                HVM_DELIVER_NO_ERROR_CODE, source);
             return;
         }
@@ -1449,7 +1453,9 @@ void vmx_inject_nmi(void)
                                      PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_NMI_EXITING ) {
             nvmx_enqueue_n2_exceptions (v, 
-               INTR_INFO_VALID_MASK | (X86_EVENTTYPE_NMI<<8) | TRAP_nmi,
+               INTR_INFO_VALID_MASK |
+               MASK_INSR(X86_EVENTTYPE_NMI, INTR_INFO_INTR_TYPE_MASK) |
+               MASK_INSR(TRAP_nmi, INTR_INFO_VECTOR_MASK),
                HVM_DELIVER_NO_ERROR_CODE, hvm_intsrc_nmi);
             return;
         }
@@ -1487,7 +1493,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
         if ( guest_cpu_user_regs()->eflags & X86_EFLAGS_TF )
         {
             __restore_debug_registers(curr);
-            write_debugreg(6, read_debugreg(6) | 0x4000);
+            write_debugreg(6, read_debugreg(6) | DR_STEP);
         }
         if ( cpu_has_monitor_trap_flag )
             break;
@@ -1502,7 +1508,8 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     }
 
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
-         (((intr_info >> 8) & 7) == X86_EVENTTYPE_HW_EXCEPTION) )
+         (MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) ==
+          X86_EVENTTYPE_HW_EXCEPTION) )
     {
         _trap.vector = hvm_combine_hw_exceptions(
             (uint8_t)intr_info, _trap.vector);
@@ -1517,7 +1524,9 @@ static void vmx_inject_trap(struct hvm_trap *trap)
          nvmx_intercepts_exception(curr, _trap.vector, _trap.error_code) )
     {
         nvmx_enqueue_n2_exceptions (curr, 
-            INTR_INFO_VALID_MASK | (_trap.type<<8) | _trap.vector,
+            INTR_INFO_VALID_MASK |
+            MASK_INSR(_trap.type, INTR_INFO_INTR_TYPE_MASK) |
+            MASK_INSR(_trap.vector, INTR_INFO_VECTOR_MASK),
             _trap.error_code, hvm_intsrc_none);
         return;
     }
@@ -1976,8 +1985,11 @@ static int vmx_cr_access(unsigned long exit_qualification)
     }
     case VMX_CONTROL_REG_ACCESS_TYPE_LMSW: {
         unsigned long value = curr->arch.hvm_vcpu.guest_cr[0];
-        /* LMSW can: (1) set bits 0-3; (2) clear bits 1-3. */
-        value = (value & ~0xe) | ((exit_qualification >> 16) & 0xf);
+
+        /* LMSW can (1) set PE; (2) set or clear MP, EM, and TS. */
+        value = (value & ~(X86_CR0_MP|X86_CR0_EM|X86_CR0_TS)) |
+                (VMX_CONTROL_REG_ACCESS_DATA(exit_qualification) &
+                 (X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS));
         HVMTRACE_LONG_1D(LMSW, value);
         return hvm_set_cr0(value);
     }
@@ -2803,7 +2815,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              */
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
-            write_debugreg(6, exit_qualification | 0xffff0ff0);
+            write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
                 goto exit_and_crash;
             domain_pause_for_debugger();
@@ -2872,8 +2884,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
         case TRAP_nmi:
-            if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
-                 (X86_EVENTTYPE_NMI << 8) )
+            if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) !=
+                 X86_EVENTTYPE_NMI )
                 goto exit_and_crash;
             HVMTRACE_0D(NMI);
             /* Already handled above. */
@@ -2924,7 +2936,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
          *  - TSW is a vectored event due to a SW exception or SW interrupt.
          */
         inst_len = ((source != 3) ||        /* CALL, IRET, or JMP? */
-                    (idtv_info & (1u<<10))) /* IntrType > 3? */
+                    (MASK_EXTR(idtv_info, INTR_INFO_INTR_TYPE_MASK)
+                     > 3)) /* IntrType > 3? */
             ? get_instruction_length() /* Safe: SDM 3B 23.2.4 */ : 0;
         if ( (source == 3) && (idtv_info & INTR_INFO_DELIVER_CODE_MASK) )
             __vmread(IDT_VECTORING_ERROR_CODE, &ecode);
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 91e6ae4..ac6e3b3 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1272,7 +1272,7 @@ static void sync_exception_state(struct vcpu *v)
     if ( !(nvmx->intr.intr_info & INTR_INFO_VALID_MASK) )
         return;
 
-    switch ( (nvmx->intr.intr_info & INTR_INFO_INTR_TYPE_MASK) >> 8 )
+    switch ( MASK_EXTR(nvmx->intr.intr_info, INTR_INFO_INTR_TYPE_MASK) )
     {
     case X86_EVENTTYPE_EXT_INTR:
         /* rename exit_reason to EXTERNAL_INTERRUPT */
@@ -1327,10 +1327,10 @@ static void nvmx_update_apicv(struct vcpu *v)
         ppr = vlapic_set_ppr(vlapic);
         WARN_ON((ppr & 0xf0) != (vector & 0xf0));
 
-        status = vector << 8;
+        status = vector << VMX_GUEST_INTR_STATUS_SVI_OFFSET;
         rvi = vlapic_has_pending_irq(v);
         if ( rvi != -1 )
-            status |= rvi & 0xff;
+            status |= rvi & VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK;
 
         __vmwrite(GUEST_INTR_STATUS, status);
     }
@@ -2161,7 +2161,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     case EXIT_REASON_EXCEPTION_NMI:
     {
         unsigned long intr_info;
-        u32 valid_mask = (X86_EVENTTYPE_HW_EXCEPTION << 8) |
+        u32 valid_mask = MASK_INSR(X86_EVENTTYPE_HW_EXCEPTION,
+                                  INTR_INFO_INTR_TYPE_MASK) |
                          INTR_INFO_VALID_MASK;
         u64 exec_bitmap;
         int vector;
@@ -2350,8 +2351,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         u32 mask = 0;
 
         __vmread(EXIT_QUALIFICATION, &exit_qualification);
-        cr = exit_qualification & 0xf;
-        write = (exit_qualification >> 4) & 3;
+        cr = VMX_CONTROL_REG_ACCESS_NUM(exit_qualification);
+        write = VMX_CONTROL_REG_ACCESS_TYPE(exit_qualification);
         /* also according to guest exec_control */
         ctrl = __n2_exec_control(v);
 
@@ -2443,8 +2444,9 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                 u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
 
                 __vmread(CR0_READ_SHADOW, &old_val);
-                old_val &= 0xf;
-                val = (exit_qualification >> 16) & 0xf;
+                old_val &= X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS;
+                val = VMX_CONTROL_REG_ACCESS_DATA(exit_qualification) &
+                      (X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS);
                 changed_bits = old_val ^ val;
                 if ( changed_bits & cr0_gh_mask )
                     nvcpu->nv_vmexit_pending = 1;
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index c8bb548..91c5e18 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -207,8 +207,10 @@ static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 # define VMX_CONTROL_REG_ACCESS_TYPE_MOV_FROM_CR 1
 # define VMX_CONTROL_REG_ACCESS_TYPE_CLTS        2
 # define VMX_CONTROL_REG_ACCESS_TYPE_LMSW        3
- /* 10:8 - general purpose register operand */
+ /* 11:8 - general purpose register operand */
 #define VMX_CONTROL_REG_ACCESS_GPR(eq)  (((eq) >> 8) & 0xf)
+ /* 31:16 - LMSW source data */
+#define VMX_CONTROL_REG_ACCESS_DATA(eq)  ((uint32_t)(eq) >> 16)
 
 /*
  * Access Rights
--
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 Tue Feb 03 07:58:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYNX-0004Mb-Lf; Tue, 03 Feb 2015 07:58:35 +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 1YIYNX-0004MS-4X
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:35 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	5E/86-25903-AAF70D45; Tue, 03 Feb 2015 07:58:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1422950313!3205715!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18894 invoked from network); 3 Feb 2015 07:58:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:58: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 1YIYNU-0004yy-Sx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNU-0006Et-RL
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:32 +0000
Date: Tue, 03 Feb 2015 07:58:32 +0000
Message-Id: <E1YIYNU-0006Et-RL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant-table: use uint16_t consistently
	for grant copy offset and length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b7f74a19fe099e373ad52e4218c466f3e91b5f43
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Fri Jan 23 15:05:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:05:48 2015 +0100

    grant-table: use uint16_t consistently for grant copy offset and length
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index fe52b63..fb9d8f7 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1882,7 +1882,7 @@ static int
 __acquire_grant_for_copy(
     struct domain *rd, unsigned long gref, domid_t ldom, int readonly,
     unsigned long *frame, struct page_info **page, 
-    unsigned *page_off, unsigned *length, unsigned allow_transitive)
+    uint16_t *page_off, uint16_t *length, unsigned allow_transitive)
 {
     struct grant_table *rgt = rd->grant_table;
     grant_entry_v1_t *sha1;
@@ -1895,8 +1895,8 @@ __acquire_grant_for_copy(
     grant_ref_t trans_gref;
     struct domain *td;
     unsigned long grant_frame;
-    unsigned trans_page_off;
-    unsigned trans_length;
+    uint16_t trans_page_off;
+    uint16_t trans_length;
     int is_sub_page;
     s16 rc = GNTST_okay;
 
@@ -2122,7 +2122,7 @@ __gnttab_copy(
 
     if ( src_is_gref )
     {
-        unsigned source_off, source_len;
+        uint16_t source_off, source_len;
         rc = __acquire_grant_for_copy(sd, op->source.u.ref,
                                       current->domain->domain_id, 1,
                                       &s_frame, &s_pg,
@@ -2147,7 +2147,7 @@ __gnttab_copy(
 
     if ( dest_is_gref )
     {
-        unsigned dest_off, dest_len;
+        uint16_t dest_off, dest_len;
         rc = __acquire_grant_for_copy(dd, op->dest.u.ref,
                                       current->domain->domain_id, 0,
                                       &d_frame, &d_pg, &dest_off, &dest_len, 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 Tue Feb 03 07:58:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYNX-0004Mb-Lf; Tue, 03 Feb 2015 07:58:35 +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 1YIYNX-0004MS-4X
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:35 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	5E/86-25903-AAF70D45; Tue, 03 Feb 2015 07:58:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1422950313!3205715!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18894 invoked from network); 3 Feb 2015 07:58:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 07:58: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 1YIYNU-0004yy-Sx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNU-0006Et-RL
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:32 +0000
Date: Tue, 03 Feb 2015 07:58:32 +0000
Message-Id: <E1YIYNU-0006Et-RL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant-table: use uint16_t consistently
	for grant copy offset and length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b7f74a19fe099e373ad52e4218c466f3e91b5f43
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Fri Jan 23 15:05:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:05:48 2015 +0100

    grant-table: use uint16_t consistently for grant copy offset and length
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index fe52b63..fb9d8f7 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1882,7 +1882,7 @@ static int
 __acquire_grant_for_copy(
     struct domain *rd, unsigned long gref, domid_t ldom, int readonly,
     unsigned long *frame, struct page_info **page, 
-    unsigned *page_off, unsigned *length, unsigned allow_transitive)
+    uint16_t *page_off, uint16_t *length, unsigned allow_transitive)
 {
     struct grant_table *rgt = rd->grant_table;
     grant_entry_v1_t *sha1;
@@ -1895,8 +1895,8 @@ __acquire_grant_for_copy(
     grant_ref_t trans_gref;
     struct domain *td;
     unsigned long grant_frame;
-    unsigned trans_page_off;
-    unsigned trans_length;
+    uint16_t trans_page_off;
+    uint16_t trans_length;
     int is_sub_page;
     s16 rc = GNTST_okay;
 
@@ -2122,7 +2122,7 @@ __gnttab_copy(
 
     if ( src_is_gref )
     {
-        unsigned source_off, source_len;
+        uint16_t source_off, source_len;
         rc = __acquire_grant_for_copy(sd, op->source.u.ref,
                                       current->domain->domain_id, 1,
                                       &s_frame, &s_pg,
@@ -2147,7 +2147,7 @@ __gnttab_copy(
 
     if ( dest_is_gref )
     {
-        unsigned dest_off, dest_len;
+        uint16_t dest_off, dest_len;
         rc = __acquire_grant_for_copy(dd, op->dest.u.ref,
                                       current->domain->domain_id, 0,
                                       &d_frame, &d_pg, &dest_off, &dest_len, 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 Tue Feb 03 07:58:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYNi-0004OE-OS; Tue, 03 Feb 2015 07:58:46 +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 1YIYNh-0004Nz-Do
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:45 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C3/B5-02749-4BF70D45; Tue, 03 Feb 2015 07:58:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950323!12128751!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24457 invoked from network); 3 Feb 2015 07:58:43 -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;
	3 Feb 2015 07:58:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNf-0004z4-14
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNf-0006Fs-0D
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:43 +0000
Date: Tue, 03 Feb 2015 07:58:43 +0000
Message-Id: <E1YIYNf-0006Fs-0D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] handle XENMEM_get_vnumainfo in
	compat_memory_op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5f6ec28f2c3c3ba17a0b7f2a1d98324665420f46
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jan 23 15:06:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:06:26 2015 +0100

    handle XENMEM_get_vnumainfo in compat_memory_op
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/compat/memory.c |   48 ++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xlat.lst       |    2 +
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 06c90be..b258138 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -15,6 +15,7 @@ CHECK_TYPE(domid);
 #undef xen_domid_t
 
 CHECK_mem_access_op;
+CHECK_vmemrange;
 
 int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
@@ -32,12 +33,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             struct xen_add_to_physmap *atp;
             struct xen_add_to_physmap_batch *atpb;
             struct xen_remove_from_physmap *xrfp;
+            struct xen_vnuma_topology_info *vnuma;
         } nat;
         union {
             struct compat_memory_reservation rsrv;
             struct compat_memory_exchange xchg;
             struct compat_add_to_physmap atp;
             struct compat_add_to_physmap_batch atpb;
+            struct compat_vnuma_topology_info vnuma;
         } cmp;
 
         set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
@@ -273,13 +276,50 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+        case XENMEM_get_vnumainfo:
+        {
+            enum XLAT_vnuma_topology_info_vdistance vdistance =
+                XLAT_vnuma_topology_info_vdistance_h;
+            enum XLAT_vnuma_topology_info_vcpu_to_vnode vcpu_to_vnode =
+                XLAT_vnuma_topology_info_vcpu_to_vnode_h;
+            enum XLAT_vnuma_topology_info_vmemrange vmemrange =
+                XLAT_vnuma_topology_info_vmemrange_h;
+
+            if ( copy_from_guest(&cmp.vnuma, compat, 1) )
+                return -EFAULT;
+
+#define XLAT_vnuma_topology_info_HNDL_vdistance_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vdistance.h, (_s_)->vdistance.h)
+#define XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vcpu_to_vnode.h, (_s_)->vcpu_to_vnode.h)
+#define XLAT_vnuma_topology_info_HNDL_vmemrange_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vmemrange.h, (_s_)->vmemrange.h)
+
+            XLAT_vnuma_topology_info(nat.vnuma, &cmp.vnuma);
+
+#undef XLAT_vnuma_topology_info_HNDL_vdistance_h
+#undef XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h
+#undef XLAT_vnuma_topology_info_HNDL_vmemrange_h
+            break;
+        }
+
         default:
             return compat_arch_memory_op(cmd, compat);
         }
 
         rc = do_memory_op(cmd, nat.hnd);
         if ( rc < 0 )
+        {
+            if ( rc == -ENOBUFS && op == XENMEM_get_vnumainfo )
+            {
+                cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+                cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+                cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+                if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                    rc = -EFAULT;
+            }
             break;
+        }
 
         cmd = 0;
         if ( hypercall_xlat_continuation(&cmd, 2, 0x02, nat.hnd, compat) )
@@ -398,6 +438,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_remove_from_physmap:
             break;
 
+        case XENMEM_get_vnumainfo:
+            cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+            cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+            cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+            if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                rc = -EFAULT;
+            break;
+
         default:
             domain_crash(current->domain);
             split = 0;
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 41b3e35..9c9fd9a 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -64,6 +64,8 @@
 ?	mem_access_op		memory.h
 !	pod_target			memory.h
 !	remove_from_physmap		memory.h
+?	vmemrange			memory.h
+!	vnuma_topology_info		memory.h
 ?	physdev_eoi			physdev.h
 ?	physdev_get_free_pirq		physdev.h
 ?	physdev_irq			physdev.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 Tue Feb 03 07:58:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYNi-0004OE-OS; Tue, 03 Feb 2015 07:58:46 +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 1YIYNh-0004Nz-Do
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:45 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C3/B5-02749-4BF70D45; Tue, 03 Feb 2015 07:58:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950323!12128751!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24457 invoked from network); 3 Feb 2015 07:58:43 -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;
	3 Feb 2015 07:58:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNf-0004z4-14
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNf-0006Fs-0D
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:43 +0000
Date: Tue, 03 Feb 2015 07:58:43 +0000
Message-Id: <E1YIYNf-0006Fs-0D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] handle XENMEM_get_vnumainfo in
	compat_memory_op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5f6ec28f2c3c3ba17a0b7f2a1d98324665420f46
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Jan 23 15:06:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:06:26 2015 +0100

    handle XENMEM_get_vnumainfo in compat_memory_op
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/compat/memory.c |   48 ++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xlat.lst       |    2 +
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 06c90be..b258138 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -15,6 +15,7 @@ CHECK_TYPE(domid);
 #undef xen_domid_t
 
 CHECK_mem_access_op;
+CHECK_vmemrange;
 
 int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
@@ -32,12 +33,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             struct xen_add_to_physmap *atp;
             struct xen_add_to_physmap_batch *atpb;
             struct xen_remove_from_physmap *xrfp;
+            struct xen_vnuma_topology_info *vnuma;
         } nat;
         union {
             struct compat_memory_reservation rsrv;
             struct compat_memory_exchange xchg;
             struct compat_add_to_physmap atp;
             struct compat_add_to_physmap_batch atpb;
+            struct compat_vnuma_topology_info vnuma;
         } cmp;
 
         set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
@@ -273,13 +276,50 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+        case XENMEM_get_vnumainfo:
+        {
+            enum XLAT_vnuma_topology_info_vdistance vdistance =
+                XLAT_vnuma_topology_info_vdistance_h;
+            enum XLAT_vnuma_topology_info_vcpu_to_vnode vcpu_to_vnode =
+                XLAT_vnuma_topology_info_vcpu_to_vnode_h;
+            enum XLAT_vnuma_topology_info_vmemrange vmemrange =
+                XLAT_vnuma_topology_info_vmemrange_h;
+
+            if ( copy_from_guest(&cmp.vnuma, compat, 1) )
+                return -EFAULT;
+
+#define XLAT_vnuma_topology_info_HNDL_vdistance_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vdistance.h, (_s_)->vdistance.h)
+#define XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vcpu_to_vnode.h, (_s_)->vcpu_to_vnode.h)
+#define XLAT_vnuma_topology_info_HNDL_vmemrange_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vmemrange.h, (_s_)->vmemrange.h)
+
+            XLAT_vnuma_topology_info(nat.vnuma, &cmp.vnuma);
+
+#undef XLAT_vnuma_topology_info_HNDL_vdistance_h
+#undef XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h
+#undef XLAT_vnuma_topology_info_HNDL_vmemrange_h
+            break;
+        }
+
         default:
             return compat_arch_memory_op(cmd, compat);
         }
 
         rc = do_memory_op(cmd, nat.hnd);
         if ( rc < 0 )
+        {
+            if ( rc == -ENOBUFS && op == XENMEM_get_vnumainfo )
+            {
+                cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+                cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+                cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+                if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                    rc = -EFAULT;
+            }
             break;
+        }
 
         cmd = 0;
         if ( hypercall_xlat_continuation(&cmd, 2, 0x02, nat.hnd, compat) )
@@ -398,6 +438,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_remove_from_physmap:
             break;
 
+        case XENMEM_get_vnumainfo:
+            cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+            cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+            cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+            if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                rc = -EFAULT;
+            break;
+
         default:
             domain_crash(current->domain);
             split = 0;
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 41b3e35..9c9fd9a 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -64,6 +64,8 @@
 ?	mem_access_op		memory.h
 !	pod_target			memory.h
 !	remove_from_physmap		memory.h
+?	vmemrange			memory.h
+!	vnuma_topology_info		memory.h
 ?	physdev_eoi			physdev.h
 ?	physdev_get_free_pirq		physdev.h
 ?	physdev_irq			physdev.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 Tue Feb 03 07:58:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYNs-0004Pf-R9; Tue, 03 Feb 2015 07:58:56 +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 1YIYNr-0004PP-Lq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:55 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	6F/AE-03164-EBF70D45; Tue, 03 Feb 2015 07:58:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1422950333!5379096!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10325 invoked from network); 3 Feb 2015 07:58:54 -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 Feb 2015 07:58: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 1YIYNp-0004zD-7z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNp-0006GE-69
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:53 +0000
Date: Tue, 03 Feb 2015 07:58:53 +0000
Message-Id: <E1YIYNp-0006GE-69@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: make hvm_efer_valid() honor
	guest features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e70c3da4d02790f9144e6b455f0d67b868c09557
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:13:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:13:05 2015 +0100

    x86/HVM: make hvm_efer_valid() honor guest features
    
    Following the earlier similar change validating CR4 modifications.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   77 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 58 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 24f3333..2162f97 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1683,20 +1683,64 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     return 0;
 }
 
-static bool_t hvm_efer_valid(struct domain *d,
-                             uint64_t value, uint64_t efer_validbits)
+static bool_t hvm_efer_valid(const struct vcpu *v, uint64_t value,
+                             signed int cr0_pg)
 {
-    if ( nestedhvm_enabled(d) && cpu_has_svm )
-        efer_validbits |= EFER_SVME;
+    unsigned int ext1_ecx = 0, ext1_edx = 0;
 
-    return !((value & ~efer_validbits) ||
-             ((sizeof(long) != 8) && (value & EFER_LME)) ||
-             (!cpu_has_svm && (value & EFER_SVME)) ||
-             (!cpu_has_nx && (value & EFER_NX)) ||
-             (!cpu_has_syscall && (value & EFER_SCE)) ||
-             (!cpu_has_lmsl && (value & EFER_LMSLE)) ||
-             (!cpu_has_ffxsr && (value & EFER_FFXSE)) ||
-             ((value & (EFER_LME|EFER_LMA)) == EFER_LMA));
+    if ( cr0_pg < 0 && !is_hardware_domain(v->domain) )
+    {
+        unsigned int level;
+
+        ASSERT(v == current);
+        hvm_cpuid(0x80000000, &level, NULL, NULL, NULL);
+        if ( level >= 0x80000001 )
+        {
+            unsigned int dummy;
+
+            level = 0x80000001;
+            hvm_funcs.cpuid_intercept(&level, &dummy, &ext1_ecx, &ext1_edx);
+        }
+    }
+    else
+    {
+        ext1_edx = boot_cpu_data.x86_capability[X86_FEATURE_LM / 32];
+        ext1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_SVM / 32];
+    }
+
+    /*
+     * Guests may want to set EFER.SCE and EFER.LME at the same time, so we
+     * can't make the check depend on only X86_FEATURE_SYSCALL (which on VMX
+     * will be clear without the guest having entered 64-bit mode).
+     */
+    if ( (value & EFER_SCE) &&
+         !(ext1_edx & cpufeat_mask(X86_FEATURE_SYSCALL)) &&
+         (cr0_pg >= 0 || !(value & EFER_LME)) )
+        return 0;
+
+    if ( (value & (EFER_LME | EFER_LMA)) &&
+         !(ext1_edx & cpufeat_mask(X86_FEATURE_LM)) )
+        return 0;
+
+    if ( (value & EFER_LMA) && (!(value & EFER_LME) || !cr0_pg) )
+        return 0;
+
+    if ( (value & EFER_NX) && !(ext1_edx & cpufeat_mask(X86_FEATURE_NX)) )
+        return 0;
+
+    if ( (value & EFER_SVME) &&
+         (!(ext1_ecx & cpufeat_mask(X86_FEATURE_SVM)) ||
+          !nestedhvm_enabled(v->domain)) )
+        return 0;
+
+    if ( (value & EFER_LMSLE) && !cpu_has_lmsl )
+        return 0;
+
+    if ( (value & EFER_FFXSE) &&
+         !(ext1_edx & cpufeat_mask(X86_FEATURE_FFXSR)) )
+        return 0;
+
+    return 1;
 }
 
 /* These reserved bits in lower 32 remain 0 after any load of CR0 */
@@ -1774,7 +1818,6 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     struct vcpu *v;
     struct hvm_hw_cpu ctxt;
     struct segment_register seg;
-    uint64_t efer_validbits;
 
     /* Which vcpu is this? */
     vcpuid = hvm_load_instance(h);
@@ -1805,9 +1848,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    efer_validbits = EFER_FFXSE | EFER_LMSLE | EFER_LME | EFER_LMA
-                   | EFER_NX | EFER_SCE;
-    if ( !hvm_efer_valid(d, ctxt.msr_efer, efer_validbits) )
+    if ( !hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG)) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad EFER %#" PRIx64 "\n",
                d->domain_id, ctxt.msr_efer);
@@ -2947,12 +2988,10 @@ err:
 int hvm_set_efer(uint64_t value)
 {
     struct vcpu *v = current;
-    uint64_t efer_validbits;
 
     value &= ~EFER_LMA;
 
-    efer_validbits = EFER_FFXSE | EFER_LMSLE | EFER_LME | EFER_NX | EFER_SCE;
-    if ( !hvm_efer_valid(v->domain, value, efer_validbits) )
+    if ( !hvm_efer_valid(v, value, -1) )
     {
         gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
                  "EFER: %#"PRIx64"\n", value);
--
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 Tue Feb 03 07:58:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:58: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 1YIYNs-0004Pf-R9; Tue, 03 Feb 2015 07:58:56 +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 1YIYNr-0004PP-Lq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:55 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	6F/AE-03164-EBF70D45; Tue, 03 Feb 2015 07:58:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1422950333!5379096!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10325 invoked from network); 3 Feb 2015 07:58:54 -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 Feb 2015 07:58: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 1YIYNp-0004zD-7z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNp-0006GE-69
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:58:53 +0000
Date: Tue, 03 Feb 2015 07:58:53 +0000
Message-Id: <E1YIYNp-0006GE-69@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: make hvm_efer_valid() honor
	guest features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e70c3da4d02790f9144e6b455f0d67b868c09557
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:13:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:13:05 2015 +0100

    x86/HVM: make hvm_efer_valid() honor guest features
    
    Following the earlier similar change validating CR4 modifications.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   77 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 58 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 24f3333..2162f97 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1683,20 +1683,64 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     return 0;
 }
 
-static bool_t hvm_efer_valid(struct domain *d,
-                             uint64_t value, uint64_t efer_validbits)
+static bool_t hvm_efer_valid(const struct vcpu *v, uint64_t value,
+                             signed int cr0_pg)
 {
-    if ( nestedhvm_enabled(d) && cpu_has_svm )
-        efer_validbits |= EFER_SVME;
+    unsigned int ext1_ecx = 0, ext1_edx = 0;
 
-    return !((value & ~efer_validbits) ||
-             ((sizeof(long) != 8) && (value & EFER_LME)) ||
-             (!cpu_has_svm && (value & EFER_SVME)) ||
-             (!cpu_has_nx && (value & EFER_NX)) ||
-             (!cpu_has_syscall && (value & EFER_SCE)) ||
-             (!cpu_has_lmsl && (value & EFER_LMSLE)) ||
-             (!cpu_has_ffxsr && (value & EFER_FFXSE)) ||
-             ((value & (EFER_LME|EFER_LMA)) == EFER_LMA));
+    if ( cr0_pg < 0 && !is_hardware_domain(v->domain) )
+    {
+        unsigned int level;
+
+        ASSERT(v == current);
+        hvm_cpuid(0x80000000, &level, NULL, NULL, NULL);
+        if ( level >= 0x80000001 )
+        {
+            unsigned int dummy;
+
+            level = 0x80000001;
+            hvm_funcs.cpuid_intercept(&level, &dummy, &ext1_ecx, &ext1_edx);
+        }
+    }
+    else
+    {
+        ext1_edx = boot_cpu_data.x86_capability[X86_FEATURE_LM / 32];
+        ext1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_SVM / 32];
+    }
+
+    /*
+     * Guests may want to set EFER.SCE and EFER.LME at the same time, so we
+     * can't make the check depend on only X86_FEATURE_SYSCALL (which on VMX
+     * will be clear without the guest having entered 64-bit mode).
+     */
+    if ( (value & EFER_SCE) &&
+         !(ext1_edx & cpufeat_mask(X86_FEATURE_SYSCALL)) &&
+         (cr0_pg >= 0 || !(value & EFER_LME)) )
+        return 0;
+
+    if ( (value & (EFER_LME | EFER_LMA)) &&
+         !(ext1_edx & cpufeat_mask(X86_FEATURE_LM)) )
+        return 0;
+
+    if ( (value & EFER_LMA) && (!(value & EFER_LME) || !cr0_pg) )
+        return 0;
+
+    if ( (value & EFER_NX) && !(ext1_edx & cpufeat_mask(X86_FEATURE_NX)) )
+        return 0;
+
+    if ( (value & EFER_SVME) &&
+         (!(ext1_ecx & cpufeat_mask(X86_FEATURE_SVM)) ||
+          !nestedhvm_enabled(v->domain)) )
+        return 0;
+
+    if ( (value & EFER_LMSLE) && !cpu_has_lmsl )
+        return 0;
+
+    if ( (value & EFER_FFXSE) &&
+         !(ext1_edx & cpufeat_mask(X86_FEATURE_FFXSR)) )
+        return 0;
+
+    return 1;
 }
 
 /* These reserved bits in lower 32 remain 0 after any load of CR0 */
@@ -1774,7 +1818,6 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     struct vcpu *v;
     struct hvm_hw_cpu ctxt;
     struct segment_register seg;
-    uint64_t efer_validbits;
 
     /* Which vcpu is this? */
     vcpuid = hvm_load_instance(h);
@@ -1805,9 +1848,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    efer_validbits = EFER_FFXSE | EFER_LMSLE | EFER_LME | EFER_LMA
-                   | EFER_NX | EFER_SCE;
-    if ( !hvm_efer_valid(d, ctxt.msr_efer, efer_validbits) )
+    if ( !hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG)) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad EFER %#" PRIx64 "\n",
                d->domain_id, ctxt.msr_efer);
@@ -2947,12 +2988,10 @@ err:
 int hvm_set_efer(uint64_t value)
 {
     struct vcpu *v = current;
-    uint64_t efer_validbits;
 
     value &= ~EFER_LMA;
 
-    efer_validbits = EFER_FFXSE | EFER_LMSLE | EFER_LME | EFER_NX | EFER_SCE;
-    if ( !hvm_efer_valid(v->domain, value, efer_validbits) )
+    if ( !hvm_efer_valid(v, value, -1) )
     {
         gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
                  "EFER: %#"PRIx64"\n", value);
--
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 Tue Feb 03 07:59:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYO4-0004RA-UA; Tue, 03 Feb 2015 07:59:08 +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 1YIYO3-0004Qw-PX
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:07 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	12/C0-02635-BCF70D45; Tue, 03 Feb 2015 07:59:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1422950345!12394676!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7309 invoked from network); 3 Feb 2015 07:59: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;
	3 Feb 2015 07:59: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 1YIYNz-0004zm-Fg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNz-0006Gw-DK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:03 +0000
Date: Tue, 03 Feb 2015 07:59:03 +0000
Message-Id: <E1YIYNz-0006Gw-DK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: replace plain numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 156e4eaa3b2665c587683ed01b7223522872108c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:13:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:13:39 2015 +0100

    x86/HVM: replace plain numbers
    
    ... making the code better document itself. No functional change
    intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vioapic.c        |   25 +++++++++++++++++++------
 xen/arch/x86/hvm/vlapic.c         |    2 +-
 xen/include/asm-x86/hvm/vioapic.h |    1 +
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 9248adc..1e48110 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -53,18 +53,26 @@ static uint32_t vioapic_read_indirect(const struct hvm_hw_vioapic *vioapic)
     switch ( vioapic->ioregsel )
     {
     case VIOAPIC_REG_VERSION:
-        result = ((((VIOAPIC_NUM_PINS-1) & 0xff) << 16)
-                  | (VIOAPIC_VERSION_ID & 0xff));
+        result = ((union IO_APIC_reg_01){
+                  .bits = { .version = VIOAPIC_VERSION_ID,
+                            .entries = VIOAPIC_NUM_PINS - 1 }
+                  }).raw;
         break;
 
     case VIOAPIC_REG_APIC_ID:
+        /*
+         * Using union IO_APIC_reg_02 for the ID register too, as
+         * union IO_APIC_reg_00's ID field is 8 bits wide for some reason.
+         */
     case VIOAPIC_REG_ARB_ID:
-        result = ((vioapic->id & 0xf) << 24);
+        result = ((union IO_APIC_reg_02){
+                  .bits = { .arbitration = vioapic->id }
+                  }).raw;
         break;
 
     default:
     {
-        uint32_t redir_index = (vioapic->ioregsel - 0x10) >> 1;
+        uint32_t redir_index = (vioapic->ioregsel - VIOAPIC_REG_RTE0) >> 1;
         uint64_t redir_content;
 
         if ( redir_index >= VIOAPIC_NUM_PINS )
@@ -173,7 +181,12 @@ static void vioapic_write_indirect(
         break;
 
     case VIOAPIC_REG_APIC_ID:
-        vioapic->id = (val >> 24) & 0xf;
+        /*
+         * Presumably because we emulate an Intel IOAPIC which only has a
+         * 4 bit ID field (compared to 8 for AMD), using union IO_APIC_reg_02
+         * for the ID register (union IO_APIC_reg_00's ID field is 8 bits).
+         */
+        vioapic->id = ((union IO_APIC_reg_02){ .raw = val }).bits.arbitration;
         break;
 
     case VIOAPIC_REG_ARB_ID:
@@ -181,7 +194,7 @@ static void vioapic_write_indirect(
 
     default:
     {
-        uint32_t redir_index = (vioapic->ioregsel - 0x10) >> 1;
+        uint32_t redir_index = (vioapic->ioregsel - VIOAPIC_REG_RTE0) >> 1;
 
         HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "rte[%02x].%s = %08x",
                     redir_index, vioapic->ioregsel & 1 ? "hi" : "lo", val);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index a91cee1..8062f31 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -835,7 +835,7 @@ static int vlapic_write(struct vcpu *v, unsigned long address,
     unsigned int offset = address - vlapic_base_address(vlapic);
     int rc = X86EMUL_OKAY;
 
-    if ( offset != 0xb0 )
+    if ( offset != APIC_EOI )
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
                     "offset %#x with length %#lx, and value is %#lx",
                     offset, len, val);
diff --git a/xen/include/asm-x86/hvm/vioapic.h b/xen/include/asm-x86/hvm/vioapic.h
index ab4e07e..a18ffd0 100644
--- a/xen/include/asm-x86/hvm/vioapic.h
+++ b/xen/include/asm-x86/hvm/vioapic.h
@@ -47,6 +47,7 @@
 #define VIOAPIC_REG_APIC_ID 0x00 /* x86 IOAPIC only */
 #define VIOAPIC_REG_VERSION 0x01
 #define VIOAPIC_REG_ARB_ID  0x02 /* x86 IOAPIC only */
+#define VIOAPIC_REG_RTE0    0x10
 
 struct hvm_vioapic {
     struct hvm_hw_vioapic hvm_hw_vioapic;
--
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 Tue Feb 03 07:59:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYO4-0004RA-UA; Tue, 03 Feb 2015 07:59:08 +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 1YIYO3-0004Qw-PX
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:07 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	12/C0-02635-BCF70D45; Tue, 03 Feb 2015 07:59:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1422950345!12394676!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7309 invoked from network); 3 Feb 2015 07:59: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;
	3 Feb 2015 07:59: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 1YIYNz-0004zm-Fg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYNz-0006Gw-DK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:03 +0000
Date: Tue, 03 Feb 2015 07:59:03 +0000
Message-Id: <E1YIYNz-0006Gw-DK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: replace plain numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 156e4eaa3b2665c587683ed01b7223522872108c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 23 15:13:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:13:39 2015 +0100

    x86/HVM: replace plain numbers
    
    ... making the code better document itself. No functional change
    intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vioapic.c        |   25 +++++++++++++++++++------
 xen/arch/x86/hvm/vlapic.c         |    2 +-
 xen/include/asm-x86/hvm/vioapic.h |    1 +
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 9248adc..1e48110 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -53,18 +53,26 @@ static uint32_t vioapic_read_indirect(const struct hvm_hw_vioapic *vioapic)
     switch ( vioapic->ioregsel )
     {
     case VIOAPIC_REG_VERSION:
-        result = ((((VIOAPIC_NUM_PINS-1) & 0xff) << 16)
-                  | (VIOAPIC_VERSION_ID & 0xff));
+        result = ((union IO_APIC_reg_01){
+                  .bits = { .version = VIOAPIC_VERSION_ID,
+                            .entries = VIOAPIC_NUM_PINS - 1 }
+                  }).raw;
         break;
 
     case VIOAPIC_REG_APIC_ID:
+        /*
+         * Using union IO_APIC_reg_02 for the ID register too, as
+         * union IO_APIC_reg_00's ID field is 8 bits wide for some reason.
+         */
     case VIOAPIC_REG_ARB_ID:
-        result = ((vioapic->id & 0xf) << 24);
+        result = ((union IO_APIC_reg_02){
+                  .bits = { .arbitration = vioapic->id }
+                  }).raw;
         break;
 
     default:
     {
-        uint32_t redir_index = (vioapic->ioregsel - 0x10) >> 1;
+        uint32_t redir_index = (vioapic->ioregsel - VIOAPIC_REG_RTE0) >> 1;
         uint64_t redir_content;
 
         if ( redir_index >= VIOAPIC_NUM_PINS )
@@ -173,7 +181,12 @@ static void vioapic_write_indirect(
         break;
 
     case VIOAPIC_REG_APIC_ID:
-        vioapic->id = (val >> 24) & 0xf;
+        /*
+         * Presumably because we emulate an Intel IOAPIC which only has a
+         * 4 bit ID field (compared to 8 for AMD), using union IO_APIC_reg_02
+         * for the ID register (union IO_APIC_reg_00's ID field is 8 bits).
+         */
+        vioapic->id = ((union IO_APIC_reg_02){ .raw = val }).bits.arbitration;
         break;
 
     case VIOAPIC_REG_ARB_ID:
@@ -181,7 +194,7 @@ static void vioapic_write_indirect(
 
     default:
     {
-        uint32_t redir_index = (vioapic->ioregsel - 0x10) >> 1;
+        uint32_t redir_index = (vioapic->ioregsel - VIOAPIC_REG_RTE0) >> 1;
 
         HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "rte[%02x].%s = %08x",
                     redir_index, vioapic->ioregsel & 1 ? "hi" : "lo", val);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index a91cee1..8062f31 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -835,7 +835,7 @@ static int vlapic_write(struct vcpu *v, unsigned long address,
     unsigned int offset = address - vlapic_base_address(vlapic);
     int rc = X86EMUL_OKAY;
 
-    if ( offset != 0xb0 )
+    if ( offset != APIC_EOI )
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
                     "offset %#x with length %#lx, and value is %#lx",
                     offset, len, val);
diff --git a/xen/include/asm-x86/hvm/vioapic.h b/xen/include/asm-x86/hvm/vioapic.h
index ab4e07e..a18ffd0 100644
--- a/xen/include/asm-x86/hvm/vioapic.h
+++ b/xen/include/asm-x86/hvm/vioapic.h
@@ -47,6 +47,7 @@
 #define VIOAPIC_REG_APIC_ID 0x00 /* x86 IOAPIC only */
 #define VIOAPIC_REG_VERSION 0x01
 #define VIOAPIC_REG_ARB_ID  0x02 /* x86 IOAPIC only */
+#define VIOAPIC_REG_RTE0    0x10
 
 struct hvm_vioapic {
     struct hvm_hw_vioapic hvm_hw_vioapic;
--
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 Tue Feb 03 07:59:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOF-0004So-2r; Tue, 03 Feb 2015 07:59: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 1YIYOE-0004Sa-76
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:18 +0000
Content-Length: 5394
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	CF/B7-02881-5DF70D45; Tue, 03 Feb 2015 07:59:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1422950355!11451740!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17415 invoked from network); 3 Feb 2015 07:59:16 -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;
	3 Feb 2015 07:59: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 1YIYOB-0004zs-H0
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOB-0006HT-Fx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:15 +0000
Date: Tue, 03 Feb 2015 07:59:15 +0000
Message-Id: <E1YIYOB-0006HT-Fx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow set_mmio_p2m_entry to
	specify access 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: multipart/mixed; boundary="===============2262159631416912861=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2262159631416912861==
Content-Length: 5060
Content-Transfer-Encoding: quoted-printable

commit 8cb60dd0f1fd34813bceb309f11a57a00f3f91f5
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 23 15:14:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:14:56 2015 +0100

    x86: allow set_mmio_p2m_entry to specify access type
    
    Preparatory change that allows setting the access type to
    set_mmio_p2m_entry.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain_build.c |    4 +++-
 xen/arch/x86/hvm/vmx/vmx.c  |    2 +-
 xen/arch/x86/mm/p2m.c       |   15 +++++++++------
 xen/include/asm-x86/p2m.h   |    3 ++-
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 7a912e9..01cfa58 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -319,11 +319,13 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
                                        unsigned long mfn, unsigned long nr_mfns)
 {
     unsigned long i;
+    p2m_access_t a;
     int rc;
 
+    a =3D p2m_get_hostp2m(d)->default_access;
     for ( i =3D 0; i < nr_mfns; i++ )
     {
-        if ( (rc =3D set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i))) )
+        if ( (rc =3D set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
                   gfn, mfn, i, rc);
         if ( !(i & 0xfffff) )
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8612601..88b7821 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2185,7 +2185,7 @@ static int vmx_alloc_vlapic_mapping(struct domain *d)
     share_xen_page_with_guest(virt_to_page(apic_va), d, XENSHARE_writable);
     d->arch.hvm_domain.vmx.apic_access_mfn =3D virt_to_mfn(apic_va);
     set_mmio_p2m_entry(d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE),
-        _mfn(virt_to_mfn(apic_va)));
+        _mfn(virt_to_mfn(apic_va)), p2m_get_hostp2m(d)->default_access);
 
     return 0;
 }
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index efa49dd..c1b7545 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -810,7 +810,7 @@ void p2m_change_type_range(struct domain *d,
 
 /* Returns: 0 for success, -errno for failure */
 static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
-                               p2m_type_t gfn_p2mt)
+                               p2m_type_t gfn_p2mt, p2m_access_t access)
 {
     int rc =3D 0;
     p2m_access_t a;
@@ -837,7 +837,7 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 
     P2M_DEBUG("set %d %lx %lx\n", gfn_p2mt, gfn, mfn_x(mfn));
     rc =3D p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, gfn_p2mt,
-                       p2m->default_access);
+                       access);
     gfn_unlock(p2m, gfn, 0);
     if ( rc )
         gdprintk(XENLOG_ERR,
@@ -850,12 +850,14 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 static int set_foreign_p2m_entry(struct domain *d, unsigned long gfn,
                                  mfn_t mfn)
 {
-    return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign);
+    return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign,
+                               p2m_get_hostp2m(d)->default_access);
 }
 
-int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
+int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
+                       p2m_access_t access)
 {
-    return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct);
+    return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct, access);
 }
 
 /* Returns: 0 for success, -errno for failure */
@@ -1858,7 +1860,8 @@ int map_mmio_regions(struct domain *d,
 
     for ( i =3D 0; !ret && i < nr; i++ )
     {
-        ret =3D set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i));
+        ret =3D set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i),
+                                 p2m_get_hostp2m(d)->default_access);
         if ( ret )
         {
             unmap_mmio_regions(d, start_gfn, i, mfn);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 2cf73ca..e86e26f 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -513,7 +513,8 @@ int p2m_is_logdirty_range(struct p2m_domain *, unsigned long start,
                           unsigned long end);
 
 /* Set mmio addresses in the p2m table (for pass-through) */
-int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
+int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
+                       p2m_access_t access);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 
 /* Add foreign mapping to the guest's p2m table. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2262159631416912861==
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
--===============2262159631416912861==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 07:59:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOF-0004So-2r; Tue, 03 Feb 2015 07:59: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 1YIYOE-0004Sa-76
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:18 +0000
Content-Length: 5394
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	CF/B7-02881-5DF70D45; Tue, 03 Feb 2015 07:59:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1422950355!11451740!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17415 invoked from network); 3 Feb 2015 07:59:16 -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;
	3 Feb 2015 07:59: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 1YIYOB-0004zs-H0
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOB-0006HT-Fx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:15 +0000
Date: Tue, 03 Feb 2015 07:59:15 +0000
Message-Id: <E1YIYOB-0006HT-Fx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow set_mmio_p2m_entry to
	specify access 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: multipart/mixed; boundary="===============2262159631416912861=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2262159631416912861==
Content-Length: 5060
Content-Transfer-Encoding: quoted-printable

commit 8cb60dd0f1fd34813bceb309f11a57a00f3f91f5
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 23 15:14:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:14:56 2015 +0100

    x86: allow set_mmio_p2m_entry to specify access type
    
    Preparatory change that allows setting the access type to
    set_mmio_p2m_entry.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain_build.c |    4 +++-
 xen/arch/x86/hvm/vmx/vmx.c  |    2 +-
 xen/arch/x86/mm/p2m.c       |   15 +++++++++------
 xen/include/asm-x86/p2m.h   |    3 ++-
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 7a912e9..01cfa58 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -319,11 +319,13 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
                                        unsigned long mfn, unsigned long nr_mfns)
 {
     unsigned long i;
+    p2m_access_t a;
     int rc;
 
+    a =3D p2m_get_hostp2m(d)->default_access;
     for ( i =3D 0; i < nr_mfns; i++ )
     {
-        if ( (rc =3D set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i))) )
+        if ( (rc =3D set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
                   gfn, mfn, i, rc);
         if ( !(i & 0xfffff) )
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8612601..88b7821 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2185,7 +2185,7 @@ static int vmx_alloc_vlapic_mapping(struct domain *d)
     share_xen_page_with_guest(virt_to_page(apic_va), d, XENSHARE_writable);
     d->arch.hvm_domain.vmx.apic_access_mfn =3D virt_to_mfn(apic_va);
     set_mmio_p2m_entry(d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE),
-        _mfn(virt_to_mfn(apic_va)));
+        _mfn(virt_to_mfn(apic_va)), p2m_get_hostp2m(d)->default_access);
 
     return 0;
 }
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index efa49dd..c1b7545 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -810,7 +810,7 @@ void p2m_change_type_range(struct domain *d,
 
 /* Returns: 0 for success, -errno for failure */
 static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
-                               p2m_type_t gfn_p2mt)
+                               p2m_type_t gfn_p2mt, p2m_access_t access)
 {
     int rc =3D 0;
     p2m_access_t a;
@@ -837,7 +837,7 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 
     P2M_DEBUG("set %d %lx %lx\n", gfn_p2mt, gfn, mfn_x(mfn));
     rc =3D p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, gfn_p2mt,
-                       p2m->default_access);
+                       access);
     gfn_unlock(p2m, gfn, 0);
     if ( rc )
         gdprintk(XENLOG_ERR,
@@ -850,12 +850,14 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 static int set_foreign_p2m_entry(struct domain *d, unsigned long gfn,
                                  mfn_t mfn)
 {
-    return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign);
+    return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign,
+                               p2m_get_hostp2m(d)->default_access);
 }
 
-int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
+int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
+                       p2m_access_t access)
 {
-    return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct);
+    return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct, access);
 }
 
 /* Returns: 0 for success, -errno for failure */
@@ -1858,7 +1860,8 @@ int map_mmio_regions(struct domain *d,
 
     for ( i =3D 0; !ret && i < nr; i++ )
     {
-        ret =3D set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i));
+        ret =3D set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i),
+                                 p2m_get_hostp2m(d)->default_access);
         if ( ret )
         {
             unmap_mmio_regions(d, start_gfn, i, mfn);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 2cf73ca..e86e26f 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -513,7 +513,8 @@ int p2m_is_logdirty_range(struct p2m_domain *, unsigned long start,
                           unsigned long end);
 
 /* Set mmio addresses in the p2m table (for pass-through) */
-int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
+int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
+                       p2m_access_t access);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 
 /* Add foreign mapping to the guest's p2m table. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2262159631416912861==
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
--===============2262159631416912861==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 07:59:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOP-0004Um-PB; Tue, 03 Feb 2015 07:59: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 1YIYON-0004UI-OK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:27 +0000
Content-Length: 2161
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	AE/CA-03000-FDF70D45; Tue, 03 Feb 2015 07:59:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1422950365!12033084!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26428 invoked from network); 3 Feb 2015 07:59:26 -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;
	3 Feb 2015 07:59: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 1YIYOL-0004zy-MO
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOL-0006I3-LU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:25 +0000
Date: Tue, 03 Feb 2015 07:59:25 +0000
Message-Id: <E1YIYOL-0006I3-LU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/pvh: check permissions when adding
	MMIO regions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============3030217475677999594=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3030217475677999594==
Content-Length: 1757
Content-Transfer-Encoding: quoted-printable

commit 631136c7db91b18a125549b52585fc8e133a6711
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 23 15:15:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:15:30 2015 +0100

    x86/pvh: check permissions when adding MMIO regions
    
    Check that MMIO regions added to PVH Dom0 are allowed. Previously a PVH Dom0
    would have access to the full MMIO range.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/arch/x86/domain_build.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 01cfa58..2f9aaf9 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -320,11 +320,24 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
 {
     unsigned long i;
     p2m_access_t a;
+    mfn_t omfn;
+    p2m_type_t t;
     int rc;
 
-    a =3D p2m_get_hostp2m(d)->default_access;
     for ( i =3D 0; i < nr_mfns; i++ )
     {
+        if ( !iomem_access_permitted(d, mfn + i, mfn + i) )
+        {
+            omfn =3D get_gfn_query_unlocked(d, gfn + i, &t);
+            guest_physmap_remove_page(d, gfn + i, mfn_x(omfn), PAGE_ORDER_4K);
+            continue;
+        }
+
+        if ( rangeset_contains_singleton(mmio_ro_ranges, mfn + i) )
+            a =3D p2m_access_rx;
+        else
+            a =3D p2m_access_rwx;
+
         if ( (rc =3D set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
                   gfn, mfn, i, rc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3030217475677999594==
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
--===============3030217475677999594==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 07:59:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOP-0004Um-PB; Tue, 03 Feb 2015 07:59: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 1YIYON-0004UI-OK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:27 +0000
Content-Length: 2161
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	AE/CA-03000-FDF70D45; Tue, 03 Feb 2015 07:59:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1422950365!12033084!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26428 invoked from network); 3 Feb 2015 07:59:26 -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;
	3 Feb 2015 07:59: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 1YIYOL-0004zy-MO
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOL-0006I3-LU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:25 +0000
Date: Tue, 03 Feb 2015 07:59:25 +0000
Message-Id: <E1YIYOL-0006I3-LU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/pvh: check permissions when adding
	MMIO regions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============3030217475677999594=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3030217475677999594==
Content-Length: 1757
Content-Transfer-Encoding: quoted-printable

commit 631136c7db91b18a125549b52585fc8e133a6711
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 23 15:15:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:15:30 2015 +0100

    x86/pvh: check permissions when adding MMIO regions
    
    Check that MMIO regions added to PVH Dom0 are allowed. Previously a PVH Dom0
    would have access to the full MMIO range.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/arch/x86/domain_build.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 01cfa58..2f9aaf9 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -320,11 +320,24 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
 {
     unsigned long i;
     p2m_access_t a;
+    mfn_t omfn;
+    p2m_type_t t;
     int rc;
 
-    a =3D p2m_get_hostp2m(d)->default_access;
     for ( i =3D 0; i < nr_mfns; i++ )
     {
+        if ( !iomem_access_permitted(d, mfn + i, mfn + i) )
+        {
+            omfn =3D get_gfn_query_unlocked(d, gfn + i, &t);
+            guest_physmap_remove_page(d, gfn + i, mfn_x(omfn), PAGE_ORDER_4K);
+            continue;
+        }
+
+        if ( rangeset_contains_singleton(mmio_ro_ranges, mfn + i) )
+            a =3D p2m_access_rx;
+        else
+            a =3D p2m_access_rwx;
+
         if ( (rc =3D set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
                   gfn, mfn, i, rc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3030217475677999594==
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
--===============3030217475677999594==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 07:59:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOZ-0004We-SJ; Tue, 03 Feb 2015 07:59: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 1YIYOY-0004WH-E4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:38 +0000
Content-Length: 5035
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	A5/F5-02991-9EF70D45; Tue, 03 Feb 2015 07:59:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1422950376!7859316!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15248 invoked from network); 3 Feb 2015 07:59: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;
	3 Feb 2015 07:59: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 1YIYOV-000506-Ro
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOV-0006JF-QU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:35 +0000
Date: Tue, 03 Feb 2015 07:59:35 +0000
Message-Id: <E1YIYOV-0006JF-QU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: prevent access to HPET from 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: multipart/mixed; boundary="===============2203314258484169960=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2203314258484169960==
Content-Length: 4714
Content-Transfer-Encoding: quoted-printable

commit e50fd2b3c8d8b811ea386cb95a906e631ba37f6c
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 23 15:16:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:16:18 2015 +0100

    x86: prevent access to HPET from Dom0
    
    Prevent Dom0 from accessing HPET MMIO region by adding the HPET mfn to the
    list of forbiden memory regions (if ACPI_HPET_PAGE_PROTECT4 or
    ACPI_HPET_PAGE_PROTECT64 flag is set) or to the list of read-only regions.
    
    Also provide an option that prevents adding the HPET to the read-only memory
    regions called ro-hpet, in case there are systems that put other stuff in
    the HPET page.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    
    Don't loop over iomem_deny_access() for consecutive MFNs.
    
    Put new command line option's doc entry in right spot.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.markdown |    8 ++++++++
 xen/arch/x86/acpi/boot.c            |    1 +
 xen/arch/x86/domain_build.c         |   18 ++++++++++++++++++
 xen/arch/x86/hpet.c                 |    1 +
 xen/include/asm-x86/hpet.h          |    1 +
 5 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a061aa4..0fc7559 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1119,6 +1119,14 @@ Specify the host reboot method.
 
 `pci` instructs Xen to reboot the host using PCI reset register (port CF9).
 
+### ro-hpet
+> `=3D <boolean>`
+
+> Default: `true`
+
+Map the HPET page as read only in Dom0. If disabled the page will be mapped
+with read and write permissions.
+
 ### sched
 > `=3D credit | credit2 | sedf | arinc653`
 
diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 903830b..9a8904b 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -309,6 +309,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 
 	hpet_address =3D hpet_tbl->address.address;
 	hpet_blockid =3D hpet_tbl->sequence;
+	hpet_flags =3D hpet_tbl->flags;
 	printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
 	       hpet_tbl->id, hpet_address);
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 2f9aaf9..a561d7c 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -36,6 +36,7 @@
 #include <asm/bzimage.h> /* for bzimage_parse */
 #include <asm/io_apic.h>
 #include <asm/hap.h>
+#include <asm/hpet.h>
 
 #include <public/version.h>
 
@@ -134,6 +135,9 @@ boolean_param("dom0_shadow", opt_dom0_shadow);
 static char __initdata opt_dom0_ioports_disable[200] =3D "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
 
+static bool_t __initdata ro_hpet =3D 1;
+boolean_param("ro-hpet", ro_hpet);
+
 /* Allow ring-3 access in long mode as guest cannot use ring 1 ... */
 #define BASE_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_USER)
 #define L1_PROT (BASE_PROT|_PAGE_GUEST_KERNEL)
@@ -1495,6 +1499,20 @@ int __init construct_dom0(
             rc |=3D iomem_deny_access(d, sfn, efn);
     }
 
+    /* Prevent access to HPET */
+    if ( hpet_address )
+    {
+        u8 prot_flags =3D hpet_flags & ACPI_HPET_PAGE_PROTECT_MASK;
+
+        mfn =3D paddr_to_pfn(hpet_address);
+        if ( prot_flags =3D=3D ACPI_HPET_PAGE_PROTECT4 )
+            rc |=3D iomem_deny_access(d, mfn, mfn);
+        else if ( prot_flags =3D=3D ACPI_HPET_PAGE_PROTECT64 )
+            rc |=3D iomem_deny_access(d, mfn, mfn + 15);
+        else if ( ro_hpet )
+            rc |=3D rangeset_add_singleton(mmio_ro_ranges, mfn);
+    }
+
     BUG_ON(rc !=3D 0);
 
     if ( elf_check_broken(&elf) )
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 0b13f52..7aa740f 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -52,6 +52,7 @@ DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __initdata hpet_address;
 u8 __initdata hpet_blockid;
+u8 __initdata hpet_flags;
 
 /*
  * force_hpet_broadcast: by default legacy hpet broadcast will be stopped
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 875f1de..10c4a56 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -52,6 +52,7 @@
 
 extern unsigned long hpet_address;
 extern u8 hpet_blockid;
+extern u8 hpet_flags;
 
 /*
  * Detect and initialise HPET hardware: return counter update frequency.
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2203314258484169960==
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
--===============2203314258484169960==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 07:59:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOZ-0004We-SJ; Tue, 03 Feb 2015 07:59: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 1YIYOY-0004WH-E4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:38 +0000
Content-Length: 5035
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	A5/F5-02991-9EF70D45; Tue, 03 Feb 2015 07:59:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1422950376!7859316!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15248 invoked from network); 3 Feb 2015 07:59: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;
	3 Feb 2015 07:59: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 1YIYOV-000506-Ro
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOV-0006JF-QU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:35 +0000
Date: Tue, 03 Feb 2015 07:59:35 +0000
Message-Id: <E1YIYOV-0006JF-QU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: prevent access to HPET from 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: multipart/mixed; boundary="===============2203314258484169960=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2203314258484169960==
Content-Length: 4714
Content-Transfer-Encoding: quoted-printable

commit e50fd2b3c8d8b811ea386cb95a906e631ba37f6c
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 23 15:16:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 15:16:18 2015 +0100

    x86: prevent access to HPET from Dom0
    
    Prevent Dom0 from accessing HPET MMIO region by adding the HPET mfn to the
    list of forbiden memory regions (if ACPI_HPET_PAGE_PROTECT4 or
    ACPI_HPET_PAGE_PROTECT64 flag is set) or to the list of read-only regions.
    
    Also provide an option that prevents adding the HPET to the read-only memory
    regions called ro-hpet, in case there are systems that put other stuff in
    the HPET page.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    
    Don't loop over iomem_deny_access() for consecutive MFNs.
    
    Put new command line option's doc entry in right spot.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.markdown |    8 ++++++++
 xen/arch/x86/acpi/boot.c            |    1 +
 xen/arch/x86/domain_build.c         |   18 ++++++++++++++++++
 xen/arch/x86/hpet.c                 |    1 +
 xen/include/asm-x86/hpet.h          |    1 +
 5 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a061aa4..0fc7559 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1119,6 +1119,14 @@ Specify the host reboot method.
 
 `pci` instructs Xen to reboot the host using PCI reset register (port CF9).
 
+### ro-hpet
+> `=3D <boolean>`
+
+> Default: `true`
+
+Map the HPET page as read only in Dom0. If disabled the page will be mapped
+with read and write permissions.
+
 ### sched
 > `=3D credit | credit2 | sedf | arinc653`
 
diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 903830b..9a8904b 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -309,6 +309,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 
 	hpet_address =3D hpet_tbl->address.address;
 	hpet_blockid =3D hpet_tbl->sequence;
+	hpet_flags =3D hpet_tbl->flags;
 	printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
 	       hpet_tbl->id, hpet_address);
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 2f9aaf9..a561d7c 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -36,6 +36,7 @@
 #include <asm/bzimage.h> /* for bzimage_parse */
 #include <asm/io_apic.h>
 #include <asm/hap.h>
+#include <asm/hpet.h>
 
 #include <public/version.h>
 
@@ -134,6 +135,9 @@ boolean_param("dom0_shadow", opt_dom0_shadow);
 static char __initdata opt_dom0_ioports_disable[200] =3D "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
 
+static bool_t __initdata ro_hpet =3D 1;
+boolean_param("ro-hpet", ro_hpet);
+
 /* Allow ring-3 access in long mode as guest cannot use ring 1 ... */
 #define BASE_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_USER)
 #define L1_PROT (BASE_PROT|_PAGE_GUEST_KERNEL)
@@ -1495,6 +1499,20 @@ int __init construct_dom0(
             rc |=3D iomem_deny_access(d, sfn, efn);
     }
 
+    /* Prevent access to HPET */
+    if ( hpet_address )
+    {
+        u8 prot_flags =3D hpet_flags & ACPI_HPET_PAGE_PROTECT_MASK;
+
+        mfn =3D paddr_to_pfn(hpet_address);
+        if ( prot_flags =3D=3D ACPI_HPET_PAGE_PROTECT4 )
+            rc |=3D iomem_deny_access(d, mfn, mfn);
+        else if ( prot_flags =3D=3D ACPI_HPET_PAGE_PROTECT64 )
+            rc |=3D iomem_deny_access(d, mfn, mfn + 15);
+        else if ( ro_hpet )
+            rc |=3D rangeset_add_singleton(mmio_ro_ranges, mfn);
+    }
+
     BUG_ON(rc !=3D 0);
 
     if ( elf_check_broken(&elf) )
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 0b13f52..7aa740f 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -52,6 +52,7 @@ DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __initdata hpet_address;
 u8 __initdata hpet_blockid;
+u8 __initdata hpet_flags;
 
 /*
  * force_hpet_broadcast: by default legacy hpet broadcast will be stopped
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 875f1de..10c4a56 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -52,6 +52,7 @@
 
 extern unsigned long hpet_address;
 extern u8 hpet_blockid;
+extern u8 hpet_flags;
 
 /*
  * Detect and initialise HPET hardware: return counter update frequency.
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2203314258484169960==
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
--===============2203314258484169960==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 07:59:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOi-0004Z5-VA; Tue, 03 Feb 2015 07:59: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 1YIYOi-0004Yr-Ac
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	98/E6-02749-3FF70D45; Tue, 03 Feb 2015 07:59:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1422950386!12110747!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12482 invoked from network); 3 Feb 2015 07:59:47 -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;
	3 Feb 2015 07:59: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 1YIYOg-00050F-1R
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOf-0006Jk-WB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:46 +0000
Date: Tue, 03 Feb 2015 07:59:45 +0000
Message-Id: <E1YIYOf-0006Jk-WB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: don't globally disable VPMU
	if initialization fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0f60c178b6e35303d53ffe99e174d0b9f806352
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:49:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:49:50 2015 +0100

    x86/VPMU: don't globally disable VPMU if initialization fails
    
    The failure to initialize VPMU may be temporary so we shouldn'd disable VMPU
    forever.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/vpmu.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 37f0d9f..efb2279 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -218,6 +218,7 @@ void vpmu_initialise(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t vendor = current_cpu_data.x86_vendor;
+    int ret;
 
     if ( is_pvh_vcpu(v) )
         return;
@@ -230,21 +231,25 @@ void vpmu_initialise(struct vcpu *v)
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
-        if ( svm_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
-            opt_vpmu_enabled = 0;
+        ret = svm_vpmu_initialise(v, opt_vpmu_enabled);
         break;
 
     case X86_VENDOR_INTEL:
-        if ( vmx_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
-            opt_vpmu_enabled = 0;
+        ret = vmx_vpmu_initialise(v, opt_vpmu_enabled);
         break;
 
     default:
-        printk("VPMU: Initialization failed. "
-               "Unknown CPU vendor %d\n", vendor);
-        opt_vpmu_enabled = 0;
-        break;
+        if ( opt_vpmu_enabled )
+        {
+            printk(XENLOG_G_WARNING "VPMU: Unknown CPU vendor %d. "
+                   "Disabling VPMU\n", vendor);
+            opt_vpmu_enabled = 0;
+        }
+        return;
     }
+
+    if ( ret )
+        printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
 }
 
 static void vpmu_clear_last(void *arg)
--
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 Tue Feb 03 07:59:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOi-0004Z5-VA; Tue, 03 Feb 2015 07:59: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 1YIYOi-0004Yr-Ac
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	98/E6-02749-3FF70D45; Tue, 03 Feb 2015 07:59:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1422950386!12110747!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12482 invoked from network); 3 Feb 2015 07:59:47 -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;
	3 Feb 2015 07:59: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 1YIYOg-00050F-1R
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOf-0006Jk-WB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:46 +0000
Date: Tue, 03 Feb 2015 07:59:45 +0000
Message-Id: <E1YIYOf-0006Jk-WB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: don't globally disable VPMU
	if initialization fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0f60c178b6e35303d53ffe99e174d0b9f806352
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:49:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:49:50 2015 +0100

    x86/VPMU: don't globally disable VPMU if initialization fails
    
    The failure to initialize VPMU may be temporary so we shouldn'd disable VMPU
    forever.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/vpmu.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 37f0d9f..efb2279 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -218,6 +218,7 @@ void vpmu_initialise(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t vendor = current_cpu_data.x86_vendor;
+    int ret;
 
     if ( is_pvh_vcpu(v) )
         return;
@@ -230,21 +231,25 @@ void vpmu_initialise(struct vcpu *v)
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
-        if ( svm_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
-            opt_vpmu_enabled = 0;
+        ret = svm_vpmu_initialise(v, opt_vpmu_enabled);
         break;
 
     case X86_VENDOR_INTEL:
-        if ( vmx_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
-            opt_vpmu_enabled = 0;
+        ret = vmx_vpmu_initialise(v, opt_vpmu_enabled);
         break;
 
     default:
-        printk("VPMU: Initialization failed. "
-               "Unknown CPU vendor %d\n", vendor);
-        opt_vpmu_enabled = 0;
-        break;
+        if ( opt_vpmu_enabled )
+        {
+            printk(XENLOG_G_WARNING "VPMU: Unknown CPU vendor %d. "
+                   "Disabling VPMU\n", vendor);
+            opt_vpmu_enabled = 0;
+        }
+        return;
     }
+
+    if ( ret )
+        printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
 }
 
 static void vpmu_clear_last(void *arg)
--
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 Tue Feb 03 07:59:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOt-0004b6-1m; Tue, 03 Feb 2015 07:59: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 1YIYOs-0004as-Dj
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:58 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D3/D1-02758-DFF70D45; Tue, 03 Feb 2015 07:59:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1422950396!10781852!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11196 invoked from network); 3 Feb 2015 07:59: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;
	3 Feb 2015 07:59: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 1YIYOq-00050O-6t
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOq-0006KX-61
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:56 +0000
Date: Tue, 03 Feb 2015 07:59:56 +0000
Message-Id: <E1YIYOq-0006KX-61@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: manage VPMU_CONTEXT_SAVE
	flag in vpmu_save_force()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 028afee0e10af22219efd601ea4016c77324af55
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:50:53 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:50:53 2015 +0100

    x86/VPMU: manage VPMU_CONTEXT_SAVE flag in vpmu_save_force()
    
    There is a possibility that we set VPMU_CONTEXT_SAVE on VPMU context in
    vpmu_load() and never clear it (because vpmu_save_force() will see
    VPMU_CONTEXT_LOADED bit clear, which is possible on AMD processors)
    
    The problem is that amd_vpmu_save() assumes that if VPMU_CONTEXT_SAVE is set
    then (1) we need to save counters and (2) we don't need to "stop" control
    registers since they must have been stopped earlier. The latter may cause all
    sorts of problem (like counters still running in a wrong guest and hypervisor
    sending to that guest unexpected PMU interrupts).
    
    Since setting this flag is currently always done prior to calling
    vpmu_save_force() let's both set and clear it there.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vpmu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index efb2279..e17e194 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -128,6 +128,8 @@ static void vpmu_save_force(void *arg)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
         return;
 
+    vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
+
     if ( vpmu->arch_vpmu_ops )
         (void)vpmu->arch_vpmu_ops->arch_vpmu_save(v);
 
@@ -176,7 +178,6 @@ void vpmu_load(struct vcpu *v)
          */
         if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
         {
-            vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
             on_selected_cpus(cpumask_of(vpmu->last_pcpu),
                              vpmu_save_force, (void *)v, 1);
             vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
@@ -193,7 +194,6 @@ void vpmu_load(struct vcpu *v)
         vpmu = vcpu_vpmu(prev);
 
         /* Someone ran here before us */
-        vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
         vpmu_save_force(prev);
         vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 
--
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 Tue Feb 03 07:59:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 07:59: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 1YIYOt-0004b6-1m; Tue, 03 Feb 2015 07:59: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 1YIYOs-0004as-Dj
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:58 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D3/D1-02758-DFF70D45; Tue, 03 Feb 2015 07:59:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1422950396!10781852!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11196 invoked from network); 3 Feb 2015 07:59: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;
	3 Feb 2015 07:59: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 1YIYOq-00050O-6t
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYOq-0006KX-61
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 07:59:56 +0000
Date: Tue, 03 Feb 2015 07:59:56 +0000
Message-Id: <E1YIYOq-0006KX-61@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: manage VPMU_CONTEXT_SAVE
	flag in vpmu_save_force()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 028afee0e10af22219efd601ea4016c77324af55
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:50:53 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:50:53 2015 +0100

    x86/VPMU: manage VPMU_CONTEXT_SAVE flag in vpmu_save_force()
    
    There is a possibility that we set VPMU_CONTEXT_SAVE on VPMU context in
    vpmu_load() and never clear it (because vpmu_save_force() will see
    VPMU_CONTEXT_LOADED bit clear, which is possible on AMD processors)
    
    The problem is that amd_vpmu_save() assumes that if VPMU_CONTEXT_SAVE is set
    then (1) we need to save counters and (2) we don't need to "stop" control
    registers since they must have been stopped earlier. The latter may cause all
    sorts of problem (like counters still running in a wrong guest and hypervisor
    sending to that guest unexpected PMU interrupts).
    
    Since setting this flag is currently always done prior to calling
    vpmu_save_force() let's both set and clear it there.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vpmu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index efb2279..e17e194 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -128,6 +128,8 @@ static void vpmu_save_force(void *arg)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
         return;
 
+    vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
+
     if ( vpmu->arch_vpmu_ops )
         (void)vpmu->arch_vpmu_ops->arch_vpmu_save(v);
 
@@ -176,7 +178,6 @@ void vpmu_load(struct vcpu *v)
          */
         if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
         {
-            vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
             on_selected_cpus(cpumask_of(vpmu->last_pcpu),
                              vpmu_save_force, (void *)v, 1);
             vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
@@ -193,7 +194,6 @@ void vpmu_load(struct vcpu *v)
         vpmu = vcpu_vpmu(prev);
 
         /* Someone ran here before us */
-        vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
         vpmu_save_force(prev);
         vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 
--
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 Tue Feb 03 08:00:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYP5-0004hV-Kr; Tue, 03 Feb 2015 08:00: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 1YIYP3-0004dz-Nq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:10 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	E0/5C-03170-90080D45; Tue, 03 Feb 2015 08:00:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1422950407!12401920!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22384 invoked from network); 3 Feb 2015 08:00:08 -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;
	3 Feb 2015 08:00: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 1YIYP1-0005IS-67
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYP0-0006M1-BI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:06 +0000
Date: Tue, 03 Feb 2015 08:00:06 +0000
Message-Id: <E1YIYP0-0006M1-BI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: set MSR bitmaps only for
	HVM/PVH guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b72b471b08804d2ec1da01b5bf887f347c4fea04
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:51:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:51:15 2015 +0100

    x86/VPMU: set MSR bitmaps only for HVM/PVH guests
    
    In preparation for making VPMU code shared with PV make sure that we we update
    MSR bitmaps only for HVM/PVH guests
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |   21 +++++++++++++--------
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    8 +++++---
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 4c448bb..19777e3 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -244,7 +244,8 @@ static int amd_vpmu_save(struct vcpu *v)
 
     context_save(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) &&
+         has_hvm_container_vcpu(v) && ctx->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
     return 1;
@@ -287,8 +288,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     ASSERT(!supported);
 
     /* For all counters, enable guest only mode for HVM guest */
-    if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
-        !(is_guest_mode(msr_content)) )
+    if ( has_hvm_container_vcpu(v) &&
+         (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
+         !is_guest_mode(msr_content) )
     {
         set_guest_mode(msr_content);
     }
@@ -303,8 +305,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
         vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
-        if ( !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
-            amd_vpmu_set_msr_bitmap(v);
+        if ( has_hvm_container_vcpu(v) &&
+             !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+             amd_vpmu_set_msr_bitmap(v);
     }
 
     /* stop saving & restore if guest stops first counter */
@@ -314,8 +317,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
         vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
-        if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
-            amd_vpmu_unset_msr_bitmap(v);
+        if ( has_hvm_container_vcpu(v) &&
+             ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+             amd_vpmu_unset_msr_bitmap(v);
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
@@ -403,7 +407,8 @@ static void amd_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+    if ( has_hvm_container_vcpu(v) &&
+         ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
     xfree(vpmu->context);
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 590c2a9..c9fb202 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -335,7 +335,8 @@ static int core2_vpmu_save(struct vcpu *v)
     __core2_vpmu_save(v);
 
     /* Unset PMU MSR bitmap to trap lazy load. */
-    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && cpu_has_vmx_msr_bitmap )
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) &&
+         has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
 
     return 1;
@@ -448,7 +449,8 @@ static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
     {
         __core2_vpmu_load(current);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
-        if ( cpu_has_vmx_msr_bitmap )
+        if ( has_hvm_container_vcpu(current) &&
+             cpu_has_vmx_msr_bitmap )
             core2_vpmu_set_msr_bitmap(current->arch.hvm_vmx.msr_bitmap);
     }
     return 1;
@@ -820,7 +822,7 @@ static void core2_vpmu_destroy(struct vcpu *v)
 
     xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
-    if ( cpu_has_vmx_msr_bitmap )
+    if ( has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
     release_pmu_ownship(PMU_OWNER_HVM);
     vpmu_reset(vpmu, VPMU_CONTEXT_ALLOCATED);
--
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 Tue Feb 03 08:00:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYP5-0004hV-Kr; Tue, 03 Feb 2015 08:00: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 1YIYP3-0004dz-Nq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:10 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	E0/5C-03170-90080D45; Tue, 03 Feb 2015 08:00:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1422950407!12401920!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22384 invoked from network); 3 Feb 2015 08:00:08 -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;
	3 Feb 2015 08:00: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 1YIYP1-0005IS-67
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYP0-0006M1-BI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:06 +0000
Date: Tue, 03 Feb 2015 08:00:06 +0000
Message-Id: <E1YIYP0-0006M1-BI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: set MSR bitmaps only for
	HVM/PVH guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b72b471b08804d2ec1da01b5bf887f347c4fea04
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:51:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:51:15 2015 +0100

    x86/VPMU: set MSR bitmaps only for HVM/PVH guests
    
    In preparation for making VPMU code shared with PV make sure that we we update
    MSR bitmaps only for HVM/PVH guests
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |   21 +++++++++++++--------
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    8 +++++---
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 4c448bb..19777e3 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -244,7 +244,8 @@ static int amd_vpmu_save(struct vcpu *v)
 
     context_save(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) &&
+         has_hvm_container_vcpu(v) && ctx->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
     return 1;
@@ -287,8 +288,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     ASSERT(!supported);
 
     /* For all counters, enable guest only mode for HVM guest */
-    if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
-        !(is_guest_mode(msr_content)) )
+    if ( has_hvm_container_vcpu(v) &&
+         (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
+         !is_guest_mode(msr_content) )
     {
         set_guest_mode(msr_content);
     }
@@ -303,8 +305,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
         vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
-        if ( !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
-            amd_vpmu_set_msr_bitmap(v);
+        if ( has_hvm_container_vcpu(v) &&
+             !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+             amd_vpmu_set_msr_bitmap(v);
     }
 
     /* stop saving & restore if guest stops first counter */
@@ -314,8 +317,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
         vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
-        if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
-            amd_vpmu_unset_msr_bitmap(v);
+        if ( has_hvm_container_vcpu(v) &&
+             ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+             amd_vpmu_unset_msr_bitmap(v);
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
@@ -403,7 +407,8 @@ static void amd_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+    if ( has_hvm_container_vcpu(v) &&
+         ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
     xfree(vpmu->context);
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 590c2a9..c9fb202 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -335,7 +335,8 @@ static int core2_vpmu_save(struct vcpu *v)
     __core2_vpmu_save(v);
 
     /* Unset PMU MSR bitmap to trap lazy load. */
-    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && cpu_has_vmx_msr_bitmap )
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) &&
+         has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
 
     return 1;
@@ -448,7 +449,8 @@ static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
     {
         __core2_vpmu_load(current);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
-        if ( cpu_has_vmx_msr_bitmap )
+        if ( has_hvm_container_vcpu(current) &&
+             cpu_has_vmx_msr_bitmap )
             core2_vpmu_set_msr_bitmap(current->arch.hvm_vmx.msr_bitmap);
     }
     return 1;
@@ -820,7 +822,7 @@ static void core2_vpmu_destroy(struct vcpu *v)
 
     xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
-    if ( cpu_has_vmx_msr_bitmap )
+    if ( has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
     release_pmu_ownship(PMU_OWNER_HVM);
     vpmu_reset(vpmu, VPMU_CONTEXT_ALLOCATED);
--
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 Tue Feb 03 08:00:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYPF-0004zo-SL; Tue, 03 Feb 2015 08:00:21 +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 1YIYPD-0004zS-VB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:20 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	B3/9B-02898-31080D45; Tue, 03 Feb 2015 08:00:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1422950417!11590863!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27034 invoked from network); 3 Feb 2015 08:00:18 -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;
	3 Feb 2015 08:00: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 1YIYPB-0005RD-Bw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPB-0006Mo-AW
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:17 +0000
Date: Tue, 03 Feb 2015 08:00:17 +0000
Message-Id: <E1YIYPB-0006Mo-AW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: make vpmu macros a bit more
	efficient
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c71b23096966fd60726ed4f4e7ae1469f10bbe64
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:51:43 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:51:43 2015 +0100

    x86/VPMU: make vpmu macros a bit more efficient
    
    Introduce vpmu_are_all_set that allows testing multiple bits at once. Convert macros
    into inlines for better compiler checking.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    5 +----
 xen/arch/x86/hvm/vpmu.c           |    3 +--
 xen/include/asm-x86/hvm/vpmu.h    |   25 +++++++++++++++++++++----
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index c9fb202..951aece 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -326,10 +326,7 @@ static int core2_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
-        return 0;
-
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) 
+    if ( !vpmu_are_all_set(vpmu, VPMU_CONTEXT_SAVE | VPMU_CONTEXT_LOADED) )
         return 0;
 
     __core2_vpmu_save(v);
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index e17e194..63b2158 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -143,8 +143,7 @@ void vpmu_save(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     int pcpu = smp_processor_id();
 
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
+    if ( !vpmu_are_all_set(vpmu, VPMU_CONTEXT_ALLOCATED | VPMU_CONTEXT_LOADED) )
        return;
 
     vpmu->last_pcpu = pcpu;
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 1f28bd8..ddc2748 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -82,10 +82,27 @@ struct vpmu_struct {
 #define VPMU_CPU_HAS_BTS                    0x200 /* Has Branch Trace Store */
 
 
-#define vpmu_set(_vpmu, _x)    ((_vpmu)->flags |= (_x))
-#define vpmu_reset(_vpmu, _x)  ((_vpmu)->flags &= ~(_x))
-#define vpmu_is_set(_vpmu, _x) ((_vpmu)->flags & (_x))
-#define vpmu_clear(_vpmu)      ((_vpmu)->flags = 0)
+static inline void vpmu_set(struct vpmu_struct *vpmu, const u32 mask)
+{
+    vpmu->flags |= mask;
+}
+static inline void vpmu_reset(struct vpmu_struct *vpmu, const u32 mask)
+{
+    vpmu->flags &= ~mask;
+}
+static inline void vpmu_clear(struct vpmu_struct *vpmu)
+{
+    vpmu->flags = 0;
+}
+static inline bool_t vpmu_is_set(const struct vpmu_struct *vpmu, const u32 mask)
+{
+    return !!(vpmu->flags & mask);
+}
+static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
+                                      const u32 mask)
+{
+    return !!((vpmu->flags & mask) == mask);
+}
 
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
--
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 Tue Feb 03 08:00:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYPF-0004zo-SL; Tue, 03 Feb 2015 08:00:21 +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 1YIYPD-0004zS-VB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:20 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	B3/9B-02898-31080D45; Tue, 03 Feb 2015 08:00:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1422950417!11590863!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27034 invoked from network); 3 Feb 2015 08:00:18 -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;
	3 Feb 2015 08:00: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 1YIYPB-0005RD-Bw
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPB-0006Mo-AW
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:17 +0000
Date: Tue, 03 Feb 2015 08:00:17 +0000
Message-Id: <E1YIYPB-0006Mo-AW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: make vpmu macros a bit more
	efficient
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c71b23096966fd60726ed4f4e7ae1469f10bbe64
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:51:43 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:51:43 2015 +0100

    x86/VPMU: make vpmu macros a bit more efficient
    
    Introduce vpmu_are_all_set that allows testing multiple bits at once. Convert macros
    into inlines for better compiler checking.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    5 +----
 xen/arch/x86/hvm/vpmu.c           |    3 +--
 xen/include/asm-x86/hvm/vpmu.h    |   25 +++++++++++++++++++++----
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index c9fb202..951aece 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -326,10 +326,7 @@ static int core2_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
-        return 0;
-
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) 
+    if ( !vpmu_are_all_set(vpmu, VPMU_CONTEXT_SAVE | VPMU_CONTEXT_LOADED) )
         return 0;
 
     __core2_vpmu_save(v);
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index e17e194..63b2158 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -143,8 +143,7 @@ void vpmu_save(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     int pcpu = smp_processor_id();
 
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
+    if ( !vpmu_are_all_set(vpmu, VPMU_CONTEXT_ALLOCATED | VPMU_CONTEXT_LOADED) )
        return;
 
     vpmu->last_pcpu = pcpu;
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 1f28bd8..ddc2748 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -82,10 +82,27 @@ struct vpmu_struct {
 #define VPMU_CPU_HAS_BTS                    0x200 /* Has Branch Trace Store */
 
 
-#define vpmu_set(_vpmu, _x)    ((_vpmu)->flags |= (_x))
-#define vpmu_reset(_vpmu, _x)  ((_vpmu)->flags &= ~(_x))
-#define vpmu_is_set(_vpmu, _x) ((_vpmu)->flags & (_x))
-#define vpmu_clear(_vpmu)      ((_vpmu)->flags = 0)
+static inline void vpmu_set(struct vpmu_struct *vpmu, const u32 mask)
+{
+    vpmu->flags |= mask;
+}
+static inline void vpmu_reset(struct vpmu_struct *vpmu, const u32 mask)
+{
+    vpmu->flags &= ~mask;
+}
+static inline void vpmu_clear(struct vpmu_struct *vpmu)
+{
+    vpmu->flags = 0;
+}
+static inline bool_t vpmu_is_set(const struct vpmu_struct *vpmu, const u32 mask)
+{
+    return !!(vpmu->flags & mask);
+}
+static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
+                                      const u32 mask)
+{
+    return !!((vpmu->flags & mask) == mask);
+}
 
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
--
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 Tue Feb 03 08:00:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYPQ-000518-35; Tue, 03 Feb 2015 08:00:32 +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 1YIYPO-00050s-Pq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:31 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	30/98-02749-E1080D45; Tue, 03 Feb 2015 08:00:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1422950427!12107564!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5413 invoked from network); 3 Feb 2015 08:00:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:00: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 1YIYPL-0005Rc-LR
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPL-0006Na-Fz
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:27 +0000
Date: Tue, 03 Feb 2015 08:00:27 +0000
Message-Id: <E1YIYPL-0006Na-Fz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: clean up Intel VPMU code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c85cae312943263a00a69b038acc7454e2804b6
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:52:23 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:52:23 2015 +0100

    x86/VPMU: clean up Intel VPMU code
    
    Remove struct pmumsr and core2_pmu_enable. Replace static MSR structures with
    fields in core2_vpmu_context.
    
    Call core2_get_pmc_count() once, during initialization.
    
    Properly clean up when core2_vpmu_alloc_resource() fails.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c        |  380 ++++++++++++++----------------
 xen/include/asm-x86/hvm/vmx/vpmu_core2.h |   19 --
 2 files changed, 171 insertions(+), 228 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 951aece..9c4d00e 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -69,6 +69,27 @@
 static bool_t __read_mostly full_width_write;
 
 /*
+ * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
+ * counters. 4 bits for every counter.
+ */
+#define FIXED_CTR_CTRL_BITS 4
+#define FIXED_CTR_CTRL_MASK ((1 << FIXED_CTR_CTRL_BITS) - 1)
+
+#define VPMU_CORE2_MAX_FIXED_PMCS     4
+struct core2_vpmu_context {
+    u64 fixed_ctrl;
+    u64 ds_area;
+    u64 pebs_enable;
+    u64 global_ovf_status;
+    u64 enabled_cntrs;  /* Follows PERF_GLOBAL_CTRL MSR format */
+    u64 fix_counters[VPMU_CORE2_MAX_FIXED_PMCS];
+    struct arch_msr_pair arch_msr_pair[1];
+};
+
+/* Number of general-purpose and fixed performance counters */
+static unsigned int __read_mostly arch_pmc_cnt, fixed_pmc_cnt;
+
+/*
  * QUIRK to workaround an issue on various family 6 cpus.
  * The issue leads to endless PMC interrupt loops on the processor.
  * If the interrupt handler is running and a pmc reaches the value 0, this
@@ -88,11 +109,8 @@ static void check_pmc_quirk(void)
         is_pmc_quirk = 0;    
 }
 
-static int core2_get_pmc_count(void);
 static void handle_pmc_quirk(u64 msr_content)
 {
-    int num_gen_pmc = core2_get_pmc_count();
-    int num_fix_pmc  = 3;
     int i;
     u64 val;
 
@@ -100,7 +118,7 @@ static void handle_pmc_quirk(u64 msr_content)
         return;
 
     val = msr_content;
-    for ( i = 0; i < num_gen_pmc; i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
         if ( val & 0x1 )
         {
@@ -112,7 +130,7 @@ static void handle_pmc_quirk(u64 msr_content)
         val >>= 1;
     }
     val = msr_content >> 32;
-    for ( i = 0; i < num_fix_pmc; i++ )
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
         if ( val & 0x1 )
         {
@@ -125,128 +143,91 @@ static void handle_pmc_quirk(u64 msr_content)
     }
 }
 
-static const u32 core2_fix_counters_msr[] = {
-    MSR_CORE_PERF_FIXED_CTR0,
-    MSR_CORE_PERF_FIXED_CTR1,
-    MSR_CORE_PERF_FIXED_CTR2
-};
-
 /*
- * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
- * counters. 4 bits for every counter.
+ * Read the number of general counters via CPUID.EAX[0xa].EAX[8..15]
  */
-#define FIXED_CTR_CTRL_BITS 4
-#define FIXED_CTR_CTRL_MASK ((1 << FIXED_CTR_CTRL_BITS) - 1)
-
-/* The index into the core2_ctrls_msr[] of this MSR used in core2_vpmu_dump() */
-#define MSR_CORE_PERF_FIXED_CTR_CTRL_IDX 0
-
-/* Core 2 Non-architectual Performance Control MSRs. */
-static const u32 core2_ctrls_msr[] = {
-    MSR_CORE_PERF_FIXED_CTR_CTRL,
-    MSR_IA32_PEBS_ENABLE,
-    MSR_IA32_DS_AREA
-};
-
-struct pmumsr {
-    unsigned int num;
-    const u32 *msr;
-};
-
-static const struct pmumsr core2_fix_counters = {
-    VPMU_CORE2_NUM_FIXED,
-    core2_fix_counters_msr
-};
+static int core2_get_arch_pmc_count(void)
+{
+    u32 eax;
 
-static const struct pmumsr core2_ctrls = {
-    VPMU_CORE2_NUM_CTRLS,
-    core2_ctrls_msr
-};
-static int arch_pmc_cnt;
+    eax = cpuid_eax(0xa);
+    return MASK_EXTR(eax, PMU_GENERAL_NR_MASK);
+}
 
 /*
- * Read the number of general counters via CPUID.EAX[0xa].EAX[8..15]
+ * Read the number of fixed counters via CPUID.EDX[0xa].EDX[0..4]
  */
-static int core2_get_pmc_count(void)
+static int core2_get_fixed_pmc_count(void)
 {
-    u32 eax, ebx, ecx, edx;
+    u32 eax;
 
-    if ( arch_pmc_cnt == 0 )
-    {
-        cpuid(0xa, &eax, &ebx, &ecx, &edx);
-        arch_pmc_cnt = (eax & PMU_GENERAL_NR_MASK) >> PMU_GENERAL_NR_SHIFT;
-    }
-
-    return arch_pmc_cnt;
+    eax = cpuid_eax(0xa);
+    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
 }
 
 static u64 core2_calc_intial_glb_ctrl_msr(void)
 {
-    int arch_pmc_bits = (1 << core2_get_pmc_count()) - 1;
-    u64 fix_pmc_bits  = (1 << 3) - 1;
-    return ((fix_pmc_bits << 32) | arch_pmc_bits);
+    int arch_pmc_bits = (1 << arch_pmc_cnt) - 1;
+    u64 fix_pmc_bits  = (1 << fixed_pmc_cnt) - 1;
+
+    return (fix_pmc_bits << 32) | arch_pmc_bits;
 }
 
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
 static int core2_get_bitwidth_fix_count(void)
 {
-    u32 eax, ebx, ecx, edx;
+    u32 edx;
 
-    cpuid(0xa, &eax, &ebx, &ecx, &edx);
-    return ((edx & PMU_FIXED_WIDTH_MASK) >> PMU_FIXED_WIDTH_SHIFT);
+    edx = cpuid_edx(0xa);
+    return MASK_EXTR(edx, PMU_FIXED_WIDTH_MASK);
 }
 
 static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)
 {
-    int i;
     u32 msr_index_pmc;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    switch ( msr_index )
     {
-        if ( core2_fix_counters.msr[i] == msr_index )
+    case MSR_CORE_PERF_FIXED_CTR_CTRL:
+    case MSR_IA32_DS_AREA:
+    case MSR_IA32_PEBS_ENABLE:
+        *type = MSR_TYPE_CTRL;
+        return 1;
+
+    case MSR_CORE_PERF_GLOBAL_CTRL:
+    case MSR_CORE_PERF_GLOBAL_STATUS:
+    case MSR_CORE_PERF_GLOBAL_OVF_CTRL:
+        *type = MSR_TYPE_GLOBAL;
+        return 1;
+
+    default:
+
+        if ( (msr_index >= MSR_CORE_PERF_FIXED_CTR0) &&
+             (msr_index < MSR_CORE_PERF_FIXED_CTR0 + fixed_pmc_cnt) )
         {
+            *index = msr_index - MSR_CORE_PERF_FIXED_CTR0;
             *type = MSR_TYPE_COUNTER;
-            *index = i;
             return 1;
         }
-    }
 
-    for ( i = 0; i < core2_ctrls.num; i++ )
-    {
-        if ( core2_ctrls.msr[i] == msr_index )
+        if ( (msr_index >= MSR_P6_EVNTSEL(0)) &&
+             (msr_index < MSR_P6_EVNTSEL(arch_pmc_cnt)) )
         {
-            *type = MSR_TYPE_CTRL;
-            *index = i;
+            *index = msr_index - MSR_P6_EVNTSEL(0);
+            *type = MSR_TYPE_ARCH_CTRL;
             return 1;
         }
-    }
 
-    if ( (msr_index == MSR_CORE_PERF_GLOBAL_CTRL) ||
-         (msr_index == MSR_CORE_PERF_GLOBAL_STATUS) ||
-         (msr_index == MSR_CORE_PERF_GLOBAL_OVF_CTRL) )
-    {
-        *type = MSR_TYPE_GLOBAL;
-        return 1;
-    }
-
-    msr_index_pmc = msr_index & MSR_PMC_ALIAS_MASK;
-    if ( (msr_index_pmc >= MSR_IA32_PERFCTR0) &&
-         (msr_index_pmc < (MSR_IA32_PERFCTR0 + core2_get_pmc_count())) )
-    {
-        *type = MSR_TYPE_ARCH_COUNTER;
-        *index = msr_index_pmc - MSR_IA32_PERFCTR0;
-        return 1;
-    }
-
-    if ( (msr_index >= MSR_P6_EVNTSEL(0)) &&
-         (msr_index < (MSR_P6_EVNTSEL(core2_get_pmc_count()))) )
-    {
-        *type = MSR_TYPE_ARCH_CTRL;
-        *index = msr_index - MSR_P6_EVNTSEL(0);
-        return 1;
+        msr_index_pmc = msr_index & MSR_PMC_ALIAS_MASK;
+        if ( (msr_index_pmc >= MSR_IA32_PERFCTR0) &&
+             (msr_index_pmc < (MSR_IA32_PERFCTR0 + arch_pmc_cnt)) )
+        {
+            *type = MSR_TYPE_ARCH_COUNTER;
+            *index = msr_index_pmc - MSR_IA32_PERFCTR0;
+            return 1;
+        }
+        return 0;
     }
-
-    return 0;
 }
 
 static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
@@ -254,13 +235,13 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
     int i;
 
     /* Allow Read/Write PMU Counters MSR Directly. */
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
-        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
-        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
+        clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i), msr_bitmap);
+        clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i),
                   msr_bitmap + 0x800/BYTES_PER_LONG);
     }
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
         clear_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i), msr_bitmap);
         clear_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i),
@@ -275,26 +256,28 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
     }
 
     /* Allow Read PMU Non-global Controls Directly. */
-    for ( i = 0; i < core2_ctrls.num; i++ )
-        clear_bit(msraddr_to_bitpos(core2_ctrls.msr[i]), msr_bitmap);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
-        clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
+    for ( i = 0; i < arch_pmc_cnt; i++ )
+         clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
+
+    clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
+    clear_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
+    clear_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
 static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
 {
     int i;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
-        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
-        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
+        set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i), msr_bitmap);
+        set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i),
                 msr_bitmap + 0x800/BYTES_PER_LONG);
     }
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
-        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i), msr_bitmap);
-        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i),
+        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0 + i), msr_bitmap);
+        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0 + i),
                 msr_bitmap + 0x800/BYTES_PER_LONG);
 
         if ( full_width_write )
@@ -305,10 +288,12 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
         }
     }
 
-    for ( i = 0; i < core2_ctrls.num; i++ )
-        set_bit(msraddr_to_bitpos(core2_ctrls.msr[i]), msr_bitmap);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
         set_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
+
+    set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
+    set_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
+    set_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
 static inline void __core2_vpmu_save(struct vcpu *v)
@@ -316,10 +301,10 @@ static inline void __core2_vpmu_save(struct vcpu *v)
     int i;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
-        rdmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
-        rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
+        rdmsrl(MSR_CORE_PERF_FIXED_CTR0 + i, core2_vpmu_cxt->fix_counters[i]);
+    for ( i = 0; i < arch_pmc_cnt; i++ )
+        rdmsrl(MSR_IA32_PERFCTR0 + i, core2_vpmu_cxt->arch_msr_pair[i].counter);
 }
 
 static int core2_vpmu_save(struct vcpu *v)
@@ -344,20 +329,22 @@ static inline void __core2_vpmu_load(struct vcpu *v)
     unsigned int i, pmc_start;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
-        wrmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
+        wrmsrl(MSR_CORE_PERF_FIXED_CTR0 + i, core2_vpmu_cxt->fix_counters[i]);
 
     if ( full_width_write )
         pmc_start = MSR_IA32_A_PERFCTR0;
     else
         pmc_start = MSR_IA32_PERFCTR0;
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
+    {
         wrmsrl(pmc_start + i, core2_vpmu_cxt->arch_msr_pair[i].counter);
-
-    for ( i = 0; i < core2_ctrls.num; i++ )
-        wrmsrl(core2_ctrls.msr[i], core2_vpmu_cxt->ctrls[i]);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
         wrmsrl(MSR_P6_EVNTSEL(i), core2_vpmu_cxt->arch_msr_pair[i].control);
+    }
+
+    wrmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, core2_vpmu_cxt->fixed_ctrl);
+    wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
+    wrmsrl(MSR_IA32_PEBS_ENABLE, core2_vpmu_cxt->pebs_enable);
 }
 
 static void core2_vpmu_load(struct vcpu *v)
@@ -376,56 +363,37 @@ static int core2_vpmu_alloc_resource(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt;
-    struct core2_pmu_enable *pmu_enable;
 
     if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
         return 0;
 
     wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
     if ( vmx_add_host_load_msr(MSR_CORE_PERF_GLOBAL_CTRL) )
-        return 0;
+        goto out_err;
 
     if ( vmx_add_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL) )
-        return 0;
+        goto out_err;
     vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL,
                  core2_calc_intial_glb_ctrl_msr());
 
-    pmu_enable = xzalloc_bytes(sizeof(struct core2_pmu_enable) +
-                               core2_get_pmc_count() - 1);
-    if ( !pmu_enable )
-        goto out1;
-
     core2_vpmu_cxt = xzalloc_bytes(sizeof(struct core2_vpmu_context) +
-                    (core2_get_pmc_count()-1)*sizeof(struct arch_msr_pair));
+                    (arch_pmc_cnt-1)*sizeof(struct arch_msr_pair));
     if ( !core2_vpmu_cxt )
-        goto out2;
-    core2_vpmu_cxt->pmu_enable = pmu_enable;
+        goto out_err;
+
     vpmu->context = (void *)core2_vpmu_cxt;
 
+    vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
+
     return 1;
- out2:
-    xfree(pmu_enable);
- out1:
-    gdprintk(XENLOG_WARNING, "Insufficient memory for PMU, PMU feature is "
-             "unavailable on domain %d vcpu %d.\n",
-             v->vcpu_id, v->domain->domain_id);
-    return 0;
-}
 
-static void core2_vpmu_save_msr_context(struct vcpu *v, int type,
-                                       int index, u64 msr_data)
-{
-    struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
+out_err:
+    release_pmu_ownship(PMU_OWNER_HVM);
 
-    switch ( type )
-    {
-    case MSR_TYPE_CTRL:
-        core2_vpmu_cxt->ctrls[index] = msr_data;
-        break;
-    case MSR_TYPE_ARCH_CTRL:
-        core2_vpmu_cxt->arch_msr_pair[index].control = msr_data;
-        break;
-    }
+    printk("Failed to allocate VPMU resources for domain %u vcpu %u\n",
+           v->vcpu_id, v->domain->domain_id);
+
+    return 0;
 }
 
 static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
@@ -436,10 +404,8 @@ static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
         return 0;
 
     if ( unlikely(!vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED)) &&
-	 (vpmu->context != NULL ||
-	  !core2_vpmu_alloc_resource(current)) )
+         !core2_vpmu_alloc_resource(current) )
         return 0;
-    vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
 
     /* Do the lazy load staff. */
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
@@ -456,8 +422,7 @@ static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
 static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                                uint64_t supported)
 {
-    u64 global_ctrl, non_global_ctrl;
-    char pmu_enable = 0;
+    u64 global_ctrl;
     int i, tmp;
     int type = -1, index = -1;
     struct vcpu *v = current;
@@ -504,6 +469,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( msr_content & 1 )
             gdprintk(XENLOG_WARNING, "Guest is trying to enable PEBS, "
                      "which is not supported.\n");
+        core2_vpmu_cxt->pebs_enable = msr_content;
         return 1;
     case MSR_IA32_DS_AREA:
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
@@ -516,57 +482,48 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                 hvm_inject_hw_exception(TRAP_gp_fault, 0);
                 return 1;
             }
-            core2_vpmu_cxt->pmu_enable->ds_area_enable = msr_content ? 1 : 0;
+            core2_vpmu_cxt->ds_area = msr_content;
             break;
         }
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 1;
     case MSR_CORE_PERF_GLOBAL_CTRL:
         global_ctrl = msr_content;
-        for ( i = 0; i < core2_get_pmc_count(); i++ )
-        {
-            rdmsrl(MSR_P6_EVNTSEL(i), non_global_ctrl);
-            core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i] =
-                    global_ctrl & (non_global_ctrl >> 22) & 1;
-            global_ctrl >>= 1;
-        }
-
-        rdmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, non_global_ctrl);
-        global_ctrl = msr_content >> 32;
-        for ( i = 0; i < core2_fix_counters.num; i++ )
-        {
-            core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
-                (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
-            non_global_ctrl >>= FIXED_CTR_CTRL_BITS;
-            global_ctrl >>= 1;
-        }
         break;
     case MSR_CORE_PERF_FIXED_CTR_CTRL:
-        non_global_ctrl = msr_content;
         vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
-        global_ctrl >>= 32;
-        for ( i = 0; i < core2_fix_counters.num; i++ )
+        core2_vpmu_cxt->enabled_cntrs &=
+                ~(((1ULL << VPMU_CORE2_MAX_FIXED_PMCS) - 1) << 32);
+        if ( msr_content != 0 )
         {
-            core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
-                (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
-            non_global_ctrl >>= 4;
-            global_ctrl >>= 1;
+            u64 val = msr_content;
+            for ( i = 0; i < fixed_pmc_cnt; i++ )
+            {
+                if ( val & 3 )
+                    core2_vpmu_cxt->enabled_cntrs |= (1ULL << 32) << i;
+                val >>= FIXED_CTR_CTRL_BITS;
+            }
         }
+
+        core2_vpmu_cxt->fixed_ctrl = msr_content;
         break;
     default:
         tmp = msr - MSR_P6_EVNTSEL(0);
-        vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
-        if ( tmp >= 0 && tmp < core2_get_pmc_count() )
-            core2_vpmu_cxt->pmu_enable->arch_pmc_enable[tmp] =
-                (global_ctrl >> tmp) & (msr_content >> 22) & 1;
+        if ( tmp >= 0 && tmp < arch_pmc_cnt )
+        {
+            vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
+
+            if ( msr_content & (1ULL << 22) )
+                core2_vpmu_cxt->enabled_cntrs |= 1ULL << tmp;
+            else
+                core2_vpmu_cxt->enabled_cntrs &= ~(1ULL << tmp);
+
+            core2_vpmu_cxt->arch_msr_pair[tmp].control = msr_content;
+        }
     }
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
-        pmu_enable |= core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i];
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
-        pmu_enable |= core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i];
-    pmu_enable |= core2_vpmu_cxt->pmu_enable->ds_area_enable;
-    if ( pmu_enable )
+    if ( (global_ctrl & core2_vpmu_cxt->enabled_cntrs) ||
+         (core2_vpmu_cxt->ds_area != 0)  )
         vpmu_set(vpmu, VPMU_RUNNING);
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
@@ -584,7 +541,6 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
     }
 
-    core2_vpmu_save_msr_context(v, type, index, msr_content);
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -600,7 +556,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
             if  ( msr == MSR_IA32_DS_AREA )
                 break;
             /* 4 bits per counter, currently 3 fixed counters implemented. */
-            mask = ~((1ull << (VPMU_CORE2_NUM_FIXED * FIXED_CTR_CTRL_BITS)) - 1);
+            mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
             if (msr_content & mask)
                 inject_gp = 1;
             break;
@@ -685,7 +641,7 @@ static void core2_vpmu_do_cpuid(unsigned int input,
 static void core2_vpmu_dump(const struct vcpu *v)
 {
     const struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    int i, num;
+    unsigned int i;
     const struct core2_vpmu_context *core2_vpmu_cxt = NULL;
     u64 val;
 
@@ -703,27 +659,25 @@ static void core2_vpmu_dump(const struct vcpu *v)
 
     printk("    vPMU running\n");
     core2_vpmu_cxt = vpmu->context;
-    num = core2_get_pmc_count();
+
     /* Print the contents of the counter and its configuration msr. */
-    for ( i = 0; i < num; i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
         const struct arch_msr_pair *msr_pair = core2_vpmu_cxt->arch_msr_pair;
 
-        if ( core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i] )
-            printk("      general_%d: 0x%016lx ctrl: 0x%016lx\n",
-                   i, msr_pair[i].counter, msr_pair[i].control);
+        printk("      general_%d: 0x%016lx ctrl: 0x%016lx\n",
+               i, msr_pair[i].counter, msr_pair[i].control);
     }
     /*
      * The configuration of the fixed counter is 4 bits each in the
      * MSR_CORE_PERF_FIXED_CTR_CTRL.
      */
-    val = core2_vpmu_cxt->ctrls[MSR_CORE_PERF_FIXED_CTR_CTRL_IDX];
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    val = core2_vpmu_cxt->fixed_ctrl;
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
-        if ( core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] )
-            printk("      fixed_%d:   0x%016lx ctrl: %#lx\n",
-                   i, core2_vpmu_cxt->fix_counters[i],
-                   val & FIXED_CTR_CTRL_MASK);
+        printk("      fixed_%d:   0x%016lx ctrl: %#lx\n",
+               i, core2_vpmu_cxt->fix_counters[i],
+               val & FIXED_CTR_CTRL_MASK);
         val >>= FIXED_CTR_CTRL_BITS;
     }
 }
@@ -741,7 +695,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_ovf_status |= msr_content;
-        msr_content = 0xC000000700000000 | ((1 << core2_get_pmc_count()) - 1);
+        msr_content = 0xC000000700000000 | ((1 << arch_pmc_cnt) - 1);
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
@@ -808,6 +762,16 @@ static int core2_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
     }
     ds_warned = 1;
  func_out:
+
+    arch_pmc_cnt = core2_get_arch_pmc_count();
+    fixed_pmc_cnt = core2_get_fixed_pmc_count();
+    if ( fixed_pmc_cnt > VPMU_CORE2_MAX_FIXED_PMCS )
+    {
+        fixed_pmc_cnt = VPMU_CORE2_MAX_FIXED_PMCS;
+        printk(XENLOG_G_WARNING "Limiting number of fixed counters to %d\n",
+               fixed_pmc_cnt);
+    }
+
     check_pmc_quirk();
     return 0;
 }
@@ -815,9 +779,7 @@ static int core2_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 static void core2_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
 
-    xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
     if ( has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
diff --git a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
index 60b05fd..410372d 100644
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
@@ -23,29 +23,10 @@
 #ifndef __ASM_X86_HVM_VPMU_CORE_H_
 #define __ASM_X86_HVM_VPMU_CORE_H_
 
-/* Currently only 3 fixed counters are supported. */
-#define VPMU_CORE2_NUM_FIXED 3
-/* Currently only 3 Non-architectual Performance Control MSRs */
-#define VPMU_CORE2_NUM_CTRLS 3
-
 struct arch_msr_pair {
     u64 counter;
     u64 control;
 };
 
-struct core2_pmu_enable {
-    char ds_area_enable;
-    char fixed_ctr_enable[VPMU_CORE2_NUM_FIXED];
-    char arch_pmc_enable[1];
-};
-
-struct core2_vpmu_context {
-    struct core2_pmu_enable *pmu_enable;
-    u64 fix_counters[VPMU_CORE2_NUM_FIXED];
-    u64 ctrls[VPMU_CORE2_NUM_CTRLS];
-    u64 global_ovf_status;
-    struct arch_msr_pair arch_msr_pair[1];
-};
-
 #endif /* __ASM_X86_HVM_VPMU_CORE_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 Tue Feb 03 08:00:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYPQ-000518-35; Tue, 03 Feb 2015 08:00:32 +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 1YIYPO-00050s-Pq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:31 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	30/98-02749-E1080D45; Tue, 03 Feb 2015 08:00:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1422950427!12107564!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5413 invoked from network); 3 Feb 2015 08:00:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:00: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 1YIYPL-0005Rc-LR
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPL-0006Na-Fz
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:27 +0000
Date: Tue, 03 Feb 2015 08:00:27 +0000
Message-Id: <E1YIYPL-0006Na-Fz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: clean up Intel VPMU code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c85cae312943263a00a69b038acc7454e2804b6
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:52:23 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:52:23 2015 +0100

    x86/VPMU: clean up Intel VPMU code
    
    Remove struct pmumsr and core2_pmu_enable. Replace static MSR structures with
    fields in core2_vpmu_context.
    
    Call core2_get_pmc_count() once, during initialization.
    
    Properly clean up when core2_vpmu_alloc_resource() fails.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c        |  380 ++++++++++++++----------------
 xen/include/asm-x86/hvm/vmx/vpmu_core2.h |   19 --
 2 files changed, 171 insertions(+), 228 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 951aece..9c4d00e 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -69,6 +69,27 @@
 static bool_t __read_mostly full_width_write;
 
 /*
+ * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
+ * counters. 4 bits for every counter.
+ */
+#define FIXED_CTR_CTRL_BITS 4
+#define FIXED_CTR_CTRL_MASK ((1 << FIXED_CTR_CTRL_BITS) - 1)
+
+#define VPMU_CORE2_MAX_FIXED_PMCS     4
+struct core2_vpmu_context {
+    u64 fixed_ctrl;
+    u64 ds_area;
+    u64 pebs_enable;
+    u64 global_ovf_status;
+    u64 enabled_cntrs;  /* Follows PERF_GLOBAL_CTRL MSR format */
+    u64 fix_counters[VPMU_CORE2_MAX_FIXED_PMCS];
+    struct arch_msr_pair arch_msr_pair[1];
+};
+
+/* Number of general-purpose and fixed performance counters */
+static unsigned int __read_mostly arch_pmc_cnt, fixed_pmc_cnt;
+
+/*
  * QUIRK to workaround an issue on various family 6 cpus.
  * The issue leads to endless PMC interrupt loops on the processor.
  * If the interrupt handler is running and a pmc reaches the value 0, this
@@ -88,11 +109,8 @@ static void check_pmc_quirk(void)
         is_pmc_quirk = 0;    
 }
 
-static int core2_get_pmc_count(void);
 static void handle_pmc_quirk(u64 msr_content)
 {
-    int num_gen_pmc = core2_get_pmc_count();
-    int num_fix_pmc  = 3;
     int i;
     u64 val;
 
@@ -100,7 +118,7 @@ static void handle_pmc_quirk(u64 msr_content)
         return;
 
     val = msr_content;
-    for ( i = 0; i < num_gen_pmc; i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
         if ( val & 0x1 )
         {
@@ -112,7 +130,7 @@ static void handle_pmc_quirk(u64 msr_content)
         val >>= 1;
     }
     val = msr_content >> 32;
-    for ( i = 0; i < num_fix_pmc; i++ )
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
         if ( val & 0x1 )
         {
@@ -125,128 +143,91 @@ static void handle_pmc_quirk(u64 msr_content)
     }
 }
 
-static const u32 core2_fix_counters_msr[] = {
-    MSR_CORE_PERF_FIXED_CTR0,
-    MSR_CORE_PERF_FIXED_CTR1,
-    MSR_CORE_PERF_FIXED_CTR2
-};
-
 /*
- * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
- * counters. 4 bits for every counter.
+ * Read the number of general counters via CPUID.EAX[0xa].EAX[8..15]
  */
-#define FIXED_CTR_CTRL_BITS 4
-#define FIXED_CTR_CTRL_MASK ((1 << FIXED_CTR_CTRL_BITS) - 1)
-
-/* The index into the core2_ctrls_msr[] of this MSR used in core2_vpmu_dump() */
-#define MSR_CORE_PERF_FIXED_CTR_CTRL_IDX 0
-
-/* Core 2 Non-architectual Performance Control MSRs. */
-static const u32 core2_ctrls_msr[] = {
-    MSR_CORE_PERF_FIXED_CTR_CTRL,
-    MSR_IA32_PEBS_ENABLE,
-    MSR_IA32_DS_AREA
-};
-
-struct pmumsr {
-    unsigned int num;
-    const u32 *msr;
-};
-
-static const struct pmumsr core2_fix_counters = {
-    VPMU_CORE2_NUM_FIXED,
-    core2_fix_counters_msr
-};
+static int core2_get_arch_pmc_count(void)
+{
+    u32 eax;
 
-static const struct pmumsr core2_ctrls = {
-    VPMU_CORE2_NUM_CTRLS,
-    core2_ctrls_msr
-};
-static int arch_pmc_cnt;
+    eax = cpuid_eax(0xa);
+    return MASK_EXTR(eax, PMU_GENERAL_NR_MASK);
+}
 
 /*
- * Read the number of general counters via CPUID.EAX[0xa].EAX[8..15]
+ * Read the number of fixed counters via CPUID.EDX[0xa].EDX[0..4]
  */
-static int core2_get_pmc_count(void)
+static int core2_get_fixed_pmc_count(void)
 {
-    u32 eax, ebx, ecx, edx;
+    u32 eax;
 
-    if ( arch_pmc_cnt == 0 )
-    {
-        cpuid(0xa, &eax, &ebx, &ecx, &edx);
-        arch_pmc_cnt = (eax & PMU_GENERAL_NR_MASK) >> PMU_GENERAL_NR_SHIFT;
-    }
-
-    return arch_pmc_cnt;
+    eax = cpuid_eax(0xa);
+    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
 }
 
 static u64 core2_calc_intial_glb_ctrl_msr(void)
 {
-    int arch_pmc_bits = (1 << core2_get_pmc_count()) - 1;
-    u64 fix_pmc_bits  = (1 << 3) - 1;
-    return ((fix_pmc_bits << 32) | arch_pmc_bits);
+    int arch_pmc_bits = (1 << arch_pmc_cnt) - 1;
+    u64 fix_pmc_bits  = (1 << fixed_pmc_cnt) - 1;
+
+    return (fix_pmc_bits << 32) | arch_pmc_bits;
 }
 
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
 static int core2_get_bitwidth_fix_count(void)
 {
-    u32 eax, ebx, ecx, edx;
+    u32 edx;
 
-    cpuid(0xa, &eax, &ebx, &ecx, &edx);
-    return ((edx & PMU_FIXED_WIDTH_MASK) >> PMU_FIXED_WIDTH_SHIFT);
+    edx = cpuid_edx(0xa);
+    return MASK_EXTR(edx, PMU_FIXED_WIDTH_MASK);
 }
 
 static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)
 {
-    int i;
     u32 msr_index_pmc;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    switch ( msr_index )
     {
-        if ( core2_fix_counters.msr[i] == msr_index )
+    case MSR_CORE_PERF_FIXED_CTR_CTRL:
+    case MSR_IA32_DS_AREA:
+    case MSR_IA32_PEBS_ENABLE:
+        *type = MSR_TYPE_CTRL;
+        return 1;
+
+    case MSR_CORE_PERF_GLOBAL_CTRL:
+    case MSR_CORE_PERF_GLOBAL_STATUS:
+    case MSR_CORE_PERF_GLOBAL_OVF_CTRL:
+        *type = MSR_TYPE_GLOBAL;
+        return 1;
+
+    default:
+
+        if ( (msr_index >= MSR_CORE_PERF_FIXED_CTR0) &&
+             (msr_index < MSR_CORE_PERF_FIXED_CTR0 + fixed_pmc_cnt) )
         {
+            *index = msr_index - MSR_CORE_PERF_FIXED_CTR0;
             *type = MSR_TYPE_COUNTER;
-            *index = i;
             return 1;
         }
-    }
 
-    for ( i = 0; i < core2_ctrls.num; i++ )
-    {
-        if ( core2_ctrls.msr[i] == msr_index )
+        if ( (msr_index >= MSR_P6_EVNTSEL(0)) &&
+             (msr_index < MSR_P6_EVNTSEL(arch_pmc_cnt)) )
         {
-            *type = MSR_TYPE_CTRL;
-            *index = i;
+            *index = msr_index - MSR_P6_EVNTSEL(0);
+            *type = MSR_TYPE_ARCH_CTRL;
             return 1;
         }
-    }
 
-    if ( (msr_index == MSR_CORE_PERF_GLOBAL_CTRL) ||
-         (msr_index == MSR_CORE_PERF_GLOBAL_STATUS) ||
-         (msr_index == MSR_CORE_PERF_GLOBAL_OVF_CTRL) )
-    {
-        *type = MSR_TYPE_GLOBAL;
-        return 1;
-    }
-
-    msr_index_pmc = msr_index & MSR_PMC_ALIAS_MASK;
-    if ( (msr_index_pmc >= MSR_IA32_PERFCTR0) &&
-         (msr_index_pmc < (MSR_IA32_PERFCTR0 + core2_get_pmc_count())) )
-    {
-        *type = MSR_TYPE_ARCH_COUNTER;
-        *index = msr_index_pmc - MSR_IA32_PERFCTR0;
-        return 1;
-    }
-
-    if ( (msr_index >= MSR_P6_EVNTSEL(0)) &&
-         (msr_index < (MSR_P6_EVNTSEL(core2_get_pmc_count()))) )
-    {
-        *type = MSR_TYPE_ARCH_CTRL;
-        *index = msr_index - MSR_P6_EVNTSEL(0);
-        return 1;
+        msr_index_pmc = msr_index & MSR_PMC_ALIAS_MASK;
+        if ( (msr_index_pmc >= MSR_IA32_PERFCTR0) &&
+             (msr_index_pmc < (MSR_IA32_PERFCTR0 + arch_pmc_cnt)) )
+        {
+            *type = MSR_TYPE_ARCH_COUNTER;
+            *index = msr_index_pmc - MSR_IA32_PERFCTR0;
+            return 1;
+        }
+        return 0;
     }
-
-    return 0;
 }
 
 static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
@@ -254,13 +235,13 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
     int i;
 
     /* Allow Read/Write PMU Counters MSR Directly. */
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
-        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
-        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
+        clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i), msr_bitmap);
+        clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i),
                   msr_bitmap + 0x800/BYTES_PER_LONG);
     }
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
         clear_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i), msr_bitmap);
         clear_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i),
@@ -275,26 +256,28 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
     }
 
     /* Allow Read PMU Non-global Controls Directly. */
-    for ( i = 0; i < core2_ctrls.num; i++ )
-        clear_bit(msraddr_to_bitpos(core2_ctrls.msr[i]), msr_bitmap);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
-        clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
+    for ( i = 0; i < arch_pmc_cnt; i++ )
+         clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
+
+    clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
+    clear_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
+    clear_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
 static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
 {
     int i;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
-        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
-        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
+        set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i), msr_bitmap);
+        set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR0 + i),
                 msr_bitmap + 0x800/BYTES_PER_LONG);
     }
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
-        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i), msr_bitmap);
-        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0+i),
+        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0 + i), msr_bitmap);
+        set_bit(msraddr_to_bitpos(MSR_IA32_PERFCTR0 + i),
                 msr_bitmap + 0x800/BYTES_PER_LONG);
 
         if ( full_width_write )
@@ -305,10 +288,12 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
         }
     }
 
-    for ( i = 0; i < core2_ctrls.num; i++ )
-        set_bit(msraddr_to_bitpos(core2_ctrls.msr[i]), msr_bitmap);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
         set_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
+
+    set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
+    set_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
+    set_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
 static inline void __core2_vpmu_save(struct vcpu *v)
@@ -316,10 +301,10 @@ static inline void __core2_vpmu_save(struct vcpu *v)
     int i;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
-        rdmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
-        rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
+        rdmsrl(MSR_CORE_PERF_FIXED_CTR0 + i, core2_vpmu_cxt->fix_counters[i]);
+    for ( i = 0; i < arch_pmc_cnt; i++ )
+        rdmsrl(MSR_IA32_PERFCTR0 + i, core2_vpmu_cxt->arch_msr_pair[i].counter);
 }
 
 static int core2_vpmu_save(struct vcpu *v)
@@ -344,20 +329,22 @@ static inline void __core2_vpmu_load(struct vcpu *v)
     unsigned int i, pmc_start;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
-        wrmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
+        wrmsrl(MSR_CORE_PERF_FIXED_CTR0 + i, core2_vpmu_cxt->fix_counters[i]);
 
     if ( full_width_write )
         pmc_start = MSR_IA32_A_PERFCTR0;
     else
         pmc_start = MSR_IA32_PERFCTR0;
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
+    {
         wrmsrl(pmc_start + i, core2_vpmu_cxt->arch_msr_pair[i].counter);
-
-    for ( i = 0; i < core2_ctrls.num; i++ )
-        wrmsrl(core2_ctrls.msr[i], core2_vpmu_cxt->ctrls[i]);
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
         wrmsrl(MSR_P6_EVNTSEL(i), core2_vpmu_cxt->arch_msr_pair[i].control);
+    }
+
+    wrmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, core2_vpmu_cxt->fixed_ctrl);
+    wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
+    wrmsrl(MSR_IA32_PEBS_ENABLE, core2_vpmu_cxt->pebs_enable);
 }
 
 static void core2_vpmu_load(struct vcpu *v)
@@ -376,56 +363,37 @@ static int core2_vpmu_alloc_resource(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt;
-    struct core2_pmu_enable *pmu_enable;
 
     if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
         return 0;
 
     wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
     if ( vmx_add_host_load_msr(MSR_CORE_PERF_GLOBAL_CTRL) )
-        return 0;
+        goto out_err;
 
     if ( vmx_add_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL) )
-        return 0;
+        goto out_err;
     vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL,
                  core2_calc_intial_glb_ctrl_msr());
 
-    pmu_enable = xzalloc_bytes(sizeof(struct core2_pmu_enable) +
-                               core2_get_pmc_count() - 1);
-    if ( !pmu_enable )
-        goto out1;
-
     core2_vpmu_cxt = xzalloc_bytes(sizeof(struct core2_vpmu_context) +
-                    (core2_get_pmc_count()-1)*sizeof(struct arch_msr_pair));
+                    (arch_pmc_cnt-1)*sizeof(struct arch_msr_pair));
     if ( !core2_vpmu_cxt )
-        goto out2;
-    core2_vpmu_cxt->pmu_enable = pmu_enable;
+        goto out_err;
+
     vpmu->context = (void *)core2_vpmu_cxt;
 
+    vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
+
     return 1;
- out2:
-    xfree(pmu_enable);
- out1:
-    gdprintk(XENLOG_WARNING, "Insufficient memory for PMU, PMU feature is "
-             "unavailable on domain %d vcpu %d.\n",
-             v->vcpu_id, v->domain->domain_id);
-    return 0;
-}
 
-static void core2_vpmu_save_msr_context(struct vcpu *v, int type,
-                                       int index, u64 msr_data)
-{
-    struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
+out_err:
+    release_pmu_ownship(PMU_OWNER_HVM);
 
-    switch ( type )
-    {
-    case MSR_TYPE_CTRL:
-        core2_vpmu_cxt->ctrls[index] = msr_data;
-        break;
-    case MSR_TYPE_ARCH_CTRL:
-        core2_vpmu_cxt->arch_msr_pair[index].control = msr_data;
-        break;
-    }
+    printk("Failed to allocate VPMU resources for domain %u vcpu %u\n",
+           v->vcpu_id, v->domain->domain_id);
+
+    return 0;
 }
 
 static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
@@ -436,10 +404,8 @@ static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
         return 0;
 
     if ( unlikely(!vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED)) &&
-	 (vpmu->context != NULL ||
-	  !core2_vpmu_alloc_resource(current)) )
+         !core2_vpmu_alloc_resource(current) )
         return 0;
-    vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
 
     /* Do the lazy load staff. */
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
@@ -456,8 +422,7 @@ static int core2_vpmu_msr_common_check(u32 msr_index, int *type, int *index)
 static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                                uint64_t supported)
 {
-    u64 global_ctrl, non_global_ctrl;
-    char pmu_enable = 0;
+    u64 global_ctrl;
     int i, tmp;
     int type = -1, index = -1;
     struct vcpu *v = current;
@@ -504,6 +469,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( msr_content & 1 )
             gdprintk(XENLOG_WARNING, "Guest is trying to enable PEBS, "
                      "which is not supported.\n");
+        core2_vpmu_cxt->pebs_enable = msr_content;
         return 1;
     case MSR_IA32_DS_AREA:
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
@@ -516,57 +482,48 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                 hvm_inject_hw_exception(TRAP_gp_fault, 0);
                 return 1;
             }
-            core2_vpmu_cxt->pmu_enable->ds_area_enable = msr_content ? 1 : 0;
+            core2_vpmu_cxt->ds_area = msr_content;
             break;
         }
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 1;
     case MSR_CORE_PERF_GLOBAL_CTRL:
         global_ctrl = msr_content;
-        for ( i = 0; i < core2_get_pmc_count(); i++ )
-        {
-            rdmsrl(MSR_P6_EVNTSEL(i), non_global_ctrl);
-            core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i] =
-                    global_ctrl & (non_global_ctrl >> 22) & 1;
-            global_ctrl >>= 1;
-        }
-
-        rdmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, non_global_ctrl);
-        global_ctrl = msr_content >> 32;
-        for ( i = 0; i < core2_fix_counters.num; i++ )
-        {
-            core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
-                (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
-            non_global_ctrl >>= FIXED_CTR_CTRL_BITS;
-            global_ctrl >>= 1;
-        }
         break;
     case MSR_CORE_PERF_FIXED_CTR_CTRL:
-        non_global_ctrl = msr_content;
         vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
-        global_ctrl >>= 32;
-        for ( i = 0; i < core2_fix_counters.num; i++ )
+        core2_vpmu_cxt->enabled_cntrs &=
+                ~(((1ULL << VPMU_CORE2_MAX_FIXED_PMCS) - 1) << 32);
+        if ( msr_content != 0 )
         {
-            core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
-                (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
-            non_global_ctrl >>= 4;
-            global_ctrl >>= 1;
+            u64 val = msr_content;
+            for ( i = 0; i < fixed_pmc_cnt; i++ )
+            {
+                if ( val & 3 )
+                    core2_vpmu_cxt->enabled_cntrs |= (1ULL << 32) << i;
+                val >>= FIXED_CTR_CTRL_BITS;
+            }
         }
+
+        core2_vpmu_cxt->fixed_ctrl = msr_content;
         break;
     default:
         tmp = msr - MSR_P6_EVNTSEL(0);
-        vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
-        if ( tmp >= 0 && tmp < core2_get_pmc_count() )
-            core2_vpmu_cxt->pmu_enable->arch_pmc_enable[tmp] =
-                (global_ctrl >> tmp) & (msr_content >> 22) & 1;
+        if ( tmp >= 0 && tmp < arch_pmc_cnt )
+        {
+            vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
+
+            if ( msr_content & (1ULL << 22) )
+                core2_vpmu_cxt->enabled_cntrs |= 1ULL << tmp;
+            else
+                core2_vpmu_cxt->enabled_cntrs &= ~(1ULL << tmp);
+
+            core2_vpmu_cxt->arch_msr_pair[tmp].control = msr_content;
+        }
     }
 
-    for ( i = 0; i < core2_fix_counters.num; i++ )
-        pmu_enable |= core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i];
-    for ( i = 0; i < core2_get_pmc_count(); i++ )
-        pmu_enable |= core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i];
-    pmu_enable |= core2_vpmu_cxt->pmu_enable->ds_area_enable;
-    if ( pmu_enable )
+    if ( (global_ctrl & core2_vpmu_cxt->enabled_cntrs) ||
+         (core2_vpmu_cxt->ds_area != 0)  )
         vpmu_set(vpmu, VPMU_RUNNING);
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
@@ -584,7 +541,6 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
     }
 
-    core2_vpmu_save_msr_context(v, type, index, msr_content);
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -600,7 +556,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
             if  ( msr == MSR_IA32_DS_AREA )
                 break;
             /* 4 bits per counter, currently 3 fixed counters implemented. */
-            mask = ~((1ull << (VPMU_CORE2_NUM_FIXED * FIXED_CTR_CTRL_BITS)) - 1);
+            mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
             if (msr_content & mask)
                 inject_gp = 1;
             break;
@@ -685,7 +641,7 @@ static void core2_vpmu_do_cpuid(unsigned int input,
 static void core2_vpmu_dump(const struct vcpu *v)
 {
     const struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    int i, num;
+    unsigned int i;
     const struct core2_vpmu_context *core2_vpmu_cxt = NULL;
     u64 val;
 
@@ -703,27 +659,25 @@ static void core2_vpmu_dump(const struct vcpu *v)
 
     printk("    vPMU running\n");
     core2_vpmu_cxt = vpmu->context;
-    num = core2_get_pmc_count();
+
     /* Print the contents of the counter and its configuration msr. */
-    for ( i = 0; i < num; i++ )
+    for ( i = 0; i < arch_pmc_cnt; i++ )
     {
         const struct arch_msr_pair *msr_pair = core2_vpmu_cxt->arch_msr_pair;
 
-        if ( core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i] )
-            printk("      general_%d: 0x%016lx ctrl: 0x%016lx\n",
-                   i, msr_pair[i].counter, msr_pair[i].control);
+        printk("      general_%d: 0x%016lx ctrl: 0x%016lx\n",
+               i, msr_pair[i].counter, msr_pair[i].control);
     }
     /*
      * The configuration of the fixed counter is 4 bits each in the
      * MSR_CORE_PERF_FIXED_CTR_CTRL.
      */
-    val = core2_vpmu_cxt->ctrls[MSR_CORE_PERF_FIXED_CTR_CTRL_IDX];
-    for ( i = 0; i < core2_fix_counters.num; i++ )
+    val = core2_vpmu_cxt->fixed_ctrl;
+    for ( i = 0; i < fixed_pmc_cnt; i++ )
     {
-        if ( core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] )
-            printk("      fixed_%d:   0x%016lx ctrl: %#lx\n",
-                   i, core2_vpmu_cxt->fix_counters[i],
-                   val & FIXED_CTR_CTRL_MASK);
+        printk("      fixed_%d:   0x%016lx ctrl: %#lx\n",
+               i, core2_vpmu_cxt->fix_counters[i],
+               val & FIXED_CTR_CTRL_MASK);
         val >>= FIXED_CTR_CTRL_BITS;
     }
 }
@@ -741,7 +695,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_ovf_status |= msr_content;
-        msr_content = 0xC000000700000000 | ((1 << core2_get_pmc_count()) - 1);
+        msr_content = 0xC000000700000000 | ((1 << arch_pmc_cnt) - 1);
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
@@ -808,6 +762,16 @@ static int core2_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
     }
     ds_warned = 1;
  func_out:
+
+    arch_pmc_cnt = core2_get_arch_pmc_count();
+    fixed_pmc_cnt = core2_get_fixed_pmc_count();
+    if ( fixed_pmc_cnt > VPMU_CORE2_MAX_FIXED_PMCS )
+    {
+        fixed_pmc_cnt = VPMU_CORE2_MAX_FIXED_PMCS;
+        printk(XENLOG_G_WARNING "Limiting number of fixed counters to %d\n",
+               fixed_pmc_cnt);
+    }
+
     check_pmc_quirk();
     return 0;
 }
@@ -815,9 +779,7 @@ static int core2_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 static void core2_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
 
-    xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
     if ( has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
diff --git a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
index 60b05fd..410372d 100644
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
@@ -23,29 +23,10 @@
 #ifndef __ASM_X86_HVM_VPMU_CORE_H_
 #define __ASM_X86_HVM_VPMU_CORE_H_
 
-/* Currently only 3 fixed counters are supported. */
-#define VPMU_CORE2_NUM_FIXED 3
-/* Currently only 3 Non-architectual Performance Control MSRs */
-#define VPMU_CORE2_NUM_CTRLS 3
-
 struct arch_msr_pair {
     u64 counter;
     u64 control;
 };
 
-struct core2_pmu_enable {
-    char ds_area_enable;
-    char fixed_ctr_enable[VPMU_CORE2_NUM_FIXED];
-    char arch_pmc_enable[1];
-};
-
-struct core2_vpmu_context {
-    struct core2_pmu_enable *pmu_enable;
-    u64 fix_counters[VPMU_CORE2_NUM_FIXED];
-    u64 ctrls[VPMU_CORE2_NUM_CTRLS];
-    u64 global_ovf_status;
-    struct arch_msr_pair arch_msr_pair[1];
-};
-
 #endif /* __ASM_X86_HVM_VPMU_CORE_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 Tue Feb 03 08:00:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYPZ-00053G-I4; Tue, 03 Feb 2015 08:00:41 +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 1YIYPY-00052w-C9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:40 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	89/1A-03172-72080D45; Tue, 03 Feb 2015 08:00:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950438!7006031!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29817 invoked from network); 3 Feb 2015 08:00:38 -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;
	3 Feb 2015 08:00: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 1YIYPV-0005Rl-S6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPV-0006Od-PK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:37 +0000
Date: Tue, 03 Feb 2015 08:00:37 +0000
Message-Id: <E1YIYPV-0006Od-PK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: merge MSR management routines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f0195f9f096cdf2dc233d4f34f96c19b44a15252
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:53:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:53:01 2015 +0100

    vmx: merge MSR management routines
    
    vmx_add_host_load_msr() and vmx_add_guest_msr() share fair amount of code. Merge
    them to simplify code maintenance.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   84 +++++++++++++++++------------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   16 ++++++-
 2 files changed, 55 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b397c65..d614638 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1201,64 +1201,62 @@ int vmx_write_guest_msr(u32 msr, u64 val)
     return -ESRCH;
 }
 
-int vmx_add_guest_msr(u32 msr)
+int vmx_add_msr(u32 msr, int type)
 {
     struct vcpu *curr = current;
-    unsigned int i, msr_count = curr->arch.hvm_vmx.msr_count;
-    struct vmx_msr_entry *msr_area = curr->arch.hvm_vmx.msr_area;
+    unsigned int idx, *msr_count;
+    struct vmx_msr_entry **msr_area, *msr_area_elem;
+
+    if ( type == VMX_GUEST_MSR )
+    {
+        msr_count = &curr->arch.hvm_vmx.msr_count;
+        msr_area = &curr->arch.hvm_vmx.msr_area;
+    }
+    else
+    {
+        ASSERT(type == VMX_HOST_MSR);
+        msr_count = &curr->arch.hvm_vmx.host_msr_count;
+        msr_area = &curr->arch.hvm_vmx.host_msr_area;
+    }
 
-    if ( msr_area == NULL )
+    if ( *msr_area == NULL )
     {
-        if ( (msr_area = alloc_xenheap_page()) == NULL )
+        if ( (*msr_area = alloc_xenheap_page()) == NULL )
             return -ENOMEM;
-        curr->arch.hvm_vmx.msr_area = msr_area;
-        __vmwrite(VM_EXIT_MSR_STORE_ADDR, virt_to_maddr(msr_area));
-        __vmwrite(VM_ENTRY_MSR_LOAD_ADDR, virt_to_maddr(msr_area));
+
+        if ( type == VMX_GUEST_MSR )
+        {
+            __vmwrite(VM_EXIT_MSR_STORE_ADDR, virt_to_maddr(*msr_area));
+            __vmwrite(VM_ENTRY_MSR_LOAD_ADDR, virt_to_maddr(*msr_area));
+        }
+        else
+            __vmwrite(VM_EXIT_MSR_LOAD_ADDR, virt_to_maddr(*msr_area));
     }
 
-    for ( i = 0; i < msr_count; i++ )
-        if ( msr_area[i].index == msr )
+    for ( idx = 0; idx < *msr_count; idx++ )
+        if ( (*msr_area)[idx].index == msr )
             return 0;
 
-    if ( msr_count == (PAGE_SIZE / sizeof(struct vmx_msr_entry)) )
+    if ( *msr_count == (PAGE_SIZE / sizeof(struct vmx_msr_entry)) )
         return -ENOSPC;
 
-    msr_area[msr_count].index = msr;
-    msr_area[msr_count].mbz   = 0;
-    msr_area[msr_count].data  = 0;
-    curr->arch.hvm_vmx.msr_count = ++msr_count;
-    __vmwrite(VM_EXIT_MSR_STORE_COUNT, msr_count);
-    __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, msr_count);
+    msr_area_elem = *msr_area + *msr_count;
+    msr_area_elem->index = msr;
+    msr_area_elem->mbz = 0;
 
-    return 0;
-}
+    ++*msr_count;
 
-int vmx_add_host_load_msr(u32 msr)
-{
-    struct vcpu *curr = current;
-    unsigned int i, msr_count = curr->arch.hvm_vmx.host_msr_count;
-    struct vmx_msr_entry *msr_area = curr->arch.hvm_vmx.host_msr_area;
-
-    if ( msr_area == NULL )
+    if ( type == VMX_GUEST_MSR )
     {
-        if ( (msr_area = alloc_xenheap_page()) == NULL )
-            return -ENOMEM;
-        curr->arch.hvm_vmx.host_msr_area = msr_area;
-        __vmwrite(VM_EXIT_MSR_LOAD_ADDR, virt_to_maddr(msr_area));
+        msr_area_elem->data = 0;
+        __vmwrite(VM_EXIT_MSR_STORE_COUNT, *msr_count);
+        __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, *msr_count);
+    }
+    else
+    {
+        rdmsrl(msr, msr_area_elem->data);
+        __vmwrite(VM_EXIT_MSR_LOAD_COUNT, *msr_count);
     }
-
-    for ( i = 0; i < msr_count; i++ )
-        if ( msr_area[i].index == msr )
-            return 0;
-
-    if ( msr_count == (PAGE_SIZE / sizeof(struct vmx_msr_entry)) )
-        return -ENOSPC;
-
-    msr_area[msr_count].index = msr;
-    msr_area[msr_count].mbz   = 0;
-    rdmsrl(msr, msr_area[msr_count].data);
-    curr->arch.hvm_vmx.host_msr_count = ++msr_count;
-    __vmwrite(VM_EXIT_MSR_LOAD_COUNT, msr_count);
 
     return 0;
 }
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 88c4fab..6fce6aa 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -456,12 +456,15 @@ extern const unsigned int vmx_introspection_force_enabled_msrs_size;
 
 #define MSR_TYPE_R 1
 #define MSR_TYPE_W 2
+
+#define VMX_GUEST_MSR 0
+#define VMX_HOST_MSR  1
+
 void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 void vmx_enable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
 int vmx_write_guest_msr(u32 msr, u64 val);
-int vmx_add_guest_msr(u32 msr);
-int vmx_add_host_load_msr(u32 msr);
+int vmx_add_msr(u32 msr, int type);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
@@ -471,6 +474,15 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+static inline int vmx_add_guest_msr(u32 msr)
+{
+    return vmx_add_msr(msr, VMX_GUEST_MSR);
+}
+static inline int vmx_add_host_load_msr(u32 msr)
+{
+    return vmx_add_msr(msr, VMX_HOST_MSR);
+}
+
 DECLARE_PER_CPU(bool_t, vmxon);
 
 #endif /* ASM_X86_HVM_VMX_VMCS_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 Tue Feb 03 08:00:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYPZ-00053G-I4; Tue, 03 Feb 2015 08:00:41 +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 1YIYPY-00052w-C9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:40 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	89/1A-03172-72080D45; Tue, 03 Feb 2015 08:00:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950438!7006031!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29817 invoked from network); 3 Feb 2015 08:00:38 -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;
	3 Feb 2015 08:00: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 1YIYPV-0005Rl-S6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPV-0006Od-PK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:37 +0000
Date: Tue, 03 Feb 2015 08:00:37 +0000
Message-Id: <E1YIYPV-0006Od-PK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: merge MSR management routines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f0195f9f096cdf2dc233d4f34f96c19b44a15252
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:53:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:53:01 2015 +0100

    vmx: merge MSR management routines
    
    vmx_add_host_load_msr() and vmx_add_guest_msr() share fair amount of code. Merge
    them to simplify code maintenance.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   84 +++++++++++++++++------------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   16 ++++++-
 2 files changed, 55 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b397c65..d614638 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1201,64 +1201,62 @@ int vmx_write_guest_msr(u32 msr, u64 val)
     return -ESRCH;
 }
 
-int vmx_add_guest_msr(u32 msr)
+int vmx_add_msr(u32 msr, int type)
 {
     struct vcpu *curr = current;
-    unsigned int i, msr_count = curr->arch.hvm_vmx.msr_count;
-    struct vmx_msr_entry *msr_area = curr->arch.hvm_vmx.msr_area;
+    unsigned int idx, *msr_count;
+    struct vmx_msr_entry **msr_area, *msr_area_elem;
+
+    if ( type == VMX_GUEST_MSR )
+    {
+        msr_count = &curr->arch.hvm_vmx.msr_count;
+        msr_area = &curr->arch.hvm_vmx.msr_area;
+    }
+    else
+    {
+        ASSERT(type == VMX_HOST_MSR);
+        msr_count = &curr->arch.hvm_vmx.host_msr_count;
+        msr_area = &curr->arch.hvm_vmx.host_msr_area;
+    }
 
-    if ( msr_area == NULL )
+    if ( *msr_area == NULL )
     {
-        if ( (msr_area = alloc_xenheap_page()) == NULL )
+        if ( (*msr_area = alloc_xenheap_page()) == NULL )
             return -ENOMEM;
-        curr->arch.hvm_vmx.msr_area = msr_area;
-        __vmwrite(VM_EXIT_MSR_STORE_ADDR, virt_to_maddr(msr_area));
-        __vmwrite(VM_ENTRY_MSR_LOAD_ADDR, virt_to_maddr(msr_area));
+
+        if ( type == VMX_GUEST_MSR )
+        {
+            __vmwrite(VM_EXIT_MSR_STORE_ADDR, virt_to_maddr(*msr_area));
+            __vmwrite(VM_ENTRY_MSR_LOAD_ADDR, virt_to_maddr(*msr_area));
+        }
+        else
+            __vmwrite(VM_EXIT_MSR_LOAD_ADDR, virt_to_maddr(*msr_area));
     }
 
-    for ( i = 0; i < msr_count; i++ )
-        if ( msr_area[i].index == msr )
+    for ( idx = 0; idx < *msr_count; idx++ )
+        if ( (*msr_area)[idx].index == msr )
             return 0;
 
-    if ( msr_count == (PAGE_SIZE / sizeof(struct vmx_msr_entry)) )
+    if ( *msr_count == (PAGE_SIZE / sizeof(struct vmx_msr_entry)) )
         return -ENOSPC;
 
-    msr_area[msr_count].index = msr;
-    msr_area[msr_count].mbz   = 0;
-    msr_area[msr_count].data  = 0;
-    curr->arch.hvm_vmx.msr_count = ++msr_count;
-    __vmwrite(VM_EXIT_MSR_STORE_COUNT, msr_count);
-    __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, msr_count);
+    msr_area_elem = *msr_area + *msr_count;
+    msr_area_elem->index = msr;
+    msr_area_elem->mbz = 0;
 
-    return 0;
-}
+    ++*msr_count;
 
-int vmx_add_host_load_msr(u32 msr)
-{
-    struct vcpu *curr = current;
-    unsigned int i, msr_count = curr->arch.hvm_vmx.host_msr_count;
-    struct vmx_msr_entry *msr_area = curr->arch.hvm_vmx.host_msr_area;
-
-    if ( msr_area == NULL )
+    if ( type == VMX_GUEST_MSR )
     {
-        if ( (msr_area = alloc_xenheap_page()) == NULL )
-            return -ENOMEM;
-        curr->arch.hvm_vmx.host_msr_area = msr_area;
-        __vmwrite(VM_EXIT_MSR_LOAD_ADDR, virt_to_maddr(msr_area));
+        msr_area_elem->data = 0;
+        __vmwrite(VM_EXIT_MSR_STORE_COUNT, *msr_count);
+        __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, *msr_count);
+    }
+    else
+    {
+        rdmsrl(msr, msr_area_elem->data);
+        __vmwrite(VM_EXIT_MSR_LOAD_COUNT, *msr_count);
     }
-
-    for ( i = 0; i < msr_count; i++ )
-        if ( msr_area[i].index == msr )
-            return 0;
-
-    if ( msr_count == (PAGE_SIZE / sizeof(struct vmx_msr_entry)) )
-        return -ENOSPC;
-
-    msr_area[msr_count].index = msr;
-    msr_area[msr_count].mbz   = 0;
-    rdmsrl(msr, msr_area[msr_count].data);
-    curr->arch.hvm_vmx.host_msr_count = ++msr_count;
-    __vmwrite(VM_EXIT_MSR_LOAD_COUNT, msr_count);
 
     return 0;
 }
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 88c4fab..6fce6aa 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -456,12 +456,15 @@ extern const unsigned int vmx_introspection_force_enabled_msrs_size;
 
 #define MSR_TYPE_R 1
 #define MSR_TYPE_W 2
+
+#define VMX_GUEST_MSR 0
+#define VMX_HOST_MSR  1
+
 void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 void vmx_enable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
 int vmx_write_guest_msr(u32 msr, u64 val);
-int vmx_add_guest_msr(u32 msr);
-int vmx_add_host_load_msr(u32 msr);
+int vmx_add_msr(u32 msr, int type);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
@@ -471,6 +474,15 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+static inline int vmx_add_guest_msr(u32 msr)
+{
+    return vmx_add_msr(msr, VMX_GUEST_MSR);
+}
+static inline int vmx_add_host_load_msr(u32 msr)
+{
+    return vmx_add_msr(msr, VMX_HOST_MSR);
+}
+
 DECLARE_PER_CPU(bool_t, vmxon);
 
 #endif /* ASM_X86_HVM_VMX_VMCS_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 Tue Feb 03 08:00:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYPk-00055Y-Om; Tue, 03 Feb 2015 08:00: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 1YIYPi-00055A-Gn
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	85/66-02770-13080D45; Tue, 03 Feb 2015 08:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1422950448!12357812!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11715 invoked from network); 3 Feb 2015 08:00: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;
	3 Feb 2015 08:00: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 1YIYPg-0005Rr-1q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPg-0006PA-0Z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:48 +0000
Date: Tue, 03 Feb 2015 08:00:48 +0000
Message-Id: <E1YIYPg-0006PA-0Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: handle APIC_LVTPC accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8097616fbdda2d214b305dc41f2468f9fb88d500
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:53:49 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:53:49 2015 +0100

    x86/VPMU: handle APIC_LVTPC accesses
    
    Don't have the hypervisor update APIC_LVTPC when _it_ thinks the vector should
    be updated. Instead, handle guest's APIC_LVTPC accesses and write what the guest
    explicitly wanted.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |    4 ----
 xen/arch/x86/hvm/vlapic.c         |    3 +++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   17 -----------------
 xen/arch/x86/hvm/vpmu.c           |    8 ++++++++
 xen/include/asm-x86/hvm/vpmu.h    |    1 +
 5 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 19777e3..64dc167 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -302,8 +302,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( has_hvm_container_vcpu(v) &&
              !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
@@ -314,8 +312,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) &&
              ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 8062f31..5da6d8f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -38,6 +38,7 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/vpmu.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -777,6 +778,8 @@ static int vlapic_reg_write(struct vcpu *v,
         }
         if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) )
             pt_may_unmask_irq(NULL, &vlapic->pt);
+        if ( offset == APIC_LVTPC )
+            vpmu_lvtpc_update(val);
         break;
 
     case APIC_TMICT:
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 9c4d00e..8b84079 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -528,19 +528,6 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
 
-    /* Setup LVTPC in local apic */
-    if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
-         is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
-    }
-    else
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
-    }
-
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -706,10 +693,6 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
-    /* HW sets the MASK bit when performance counter interrupt occurs*/
-    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
-    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
-
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 63b2158..d94b63c 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -64,6 +64,14 @@ static void __init parse_vpmu_param(char *s)
     }
 }
 
+void vpmu_lvtpc_update(uint32_t val)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
+    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+}
+
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(current);
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index ddc2748..9c4e65a 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -104,6 +104,7 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
     return !!((vpmu->flags & mask) == mask);
 }
 
+void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 void vpmu_do_interrupt(struct cpu_user_regs *regs);
--
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 Tue Feb 03 08:00:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:00: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 1YIYPk-00055Y-Om; Tue, 03 Feb 2015 08:00: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 1YIYPi-00055A-Gn
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	85/66-02770-13080D45; Tue, 03 Feb 2015 08:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1422950448!12357812!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11715 invoked from network); 3 Feb 2015 08:00: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;
	3 Feb 2015 08:00: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 1YIYPg-0005Rr-1q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPg-0006PA-0Z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:48 +0000
Date: Tue, 03 Feb 2015 08:00:48 +0000
Message-Id: <E1YIYPg-0006PA-0Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: handle APIC_LVTPC accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8097616fbdda2d214b305dc41f2468f9fb88d500
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:53:49 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:53:49 2015 +0100

    x86/VPMU: handle APIC_LVTPC accesses
    
    Don't have the hypervisor update APIC_LVTPC when _it_ thinks the vector should
    be updated. Instead, handle guest's APIC_LVTPC accesses and write what the guest
    explicitly wanted.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |    4 ----
 xen/arch/x86/hvm/vlapic.c         |    3 +++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   17 -----------------
 xen/arch/x86/hvm/vpmu.c           |    8 ++++++++
 xen/include/asm-x86/hvm/vpmu.h    |    1 +
 5 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 19777e3..64dc167 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -302,8 +302,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( has_hvm_container_vcpu(v) &&
              !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
@@ -314,8 +312,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) &&
              ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 8062f31..5da6d8f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -38,6 +38,7 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/vpmu.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -777,6 +778,8 @@ static int vlapic_reg_write(struct vcpu *v,
         }
         if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) )
             pt_may_unmask_irq(NULL, &vlapic->pt);
+        if ( offset == APIC_LVTPC )
+            vpmu_lvtpc_update(val);
         break;
 
     case APIC_TMICT:
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 9c4d00e..8b84079 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -528,19 +528,6 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
 
-    /* Setup LVTPC in local apic */
-    if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
-         is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
-    }
-    else
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
-    }
-
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -706,10 +693,6 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
-    /* HW sets the MASK bit when performance counter interrupt occurs*/
-    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
-    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
-
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 63b2158..d94b63c 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -64,6 +64,14 @@ static void __init parse_vpmu_param(char *s)
     }
 }
 
+void vpmu_lvtpc_update(uint32_t val)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
+    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+}
+
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(current);
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index ddc2748..9c4e65a 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -104,6 +104,7 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
     return !!((vpmu->flags & mask) == mask);
 }
 
+void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 void vpmu_do_interrupt(struct cpu_user_regs *regs);
--
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 Tue Feb 03 08:01:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYPt-000571-07; Tue, 03 Feb 2015 08:01:01 +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 1YIYPs-00056s-Dr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:00 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	4D/03-03164-B3080D45; Tue, 03 Feb 2015 08:00:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1422950458!6669005!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23909 invoked from network); 3 Feb 2015 08:00:59 -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;
	3 Feb 2015 08:00: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 1YIYPq-0005S0-7z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPq-0006Pf-60
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:58 +0000
Date: Tue, 03 Feb 2015 08:00:58 +0000
Message-Id: <E1YIYPq-0006Pf-60@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL
	should be initialized to zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49de0b57b853064d6b3ad1646fafe08b8dcaac98
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:54:23 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:54:23 2015 +0100

    intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL should be initialized to zero
    
    MSR_CORE_PERF_GLOBAL_CTRL register should be set zero initially. It is up to
    the guest to set it so that counters are enabled.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 8b84079..7793145 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -165,14 +165,6 @@ static int core2_get_fixed_pmc_count(void)
     return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
 }
 
-static u64 core2_calc_intial_glb_ctrl_msr(void)
-{
-    int arch_pmc_bits = (1 << arch_pmc_cnt) - 1;
-    u64 fix_pmc_bits  = (1 << fixed_pmc_cnt) - 1;
-
-    return (fix_pmc_bits << 32) | arch_pmc_bits;
-}
-
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
 static int core2_get_bitwidth_fix_count(void)
 {
@@ -373,8 +365,7 @@ static int core2_vpmu_alloc_resource(struct vcpu *v)
 
     if ( vmx_add_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL) )
         goto out_err;
-    vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL,
-                 core2_calc_intial_glb_ctrl_msr());
+    vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, 0);
 
     core2_vpmu_cxt = xzalloc_bytes(sizeof(struct core2_vpmu_context) +
                     (arch_pmc_cnt-1)*sizeof(struct arch_msr_pair));
--
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 Tue Feb 03 08:01:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYPt-000571-07; Tue, 03 Feb 2015 08:01:01 +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 1YIYPs-00056s-Dr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:00 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	4D/03-03164-B3080D45; Tue, 03 Feb 2015 08:00:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1422950458!6669005!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23909 invoked from network); 3 Feb 2015 08:00:59 -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;
	3 Feb 2015 08:00: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 1YIYPq-0005S0-7z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYPq-0006Pf-60
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:00:58 +0000
Date: Tue, 03 Feb 2015 08:00:58 +0000
Message-Id: <E1YIYPq-0006Pf-60@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL
	should be initialized to zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49de0b57b853064d6b3ad1646fafe08b8dcaac98
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri Jan 23 17:54:23 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 23 17:54:23 2015 +0100

    intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL should be initialized to zero
    
    MSR_CORE_PERF_GLOBAL_CTRL register should be set zero initially. It is up to
    the guest to set it so that counters are enabled.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 8b84079..7793145 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -165,14 +165,6 @@ static int core2_get_fixed_pmc_count(void)
     return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
 }
 
-static u64 core2_calc_intial_glb_ctrl_msr(void)
-{
-    int arch_pmc_bits = (1 << arch_pmc_cnt) - 1;
-    u64 fix_pmc_bits  = (1 << fixed_pmc_cnt) - 1;
-
-    return (fix_pmc_bits << 32) | arch_pmc_bits;
-}
-
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
 static int core2_get_bitwidth_fix_count(void)
 {
@@ -373,8 +365,7 @@ static int core2_vpmu_alloc_resource(struct vcpu *v)
 
     if ( vmx_add_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL) )
         goto out_err;
-    vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL,
-                 core2_calc_intial_glb_ctrl_msr());
+    vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, 0);
 
     core2_vpmu_cxt = xzalloc_bytes(sizeof(struct core2_vpmu_context) +
                     (arch_pmc_cnt-1)*sizeof(struct arch_msr_pair));
--
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 Tue Feb 03 08:01:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01: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 1YIYQ4-00058h-6M; Tue, 03 Feb 2015 08:01:12 +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 1YIYQ3-00058U-8c
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:11 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	EA/26-10964-64080D45; Tue, 03 Feb 2015 08:01:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950468!12416436!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12376 invoked from network); 3 Feb 2015 08:01:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:01: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 1YIYQ0-0005SY-Kt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQ0-0006QE-D6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:08 +0000
Date: Tue, 03 Feb 2015 08:01:08 +0000
Message-Id: <E1YIYQ0-0006QE-D6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/VPMU: handle APIC_LVTPC
	accesses"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc3404093c8599743d53fb428d27074abe55a20e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 12:47:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:47:30 2015 +0100

    Revert "x86/VPMU: handle APIC_LVTPC accesses"
    
    This reverts commit 8097616fbdda2d214b305dc41f2468f9fb88d500, most
    likely reponsible for regressions found by osstest.
---
 xen/arch/x86/hvm/svm/vpmu.c       |    4 ++++
 xen/arch/x86/hvm/vlapic.c         |    3 ---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   17 +++++++++++++++++
 xen/arch/x86/hvm/vpmu.c           |    8 --------
 xen/include/asm-x86/hvm/vpmu.h    |    1 -
 5 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 64dc167..19777e3 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -302,6 +302,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
+        apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( has_hvm_container_vcpu(v) &&
              !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
@@ -312,6 +314,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
+        apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) &&
              ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 5da6d8f..8062f31 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -38,7 +38,6 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/nestedhvm.h>
-#include <asm/hvm/vpmu.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -778,8 +777,6 @@ static int vlapic_reg_write(struct vcpu *v,
         }
         if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) )
             pt_may_unmask_irq(NULL, &vlapic->pt);
-        if ( offset == APIC_LVTPC )
-            vpmu_lvtpc_update(val);
         break;
 
     case APIC_TMICT:
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 7793145..4d0e9a8 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -519,6 +519,19 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
 
+    /* Setup LVTPC in local apic */
+    if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
+         is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
+    {
+        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
+    }
+    else
+    {
+        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+    }
+
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -684,6 +697,10 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
+    /* HW sets the MASK bit when performance counter interrupt occurs*/
+    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
+    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index d94b63c..63b2158 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -64,14 +64,6 @@ static void __init parse_vpmu_param(char *s)
     }
 }
 
-void vpmu_lvtpc_update(uint32_t val)
-{
-    struct vpmu_struct *vpmu = vcpu_vpmu(current);
-
-    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
-    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
-}
-
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(current);
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 9c4e65a..ddc2748 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -104,7 +104,6 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
     return !!((vpmu->flags & mask) == mask);
 }
 
-void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 void vpmu_do_interrupt(struct cpu_user_regs *regs);
--
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 Tue Feb 03 08:01:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01: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 1YIYQ4-00058h-6M; Tue, 03 Feb 2015 08:01:12 +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 1YIYQ3-00058U-8c
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:11 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	EA/26-10964-64080D45; Tue, 03 Feb 2015 08:01:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950468!12416436!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12376 invoked from network); 3 Feb 2015 08:01:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:01: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 1YIYQ0-0005SY-Kt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQ0-0006QE-D6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:08 +0000
Date: Tue, 03 Feb 2015 08:01:08 +0000
Message-Id: <E1YIYQ0-0006QE-D6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/VPMU: handle APIC_LVTPC
	accesses"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc3404093c8599743d53fb428d27074abe55a20e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 12:47:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:47:30 2015 +0100

    Revert "x86/VPMU: handle APIC_LVTPC accesses"
    
    This reverts commit 8097616fbdda2d214b305dc41f2468f9fb88d500, most
    likely reponsible for regressions found by osstest.
---
 xen/arch/x86/hvm/svm/vpmu.c       |    4 ++++
 xen/arch/x86/hvm/vlapic.c         |    3 ---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   17 +++++++++++++++++
 xen/arch/x86/hvm/vpmu.c           |    8 --------
 xen/include/asm-x86/hvm/vpmu.h    |    1 -
 5 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 64dc167..19777e3 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -302,6 +302,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
+        apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( has_hvm_container_vcpu(v) &&
              !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
@@ -312,6 +314,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
+        apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) &&
              ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 5da6d8f..8062f31 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -38,7 +38,6 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/nestedhvm.h>
-#include <asm/hvm/vpmu.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -778,8 +777,6 @@ static int vlapic_reg_write(struct vcpu *v,
         }
         if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) )
             pt_may_unmask_irq(NULL, &vlapic->pt);
-        if ( offset == APIC_LVTPC )
-            vpmu_lvtpc_update(val);
         break;
 
     case APIC_TMICT:
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 7793145..4d0e9a8 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -519,6 +519,19 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
 
+    /* Setup LVTPC in local apic */
+    if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
+         is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
+    {
+        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
+    }
+    else
+    {
+        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+    }
+
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -684,6 +697,10 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
+    /* HW sets the MASK bit when performance counter interrupt occurs*/
+    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
+    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index d94b63c..63b2158 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -64,14 +64,6 @@ static void __init parse_vpmu_param(char *s)
     }
 }
 
-void vpmu_lvtpc_update(uint32_t val)
-{
-    struct vpmu_struct *vpmu = vcpu_vpmu(current);
-
-    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
-    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
-}
-
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(current);
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 9c4e65a..ddc2748 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -104,7 +104,6 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
     return !!((vpmu->flags & mask) == mask);
 }
 
-void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 void vpmu_do_interrupt(struct cpu_user_regs *regs);
--
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 Tue Feb 03 08:01:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYQF-0005NM-Cx; Tue, 03 Feb 2015 08:01:23 +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 1YIYQD-0005J7-Vp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:22 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	CD/34-02635-15080D45; Tue, 03 Feb 2015 08:01:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1422950479!12423894!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28105 invoked from network); 3 Feb 2015 08:01:19 -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 Feb 2015 08:01: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 1YIYQA-0005Se-R9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQA-0006Qe-PH
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:18 +0000
Date: Tue, 03 Feb 2015 08:01:18 +0000
Message-Id: <E1YIYQA-0006Qe-PH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: improve EFER validation error
	messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b898944d31badc8d35b60c26b6c0ab55dc95074
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 26 12:48:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:48:38 2015 +0100

    x86/HVM: improve EFER validation error messages
    
    The previous error message was very little use in identifying the actual
    problem after the fact.  Now, hvm_efer_valid() will indicate the issue which
    it objects to, which is far more useful for diagnosing issues from logs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2162f97..fd2314e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1683,8 +1683,9 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     return 0;
 }
 
-static bool_t hvm_efer_valid(const struct vcpu *v, uint64_t value,
-                             signed int cr0_pg)
+/* Return a string indicating the error, or NULL for valid. */
+static const char * hvm_efer_valid(const struct vcpu *v, uint64_t value,
+                                   signed int cr0_pg)
 {
     unsigned int ext1_ecx = 0, ext1_edx = 0;
 
@@ -1716,31 +1717,31 @@ static bool_t hvm_efer_valid(const struct vcpu *v, uint64_t value,
     if ( (value & EFER_SCE) &&
          !(ext1_edx & cpufeat_mask(X86_FEATURE_SYSCALL)) &&
          (cr0_pg >= 0 || !(value & EFER_LME)) )
-        return 0;
+        return "SCE without feature";
 
     if ( (value & (EFER_LME | EFER_LMA)) &&
          !(ext1_edx & cpufeat_mask(X86_FEATURE_LM)) )
-        return 0;
+        return "LME/LMA without feature";
 
     if ( (value & EFER_LMA) && (!(value & EFER_LME) || !cr0_pg) )
-        return 0;
+        return "LMA/LME/CR0.PG inconsistency";
 
     if ( (value & EFER_NX) && !(ext1_edx & cpufeat_mask(X86_FEATURE_NX)) )
-        return 0;
+        return "NX without feature";
 
     if ( (value & EFER_SVME) &&
          (!(ext1_ecx & cpufeat_mask(X86_FEATURE_SVM)) ||
           !nestedhvm_enabled(v->domain)) )
-        return 0;
+        return "SVME without nested virt";
 
     if ( (value & EFER_LMSLE) && !cpu_has_lmsl )
-        return 0;
+        return "LMSLE without support";
 
     if ( (value & EFER_FFXSE) &&
          !(ext1_edx & cpufeat_mask(X86_FEATURE_FFXSR)) )
-        return 0;
+        return "FFXSE without feature";
 
-    return 1;
+    return NULL;
 }
 
 /* These reserved bits in lower 32 remain 0 after any load of CR0 */
@@ -1818,6 +1819,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     struct vcpu *v;
     struct hvm_hw_cpu ctxt;
     struct segment_register seg;
+    const char *errstr;
 
     /* Which vcpu is this? */
     vcpuid = hvm_load_instance(h);
@@ -1848,10 +1850,11 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( !hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG)) )
+    errstr = hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG));
+    if ( errstr )
     {
-        printk(XENLOG_G_ERR "HVM%d restore: bad EFER %#" PRIx64 "\n",
-               d->domain_id, ctxt.msr_efer);
+        printk(XENLOG_G_ERR "%pv: HVM restore: bad EFER %#" PRIx64 " - %s\n",
+               v, ctxt.msr_efer, errstr);
         return -EINVAL;
     }
 
@@ -2988,13 +2991,16 @@ err:
 int hvm_set_efer(uint64_t value)
 {
     struct vcpu *v = current;
+    const char *errstr;
 
     value &= ~EFER_LMA;
 
-    if ( !hvm_efer_valid(v, value, -1) )
+    errstr = hvm_efer_valid(v, value, -1);
+    if ( errstr )
     {
-        gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
-                 "EFER: %#"PRIx64"\n", value);
+        printk(XENLOG_G_WARNING
+               "%pv: Invalid EFER update: %#"PRIx64" -> %#"PRIx64" - %s\n",
+               v, v->arch.hvm_vcpu.guest_efer, value, errstr);
         hvm_inject_hw_exception(TRAP_gp_fault, 0);
         return X86EMUL_EXCEPTION;
     }
--
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 Tue Feb 03 08:01:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYQF-0005NM-Cx; Tue, 03 Feb 2015 08:01:23 +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 1YIYQD-0005J7-Vp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:22 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	CD/34-02635-15080D45; Tue, 03 Feb 2015 08:01:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1422950479!12423894!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28105 invoked from network); 3 Feb 2015 08:01:19 -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 Feb 2015 08:01: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 1YIYQA-0005Se-R9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQA-0006Qe-PH
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:18 +0000
Date: Tue, 03 Feb 2015 08:01:18 +0000
Message-Id: <E1YIYQA-0006Qe-PH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: improve EFER validation error
	messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b898944d31badc8d35b60c26b6c0ab55dc95074
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 26 12:48:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:48:38 2015 +0100

    x86/HVM: improve EFER validation error messages
    
    The previous error message was very little use in identifying the actual
    problem after the fact.  Now, hvm_efer_valid() will indicate the issue which
    it objects to, which is far more useful for diagnosing issues from logs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2162f97..fd2314e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1683,8 +1683,9 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     return 0;
 }
 
-static bool_t hvm_efer_valid(const struct vcpu *v, uint64_t value,
-                             signed int cr0_pg)
+/* Return a string indicating the error, or NULL for valid. */
+static const char * hvm_efer_valid(const struct vcpu *v, uint64_t value,
+                                   signed int cr0_pg)
 {
     unsigned int ext1_ecx = 0, ext1_edx = 0;
 
@@ -1716,31 +1717,31 @@ static bool_t hvm_efer_valid(const struct vcpu *v, uint64_t value,
     if ( (value & EFER_SCE) &&
          !(ext1_edx & cpufeat_mask(X86_FEATURE_SYSCALL)) &&
          (cr0_pg >= 0 || !(value & EFER_LME)) )
-        return 0;
+        return "SCE without feature";
 
     if ( (value & (EFER_LME | EFER_LMA)) &&
          !(ext1_edx & cpufeat_mask(X86_FEATURE_LM)) )
-        return 0;
+        return "LME/LMA without feature";
 
     if ( (value & EFER_LMA) && (!(value & EFER_LME) || !cr0_pg) )
-        return 0;
+        return "LMA/LME/CR0.PG inconsistency";
 
     if ( (value & EFER_NX) && !(ext1_edx & cpufeat_mask(X86_FEATURE_NX)) )
-        return 0;
+        return "NX without feature";
 
     if ( (value & EFER_SVME) &&
          (!(ext1_ecx & cpufeat_mask(X86_FEATURE_SVM)) ||
           !nestedhvm_enabled(v->domain)) )
-        return 0;
+        return "SVME without nested virt";
 
     if ( (value & EFER_LMSLE) && !cpu_has_lmsl )
-        return 0;
+        return "LMSLE without support";
 
     if ( (value & EFER_FFXSE) &&
          !(ext1_edx & cpufeat_mask(X86_FEATURE_FFXSR)) )
-        return 0;
+        return "FFXSE without feature";
 
-    return 1;
+    return NULL;
 }
 
 /* These reserved bits in lower 32 remain 0 after any load of CR0 */
@@ -1818,6 +1819,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     struct vcpu *v;
     struct hvm_hw_cpu ctxt;
     struct segment_register seg;
+    const char *errstr;
 
     /* Which vcpu is this? */
     vcpuid = hvm_load_instance(h);
@@ -1848,10 +1850,11 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( !hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG)) )
+    errstr = hvm_efer_valid(v, ctxt.msr_efer, MASK_EXTR(ctxt.cr0, X86_CR0_PG));
+    if ( errstr )
     {
-        printk(XENLOG_G_ERR "HVM%d restore: bad EFER %#" PRIx64 "\n",
-               d->domain_id, ctxt.msr_efer);
+        printk(XENLOG_G_ERR "%pv: HVM restore: bad EFER %#" PRIx64 " - %s\n",
+               v, ctxt.msr_efer, errstr);
         return -EINVAL;
     }
 
@@ -2988,13 +2991,16 @@ err:
 int hvm_set_efer(uint64_t value)
 {
     struct vcpu *v = current;
+    const char *errstr;
 
     value &= ~EFER_LMA;
 
-    if ( !hvm_efer_valid(v, value, -1) )
+    errstr = hvm_efer_valid(v, value, -1);
+    if ( errstr )
     {
-        gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
-                 "EFER: %#"PRIx64"\n", value);
+        printk(XENLOG_G_WARNING
+               "%pv: Invalid EFER update: %#"PRIx64" -> %#"PRIx64" - %s\n",
+               v, v->arch.hvm_vcpu.guest_efer, value, errstr);
         hvm_inject_hw_exception(TRAP_gp_fault, 0);
         return X86EMUL_EXCEPTION;
     }
--
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 Tue Feb 03 08:01:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01: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 1YIYQO-0005WC-OI; Tue, 03 Feb 2015 08:01:32 +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 1YIYQN-0005Sy-6O
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:31 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	37/9B-02991-A5080D45; Tue, 03 Feb 2015 08:01:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950489!10834937!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3673 invoked from network); 3 Feb 2015 08:01:29 -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;
	3 Feb 2015 08: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 1YIYQL-0005Sm-0c
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQK-0006R5-VK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:28 +0000
Date: Tue, 03 Feb 2015 08:01:28 +0000
Message-Id: <E1YIYQK-0006R5-VK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: use tzcnt instead of bsf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b18b6daf65554fd9e1b6008513bfd50a7ef5d3e9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 12:50:21 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:50:21 2015 +0100

    x86: use tzcnt instead of bsf
    
    Following a compiler change done in 2012, make use of the fact that for
    non-zero input BSF and TZCNT produce the same numeric result (EFLAGS
    setting differs), and that CPUs not knowing of TZCNT will treat the
    instruction as BSF (i.e. ignore what looks like a REP prefix to them).
    The assumption here is that TZCNT would never have worse performance
    than BSF.
    
    Also extend the asm() input in find_first_set_bit() to allow memory
    operands.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/bitops.c        |    2 +-
 xen/arch/x86/hvm/vpic.c      |    2 +-
 xen/include/asm-x86/bitops.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/bitops.c b/xen/arch/x86/bitops.c
index c037567..f6ee715 100644
--- a/xen/arch/x86/bitops.c
+++ b/xen/arch/x86/bitops.c
@@ -62,7 +62,7 @@ unsigned int __find_first_zero_bit(
         "   je 2f\n\t"
         "   xor -"STR(BITS_PER_LONG/8)"(%2),%3\n\t"
         "   jz 1b\n\t"
-        "   bsf %3,%0\n\t"
+        "   rep; bsf %3,%0\n\t"
         "   lea -"STR(BITS_PER_LONG/8)"(%2),%2\n\t"
         "2: sub %%ebx,%%edi\n\t"
         "   shl $3,%%edi\n\t"
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 2c6e6e5..d72b6ff 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -56,7 +56,7 @@ static int vpic_get_priority(struct hvm_hw_vpic *vpic, uint8_t mask)
         return VPIC_PRIO_NONE;
 
     /* prio = ffs(mask ROR vpic->priority_add); */
-    asm ( "ror %%cl,%b1 ; bsf %1,%0"
+    asm ( "ror %%cl,%b1 ; rep; bsf %1,%0"
           : "=r" (prio) : "q" ((uint32_t)mask), "c" (vpic->priority_add) );
     return prio;
 }
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 099a74c..6f0f34b 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -391,7 +391,7 @@ static inline unsigned int __scanbit(unsigned long val, unsigned long max)
  */
 static inline unsigned int find_first_set_bit(unsigned long word)
 {
-    asm ( "bsf %1,%0" : "=r" (word) : "r" (word) );
+    asm ( "rep; bsf %1,%0" : "=r" (word) : "rm" (word) );
     return (unsigned int)word;
 }
 
--
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 Tue Feb 03 08:01:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01: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 1YIYQO-0005WC-OI; Tue, 03 Feb 2015 08:01:32 +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 1YIYQN-0005Sy-6O
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:31 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	37/9B-02991-A5080D45; Tue, 03 Feb 2015 08:01:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950489!10834937!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3673 invoked from network); 3 Feb 2015 08:01:29 -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;
	3 Feb 2015 08: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 1YIYQL-0005Sm-0c
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQK-0006R5-VK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:28 +0000
Date: Tue, 03 Feb 2015 08:01:28 +0000
Message-Id: <E1YIYQK-0006R5-VK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: use tzcnt instead of bsf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b18b6daf65554fd9e1b6008513bfd50a7ef5d3e9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 12:50:21 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:50:21 2015 +0100

    x86: use tzcnt instead of bsf
    
    Following a compiler change done in 2012, make use of the fact that for
    non-zero input BSF and TZCNT produce the same numeric result (EFLAGS
    setting differs), and that CPUs not knowing of TZCNT will treat the
    instruction as BSF (i.e. ignore what looks like a REP prefix to them).
    The assumption here is that TZCNT would never have worse performance
    than BSF.
    
    Also extend the asm() input in find_first_set_bit() to allow memory
    operands.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/bitops.c        |    2 +-
 xen/arch/x86/hvm/vpic.c      |    2 +-
 xen/include/asm-x86/bitops.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/bitops.c b/xen/arch/x86/bitops.c
index c037567..f6ee715 100644
--- a/xen/arch/x86/bitops.c
+++ b/xen/arch/x86/bitops.c
@@ -62,7 +62,7 @@ unsigned int __find_first_zero_bit(
         "   je 2f\n\t"
         "   xor -"STR(BITS_PER_LONG/8)"(%2),%3\n\t"
         "   jz 1b\n\t"
-        "   bsf %3,%0\n\t"
+        "   rep; bsf %3,%0\n\t"
         "   lea -"STR(BITS_PER_LONG/8)"(%2),%2\n\t"
         "2: sub %%ebx,%%edi\n\t"
         "   shl $3,%%edi\n\t"
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 2c6e6e5..d72b6ff 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -56,7 +56,7 @@ static int vpic_get_priority(struct hvm_hw_vpic *vpic, uint8_t mask)
         return VPIC_PRIO_NONE;
 
     /* prio = ffs(mask ROR vpic->priority_add); */
-    asm ( "ror %%cl,%b1 ; bsf %1,%0"
+    asm ( "ror %%cl,%b1 ; rep; bsf %1,%0"
           : "=r" (prio) : "q" ((uint32_t)mask), "c" (vpic->priority_add) );
     return prio;
 }
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 099a74c..6f0f34b 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -391,7 +391,7 @@ static inline unsigned int __scanbit(unsigned long val, unsigned long max)
  */
 static inline unsigned int find_first_set_bit(unsigned long word)
 {
-    asm ( "bsf %1,%0" : "=r" (word) : "r" (word) );
+    asm ( "rep; bsf %1,%0" : "=r" (word) : "rm" (word) );
     return (unsigned int)word;
 }
 
--
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 Tue Feb 03 08:01:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYQY-0005r4-TL; Tue, 03 Feb 2015 08:01:42 +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 1YIYQX-0005ql-G1
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:41 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	56/36-03736-46080D45; Tue, 03 Feb 2015 08:01:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1422950499!7910904!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32166 invoked from network); 3 Feb 2015 08:01:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:01: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 1YIYQV-0005Ss-4x
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQV-0006SG-40
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:39 +0000
Date: Tue, 03 Feb 2015 08:01:39 +0000
Message-Id: <E1YIYQV-0006SG-40@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: vcpu_destroy_pagetables() must
	not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de4f284b3d7b47d3b9807f354552ecf3e0fff56b
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon Jan 26 12:51:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:51:09 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6e9c2c0..d4965da 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2677,7 +2677,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
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 Tue Feb 03 08:01:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYQY-0005r4-TL; Tue, 03 Feb 2015 08:01:42 +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 1YIYQX-0005ql-G1
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:41 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	56/36-03736-46080D45; Tue, 03 Feb 2015 08:01:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1422950499!7910904!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32166 invoked from network); 3 Feb 2015 08:01:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:01: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 1YIYQV-0005Ss-4x
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQV-0006SG-40
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:39 +0000
Date: Tue, 03 Feb 2015 08:01:39 +0000
Message-Id: <E1YIYQV-0006SG-40@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: vcpu_destroy_pagetables() must
	not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de4f284b3d7b47d3b9807f354552ecf3e0fff56b
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon Jan 26 12:51:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 12:51:09 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6e9c2c0..d4965da 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2677,7 +2677,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
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 Tue Feb 03 08:01:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01: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 1YIYQj-00060S-19; Tue, 03 Feb 2015 08:01: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 1YIYQh-000607-LT
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:51 +0000
Content-Length: 6642
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	AE/05-02754-F6080D45; Tue, 03 Feb 2015 08:01:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1422950509!4799292!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17060 invoked from network); 3 Feb 2015 08:01:50 -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;
	3 Feb 2015 08:01:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQf-0005Sy-AE
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQf-0006Sn-9L
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:49 +0000
Date: Tue, 03 Feb 2015 08:01:49 +0000
Message-Id: <E1YIYQf-0006Sn-9L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce a per architecture
	scratch pfn for temporary grant mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2222578797412873595=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2222578797412873595==
Content-Length: 6365
Content-Transfer-Encoding: quoted-printable

commit 5b5c40c0d10f5ffbd35b7eef6df34a086000442f
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Jan 21 13:25:44 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:30:35 2015 +0000

    libxc: introduce a per architecture scratch pfn for temporary grant mapping
    
    The code to initialize the grant table in libxc uses
    xc_domain_maximum_gpfn() + 1 to get a guest pfn for mapping the grant
    frame and to initialize it.
    
    This solution has two major issues:
        - The check of the return of xc_domain_maximum_gpfn is buggy because
        xen_pfn_t is unsigned and in case of an error -ERRNO is returned.
        Which is never catch with ( pfn <=3D 0 ).
        - The guest memory layout maybe filled up to the end, i.e
        xc_domain_maximum_gpfn() + 1 gives either 0 or an invalid PFN due to
        hardware limitation.
    
    Futhermore, on ARM, xc_domain_maximum_gpfn() is not implemented and
    return -ENOSYS. This will make libxc to use always the same PFN which
    may colapse with an already mapped region (see xen/include/public/arch-arm.h
    for the layout).
    
    This patch only address the problem for ARM, the x86 version use the same
    behavior (ie xc_domain_maximum_gpfn() + 1), as I'm not familiar with Xen x86.
    
    A new function xc_core_arch_get_scratch_gpfn is introduced to be able to
    choose the gpfn per architecture.
    
    For the ARM version, we use the GUEST_GNTTAB_GUEST which is the base of
    the region by the guest to map the grant table. At the build time,
    nothing is mapped there.
    
    At the same time correctly check the return of xc_domain_maximum_gpfn
    for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Cc: Roger Pau Monn=C3=A9 <roger.pau@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>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_core.h     |    3 +++
 tools/libxc/xc_core_arm.c |   17 +++++++++++++++++
 tools/libxc/xc_core_x86.c |   17 +++++++++++++++++
 tools/libxc/xc_dom_boot.c |   18 ++++++++++++------
 4 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 10cbfca..5867030 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -148,6 +148,9 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
                                   shared_info_any_t *live_shinfo,
                                   xen_pfn_t **live_p2m, unsigned long *pfnp);
 
+int xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                                  xen_pfn_t *gpfn);
+
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
index 2fbcf3f..16508e7 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -96,6 +96,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    /*
+     * The Grant Table region space is not used until the guest is
+     * booting. Use the first page for the scratch pfn.
+     */
+    XC_BUILD_BUG_ON(GUEST_GNTTAB_SIZE < XC_PAGE_SIZE);
+
+    *gpfn =3D GUEST_GNTTAB_BASE >> XC_PAGE_SHIFT;
+
+    return 0;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index f05060a..fac99ec 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -205,6 +205,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    int rc;
+
+    rc =3D xc_domain_maximum_gpfn(xch, domid);
+
+    if ( rc <=3D 0 )
+        return rc;
+
+    *gpfn =3D rc + 1;
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f0a1c64..a141eb5 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -33,6 +33,7 @@
 
 #include "xg_private.h"
 #include "xc_dom.h"
+#include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
 
@@ -365,7 +366,7 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
                            domid_t xenstore_domid)
 {
     int rc;
-    xen_pfn_t max_gfn;
+    xen_pfn_t scratch_gpfn;
     struct xen_add_to_physmap xatp =3D {
         .domid =3D domid,
         .space =3D XENMAPSPACE_grant_table,
@@ -375,16 +376,21 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
         .domid =3D domid,
     };
 
-    max_gfn =3D xc_domain_maximum_gpfn(xch, domid);
-    if ( max_gfn <=3D 0 ) {
+    rc =3D xc_core_arch_get_scratch_gpfn(xch, domid, &scratch_gpfn);
+    if ( rc < 0 )
+    {
         xc_dom_panic(xch, XC_INTERNAL_ERROR,
-                     "%s: failed to get max gfn "
+                     "%s: failed to get a scratch gfn "
                      "[errno=3D%d]\n",
                      __FUNCTION__, errno);
         return -1;
     }
-    xatp.gpfn =3D max_gfn + 1;
-    xrfp.gpfn =3D max_gfn + 1;
+    xatp.gpfn =3D scratch_gpfn;
+    xrfp.gpfn =3D scratch_gpfn;
+
+    xc_dom_printf(xch, "%s: called, pfn=3D0x%"PRI_xen_pfn, __FUNCTION__,
+                  scratch_gpfn);
+
 
     rc =3D do_memory_op(xch, XENMEM_add_to_physmap, &xatp, sizeof(xatp));
     if ( rc !=3D 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2222578797412873595==
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
--===============2222578797412873595==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:01:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:01: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 1YIYQj-00060S-19; Tue, 03 Feb 2015 08:01: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 1YIYQh-000607-LT
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:51 +0000
Content-Length: 6642
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	AE/05-02754-F6080D45; Tue, 03 Feb 2015 08:01:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1422950509!4799292!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17060 invoked from network); 3 Feb 2015 08:01:50 -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;
	3 Feb 2015 08:01:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQf-0005Sy-AE
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQf-0006Sn-9L
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:49 +0000
Date: Tue, 03 Feb 2015 08:01:49 +0000
Message-Id: <E1YIYQf-0006Sn-9L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce a per architecture
	scratch pfn for temporary grant mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2222578797412873595=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2222578797412873595==
Content-Length: 6365
Content-Transfer-Encoding: quoted-printable

commit 5b5c40c0d10f5ffbd35b7eef6df34a086000442f
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Jan 21 13:25:44 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:30:35 2015 +0000

    libxc: introduce a per architecture scratch pfn for temporary grant mapping
    
    The code to initialize the grant table in libxc uses
    xc_domain_maximum_gpfn() + 1 to get a guest pfn for mapping the grant
    frame and to initialize it.
    
    This solution has two major issues:
        - The check of the return of xc_domain_maximum_gpfn is buggy because
        xen_pfn_t is unsigned and in case of an error -ERRNO is returned.
        Which is never catch with ( pfn <=3D 0 ).
        - The guest memory layout maybe filled up to the end, i.e
        xc_domain_maximum_gpfn() + 1 gives either 0 or an invalid PFN due to
        hardware limitation.
    
    Futhermore, on ARM, xc_domain_maximum_gpfn() is not implemented and
    return -ENOSYS. This will make libxc to use always the same PFN which
    may colapse with an already mapped region (see xen/include/public/arch-arm.h
    for the layout).
    
    This patch only address the problem for ARM, the x86 version use the same
    behavior (ie xc_domain_maximum_gpfn() + 1), as I'm not familiar with Xen x86.
    
    A new function xc_core_arch_get_scratch_gpfn is introduced to be able to
    choose the gpfn per architecture.
    
    For the ARM version, we use the GUEST_GNTTAB_GUEST which is the base of
    the region by the guest to map the grant table. At the build time,
    nothing is mapped there.
    
    At the same time correctly check the return of xc_domain_maximum_gpfn
    for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Cc: Roger Pau Monn=C3=A9 <roger.pau@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>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_core.h     |    3 +++
 tools/libxc/xc_core_arm.c |   17 +++++++++++++++++
 tools/libxc/xc_core_x86.c |   17 +++++++++++++++++
 tools/libxc/xc_dom_boot.c |   18 ++++++++++++------
 4 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 10cbfca..5867030 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -148,6 +148,9 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
                                   shared_info_any_t *live_shinfo,
                                   xen_pfn_t **live_p2m, unsigned long *pfnp);
 
+int xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                                  xen_pfn_t *gpfn);
+
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
index 2fbcf3f..16508e7 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -96,6 +96,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    /*
+     * The Grant Table region space is not used until the guest is
+     * booting. Use the first page for the scratch pfn.
+     */
+    XC_BUILD_BUG_ON(GUEST_GNTTAB_SIZE < XC_PAGE_SIZE);
+
+    *gpfn =3D GUEST_GNTTAB_BASE >> XC_PAGE_SHIFT;
+
+    return 0;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index f05060a..fac99ec 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -205,6 +205,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    int rc;
+
+    rc =3D xc_domain_maximum_gpfn(xch, domid);
+
+    if ( rc <=3D 0 )
+        return rc;
+
+    *gpfn =3D rc + 1;
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f0a1c64..a141eb5 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -33,6 +33,7 @@
 
 #include "xg_private.h"
 #include "xc_dom.h"
+#include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
 
@@ -365,7 +366,7 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
                            domid_t xenstore_domid)
 {
     int rc;
-    xen_pfn_t max_gfn;
+    xen_pfn_t scratch_gpfn;
     struct xen_add_to_physmap xatp =3D {
         .domid =3D domid,
         .space =3D XENMAPSPACE_grant_table,
@@ -375,16 +376,21 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
         .domid =3D domid,
     };
 
-    max_gfn =3D xc_domain_maximum_gpfn(xch, domid);
-    if ( max_gfn <=3D 0 ) {
+    rc =3D xc_core_arch_get_scratch_gpfn(xch, domid, &scratch_gpfn);
+    if ( rc < 0 )
+    {
         xc_dom_panic(xch, XC_INTERNAL_ERROR,
-                     "%s: failed to get max gfn "
+                     "%s: failed to get a scratch gfn "
                      "[errno=3D%d]\n",
                      __FUNCTION__, errno);
         return -1;
     }
-    xatp.gpfn =3D max_gfn + 1;
-    xrfp.gpfn =3D max_gfn + 1;
+    xatp.gpfn =3D scratch_gpfn;
+    xrfp.gpfn =3D scratch_gpfn;
+
+    xc_dom_printf(xch, "%s: called, pfn=3D0x%"PRI_xen_pfn, __FUNCTION__,
+                  scratch_gpfn);
+
 
     rc =3D do_memory_op(xch, XENMEM_add_to_physmap, &xatp, sizeof(xatp));
     if ( rc !=3D 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2222578797412873595==
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
--===============2222578797412873595==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:02:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYQt-000626-5J; Tue, 03 Feb 2015 08:02: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 1YIYQr-00061r-OK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:01 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	36/C8-02994-97080D45; Tue, 03 Feb 2015 08:02:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950519!12416727!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21144 invoked from network); 3 Feb 2015 08:02:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08: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 1YIYQp-0005T7-FF
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQp-0006TE-EB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:59 +0000
Date: Tue, 03 Feb 2015 08:01:59 +0000
Message-Id: <E1YIYQp-0006TE-EB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: delete xenlight.pc.in in
	distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d057fc5ead09b403efc2b4a335e158b97748b25
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 12:22:49 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:34:05 2015 +0000

    libxl: delete xenlight.pc.in in distclean
    
    That file is generated by configure. Deleting it in "make clean" leads
    to rerun configure. Move it under distclean target.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 08fe814..bb19802 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -282,9 +282,10 @@ clean:
 	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
 	$(RM) -f testidl.c.new testidl.c *.api-ok
-	$(RM) -f xenlight.pc xenlight.pc.in
+	$(RM) -f xenlight.pc
 
 distclean: clean
+	$(RM) -f xenlight.pc.in
 
 realclean: distclean
 	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
--
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 Tue Feb 03 08:02:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYQt-000626-5J; Tue, 03 Feb 2015 08:02: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 1YIYQr-00061r-OK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:01 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	36/C8-02994-97080D45; Tue, 03 Feb 2015 08:02:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1422950519!12416727!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21144 invoked from network); 3 Feb 2015 08:02:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08: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 1YIYQp-0005T7-FF
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQp-0006TE-EB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:01:59 +0000
Date: Tue, 03 Feb 2015 08:01:59 +0000
Message-Id: <E1YIYQp-0006TE-EB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: delete xenlight.pc.in in
	distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d057fc5ead09b403efc2b4a335e158b97748b25
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 12:22:49 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:34:05 2015 +0000

    libxl: delete xenlight.pc.in in distclean
    
    That file is generated by configure. Deleting it in "make clean" leads
    to rerun configure. Move it under distclean target.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 08fe814..bb19802 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -282,9 +282,10 @@ clean:
 	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
 	$(RM) -f testidl.c.new testidl.c *.api-ok
-	$(RM) -f xenlight.pc xenlight.pc.in
+	$(RM) -f xenlight.pc
 
 distclean: clean
+	$(RM) -f xenlight.pc.in
 
 realclean: distclean
 	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
--
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 Tue Feb 03 08:02:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02: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 1YIYR2-00063f-7p; Tue, 03 Feb 2015 08:02:12 +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 1YIYR1-00063W-R0
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	88/B5-02754-38080D45; Tue, 03 Feb 2015 08:02:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950529!12111323!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21165 invoked from network); 3 Feb 2015 08:02:10 -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;
	3 Feb 2015 08:02: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 1YIYQz-0005Tg-Kr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQz-0006Tz-J3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:09 +0000
Date: Tue, 03 Feb 2015 08:02:09 +0000
Message-Id: <E1YIYQz-0006Tz-J3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: provide xlutil.pc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 675b2d22a05f026d2a4dfdeb528930b084745d14
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 12:22:50 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:34:05 2015 +0000

    libxl: provide xlutil.pc
    
    Please rerun autogen.sh after applying this patch.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore                  |    4 ++--
 tools/configure.ac          |    1 +
 tools/libxl/Makefile        |   10 ++++++----
 tools/libxl/xlutil.pc.in.in |    9 +++++++++
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 33c2ca0..13ee05b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -153,8 +153,8 @@ tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
 tools/libxl/libxlu_cfg_y.output
-tools/libxl/xenlight.pc
-tools/libxl/xenlight.pc.in
+tools/libxl/*.pc
+tools/libxl/*.pc.in
 tools/libxl/xl
 tools/libxl/testenum
 tools/libxl/testenum.c
diff --git a/tools/configure.ac b/tools/configure.ac
index 113285d..1ecc216 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -28,6 +28,7 @@ hotplug/Linux/xen-hotplug-common.sh
 hotplug/Linux/xendomains
 hotplug/NetBSD/rc.d/xencommons
 libxl/xenlight.pc.in
+libxl/xlutil.pc.in
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index bb19802..5df4970 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -143,7 +143,7 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 
-PKG_CONFIG = xenlight.pc
+PKG_CONFIG = xenlight.pc xlutil.pc
 
 testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
 testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS)
@@ -250,8 +250,8 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-xenlight.pc: xenlight.pc.in Makefile
-	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < xenlight.pc.in > $@.new
+$(PKG_CONFIG): %.in : Makefile
+	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $@.in > $@.new
 	@mv -f $@.new $@
 
 .PHONY: install
@@ -276,6 +276,7 @@ install: all
 	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
 	$(INSTALL_DATA) xenlight.pc $(DESTDIR)$(SHAREDIR)/pkgconfig/
+	$(INSTALL_DATA) xlutil.pc $(DESTDIR)$(SHAREDIR)/pkgconfig/
 
 .PHONY: clean
 clean:
@@ -283,9 +284,10 @@ clean:
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
 	$(RM) -f testidl.c.new testidl.c *.api-ok
 	$(RM) -f xenlight.pc
+	$(RM) -f xlutil.pc
 
 distclean: clean
-	$(RM) -f xenlight.pc.in
+	$(RM) -f xenlight.pc.in xlutil.pc.in
 
 realclean: distclean
 	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
diff --git a/tools/libxl/xlutil.pc.in.in b/tools/libxl/xlutil.pc.in.in
new file mode 100644
index 0000000..e7dc14d
--- /dev/null
+++ b/tools/libxl/xlutil.pc.in.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: Xlutil
+Description: The xl utility library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lxlutil
--
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 Tue Feb 03 08:02:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02: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 1YIYR2-00063f-7p; Tue, 03 Feb 2015 08:02:12 +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 1YIYR1-00063W-R0
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	88/B5-02754-38080D45; Tue, 03 Feb 2015 08:02:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950529!12111323!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21165 invoked from network); 3 Feb 2015 08:02:10 -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;
	3 Feb 2015 08:02: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 1YIYQz-0005Tg-Kr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYQz-0006Tz-J3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:09 +0000
Date: Tue, 03 Feb 2015 08:02:09 +0000
Message-Id: <E1YIYQz-0006Tz-J3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: provide xlutil.pc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 675b2d22a05f026d2a4dfdeb528930b084745d14
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 12:22:50 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:34:05 2015 +0000

    libxl: provide xlutil.pc
    
    Please rerun autogen.sh after applying this patch.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore                  |    4 ++--
 tools/configure.ac          |    1 +
 tools/libxl/Makefile        |   10 ++++++----
 tools/libxl/xlutil.pc.in.in |    9 +++++++++
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 33c2ca0..13ee05b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -153,8 +153,8 @@ tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
 tools/libxl/libxlu_cfg_y.output
-tools/libxl/xenlight.pc
-tools/libxl/xenlight.pc.in
+tools/libxl/*.pc
+tools/libxl/*.pc.in
 tools/libxl/xl
 tools/libxl/testenum
 tools/libxl/testenum.c
diff --git a/tools/configure.ac b/tools/configure.ac
index 113285d..1ecc216 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -28,6 +28,7 @@ hotplug/Linux/xen-hotplug-common.sh
 hotplug/Linux/xendomains
 hotplug/NetBSD/rc.d/xencommons
 libxl/xenlight.pc.in
+libxl/xlutil.pc.in
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index bb19802..5df4970 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -143,7 +143,7 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 
-PKG_CONFIG = xenlight.pc
+PKG_CONFIG = xenlight.pc xlutil.pc
 
 testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
 testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS)
@@ -250,8 +250,8 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-xenlight.pc: xenlight.pc.in Makefile
-	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < xenlight.pc.in > $@.new
+$(PKG_CONFIG): %.in : Makefile
+	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $@.in > $@.new
 	@mv -f $@.new $@
 
 .PHONY: install
@@ -276,6 +276,7 @@ install: all
 	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
 	$(INSTALL_DATA) xenlight.pc $(DESTDIR)$(SHAREDIR)/pkgconfig/
+	$(INSTALL_DATA) xlutil.pc $(DESTDIR)$(SHAREDIR)/pkgconfig/
 
 .PHONY: clean
 clean:
@@ -283,9 +284,10 @@ clean:
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
 	$(RM) -f testidl.c.new testidl.c *.api-ok
 	$(RM) -f xenlight.pc
+	$(RM) -f xlutil.pc
 
 distclean: clean
-	$(RM) -f xenlight.pc.in
+	$(RM) -f xenlight.pc.in xlutil.pc.in
 
 realclean: distclean
 	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
diff --git a/tools/libxl/xlutil.pc.in.in b/tools/libxl/xlutil.pc.in.in
new file mode 100644
index 0000000..e7dc14d
--- /dev/null
+++ b/tools/libxl/xlutil.pc.in.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: Xlutil
+Description: The xl utility library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lxlutil
--
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 Tue Feb 03 08:02:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02: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 1YIYRE-00065R-Bl; Tue, 03 Feb 2015 08:02:24 +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 1YIYRD-00065K-Qb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:24 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	19/4F-03511-F8080D45; Tue, 03 Feb 2015 08:02:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1422950540!6669414!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11659 invoked from network); 3 Feb 2015 08:02:20 -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;
	3 Feb 2015 08: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 1YIYR9-0005Tm-WB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYR9-0006UO-QI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:19 +0000
Date: Tue, 03 Feb 2015 08:02:19 +0000
Message-Id: <E1YIYR9-0006UO-QI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: fix "make distclean"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f9c9b127753e9eddf532d3133f57321dc3d927e4
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 13:31:12 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:34:45 2015 +0000

    tools: fix "make distclean"
    
    The original rule to target "distclean" in tools/Rules.mk was in effect
    "make clean". It should be "make distclean".
    
    However not all Makefiles in subdirectories have distclean target
    defined. So this patch also adds a bunch of distclean targets to various
    Makefiles. They only depend on clean target and don't have any actions
    in most cases.
    
    With the patch applied, following command outputs 0 results:
    
      find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \
         | grep -v ocaml | grep -v libfsimage
    
    Ocaml and libfsimage are known to have distclean defined in a dedicated
    rules file.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Rules.mk                                |    2 +-
 tools/blktap2/Makefile                        |    6 ++++--
 tools/blktap2/control/Makefile                |    4 +++-
 tools/blktap2/drivers/Makefile                |    4 +++-
 tools/blktap2/include/Makefile                |    3 +++
 tools/blktap2/lvm/Makefile                    |    4 +++-
 tools/blktap2/vhd/Makefile                    |    4 +++-
 tools/blktap2/vhd/lib/Makefile                |    4 +++-
 tools/console/Makefile                        |    3 +++
 tools/console/testsuite/Makefile              |    5 ++++-
 tools/debugger/gdbsx/Makefile                 |    4 ++++
 tools/debugger/gdbsx/gx/Makefile              |    2 ++
 tools/debugger/gdbsx/xg/Makefile              |    2 ++
 tools/debugger/kdd/Makefile                   |    3 +++
 tools/examples/Makefile                       |    3 +++
 tools/firmware/hvmloader/Makefile             |    3 +++
 tools/firmware/hvmloader/acpi/Makefile        |    2 ++
 tools/firmware/rombios/32bit/Makefile         |    3 +++
 tools/firmware/rombios/32bit/tcgbios/Makefile |    3 +++
 tools/firmware/rombios/Makefile               |    3 +++
 tools/firmware/vgabios/Makefile               |    3 +++
 tools/flask/Makefile                          |    4 ++--
 tools/flask/policy/Makefile                   |    4 +++-
 tools/flask/utils/Makefile                    |    3 +++
 tools/hotplug/FreeBSD/Makefile                |    3 +++
 tools/hotplug/Linux/Makefile                  |    3 +++
 tools/hotplug/Linux/systemd/Makefile          |    3 +++
 tools/hotplug/Makefile                        |    4 ++--
 tools/hotplug/NetBSD/Makefile                 |    3 +++
 tools/hotplug/common/Makefile                 |    3 +++
 tools/include/Makefile                        |    3 +++
 tools/include/xen-foreign/Makefile            |    4 +++-
 tools/libxc/Makefile                          |    3 +++
 tools/memshr/Makefile                         |    5 ++++-
 tools/misc/Makefile                           |    3 +++
 tools/ocaml/Makefile                          |    3 +++
 tools/ocaml/Makefile.rules                    |    2 ++
 tools/ocaml/libs/Makefile                     |    3 +++
 tools/pygrub/Makefile                         |    3 +++
 tools/python/Makefile                         |    3 +++
 tools/tests/mce-test/Makefile                 |    5 ++++-
 tools/tests/mce-test/tools/Makefile           |    3 +++
 tools/tests/mem-sharing/Makefile              |    3 +++
 tools/tests/regression/Makefile               |    4 ++--
 tools/tests/vhpet/Makefile                    |    3 +++
 tools/tests/x86_emulator/Makefile             |    3 +++
 tools/tests/xen-access/Makefile               |    3 +++
 tools/xcutils/Makefile                        |    3 +++
 tools/xenbackendd/Makefile                    |    3 +++
 tools/xenmon/Makefile                         |    3 +++
 tools/xenpaging/Makefile                      |    4 +++-
 tools/xenpmd/Makefile                         |    3 +++
 tools/xenstat/Makefile                        |    4 ++--
 tools/xenstat/libxenstat/Makefile             |    3 +++
 tools/xenstat/xentop/Makefile                 |    3 +++
 tools/xenstore/Makefile                       |    3 +++
 tools/xentrace/Makefile                       |    3 +++
 57 files changed, 166 insertions(+), 22 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 962a743..74cf37e 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -121,7 +121,7 @@ subdir-all-% subdir-clean-% subdir-install-%: .phony
 	$(MAKE) -C $* $(patsubst subdir-%-$*,%,$@)
 
 subdir-distclean-%: .phony
-	$(MAKE) -C $* clean
+	$(MAKE) -C $* distclean
 
 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Tools.mk:
diff --git a/tools/blktap2/Makefile b/tools/blktap2/Makefile
index d41758f..94200dc 100644
--- a/tools/blktap2/Makefile
+++ b/tools/blktap2/Makefile
@@ -14,5 +14,7 @@ SUBDIRS-$(CONFIG_Linux) += control
 clean:
 	rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) TAGS
 
-.PHONY: all clean install
-all clean install: %: subdirs-%
+distclean: clean
+
+.PHONY: all clean install distclean
+all clean install distclean: %: subdirs-%
diff --git a/tools/blktap2/control/Makefile b/tools/blktap2/control/Makefile
index a88ff4c..1ae6902 100644
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap2/control/Makefile
@@ -73,6 +73,8 @@ clean:
 	rm -f $(LIBNAME).so $(LIBSONAME)
 	rm -f *~
 
-.PHONY: all build clean install
+distclean: clean
+
+.PHONY: all build clean distclean install
 
 -include $(DEPS)
diff --git a/tools/blktap2/drivers/Makefile b/tools/blktap2/drivers/Makefile
index 3476fc1..2f96c91 100644
--- a/tools/blktap2/drivers/Makefile
+++ b/tools/blktap2/drivers/Makefile
@@ -108,4 +108,6 @@ install: all
 clean:
 	rm -rf .*.d *.o *~ xen TAGS $(IBIN) $(LIB) $(LOCK_UTIL) $(QCOW_UTIL)
 
-.PHONY: clean install
+distclean: clean
+
+.PHONY: clean install distclean
diff --git a/tools/blktap2/include/Makefile b/tools/blktap2/include/Makefile
index f85351e..c238486 100644
--- a/tools/blktap2/include/Makefile
+++ b/tools/blktap2/include/Makefile
@@ -12,3 +12,6 @@ install:
 .PHONY: clean
 clean:
 	@:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/blktap2/lvm/Makefile b/tools/blktap2/lvm/Makefile
index cf8a53b..7d5f8ea 100644
--- a/tools/blktap2/lvm/Makefile
+++ b/tools/blktap2/lvm/Makefile
@@ -29,6 +29,8 @@ lvm-util: lvm-util.o
 clean:
 	rm -rf *.o *.opic *~ $(DEPS) $(IBIN)
 
-.PHONY: all build clean install lvm-util
+distclean: clean
+
+.PHONY: all build clean distclean install lvm-util
 
 -include $(DEPS)
diff --git a/tools/blktap2/vhd/Makefile b/tools/blktap2/vhd/Makefile
index fef0d36..9e21cce 100644
--- a/tools/blktap2/vhd/Makefile
+++ b/tools/blktap2/vhd/Makefile
@@ -44,6 +44,8 @@ install: all
 clean: subdirs-clean
 	rm -rf *.o *~ $(DEPS) $(IBIN)
 
-.PHONY: all build clean install vhd-util vhd-update
+distclean: clean
+
+.PHONY: all build clean distclean install vhd-util vhd-update
 
 -include $(DEPS)
diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap2/vhd/lib/Makefile
index 99e3cdb..3904e97 100644
--- a/tools/blktap2/vhd/lib/Makefile
+++ b/tools/blktap2/vhd/lib/Makefile
@@ -75,6 +75,8 @@ install: all
 clean:
 	rm -rf *.a *.so* *.o *.opic *~ $(DEPS) $(LIBVHD)
 
-.PHONY: all build clean install libvhd
+distclean: clean
+
+.PHONY: all build clean distclean install libvhd
 
 -include $(DEPS)
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 6e55618..239ec60 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -22,6 +22,9 @@ clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS)
 	$(RM) client/*.o daemon/*.o
 
+.PHONY: distclean
+distclean: clean
+
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
diff --git a/tools/console/testsuite/Makefile b/tools/console/testsuite/Makefile
index d9e4380..85501fd 100644
--- a/tools/console/testsuite/Makefile
+++ b/tools/console/testsuite/Makefile
@@ -11,4 +11,7 @@ console-domU: console-domU.o
 procpipe: procpipe.o
 
 .PHONY: clean
-clean:; $(RM) *.o console-domU console-dom0 procpipe
+clean: $(RM) *.o console-domU console-dom0 procpipe
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/debugger/gdbsx/Makefile b/tools/debugger/gdbsx/Makefile
index 7938dd8..31eb900 100644
--- a/tools/debugger/gdbsx/Makefile
+++ b/tools/debugger/gdbsx/Makefile
@@ -12,6 +12,10 @@ clean:
 	rm -f xg_all.a gx_all.a gdbsx
 	set -e; for d in xg gx; do $(MAKE) -C $$d clean; done
 
+.PHONY: distclean
+distclean: clean
+	set -e; for d in xg gx; do $(MAKE) -c $$d distclean; done
+
 .PHONY: install
 install: all
 	[ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
diff --git a/tools/debugger/gdbsx/gx/Makefile b/tools/debugger/gdbsx/gx/Makefile
index 9a0ff07..3b8467f 100644
--- a/tools/debugger/gdbsx/gx/Makefile
+++ b/tools/debugger/gdbsx/gx/Makefile
@@ -11,6 +11,8 @@ all: gx_all.a
 clean:
 	rm -rf gx_all.a *.o .*.d
 
+.PHONY: distclean
+distclean: clean
 
 #%.o: %.c $(GX_HDRS) Makefile
 #	$(CC) -c $(CFLAGS) -o $@ $<
diff --git a/tools/debugger/gdbsx/xg/Makefile b/tools/debugger/gdbsx/xg/Makefile
index 7638633..78b4021 100644
--- a/tools/debugger/gdbsx/xg/Makefile
+++ b/tools/debugger/gdbsx/xg/Makefile
@@ -33,3 +33,5 @@ xen-headers:
 clean:
 	rm -rf xen xg_all.a $(XG_OBJS)  .*.d
 
+.PHONY: distclean
+distclean: clean
diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 34b781f..8eafc82 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -16,6 +16,9 @@ kdd: $(OBJS)
 clean:
 	rm -f $(OBJS) $(DEPS) kdd
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install: all
 	[ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 473580e..87dd760 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -43,3 +43,6 @@ install-configs: $(XEN_CONFIGS)
 
 .PHONY: clean
 clean:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 46a79c5..b759e81 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -139,4 +139,7 @@ clean: subdirs-clean
 	rm -f roms.inc roms.inc.new acpi.h
 	rm -f hvmloader hvmloader.tmp *.o $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile
index 2c50851..8d91881 100644
--- a/tools/firmware/hvmloader/acpi/Makefile
+++ b/tools/firmware/hvmloader/acpi/Makefile
@@ -66,6 +66,8 @@ clean:
 	rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS)
 	rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl
 
+distclean: clean
+
 install: all
 
 -include $(DEPS)
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index e5d1cbc..396906c 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -15,6 +15,9 @@ all: subdirs-all
 clean: subdirs-clean
 	rm -rf *.o $(TARGET) $(DEPS)
 
+.PHONY: distclean
+distclean: subdirs-distclean
+
 $(TARGET): 32bitbios_all.o
 	sh mkhex highbios_array 32bitbios_all.o > $@
 
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index ddb0471..f6f2649 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -12,6 +12,9 @@ all: $(TARGET)
 clean:
 	rm -rf *.o $(TARGET) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 $(TARGET): tcgbios.o tpm_drivers.o
 	$(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
 
diff --git a/tools/firmware/rombios/Makefile b/tools/firmware/rombios/Makefile
index 2f2e409..94e65db 100644
--- a/tools/firmware/rombios/Makefile
+++ b/tools/firmware/rombios/Makefile
@@ -15,6 +15,9 @@ clean: subdirs-clean
 	rm -f  BIOS-bochs-*
 	rm -f  $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 BIOS-bochs-latest: rombios.c biossums 32bitgateway.c tcgbios.c
 	gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_.c
 	bcc -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
diff --git a/tools/firmware/vgabios/Makefile b/tools/firmware/vgabios/Makefile
index 26bb871..51d9e6e 100644
--- a/tools/firmware/vgabios/Makefile
+++ b/tools/firmware/vgabios/Makefile
@@ -25,6 +25,9 @@ clean:
           temp.awk.* vgabios*.orig _vgabios_* _vgabios-debug_* core vgabios*.bin vgabios*.txt $(RELEASE).bin *.bak
 	rm -f VGABIOS-lgpl-latest*.bin
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: release
 release: 
 	VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios
diff --git a/tools/flask/Makefile b/tools/flask/Makefile
index bc77a06..a31cc16 100644
--- a/tools/flask/Makefile
+++ b/tools/flask/Makefile
@@ -4,6 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y := utils
 SUBDIRS-$(FLASK_POLICY) += policy
 
-.PHONY: all clean install
-all clean install: %: subdirs-%
+.PHONY: all clean install distclean
+all clean install distclean: %: subdirs-%
 
diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
index 5d8cfbf..54a845b 100644
--- a/tools/flask/policy/Makefile
+++ b/tools/flask/policy/Makefile
@@ -115,4 +115,6 @@ policy.conf: $(POLICY_SECTIONS)
 clean:
 	$(RM) tmp policy.conf $(POLICY_FILENAME)
 
-.PHONY: all install clean
+distclean: clean
+
+.PHONY: all install clean distclean
diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile
index c87f15c..5dfd271 100644
--- a/tools/flask/utils/Makefile
+++ b/tools/flask/utils/Makefile
@@ -39,6 +39,9 @@ clean:
 	rm -f $(CLIENTS)
 	$(RM) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: print-dir
 print-dir:
 	@echo -n tools/flask/utils: 
diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 6aba64a..8dfc90a 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -40,3 +40,6 @@ install-rcd:
 
 .PHONY: clean
 clean:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index b8490f9..d94a9cb 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -81,3 +81,6 @@ install-udev:
 
 .PHONY: clean
 clean: subdirs-clean
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 51c10fe..83e3b32 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -28,6 +28,9 @@ all:	$(ALL_XEN_SYSTEMD)
 clean:
 	rm -f $(XEN_SYSTEMD_MODULES)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
 	[ -d $(DESTDIR)$(XEN_SYSTEMD_DIR) ] || \
diff --git a/tools/hotplug/Makefile b/tools/hotplug/Makefile
index 14ae9a8..c1a82c1 100644
--- a/tools/hotplug/Makefile
+++ b/tools/hotplug/Makefile
@@ -6,5 +6,5 @@ SUBDIRS-$(CONFIG_NetBSD) += NetBSD
 SUBDIRS-$(CONFIG_Linux) += Linux
 SUBDIRS-$(CONFIG_FreeBSD) += FreeBSD
 
-.PHONY: all clean install
-all clean install: %: subdirs-%
+.PHONY: all clean install distclean
+all clean install distclean: %: subdirs-%
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index 0a370b8..4e609e3 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -42,3 +42,6 @@ install-rcd:
 
 .PHONY: clean
 clean:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 5623abb..b53b55c 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -37,3 +37,6 @@ install-scripts: build
 .PHONY: clean
 clean:
 	rm -f $(HOTPLUGPATH)
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/include/Makefile b/tools/include/Makefile
index f7a6256..601f79c 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -50,3 +50,6 @@ clean:
 	rm -rf xen
 	$(MAKE) -C xen-foreign clean
 
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index 06b844c..ef8fc12 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -6,7 +6,7 @@ ROOT = $(XEN_ROOT)/xen/include/public
 architectures := arm32 arm64 x86_32 x86_64
 headers := $(patsubst %, %.h, $(architectures))
 
-.PHONY: all clean check-headers
+.PHONY: all clean distclean check-headers
 all: $(headers) check-headers
 
 clean:
@@ -14,6 +14,8 @@ clean:
 	rm -f checker checker.c
 	rm -f *.pyc *.o *~
 
+distclean: clean
+
 checker: checker.c $(headers)
 	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index bd2ca6c..7587d4c 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -170,6 +170,9 @@ clean:
             $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
             $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: rpm
 rpm: build
 	rm -rf staging
diff --git a/tools/memshr/Makefile b/tools/memshr/Makefile
index 2c34f96..ce86f20 100644
--- a/tools/memshr/Makefile
+++ b/tools/memshr/Makefile
@@ -39,6 +39,9 @@ install: all
 clean:
 	rm -rf *.a *.o *~ $(DEPS)
 
-.PHONY: all build clean install
+.PHONY: distclean
+distclean: clean
+
+.PHONY: all build clean install distclean
 
 -include $(DEPS)
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index a255c22..ccd36af 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -62,6 +62,9 @@ install: build
 clean:
 	$(RM) *.o $(TARGETS_BUILD) *~ $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xen-hvmctx: xen-hvmctx.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 5710a5f..cfa931a 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -20,3 +20,6 @@ install: subdirs-install
 
 .PHONY: clean
 clean: subdirs-clean
+
+.PHONY: distclean
+distclean: subdirs-distclean
diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 0745e83..1796060 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -47,6 +47,8 @@ ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS))
 clean: $(CLEAN_HOOKS)
 	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META
 
+distclean: clean
+
 quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1)
 
 mk-caml-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $1 $2 $3,MLA,$1)
diff --git a/tools/ocaml/libs/Makefile b/tools/ocaml/libs/Makefile
index 3afdc89..f7c3c0e 100644
--- a/tools/ocaml/libs/Makefile
+++ b/tools/ocaml/libs/Makefile
@@ -15,3 +15,6 @@ install: subdirs-install
 
 .PHONY: clean
 clean: subdirs-clean
+
+.PHONY: distclean
+distclean: subdirs-distclean
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 3dff608..6fd194c 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -23,4 +23,7 @@ install: all
 clean:
 	rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 533d3de..af95119 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -28,4 +28,7 @@ clean:
 	rm -rf build/
 	rm -f $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/tests/mce-test/Makefile b/tools/tests/mce-test/Makefile
index 7c80eb3..07a774a 100644
--- a/tools/tests/mce-test/Makefile
+++ b/tools/tests/mce-test/Makefile
@@ -1,7 +1,10 @@
-.PHONY: all clean
+.PHONY: all clean distclean
 
 all: 
 	$(MAKE) -C tools
 
 clean:
 	$(MAKE) -C tools clean
+
+distclean:
+	$(MAKE) -C tools distclean
diff --git a/tools/tests/mce-test/tools/Makefile b/tools/tests/mce-test/tools/Makefile
index aba7177..4a0db49 100644
--- a/tools/tests/mce-test/tools/Makefile
+++ b/tools/tests/mce-test/tools/Makefile
@@ -19,5 +19,8 @@ install: xen-mceinj
 clean:
 	$(RM) *.o xen-mceinj
 
+.PHONY: distclean
+distclean: clean
+
 xen-mceinj: xen-mceinj.o Makefile
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
diff --git a/tools/tests/mem-sharing/Makefile b/tools/tests/mem-sharing/Makefile
index 1354502..d89e283 100644
--- a/tools/tests/mem-sharing/Makefile
+++ b/tools/tests/mem-sharing/Makefile
@@ -20,6 +20,9 @@ build: $(TARGETS)
 clean:
 	$(RM) *.o $(TARGETS) *~ $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 memshrtool: memshrtool.o
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl)
 
diff --git a/tools/tests/regression/Makefile b/tools/tests/regression/Makefile
index 6e91023..70d524a 100644
--- a/tools/tests/regression/Makefile
+++ b/tools/tests/regression/Makefile
@@ -22,8 +22,8 @@ check-python-syntax: runtime-environment
 .PHONY: runtime-environment
 runtime-environment: $(PYTHON_VERSIONS)
 
-.PHONY: dist-clean
-dist-clean:
+.PHONY: distclean
+distclean:
 	rm -fr $(REG_TEST_DIR)/installed $(REG_TEST_DIR)/downloads \
 		$(REG_TEST_DIR)/build
 
diff --git a/tools/tests/vhpet/Makefile b/tools/tests/vhpet/Makefile
index 763409d..cb88dd0 100644
--- a/tools/tests/vhpet/Makefile
+++ b/tools/tests/vhpet/Makefile
@@ -26,6 +26,9 @@ $(TARGET): hpet.c main.c hpet.h emul.h Makefile
 clean:
 	rm -rf $(TARGET) $(TARGET).out *.o *~ core* hpet.h hpet.c
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install:
 
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 73517b7..b52f227 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -34,6 +34,9 @@ $(TARGET): x86_emulate.o test_x86_emulator.o
 clean:
 	rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install:
 
diff --git a/tools/tests/xen-access/Makefile b/tools/tests/xen-access/Makefile
index 65eef99..f0e94fd 100644
--- a/tools/tests/xen-access/Makefile
+++ b/tools/tests/xen-access/Makefile
@@ -21,6 +21,9 @@ build: $(TARGETS)
 clean:
 	$(RM) *.o $(TARGETS) *~ $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xen-access: xen-access.o Makefile
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest)
 
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 1c5237c..fff519d 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -42,4 +42,7 @@ clean:
 	$(RM) *.o $(PROGRAMS)
 	$(RM) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/xenbackendd/Makefile b/tools/xenbackendd/Makefile
index 31e5c62..b6bc160 100644
--- a/tools/xenbackendd/Makefile
+++ b/tools/xenbackendd/Makefile
@@ -32,6 +32,9 @@ install: build
 clean:
 	$(RM) *.a *.so *.o $(DEPS) xenbackendd
 
+.PHONY: distclean
+distclean: clean
+
 xenbackendd: xenbackendd.o
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index 3fe87ba..c206d94 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -40,6 +40,9 @@ clean:
 	$(RM) -f xenbaked xenbaked.o
 	$(RM) -f xentrace_setmask setmask.o
 
+.PHONY: distclean
+distclean: clean
+
 xenbaked: xenbaked.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index c742e62..2407a30 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -31,7 +31,9 @@ install: all
 clean:
 	rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)
 
-.PHONY: clean install
+distclean: clean
+
+.PHONY: clean install distclean
 
 .PHONY: TAGS
 TAGS:
diff --git a/tools/xenpmd/Makefile b/tools/xenpmd/Makefile
index 2d925df..4605261 100644
--- a/tools/xenpmd/Makefile
+++ b/tools/xenpmd/Makefile
@@ -18,6 +18,9 @@ install: all
 clean:
 	$(RM) -f xenpmd xenpmd.o $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xenpmd: xenpmd.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
diff --git a/tools/xenstat/Makefile b/tools/xenstat/Makefile
index 904ccdd..901be4a 100644
--- a/tools/xenstat/Makefile
+++ b/tools/xenstat/Makefile
@@ -11,6 +11,6 @@ SUBDIRS += xentop
 endif
 endif
 
-.PHONY: all install clean
+.PHONY: all install clean distclean
 
-all install clean: %: subdirs-%
+all install clean distclean: %: subdirs-%
diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index 86068cb..07d39b1 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -137,4 +137,7 @@ clean:
 	rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
 	      $(BINDINGS) $(BINDINGSRC) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile
index 076e44c..e2665aa 100644
--- a/tools/xenstat/xentop/Makefile
+++ b/tools/xenstat/xentop/Makefile
@@ -42,4 +42,7 @@ endif
 clean:
 	rm -f xentop xentop.o $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 11b6a06..60c3a08 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -115,6 +115,9 @@ clean:
 	rm -f xenstore $(CLIENTS)
 	$(RM) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: TAGS
 TAGS:
 	etags `find . -name '*.[ch]'`
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index b821952..a64db86 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -34,6 +34,9 @@ install: build
 clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xentrace: xentrace.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
 
--
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 Tue Feb 03 08:02:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02: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 1YIYRE-00065R-Bl; Tue, 03 Feb 2015 08:02:24 +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 1YIYRD-00065K-Qb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:24 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	19/4F-03511-F8080D45; Tue, 03 Feb 2015 08:02:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1422950540!6669414!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11659 invoked from network); 3 Feb 2015 08:02:20 -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;
	3 Feb 2015 08: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 1YIYR9-0005Tm-WB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYR9-0006UO-QI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:19 +0000
Date: Tue, 03 Feb 2015 08:02:19 +0000
Message-Id: <E1YIYR9-0006UO-QI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: fix "make distclean"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f9c9b127753e9eddf532d3133f57321dc3d927e4
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 13:31:12 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:34:45 2015 +0000

    tools: fix "make distclean"
    
    The original rule to target "distclean" in tools/Rules.mk was in effect
    "make clean". It should be "make distclean".
    
    However not all Makefiles in subdirectories have distclean target
    defined. So this patch also adds a bunch of distclean targets to various
    Makefiles. They only depend on clean target and don't have any actions
    in most cases.
    
    With the patch applied, following command outputs 0 results:
    
      find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \
         | grep -v ocaml | grep -v libfsimage
    
    Ocaml and libfsimage are known to have distclean defined in a dedicated
    rules file.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Rules.mk                                |    2 +-
 tools/blktap2/Makefile                        |    6 ++++--
 tools/blktap2/control/Makefile                |    4 +++-
 tools/blktap2/drivers/Makefile                |    4 +++-
 tools/blktap2/include/Makefile                |    3 +++
 tools/blktap2/lvm/Makefile                    |    4 +++-
 tools/blktap2/vhd/Makefile                    |    4 +++-
 tools/blktap2/vhd/lib/Makefile                |    4 +++-
 tools/console/Makefile                        |    3 +++
 tools/console/testsuite/Makefile              |    5 ++++-
 tools/debugger/gdbsx/Makefile                 |    4 ++++
 tools/debugger/gdbsx/gx/Makefile              |    2 ++
 tools/debugger/gdbsx/xg/Makefile              |    2 ++
 tools/debugger/kdd/Makefile                   |    3 +++
 tools/examples/Makefile                       |    3 +++
 tools/firmware/hvmloader/Makefile             |    3 +++
 tools/firmware/hvmloader/acpi/Makefile        |    2 ++
 tools/firmware/rombios/32bit/Makefile         |    3 +++
 tools/firmware/rombios/32bit/tcgbios/Makefile |    3 +++
 tools/firmware/rombios/Makefile               |    3 +++
 tools/firmware/vgabios/Makefile               |    3 +++
 tools/flask/Makefile                          |    4 ++--
 tools/flask/policy/Makefile                   |    4 +++-
 tools/flask/utils/Makefile                    |    3 +++
 tools/hotplug/FreeBSD/Makefile                |    3 +++
 tools/hotplug/Linux/Makefile                  |    3 +++
 tools/hotplug/Linux/systemd/Makefile          |    3 +++
 tools/hotplug/Makefile                        |    4 ++--
 tools/hotplug/NetBSD/Makefile                 |    3 +++
 tools/hotplug/common/Makefile                 |    3 +++
 tools/include/Makefile                        |    3 +++
 tools/include/xen-foreign/Makefile            |    4 +++-
 tools/libxc/Makefile                          |    3 +++
 tools/memshr/Makefile                         |    5 ++++-
 tools/misc/Makefile                           |    3 +++
 tools/ocaml/Makefile                          |    3 +++
 tools/ocaml/Makefile.rules                    |    2 ++
 tools/ocaml/libs/Makefile                     |    3 +++
 tools/pygrub/Makefile                         |    3 +++
 tools/python/Makefile                         |    3 +++
 tools/tests/mce-test/Makefile                 |    5 ++++-
 tools/tests/mce-test/tools/Makefile           |    3 +++
 tools/tests/mem-sharing/Makefile              |    3 +++
 tools/tests/regression/Makefile               |    4 ++--
 tools/tests/vhpet/Makefile                    |    3 +++
 tools/tests/x86_emulator/Makefile             |    3 +++
 tools/tests/xen-access/Makefile               |    3 +++
 tools/xcutils/Makefile                        |    3 +++
 tools/xenbackendd/Makefile                    |    3 +++
 tools/xenmon/Makefile                         |    3 +++
 tools/xenpaging/Makefile                      |    4 +++-
 tools/xenpmd/Makefile                         |    3 +++
 tools/xenstat/Makefile                        |    4 ++--
 tools/xenstat/libxenstat/Makefile             |    3 +++
 tools/xenstat/xentop/Makefile                 |    3 +++
 tools/xenstore/Makefile                       |    3 +++
 tools/xentrace/Makefile                       |    3 +++
 57 files changed, 166 insertions(+), 22 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 962a743..74cf37e 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -121,7 +121,7 @@ subdir-all-% subdir-clean-% subdir-install-%: .phony
 	$(MAKE) -C $* $(patsubst subdir-%-$*,%,$@)
 
 subdir-distclean-%: .phony
-	$(MAKE) -C $* clean
+	$(MAKE) -C $* distclean
 
 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Tools.mk:
diff --git a/tools/blktap2/Makefile b/tools/blktap2/Makefile
index d41758f..94200dc 100644
--- a/tools/blktap2/Makefile
+++ b/tools/blktap2/Makefile
@@ -14,5 +14,7 @@ SUBDIRS-$(CONFIG_Linux) += control
 clean:
 	rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) TAGS
 
-.PHONY: all clean install
-all clean install: %: subdirs-%
+distclean: clean
+
+.PHONY: all clean install distclean
+all clean install distclean: %: subdirs-%
diff --git a/tools/blktap2/control/Makefile b/tools/blktap2/control/Makefile
index a88ff4c..1ae6902 100644
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap2/control/Makefile
@@ -73,6 +73,8 @@ clean:
 	rm -f $(LIBNAME).so $(LIBSONAME)
 	rm -f *~
 
-.PHONY: all build clean install
+distclean: clean
+
+.PHONY: all build clean distclean install
 
 -include $(DEPS)
diff --git a/tools/blktap2/drivers/Makefile b/tools/blktap2/drivers/Makefile
index 3476fc1..2f96c91 100644
--- a/tools/blktap2/drivers/Makefile
+++ b/tools/blktap2/drivers/Makefile
@@ -108,4 +108,6 @@ install: all
 clean:
 	rm -rf .*.d *.o *~ xen TAGS $(IBIN) $(LIB) $(LOCK_UTIL) $(QCOW_UTIL)
 
-.PHONY: clean install
+distclean: clean
+
+.PHONY: clean install distclean
diff --git a/tools/blktap2/include/Makefile b/tools/blktap2/include/Makefile
index f85351e..c238486 100644
--- a/tools/blktap2/include/Makefile
+++ b/tools/blktap2/include/Makefile
@@ -12,3 +12,6 @@ install:
 .PHONY: clean
 clean:
 	@:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/blktap2/lvm/Makefile b/tools/blktap2/lvm/Makefile
index cf8a53b..7d5f8ea 100644
--- a/tools/blktap2/lvm/Makefile
+++ b/tools/blktap2/lvm/Makefile
@@ -29,6 +29,8 @@ lvm-util: lvm-util.o
 clean:
 	rm -rf *.o *.opic *~ $(DEPS) $(IBIN)
 
-.PHONY: all build clean install lvm-util
+distclean: clean
+
+.PHONY: all build clean distclean install lvm-util
 
 -include $(DEPS)
diff --git a/tools/blktap2/vhd/Makefile b/tools/blktap2/vhd/Makefile
index fef0d36..9e21cce 100644
--- a/tools/blktap2/vhd/Makefile
+++ b/tools/blktap2/vhd/Makefile
@@ -44,6 +44,8 @@ install: all
 clean: subdirs-clean
 	rm -rf *.o *~ $(DEPS) $(IBIN)
 
-.PHONY: all build clean install vhd-util vhd-update
+distclean: clean
+
+.PHONY: all build clean distclean install vhd-util vhd-update
 
 -include $(DEPS)
diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap2/vhd/lib/Makefile
index 99e3cdb..3904e97 100644
--- a/tools/blktap2/vhd/lib/Makefile
+++ b/tools/blktap2/vhd/lib/Makefile
@@ -75,6 +75,8 @@ install: all
 clean:
 	rm -rf *.a *.so* *.o *.opic *~ $(DEPS) $(LIBVHD)
 
-.PHONY: all build clean install libvhd
+distclean: clean
+
+.PHONY: all build clean distclean install libvhd
 
 -include $(DEPS)
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 6e55618..239ec60 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -22,6 +22,9 @@ clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS)
 	$(RM) client/*.o daemon/*.o
 
+.PHONY: distclean
+distclean: clean
+
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
diff --git a/tools/console/testsuite/Makefile b/tools/console/testsuite/Makefile
index d9e4380..85501fd 100644
--- a/tools/console/testsuite/Makefile
+++ b/tools/console/testsuite/Makefile
@@ -11,4 +11,7 @@ console-domU: console-domU.o
 procpipe: procpipe.o
 
 .PHONY: clean
-clean:; $(RM) *.o console-domU console-dom0 procpipe
+clean: $(RM) *.o console-domU console-dom0 procpipe
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/debugger/gdbsx/Makefile b/tools/debugger/gdbsx/Makefile
index 7938dd8..31eb900 100644
--- a/tools/debugger/gdbsx/Makefile
+++ b/tools/debugger/gdbsx/Makefile
@@ -12,6 +12,10 @@ clean:
 	rm -f xg_all.a gx_all.a gdbsx
 	set -e; for d in xg gx; do $(MAKE) -C $$d clean; done
 
+.PHONY: distclean
+distclean: clean
+	set -e; for d in xg gx; do $(MAKE) -c $$d distclean; done
+
 .PHONY: install
 install: all
 	[ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
diff --git a/tools/debugger/gdbsx/gx/Makefile b/tools/debugger/gdbsx/gx/Makefile
index 9a0ff07..3b8467f 100644
--- a/tools/debugger/gdbsx/gx/Makefile
+++ b/tools/debugger/gdbsx/gx/Makefile
@@ -11,6 +11,8 @@ all: gx_all.a
 clean:
 	rm -rf gx_all.a *.o .*.d
 
+.PHONY: distclean
+distclean: clean
 
 #%.o: %.c $(GX_HDRS) Makefile
 #	$(CC) -c $(CFLAGS) -o $@ $<
diff --git a/tools/debugger/gdbsx/xg/Makefile b/tools/debugger/gdbsx/xg/Makefile
index 7638633..78b4021 100644
--- a/tools/debugger/gdbsx/xg/Makefile
+++ b/tools/debugger/gdbsx/xg/Makefile
@@ -33,3 +33,5 @@ xen-headers:
 clean:
 	rm -rf xen xg_all.a $(XG_OBJS)  .*.d
 
+.PHONY: distclean
+distclean: clean
diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 34b781f..8eafc82 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -16,6 +16,9 @@ kdd: $(OBJS)
 clean:
 	rm -f $(OBJS) $(DEPS) kdd
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install: all
 	[ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 473580e..87dd760 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -43,3 +43,6 @@ install-configs: $(XEN_CONFIGS)
 
 .PHONY: clean
 clean:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 46a79c5..b759e81 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -139,4 +139,7 @@ clean: subdirs-clean
 	rm -f roms.inc roms.inc.new acpi.h
 	rm -f hvmloader hvmloader.tmp *.o $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile
index 2c50851..8d91881 100644
--- a/tools/firmware/hvmloader/acpi/Makefile
+++ b/tools/firmware/hvmloader/acpi/Makefile
@@ -66,6 +66,8 @@ clean:
 	rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS)
 	rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl
 
+distclean: clean
+
 install: all
 
 -include $(DEPS)
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index e5d1cbc..396906c 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -15,6 +15,9 @@ all: subdirs-all
 clean: subdirs-clean
 	rm -rf *.o $(TARGET) $(DEPS)
 
+.PHONY: distclean
+distclean: subdirs-distclean
+
 $(TARGET): 32bitbios_all.o
 	sh mkhex highbios_array 32bitbios_all.o > $@
 
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index ddb0471..f6f2649 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -12,6 +12,9 @@ all: $(TARGET)
 clean:
 	rm -rf *.o $(TARGET) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 $(TARGET): tcgbios.o tpm_drivers.o
 	$(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
 
diff --git a/tools/firmware/rombios/Makefile b/tools/firmware/rombios/Makefile
index 2f2e409..94e65db 100644
--- a/tools/firmware/rombios/Makefile
+++ b/tools/firmware/rombios/Makefile
@@ -15,6 +15,9 @@ clean: subdirs-clean
 	rm -f  BIOS-bochs-*
 	rm -f  $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 BIOS-bochs-latest: rombios.c biossums 32bitgateway.c tcgbios.c
 	gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_.c
 	bcc -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
diff --git a/tools/firmware/vgabios/Makefile b/tools/firmware/vgabios/Makefile
index 26bb871..51d9e6e 100644
--- a/tools/firmware/vgabios/Makefile
+++ b/tools/firmware/vgabios/Makefile
@@ -25,6 +25,9 @@ clean:
           temp.awk.* vgabios*.orig _vgabios_* _vgabios-debug_* core vgabios*.bin vgabios*.txt $(RELEASE).bin *.bak
 	rm -f VGABIOS-lgpl-latest*.bin
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: release
 release: 
 	VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios
diff --git a/tools/flask/Makefile b/tools/flask/Makefile
index bc77a06..a31cc16 100644
--- a/tools/flask/Makefile
+++ b/tools/flask/Makefile
@@ -4,6 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y := utils
 SUBDIRS-$(FLASK_POLICY) += policy
 
-.PHONY: all clean install
-all clean install: %: subdirs-%
+.PHONY: all clean install distclean
+all clean install distclean: %: subdirs-%
 
diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
index 5d8cfbf..54a845b 100644
--- a/tools/flask/policy/Makefile
+++ b/tools/flask/policy/Makefile
@@ -115,4 +115,6 @@ policy.conf: $(POLICY_SECTIONS)
 clean:
 	$(RM) tmp policy.conf $(POLICY_FILENAME)
 
-.PHONY: all install clean
+distclean: clean
+
+.PHONY: all install clean distclean
diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile
index c87f15c..5dfd271 100644
--- a/tools/flask/utils/Makefile
+++ b/tools/flask/utils/Makefile
@@ -39,6 +39,9 @@ clean:
 	rm -f $(CLIENTS)
 	$(RM) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: print-dir
 print-dir:
 	@echo -n tools/flask/utils: 
diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 6aba64a..8dfc90a 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -40,3 +40,6 @@ install-rcd:
 
 .PHONY: clean
 clean:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index b8490f9..d94a9cb 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -81,3 +81,6 @@ install-udev:
 
 .PHONY: clean
 clean: subdirs-clean
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 51c10fe..83e3b32 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -28,6 +28,9 @@ all:	$(ALL_XEN_SYSTEMD)
 clean:
 	rm -f $(XEN_SYSTEMD_MODULES)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
 	[ -d $(DESTDIR)$(XEN_SYSTEMD_DIR) ] || \
diff --git a/tools/hotplug/Makefile b/tools/hotplug/Makefile
index 14ae9a8..c1a82c1 100644
--- a/tools/hotplug/Makefile
+++ b/tools/hotplug/Makefile
@@ -6,5 +6,5 @@ SUBDIRS-$(CONFIG_NetBSD) += NetBSD
 SUBDIRS-$(CONFIG_Linux) += Linux
 SUBDIRS-$(CONFIG_FreeBSD) += FreeBSD
 
-.PHONY: all clean install
-all clean install: %: subdirs-%
+.PHONY: all clean install distclean
+all clean install distclean: %: subdirs-%
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index 0a370b8..4e609e3 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -42,3 +42,6 @@ install-rcd:
 
 .PHONY: clean
 clean:
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 5623abb..b53b55c 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -37,3 +37,6 @@ install-scripts: build
 .PHONY: clean
 clean:
 	rm -f $(HOTPLUGPATH)
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/include/Makefile b/tools/include/Makefile
index f7a6256..601f79c 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -50,3 +50,6 @@ clean:
 	rm -rf xen
 	$(MAKE) -C xen-foreign clean
 
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index 06b844c..ef8fc12 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -6,7 +6,7 @@ ROOT = $(XEN_ROOT)/xen/include/public
 architectures := arm32 arm64 x86_32 x86_64
 headers := $(patsubst %, %.h, $(architectures))
 
-.PHONY: all clean check-headers
+.PHONY: all clean distclean check-headers
 all: $(headers) check-headers
 
 clean:
@@ -14,6 +14,8 @@ clean:
 	rm -f checker checker.c
 	rm -f *.pyc *.o *~
 
+distclean: clean
+
 checker: checker.c $(headers)
 	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index bd2ca6c..7587d4c 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -170,6 +170,9 @@ clean:
             $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
             $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: rpm
 rpm: build
 	rm -rf staging
diff --git a/tools/memshr/Makefile b/tools/memshr/Makefile
index 2c34f96..ce86f20 100644
--- a/tools/memshr/Makefile
+++ b/tools/memshr/Makefile
@@ -39,6 +39,9 @@ install: all
 clean:
 	rm -rf *.a *.o *~ $(DEPS)
 
-.PHONY: all build clean install
+.PHONY: distclean
+distclean: clean
+
+.PHONY: all build clean install distclean
 
 -include $(DEPS)
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index a255c22..ccd36af 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -62,6 +62,9 @@ install: build
 clean:
 	$(RM) *.o $(TARGETS_BUILD) *~ $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xen-hvmctx: xen-hvmctx.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 5710a5f..cfa931a 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -20,3 +20,6 @@ install: subdirs-install
 
 .PHONY: clean
 clean: subdirs-clean
+
+.PHONY: distclean
+distclean: subdirs-distclean
diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 0745e83..1796060 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -47,6 +47,8 @@ ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS))
 clean: $(CLEAN_HOOKS)
 	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META
 
+distclean: clean
+
 quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1)
 
 mk-caml-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $1 $2 $3,MLA,$1)
diff --git a/tools/ocaml/libs/Makefile b/tools/ocaml/libs/Makefile
index 3afdc89..f7c3c0e 100644
--- a/tools/ocaml/libs/Makefile
+++ b/tools/ocaml/libs/Makefile
@@ -15,3 +15,6 @@ install: subdirs-install
 
 .PHONY: clean
 clean: subdirs-clean
+
+.PHONY: distclean
+distclean: subdirs-distclean
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 3dff608..6fd194c 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -23,4 +23,7 @@ install: all
 clean:
 	rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 533d3de..af95119 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -28,4 +28,7 @@ clean:
 	rm -rf build/
 	rm -f $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/tests/mce-test/Makefile b/tools/tests/mce-test/Makefile
index 7c80eb3..07a774a 100644
--- a/tools/tests/mce-test/Makefile
+++ b/tools/tests/mce-test/Makefile
@@ -1,7 +1,10 @@
-.PHONY: all clean
+.PHONY: all clean distclean
 
 all: 
 	$(MAKE) -C tools
 
 clean:
 	$(MAKE) -C tools clean
+
+distclean:
+	$(MAKE) -C tools distclean
diff --git a/tools/tests/mce-test/tools/Makefile b/tools/tests/mce-test/tools/Makefile
index aba7177..4a0db49 100644
--- a/tools/tests/mce-test/tools/Makefile
+++ b/tools/tests/mce-test/tools/Makefile
@@ -19,5 +19,8 @@ install: xen-mceinj
 clean:
 	$(RM) *.o xen-mceinj
 
+.PHONY: distclean
+distclean: clean
+
 xen-mceinj: xen-mceinj.o Makefile
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
diff --git a/tools/tests/mem-sharing/Makefile b/tools/tests/mem-sharing/Makefile
index 1354502..d89e283 100644
--- a/tools/tests/mem-sharing/Makefile
+++ b/tools/tests/mem-sharing/Makefile
@@ -20,6 +20,9 @@ build: $(TARGETS)
 clean:
 	$(RM) *.o $(TARGETS) *~ $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 memshrtool: memshrtool.o
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl)
 
diff --git a/tools/tests/regression/Makefile b/tools/tests/regression/Makefile
index 6e91023..70d524a 100644
--- a/tools/tests/regression/Makefile
+++ b/tools/tests/regression/Makefile
@@ -22,8 +22,8 @@ check-python-syntax: runtime-environment
 .PHONY: runtime-environment
 runtime-environment: $(PYTHON_VERSIONS)
 
-.PHONY: dist-clean
-dist-clean:
+.PHONY: distclean
+distclean:
 	rm -fr $(REG_TEST_DIR)/installed $(REG_TEST_DIR)/downloads \
 		$(REG_TEST_DIR)/build
 
diff --git a/tools/tests/vhpet/Makefile b/tools/tests/vhpet/Makefile
index 763409d..cb88dd0 100644
--- a/tools/tests/vhpet/Makefile
+++ b/tools/tests/vhpet/Makefile
@@ -26,6 +26,9 @@ $(TARGET): hpet.c main.c hpet.h emul.h Makefile
 clean:
 	rm -rf $(TARGET) $(TARGET).out *.o *~ core* hpet.h hpet.c
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install:
 
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 73517b7..b52f227 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -34,6 +34,9 @@ $(TARGET): x86_emulate.o test_x86_emulator.o
 clean:
 	rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install:
 
diff --git a/tools/tests/xen-access/Makefile b/tools/tests/xen-access/Makefile
index 65eef99..f0e94fd 100644
--- a/tools/tests/xen-access/Makefile
+++ b/tools/tests/xen-access/Makefile
@@ -21,6 +21,9 @@ build: $(TARGETS)
 clean:
 	$(RM) *.o $(TARGETS) *~ $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xen-access: xen-access.o Makefile
 	$(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest)
 
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 1c5237c..fff519d 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -42,4 +42,7 @@ clean:
 	$(RM) *.o $(PROGRAMS)
 	$(RM) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/xenbackendd/Makefile b/tools/xenbackendd/Makefile
index 31e5c62..b6bc160 100644
--- a/tools/xenbackendd/Makefile
+++ b/tools/xenbackendd/Makefile
@@ -32,6 +32,9 @@ install: build
 clean:
 	$(RM) *.a *.so *.o $(DEPS) xenbackendd
 
+.PHONY: distclean
+distclean: clean
+
 xenbackendd: xenbackendd.o
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index 3fe87ba..c206d94 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -40,6 +40,9 @@ clean:
 	$(RM) -f xenbaked xenbaked.o
 	$(RM) -f xentrace_setmask setmask.o
 
+.PHONY: distclean
+distclean: clean
+
 xenbaked: xenbaked.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index c742e62..2407a30 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -31,7 +31,9 @@ install: all
 clean:
 	rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)
 
-.PHONY: clean install
+distclean: clean
+
+.PHONY: clean install distclean
 
 .PHONY: TAGS
 TAGS:
diff --git a/tools/xenpmd/Makefile b/tools/xenpmd/Makefile
index 2d925df..4605261 100644
--- a/tools/xenpmd/Makefile
+++ b/tools/xenpmd/Makefile
@@ -18,6 +18,9 @@ install: all
 clean:
 	$(RM) -f xenpmd xenpmd.o $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xenpmd: xenpmd.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
 
diff --git a/tools/xenstat/Makefile b/tools/xenstat/Makefile
index 904ccdd..901be4a 100644
--- a/tools/xenstat/Makefile
+++ b/tools/xenstat/Makefile
@@ -11,6 +11,6 @@ SUBDIRS += xentop
 endif
 endif
 
-.PHONY: all install clean
+.PHONY: all install clean distclean
 
-all install clean: %: subdirs-%
+all install clean distclean: %: subdirs-%
diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index 86068cb..07d39b1 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -137,4 +137,7 @@ clean:
 	rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
 	      $(BINDINGS) $(BINDINGSRC) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile
index 076e44c..e2665aa 100644
--- a/tools/xenstat/xentop/Makefile
+++ b/tools/xenstat/xentop/Makefile
@@ -42,4 +42,7 @@ endif
 clean:
 	rm -f xentop xentop.o $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 -include $(DEPS)
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 11b6a06..60c3a08 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -115,6 +115,9 @@ clean:
 	rm -f xenstore $(CLIENTS)
 	$(RM) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: TAGS
 TAGS:
 	etags `find . -name '*.[ch]'`
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index b821952..a64db86 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -34,6 +34,9 @@ install: build
 clean:
 	$(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) $(DEPS)
 
+.PHONY: distclean
+distclean: clean
+
 xentrace: xentrace.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
 
--
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 Tue Feb 03 08:02:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02: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 1YIYRN-00067H-Gy; Tue, 03 Feb 2015 08:02:33 +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 1YIYRM-000673-LO
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:32 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	1C/41-03000-89080D45; Tue, 03 Feb 2015 08:02:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1422950550!8657443!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20414 invoked from network); 3 Feb 2015 08:02:31 -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;
	3 Feb 2015 08:02: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 1YIYRK-0005Ty-8Z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRK-0006VG-4T
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:30 +0000
Date: Tue, 03 Feb 2015 08:02:30 +0000
Message-Id: <E1YIYRK-0006VG-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: generate systemd service files
	only when systemd is available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit accc7f52ba69b3fb096ebc2b4f70a2281e7f148f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 11:47:46 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:35:59 2015 +0000

    tools: generate systemd service files only when systemd is available
    
    Though that's not in any way harmful but it is on the other hand not
    very useful.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- rerun autogen.sh ]
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/configure    |   25 +++++++++++++++++--------
 tools/configure.ac |   26 ++++++++++++++++----------
 2 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/tools/configure b/tools/configure
index f9f560a..ab04e8c 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2281,7 +2281,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-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 libxl/xenlight.pc.in"
+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/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons libxl/xenlight.pc.in libxl/xlutil.pc.in"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -8953,6 +8953,14 @@ else
 fi
 
 
+
+if test "x$systemd" = "xy"; then :
+
+    ac_config_files="$ac_config_files 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"
+
+
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -9651,6 +9659,14 @@ do
     "hotplug/Linux/init.d/xen-watchdog") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xen-watchdog" ;;
     "hotplug/Linux/init.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xencommons" ;;
     "hotplug/Linux/init.d/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xendomains" ;;
+    "hotplug/Linux/vif-setup") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/vif-setup" ;;
+    "hotplug/Linux/xen-backend.rules") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-backend.rules" ;;
+    "hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
+    "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
+    "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
+    "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
+    "libxl/xlutil.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xlutil.pc.in" ;;
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "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" ;;
@@ -9661,13 +9677,6 @@ do
     "hotplug/Linux/systemd/xenstored.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.service" ;;
     "hotplug/Linux/systemd/xenstored.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.socket" ;;
     "hotplug/Linux/systemd/xenstored_ro.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored_ro.socket" ;;
-    "hotplug/Linux/vif-setup") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/vif-setup" ;;
-    "hotplug/Linux/xen-backend.rules") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-backend.rules" ;;
-    "hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
-    "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
-    "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
-    "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/tools/configure.ac b/tools/configure.ac
index 1ecc216..d9cbf1f 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -12,16 +12,6 @@ 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
@@ -387,5 +377,21 @@ AC_SUBST(LIBNL3_CFLAGS)
 fi # ! $rump
 
 AX_AVAILABLE_SYSTEMD()
+
+AS_IF([test "x$systemd" = "xy"], [
+    AC_CONFIG_FILES([
+    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
+    ])
+])
+
 AC_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 Tue Feb 03 08:02:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02: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 1YIYRN-00067H-Gy; Tue, 03 Feb 2015 08:02:33 +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 1YIYRM-000673-LO
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:32 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	1C/41-03000-89080D45; Tue, 03 Feb 2015 08:02:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1422950550!8657443!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20414 invoked from network); 3 Feb 2015 08:02:31 -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;
	3 Feb 2015 08:02: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 1YIYRK-0005Ty-8Z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRK-0006VG-4T
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:30 +0000
Date: Tue, 03 Feb 2015 08:02:30 +0000
Message-Id: <E1YIYRK-0006VG-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: generate systemd service files
	only when systemd is available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit accc7f52ba69b3fb096ebc2b4f70a2281e7f148f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 20 11:47:46 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:35:59 2015 +0000

    tools: generate systemd service files only when systemd is available
    
    Though that's not in any way harmful but it is on the other hand not
    very useful.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- rerun autogen.sh ]
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/configure    |   25 +++++++++++++++++--------
 tools/configure.ac |   26 ++++++++++++++++----------
 2 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/tools/configure b/tools/configure
index f9f560a..ab04e8c 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2281,7 +2281,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-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 libxl/xenlight.pc.in"
+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/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons libxl/xenlight.pc.in libxl/xlutil.pc.in"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -8953,6 +8953,14 @@ else
 fi
 
 
+
+if test "x$systemd" = "xy"; then :
+
+    ac_config_files="$ac_config_files 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"
+
+
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -9651,6 +9659,14 @@ do
     "hotplug/Linux/init.d/xen-watchdog") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xen-watchdog" ;;
     "hotplug/Linux/init.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xencommons" ;;
     "hotplug/Linux/init.d/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xendomains" ;;
+    "hotplug/Linux/vif-setup") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/vif-setup" ;;
+    "hotplug/Linux/xen-backend.rules") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-backend.rules" ;;
+    "hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
+    "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
+    "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
+    "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
+    "libxl/xlutil.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xlutil.pc.in" ;;
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "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" ;;
@@ -9661,13 +9677,6 @@ do
     "hotplug/Linux/systemd/xenstored.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.service" ;;
     "hotplug/Linux/systemd/xenstored.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.socket" ;;
     "hotplug/Linux/systemd/xenstored_ro.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored_ro.socket" ;;
-    "hotplug/Linux/vif-setup") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/vif-setup" ;;
-    "hotplug/Linux/xen-backend.rules") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-backend.rules" ;;
-    "hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
-    "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
-    "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
-    "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/tools/configure.ac b/tools/configure.ac
index 1ecc216..d9cbf1f 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -12,16 +12,6 @@ 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
@@ -387,5 +377,21 @@ AC_SUBST(LIBNL3_CFLAGS)
 fi # ! $rump
 
 AX_AVAILABLE_SYSTEMD()
+
+AS_IF([test "x$systemd" = "xy"], [
+    AC_CONFIG_FILES([
+    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
+    ])
+])
+
 AC_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 Tue Feb 03 08:02:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYRX-00068k-Ja; Tue, 03 Feb 2015 08:02:43 +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 1YIYRW-00068Y-Gf
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:42 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	C6/FA-03165-1A080D45; Tue, 03 Feb 2015 08:02:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1422950560!5498866!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 485 invoked from network); 3 Feb 2015 08:02:41 -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;
	3 Feb 2015 08:02:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRU-0005U4-Eg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRU-0006Wh-DS
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:40 +0000
Date: Tue, 03 Feb 2015 08:02:40 +0000
Message-Id: <E1YIYRU-0006Wh-DS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/Makefile: fix
	qemu-xen-traditional build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee016c2808176814910867350d103f2cc5aec58d
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Jan 25 15:38:59 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:37:50 2015 +0000

    tools/Makefile: fix qemu-xen-traditional build
    
    In d9740237a ("tools: unhook blktap1 from the build and remove all
    references to it"), one spot was left unchanged, which leads to failure
    in building qemu-xen-traditional.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 1ad7a5d..5d7a75f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -158,6 +158,7 @@ qemu-xen-traditional-dir-force-update: qemu-xen-traditional-dir-find
 subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
+		export CONFIG_BLKTAP1=n; \
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup \
 		$(IOEMU_EXTRA_LDFLAGS) \
--
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 Tue Feb 03 08:02:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYRX-00068k-Ja; Tue, 03 Feb 2015 08:02:43 +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 1YIYRW-00068Y-Gf
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:42 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	C6/FA-03165-1A080D45; Tue, 03 Feb 2015 08:02:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1422950560!5498866!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 485 invoked from network); 3 Feb 2015 08:02:41 -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;
	3 Feb 2015 08:02:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRU-0005U4-Eg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRU-0006Wh-DS
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:40 +0000
Date: Tue, 03 Feb 2015 08:02:40 +0000
Message-Id: <E1YIYRU-0006Wh-DS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/Makefile: fix
	qemu-xen-traditional build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee016c2808176814910867350d103f2cc5aec58d
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Jan 25 15:38:59 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:37:50 2015 +0000

    tools/Makefile: fix qemu-xen-traditional build
    
    In d9740237a ("tools: unhook blktap1 from the build and remove all
    references to it"), one spot was left unchanged, which leads to failure
    in building qemu-xen-traditional.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 1ad7a5d..5d7a75f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -158,6 +158,7 @@ qemu-xen-traditional-dir-force-update: qemu-xen-traditional-dir-find
 subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
+		export CONFIG_BLKTAP1=n; \
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup \
 		$(IOEMU_EXTRA_LDFLAGS) \
--
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 Tue Feb 03 08:02:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYRh-0006AT-MF; Tue, 03 Feb 2015 08:02: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 1YIYRg-0006AG-TU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:53 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	17/39-02777-CA080D45; Tue, 03 Feb 2015 08:02:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950570!7006803!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22903 invoked from network); 3 Feb 2015 08:02:51 -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;
	3 Feb 2015 08: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 1YIYRe-0005UA-KK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRe-0006XV-JT
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:50 +0000
Date: Tue, 03 Feb 2015 08:02:50 +0000
Message-Id: <E1YIYRe-0006XV-JT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Spice image compression setting
	support for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd71555985efc423b1a119b6a3177de855763453
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue Jan 20 11:26:30 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:40:57 2015 +0000

    libxl: Spice image compression setting support for upstream qemu
    
    Usage:
    spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]
    
    Specifies what image compression is to be used by spice (if given),
    otherwise the qemu default will be used.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5       |    6 ++++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_dm.c      |    4 ++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 5 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e2f91fc..0c2cbac 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1427,6 +1427,12 @@ for redirection of up to 4 usb devices from spice client to domU's qemu.
 It requires an usb controller and if not defined it will automatically adds
 an usb2 controller. The default is disabled (0).
 
+=item B<spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]>
+
+Specifies what image compression is to be used by spice (if given), otherwise
+the qemu default will be used. Please see documentations of your current qemu
+version for details.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 0a123f1..b8e0b67 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -528,6 +528,17 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
 
 /*
+ * LIBXL_HAVE_SPICE_IMAGECOMPRESSION
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: image_compression. This value defines what Spice image compression
+ * is used.
+ *
+ * If this is not defined, the Spice image compression setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c2b0487..40c8649 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -398,6 +398,10 @@ static char *dm_spice_options(libxl__gc *gc,
     if (!libxl_defbool_val(spice->clipboard_sharing))
         opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt);
 
+    if (spice->image_compression)
+        opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
+                             spice->image_compression);
+
     return opt;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 1214d2e..052ded9 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -241,6 +241,7 @@ libxl_spice_info = Struct("spice_info", [
     ("vdagent",     libxl_defbool),
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
+    ("image_compression", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 0b02a6c..00aa69d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1948,6 +1948,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.clipboard_sharing, 0);
         if (!xlu_cfg_get_long (config, "spiceusbredirection", &l, 0))
             b_info->u.hvm.spice.usbredirection = l;
+        xlu_cfg_replace_string (config, "spice_image_compression",
+                                &b_info->u.hvm.spice.image_compression, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 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 Tue Feb 03 08:02:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYRh-0006AT-MF; Tue, 03 Feb 2015 08:02: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 1YIYRg-0006AG-TU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:53 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	17/39-02777-CA080D45; Tue, 03 Feb 2015 08:02:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950570!7006803!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22903 invoked from network); 3 Feb 2015 08:02:51 -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;
	3 Feb 2015 08: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 1YIYRe-0005UA-KK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRe-0006XV-JT
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:02:50 +0000
Date: Tue, 03 Feb 2015 08:02:50 +0000
Message-Id: <E1YIYRe-0006XV-JT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Spice image compression setting
	support for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd71555985efc423b1a119b6a3177de855763453
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue Jan 20 11:26:30 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:40:57 2015 +0000

    libxl: Spice image compression setting support for upstream qemu
    
    Usage:
    spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]
    
    Specifies what image compression is to be used by spice (if given),
    otherwise the qemu default will be used.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5       |    6 ++++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_dm.c      |    4 ++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 5 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e2f91fc..0c2cbac 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1427,6 +1427,12 @@ for redirection of up to 4 usb devices from spice client to domU's qemu.
 It requires an usb controller and if not defined it will automatically adds
 an usb2 controller. The default is disabled (0).
 
+=item B<spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]>
+
+Specifies what image compression is to be used by spice (if given), otherwise
+the qemu default will be used. Please see documentations of your current qemu
+version for details.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 0a123f1..b8e0b67 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -528,6 +528,17 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
 
 /*
+ * LIBXL_HAVE_SPICE_IMAGECOMPRESSION
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: image_compression. This value defines what Spice image compression
+ * is used.
+ *
+ * If this is not defined, the Spice image compression setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c2b0487..40c8649 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -398,6 +398,10 @@ static char *dm_spice_options(libxl__gc *gc,
     if (!libxl_defbool_val(spice->clipboard_sharing))
         opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt);
 
+    if (spice->image_compression)
+        opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
+                             spice->image_compression);
+
     return opt;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 1214d2e..052ded9 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -241,6 +241,7 @@ libxl_spice_info = Struct("spice_info", [
     ("vdagent",     libxl_defbool),
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
+    ("image_compression", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 0b02a6c..00aa69d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1948,6 +1948,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.clipboard_sharing, 0);
         if (!xlu_cfg_get_long (config, "spiceusbredirection", &l, 0))
             b_info->u.hvm.spice.usbredirection = l;
+        xlu_cfg_replace_string (config, "spice_image_compression",
+                                &b_info->u.hvm.spice.image_compression, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 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 Tue Feb 03 08:03:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYRs-0006CC-P0; Tue, 03 Feb 2015 08:03:04 +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 1YIYRr-0006Br-8K
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:03 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	D9/32-02898-6B080D45; Tue, 03 Feb 2015 08:03:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1422950581!11524148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1888 invoked from network); 3 Feb 2015 08:03:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:03:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRo-0005UJ-Q9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRo-0006Xt-PG
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:00 +0000
Date: Tue, 03 Feb 2015 08:03:00 +0000
Message-Id: <E1YIYRo-0006Xt-PG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Spice streaming video setting
	support for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 296c7f3284efe655d95a8ae045a5dc1a20d6fff0
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue Jan 20 11:33:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:41:31 2015 +0000

    libxl: Spice streaming video setting support for upstream qemu
    
    Usage:
    spice_streaming_video=[filter|all|off]
    
    Specifies what streaming video setting is to be used by spice (if
    given),
    otherwise the qemu default will be used.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5       |    5 +++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_dm.c      |    4 ++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 5 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 0c2cbac..408653f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1433,6 +1433,11 @@ Specifies what image compression is to be used by spice (if given), otherwise
 the qemu default will be used. Please see documentations of your current qemu
 version for details.
 
+=item B<spice_streaming_video=[filter|all|off]>
+
+Specifies what streaming video setting is to be used by spice (if given),
+otherwise the qemu default will be used.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index b8e0b67..c219f59 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -539,6 +539,17 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
 
 /*
+ * LIBXL_HAVE_SPICE_STREAMINGVIDEO
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: streaming_video. This value defines what Spice streaming video setting
+ * is used.
+ *
+ * If this is not defined, the Spice streaming video setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 40c8649..d8d6f0c 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -402,6 +402,10 @@ static char *dm_spice_options(libxl__gc *gc,
         opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
                              spice->image_compression);
 
+    if (spice->streaming_video)
+        opt = libxl__sprintf(gc, "%s,streaming-video=%s", opt,
+                             spice->streaming_video);
+
     return opt;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 052ded9..02be466 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -242,6 +242,7 @@ libxl_spice_info = Struct("spice_info", [
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
     ("image_compression", string),
+    ("streaming_video", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 00aa69d..b7eac29 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1950,6 +1950,8 @@ skip_vfb:
             b_info->u.hvm.spice.usbredirection = l;
         xlu_cfg_replace_string (config, "spice_image_compression",
                                 &b_info->u.hvm.spice.image_compression, 0);
+        xlu_cfg_replace_string (config, "spice_streaming_video",
+                                &b_info->u.hvm.spice.streaming_video, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 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 Tue Feb 03 08:03:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYRs-0006CC-P0; Tue, 03 Feb 2015 08:03:04 +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 1YIYRr-0006Br-8K
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:03 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	D9/32-02898-6B080D45; Tue, 03 Feb 2015 08:03:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1422950581!11524148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1888 invoked from network); 3 Feb 2015 08:03:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:03:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRo-0005UJ-Q9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRo-0006Xt-PG
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:00 +0000
Date: Tue, 03 Feb 2015 08:03:00 +0000
Message-Id: <E1YIYRo-0006Xt-PG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Spice streaming video setting
	support for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 296c7f3284efe655d95a8ae045a5dc1a20d6fff0
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue Jan 20 11:33:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:41:31 2015 +0000

    libxl: Spice streaming video setting support for upstream qemu
    
    Usage:
    spice_streaming_video=[filter|all|off]
    
    Specifies what streaming video setting is to be used by spice (if
    given),
    otherwise the qemu default will be used.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5       |    5 +++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_dm.c      |    4 ++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 5 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 0c2cbac..408653f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1433,6 +1433,11 @@ Specifies what image compression is to be used by spice (if given), otherwise
 the qemu default will be used. Please see documentations of your current qemu
 version for details.
 
+=item B<spice_streaming_video=[filter|all|off]>
+
+Specifies what streaming video setting is to be used by spice (if given),
+otherwise the qemu default will be used.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index b8e0b67..c219f59 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -539,6 +539,17 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
 
 /*
+ * LIBXL_HAVE_SPICE_STREAMINGVIDEO
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: streaming_video. This value defines what Spice streaming video setting
+ * is used.
+ *
+ * If this is not defined, the Spice streaming video setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 40c8649..d8d6f0c 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -402,6 +402,10 @@ static char *dm_spice_options(libxl__gc *gc,
         opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
                              spice->image_compression);
 
+    if (spice->streaming_video)
+        opt = libxl__sprintf(gc, "%s,streaming-video=%s", opt,
+                             spice->streaming_video);
+
     return opt;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 052ded9..02be466 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -242,6 +242,7 @@ libxl_spice_info = Struct("spice_info", [
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
     ("image_compression", string),
+    ("streaming_video", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 00aa69d..b7eac29 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1950,6 +1950,8 @@ skip_vfb:
             b_info->u.hvm.spice.usbredirection = l;
         xlu_cfg_replace_string (config, "spice_image_compression",
                                 &b_info->u.hvm.spice.image_compression, 0);
+        xlu_cfg_replace_string (config, "spice_streaming_video",
+                                &b_info->u.hvm.spice.streaming_video, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 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 Tue Feb 03 08:03:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYS2-0006Dt-Rn; Tue, 03 Feb 2015 08:03: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 1YIYS1-0006Db-6m
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:13 +0000
Content-Length: 3159
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	4D/78-02804-0C080D45; Tue, 03 Feb 2015 08:03:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950591!10835395!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14575 invoked from network); 3 Feb 2015 08:03:11 -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;
	3 Feb 2015 08: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 1YIYRy-0005Ur-W5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRy-0006YQ-UV
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:10 +0000
Date: Tue, 03 Feb 2015 08:03:10 +0000
Message-Id: <E1YIYRy-0006YQ-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Prevent qemu closing QMP socket
	on shutdown before libxl is done with it.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4104158232219255782=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4104158232219255782==
Content-Length: 2765
Content-Transfer-Encoding: quoted-printable

commit 9ba80a722b193c912432d544338f8daf9a846cd7
Author:     Sander Eikelenboom <linux@eikelenboom.it>
AuthorDate: Thu Jan 22 18:21:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:45:29 2015 +0000

    libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
    
    At present on shutdown when using pci-passthrough with qemu-xen, qemu
    closes the QMP socket before libxl is done with it causing these
    errors to be logged by libxl:
    
        Waiting for domain test (domid 1) to die [pid 11568]
        Domain 1 has shut down, reason code 0 0x0
        Action for shutdown reason code 0 is destroy
        Domain 1 needs to be cleaned up: destroying the domain
        libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
        libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
        libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
        libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
        Done. Exiting now
    
    Prevent this by using the qemu '-no-shutdown' parameter which is
    described as doing:
    
        "Don=E2=80=99t exit QEMU on guest shutdown, but instead only stop the emulation.
         This allows for instance switching to monitor to commit changes to the disk image."
    
    So Qemu will stop emulating, but keeps the QMP socket open and waits
    for libxl to kill the qemu process when it is done, preventing the
    race and resulting in this to be logged by libxl:
    
        Waiting for domain test (domid 1) to die [pid 10859]
        Domain 1 has shut down, reason code 0 0x0
        Action for shutdown reason code 0 is destroy
        Domain 1 needs to be cleaned up: destroying the domain
        Done. Exiting now
    
    Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d8d6f0c..73de5c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -443,6 +443,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                     "path=3D%s/qmp-libxl-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
+    flexarray_append(dm_args, "-no-shutdown");
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=3Dlibxl-cmd,mode=3Dcontrol");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4104158232219255782==
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
--===============4104158232219255782==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:03:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYS2-0006Dt-Rn; Tue, 03 Feb 2015 08:03: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 1YIYS1-0006Db-6m
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:13 +0000
Content-Length: 3159
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	4D/78-02804-0C080D45; Tue, 03 Feb 2015 08:03:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950591!10835395!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14575 invoked from network); 3 Feb 2015 08:03:11 -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;
	3 Feb 2015 08: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 1YIYRy-0005Ur-W5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYRy-0006YQ-UV
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:10 +0000
Date: Tue, 03 Feb 2015 08:03:10 +0000
Message-Id: <E1YIYRy-0006YQ-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Prevent qemu closing QMP socket
	on shutdown before libxl is done with it.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4104158232219255782=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4104158232219255782==
Content-Length: 2765
Content-Transfer-Encoding: quoted-printable

commit 9ba80a722b193c912432d544338f8daf9a846cd7
Author:     Sander Eikelenboom <linux@eikelenboom.it>
AuthorDate: Thu Jan 22 18:21:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:45:29 2015 +0000

    libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
    
    At present on shutdown when using pci-passthrough with qemu-xen, qemu
    closes the QMP socket before libxl is done with it causing these
    errors to be logged by libxl:
    
        Waiting for domain test (domid 1) to die [pid 11568]
        Domain 1 has shut down, reason code 0 0x0
        Action for shutdown reason code 0 is destroy
        Domain 1 needs to be cleaned up: destroying the domain
        libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
        libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
        libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
        libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
        Done. Exiting now
    
    Prevent this by using the qemu '-no-shutdown' parameter which is
    described as doing:
    
        "Don=E2=80=99t exit QEMU on guest shutdown, but instead only stop the emulation.
         This allows for instance switching to monitor to commit changes to the disk image."
    
    So Qemu will stop emulating, but keeps the QMP socket open and waits
    for libxl to kill the qemu process when it is done, preventing the
    race and resulting in this to be logged by libxl:
    
        Waiting for domain test (domid 1) to die [pid 10859]
        Domain 1 has shut down, reason code 0 0x0
        Action for shutdown reason code 0 is destroy
        Domain 1 needs to be cleaned up: destroying the domain
        Done. Exiting now
    
    Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d8d6f0c..73de5c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -443,6 +443,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                     "path=3D%s/qmp-libxl-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
+    flexarray_append(dm_args, "-no-shutdown");
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=3Dlibxl-cmd,mode=3Dcontrol");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4104158232219255782==
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
--===============4104158232219255782==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:03:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYSC-0006FQ-UW; Tue, 03 Feb 2015 08:03:24 +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 1YIYSB-0006F4-Hp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:23 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	71/E2-02898-AC080D45; Tue, 03 Feb 2015 08:03:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1422950601!11587103!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2860 invoked from network); 3 Feb 2015 08:03:22 -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;
	3 Feb 2015 08: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 1YIYS9-0005V1-5C
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYS9-0006Yn-4I
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:21 +0000
Date: Tue, 03 Feb 2015 08:03:21 +0000
Message-Id: <E1YIYS9-0006Yn-4I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: enable sync console in
	machine_reboot.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d61819c0b313ff7c8c0eedbe02d9d0197a7f57a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jan 15 11:22:27 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:47:02 2015 +0000

    xen: arm: enable sync console in machine_reboot.
    
    Otherwise the last thing printed is "(XE" or something.
    
    In line with x86 also disable the watchdog and spin debugging.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/shutdown.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index 4988b03..e53ec97 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -38,6 +38,10 @@ void machine_restart(unsigned int delay_millisecs)
 {
     int timeout = 10;
 
+    watchdog_disable();
+    console_start_sync();
+    spin_debug_disable();
+
     local_irq_enable();
     smp_call_function(halt_this_cpu, NULL, 0);
     local_irq_disable();
--
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 Tue Feb 03 08:03:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08: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 1YIYSC-0006FQ-UW; Tue, 03 Feb 2015 08:03:24 +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 1YIYSB-0006F4-Hp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:23 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	71/E2-02898-AC080D45; Tue, 03 Feb 2015 08:03:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1422950601!11587103!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2860 invoked from network); 3 Feb 2015 08:03:22 -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;
	3 Feb 2015 08: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 1YIYS9-0005V1-5C
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYS9-0006Yn-4I
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:21 +0000
Date: Tue, 03 Feb 2015 08:03:21 +0000
Message-Id: <E1YIYS9-0006Yn-4I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: enable sync console in
	machine_reboot.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d61819c0b313ff7c8c0eedbe02d9d0197a7f57a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jan 15 11:22:27 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 27 16:47:02 2015 +0000

    xen: arm: enable sync console in machine_reboot.
    
    Otherwise the last thing printed is "(XE" or something.
    
    In line with x86 also disable the watchdog and spin debugging.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/shutdown.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index 4988b03..e53ec97 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -38,6 +38,10 @@ void machine_restart(unsigned int delay_millisecs)
 {
     int timeout = 10;
 
+    watchdog_disable();
+    console_start_sync();
+    spin_debug_disable();
+
     local_irq_enable();
     smp_call_function(halt_this_cpu, NULL, 0);
     local_irq_disable();
--
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 Tue Feb 03 08:03:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYSN-0006HN-2u; Tue, 03 Feb 2015 08:03:35 +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 1YIYSL-0006H1-Lx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:33 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	42/48-02999-4D080D45; Tue, 03 Feb 2015 08:03:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1422950611!11607952!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2019 invoked from network); 3 Feb 2015 08:03:32 -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;
	3 Feb 2015 08:03:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSJ-0005V9-AP
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSJ-0006ZH-9A
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:31 +0000
Date: Tue, 03 Feb 2015 08:03:31 +0000
Message-Id: <E1YIYSJ-0006ZH-9A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Correct static pattern
	rule for pkgconfig 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 027af8cdb348a97478a177d13871cacaa9b03366
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 20:34:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 09:59:46 2015 +0000

    tools/libxl: Correct static pattern rule for pkgconfig files
    
    Attempting to build libxl causes Make to emit the following warnings
    
    andrewcoop@andrewcoop:xen.git$ make -C tools/libxl all
    ...
    Makefile:253: target `xenlight.pc' doesn't match the target pattern
    Makefile:253: target `xlutil.pc' doesn't match the target pattern
    ...
    
    because the static pattern rule is malformed.  'Makefile' as the only
    prereq-pattern does not contain a pattern.
    
    The rule ends up working because of the use of $@.in where $< should have been
    used, but lacked any dependency between a $FOO.pc and its .in source file.
    
    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/libxl/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 5df4970..7329521 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -250,8 +250,8 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-$(PKG_CONFIG): %.in : Makefile
-	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $@.in > $@.new
+$(PKG_CONFIG): % : %.in Makefile
+	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
 	@mv -f $@.new $@
 
 .PHONY: 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 Tue Feb 03 08:03:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYSN-0006HN-2u; Tue, 03 Feb 2015 08:03:35 +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 1YIYSL-0006H1-Lx
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:33 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	42/48-02999-4D080D45; Tue, 03 Feb 2015 08:03:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1422950611!11607952!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2019 invoked from network); 3 Feb 2015 08:03:32 -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;
	3 Feb 2015 08:03:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSJ-0005V9-AP
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSJ-0006ZH-9A
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:31 +0000
Date: Tue, 03 Feb 2015 08:03:31 +0000
Message-Id: <E1YIYSJ-0006ZH-9A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Correct static pattern
	rule for pkgconfig 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 027af8cdb348a97478a177d13871cacaa9b03366
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 20:34:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 09:59:46 2015 +0000

    tools/libxl: Correct static pattern rule for pkgconfig files
    
    Attempting to build libxl causes Make to emit the following warnings
    
    andrewcoop@andrewcoop:xen.git$ make -C tools/libxl all
    ...
    Makefile:253: target `xenlight.pc' doesn't match the target pattern
    Makefile:253: target `xlutil.pc' doesn't match the target pattern
    ...
    
    because the static pattern rule is malformed.  'Makefile' as the only
    prereq-pattern does not contain a pattern.
    
    The rule ends up working because of the use of $@.in where $< should have been
    used, but lacked any dependency between a $FOO.pc and its .in source file.
    
    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/libxl/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 5df4970..7329521 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -250,8 +250,8 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-$(PKG_CONFIG): %.in : Makefile
-	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $@.in > $@.new
+$(PKG_CONFIG): % : %.in Makefile
+	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
 	@mv -f $@.new $@
 
 .PHONY: 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 Tue Feb 03 08:03:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYSY-0006J4-5i; Tue, 03 Feb 2015 08:03:46 +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 1YIYSW-0006Iq-Qs
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:45 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	56/88-02754-0E080D45; Tue, 03 Feb 2015 08:03:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1422950621!12034376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.2 required=7.0 tests=UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28014 invoked from network); 3 Feb 2015 08:03:42 -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;
	3 Feb 2015 08:03: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 1YIYST-0005VF-F7
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYST-0006aW-E5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:41 +0000
Date: Tue, 03 Feb 2015 08:03:41 +0000
Message-Id: <E1YIYST-0006aW-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add TPM 2.0 data structures
	and commands definition
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d5123397bdea881235128b689f5ce45b2a9a9e4b
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:40 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Add TPM 2.0 data structures and commands definition
    
    Add TPM 2.0 data structures on Trusted Platform Module Library Part 2:
    Structures and Trust Platform Module Library Part 3: Commands.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/tpm2_types.h |  978 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 978 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/tpm2_types.h b/stubdom/vtpmmgr/tpm2_types.h
new file mode 100644
index 0000000..214335c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2_types.h
@@ -0,0 +1,978 @@
+#ifndef __TPM2_TYPES_H__
+#define __TPM2_TYPES_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// "implementation.h"
+// Table 212 -- Logic Values
+#define    YES      1
+#define    NO       0
+#ifndef    TRUE
+#define    TRUE     1
+#endif
+#ifndef    FALSE
+#define    FALSE    0
+#endif
+#ifndef    true
+#define    true     1
+#endif
+#ifndef    false
+#define    false    0
+#endif
+#define    SET      1
+#define    CLEAR    0
+
+
+// Table 214 -- Implemented Algorithms
+#define    ALG_RSA               YES    // 1
+#define    ALG_DES               NO     // 0
+#define    ALG__3DES             NO     // 0
+#define    ALG_SHA1              YES    // 1
+#define    ALG_HMAC              YES    // 1
+#define    ALG_AES               YES    // 1
+#define    ALG_MGF1              YES    // 1
+#define    ALG_XOR               YES    // 1
+#define    ALG_KEYEDHASH         YES    // 1
+#define    ALG_SHA256            YES    // 1
+#define    ALG_SHA384            YES    // 0
+#define    ALG_SHA512            YES    // 0
+#define    ALG_WHIRLPOOL512      YES    // 0
+#define    ALG_SM3_256           YES    // 1
+#define    ALG_SM4               YES    // 1
+#define    ALG_RSASSA            YES    // 1
+#define    ALG_RSAES             YES    // 1
+#define    ALG_RSAPSS            YES    // 1
+#define    ALG_OAEP              YES    // 1
+#define    ALG_ECC               YES    // 1
+#define    ALG_CFB               YES    // 1
+#define    ALG_ECDH              YES    // 1
+#define    ALG_ECDSA             YES    // 1
+#define    ALG_ECDAA             YES    // 1
+#define    ALG_SM2               YES    // 1
+#define    ALG_ECSCHNORR         YES    // 1
+#define    ALG_SYMCIPHER         YES    // 1
+#define    ALG_KDF1_SP800_56a    YES    // 1
+#define    ALG_KDF2              NO     // 0
+#define    ALG_KDF1_SP800_108    YES    // 1
+#define    ALG_CTR               YES    // 1
+#define    ALG_OFB               YES    // 1
+#define    ALG_CBC               YES    // 1
+
+#define HASH_COUNT (ALG_SHA1+ALG_SHA256+ALG_SHA384+ALG_SHA512+ALG_WHIRLPOOL512+ALG_SM3_256)
+
+// Table 216 -- RSA Algorithm Constants
+#define    RSA_KEY_SIZES_BITS    2048    // {1024,2048}
+#define    MAX_RSA_KEY_BITS      2048
+#define    MAX_RSA_KEY_BYTES     ((MAX_RSA_KEY_BITS + 7) / 8)    // 256
+
+// Table 218 -- AES Algorithm Constants
+#define    AES_KEY_SIZES_BITS          128
+#define    MAX_AES_KEY_BITS            128
+#define    MAX_AES_BLOCK_SIZE_BYTES    16
+#define    MAX_AES_KEY_BYTES           ((MAX_AES_KEY_BITS + 7) / 8)    // 16
+
+
+// Table 220 -- Symmetric Algorithm Constants
+#define    MAX_SYM_KEY_BITS      MAX_AES_KEY_BITS    // 128
+#define    MAX_SYM_KEY_BYTES     MAX_AES_KEY_BYTES    // 16
+#define    MAX_SYM_BLOCK_SIZE    MAX_AES_BLOCK_SIZE_BYTES    // 16
+
+#define    MAX_SYM_DATA         128
+#define    MAX_ECC_KEY_BITS     256
+#define    MAX_ECC_KEY_BYTES    ((MAX_ECC_KEY_BITS + 7) / 8)
+
+
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint8_t       UINT8;
+typedef uint16_t      UINT16;
+typedef uint32_t      UINT32;
+typedef uint64_t      UINT64;
+
+// TPM2 command code
+
+typedef UINT32 TPM_CC;
+#define    TPM_CC_FIRST                         (TPM_CC)(0x0000011F)
+#define    TPM_CC_PP_FIRST                      (TPM_CC)(0x0000011F)
+#define    TPM_CC_NV_UndefineSpaceSpecial       (TPM_CC)(0x0000011F)
+#define    TPM_CC_EvictControl                  (TPM_CC)(0x00000120)
+#define    TPM_CC_HierarchyControl              (TPM_CC)(0x00000121)
+#define    TPM_CC_NV_UndefineSpace              (TPM_CC)(0x00000122)
+#define    TPM_CC_ChangeEPS                     (TPM_CC)(0x00000124)
+#define    TPM_CC_ChangePPS                     (TPM_CC)(0x00000125)
+#define    TPM_CC_Clear                         (TPM_CC)(0x00000126)
+#define    TPM_CC_ClearControl                  (TPM_CC)(0x00000127)
+#define    TPM_CC_ClockSet                      (TPM_CC)(0x00000128)
+#define    TPM_CC_HierarchyChangeAuth           (TPM_CC)(0x00000129)
+#define    TPM_CC_NV_DefineSpace                (TPM_CC)(0x0000012A)
+#define    TPM_CC_PCR_Allocate                  (TPM_CC)(0x0000012B)
+#define    TPM_CC_PCR_SetAuthPolicy             (TPM_CC)(0x0000012C)
+#define    TPM_CC_PP_Commands                   (TPM_CC)(0x0000012D)
+#define    TPM_CC_SetPrimaryPolicy              (TPM_CC)(0x0000012E)
+#define    TPM_CC_FieldUpgradeStart             (TPM_CC)(0x0000012F)
+#define    TPM_CC_ClockRateAdjust               (TPM_CC)(0x00000130)
+#define    TPM_CC_CreatePrimary                 (TPM_CC)(0x00000131)
+#define    TPM_CC_NV_GlobalWriteLock            (TPM_CC)(0x00000132)
+#define    TPM_CC_PP_LAST                       (TPM_CC)(0x00000132)
+#define    TPM_CC_GetCommandAuditDigest         (TPM_CC)(0x00000133)
+#define    TPM_CC_NV_Increment                  (TPM_CC)(0x00000134)
+#define    TPM_CC_NV_SetBits                    (TPM_CC)(0x00000135)
+#define    TPM_CC_NV_Extend                     (TPM_CC)(0x00000136)
+#define    TPM_CC_NV_Write                      (TPM_CC)(0x00000137)
+#define    TPM_CC_NV_WriteLock                  (TPM_CC)(0x00000138)
+#define    TPM_CC_DictionaryAttackLockReset     (TPM_CC)(0x00000139)
+#define    TPM_CC_DictionaryAttackParameters    (TPM_CC)(0x0000013A)
+#define    TPM_CC_NV_ChangeAuth                 (TPM_CC)(0x0000013B)
+#define    TPM_CC_PCR_Event                     (TPM_CC)(0x0000013C)
+#define    TPM_CC_PCR_Reset                     (TPM_CC)(0x0000013D)
+#define    TPM_CC_SequenceComplete              (TPM_CC)(0x0000013E)
+#define    TPM_CC_SetAlgorithmSet               (TPM_CC)(0x0000013F)
+#define    TPM_CC_SetCommandCodeAuditStatus     (TPM_CC)(0x00000140)
+#define    TPM_CC_FieldUpgradeData              (TPM_CC)(0x00000141)
+#define    TPM_CC_IncrementalSelfTest           (TPM_CC)(0x00000142)
+#define    TPM_CC_SelfTest                      (TPM_CC)(0x00000143)
+#define    TPM_CC_Startup                       (TPM_CC)(0x00000144)
+#define    TPM_CC_Shutdown                      (TPM_CC)(0x00000145)
+#define    TPM_CC_StirRandom                    (TPM_CC)(0x00000146)
+#define    TPM_CC_ActivateCredential            (TPM_CC)(0x00000147)
+#define    TPM_CC_Certify                       (TPM_CC)(0x00000148)
+#define    TPM_CC_PolicyNV                      (TPM_CC)(0x00000149)
+#define    TPM_CC_CertifyCreation               (TPM_CC)(0x0000014A)
+#define    TPM_CC_Duplicate                     (TPM_CC)(0x0000014B)
+#define    TPM_CC_GetTime                       (TPM_CC)(0x0000014C)
+#define    TPM_CC_GetSessionAuditDigest         (TPM_CC)(0x0000014D)
+#define    TPM_CC_NV_Read                       (TPM_CC)(0x0000014E)
+#define    TPM_CC_NV_ReadLock                   (TPM_CC)(0x0000014F)
+#define    TPM_CC_ObjectChangeAuth              (TPM_CC)(0x00000150)
+#define    TPM_CC_PolicySecret                  (TPM_CC)(0x00000151)
+#define    TPM_CC_Rewrap                        (TPM_CC)(0x00000152)
+#define    TPM_CC_Create                        (TPM_CC)(0x00000153)
+#define    TPM_CC_ECDH_ZGen                     (TPM_CC)(0x00000154)
+#define    TPM_CC_HMAC                          (TPM_CC)(0x00000155)
+#define    TPM_CC_Import                        (TPM_CC)(0x00000156)
+#define    TPM_CC_Load                          (TPM_CC)(0x00000157)
+#define    TPM_CC_Quote                         (TPM_CC)(0x00000158)
+#define    TPM_CC_RSA_Decrypt                   (TPM_CC)(0x00000159)
+#define    TPM_CC_HMAC_Start                    (TPM_CC)(0x0000015B)
+#define    TPM_CC_SequenceUpdate                (TPM_CC)(0x0000015C)
+#define    TPM_CC_Sign                          (TPM_CC)(0x0000015D)
+#define    TPM_CC_Unseal                        (TPM_CC)(0x0000015E)
+#define    TPM_CC_PolicySigned                  (TPM_CC)(0x00000160)
+#define    TPM_CC_ContextLoad                   (TPM_CC)(0x00000161)
+#define    TPM_CC_ContextSave                   (TPM_CC)(0x00000162)
+#define    TPM_CC_ECDH_KeyGen                   (TPM_CC)(0x00000163)
+#define    TPM_CC_EncryptDecrypt                (TPM_CC)(0x00000164)
+#define    TPM_CC_FlushContext                  (TPM_CC)(0x00000165)
+#define    TPM_CC_LoadExternal                  (TPM_CC)(0x00000167)
+#define    TPM_CC_MakeCredential                (TPM_CC)(0x00000168)
+#define    TPM_CC_NV_ReadPublic                 (TPM_CC)(0x00000169)
+#define    TPM_CC_PolicyAuthorize               (TPM_CC)(0x0000016A)
+#define    TPM_CC_PolicyAuthValue               (TPM_CC)(0x0000016B)
+#define    TPM_CC_PolicyCommandCode             (TPM_CC)(0x0000016C)
+#define    TPM_CC_PolicyCounterTimer            (TPM_CC)(0x0000016D)
+#define    TPM_CC_PolicyCpHash                  (TPM_CC)(0x0000016E)
+#define    TPM_CC_PolicyLocality                (TPM_CC)(0x0000016F)
+#define    TPM_CC_PolicyNameHash                (TPM_CC)(0x00000170)
+#define    TPM_CC_PolicyOR                      (TPM_CC)(0x00000171)
+#define    TPM_CC_PolicyTicket                  (TPM_CC)(0x00000172)
+#define    TPM_CC_ReadPublic                    (TPM_CC)(0x00000173)
+#define    TPM_CC_RSA_Encrypt                   (TPM_CC)(0x00000174)
+#define    TPM_CC_StartAuthSession              (TPM_CC)(0x00000176)
+#define    TPM_CC_VerifySignature               (TPM_CC)(0x00000177)
+#define    TPM_CC_ECC_Parameters                (TPM_CC)(0x00000178)
+#define    TPM_CC_FirmwareRead                  (TPM_CC)(0x00000179)
+#define    TPM_CC_GetCapability                 (TPM_CC)(0x0000017A)
+#define    TPM_CC_GetRandom                     (TPM_CC)(0x0000017B)
+#define    TPM_CC_GetTestResult                 (TPM_CC)(0x0000017C)
+#define    TPM_CC_Hash                          (TPM_CC)(0x0000017D)
+#define    TPM_CC_PCR_Read                      (TPM_CC)(0x0000017E)
+#define    TPM_CC_PolicyPCR                     (TPM_CC)(0x0000017F)
+#define    TPM_CC_PolicyRestart                 (TPM_CC)(0x00000180)
+#define    TPM_CC_ReadClock                     (TPM_CC)(0x00000181)
+#define    TPM_CC_PCR_Extend                    (TPM_CC)(0x00000182)
+#define    TPM_CC_PCR_SetAuthValue              (TPM_CC)(0x00000183)
+#define    TPM_CC_NV_Certify                    (TPM_CC)(0x00000184)
+#define    TPM_CC_EventSequenceComplete         (TPM_CC)(0x00000185)
+#define    TPM_CC_HashSequenceStart             (TPM_CC)(0x00000186)
+#define    TPM_CC_PolicyPhysicalPresence        (TPM_CC)(0x00000187)
+#define    TPM_CC_PolicyDuplicationSelect       (TPM_CC)(0x00000188)
+#define    TPM_CC_PolicyGetDigest               (TPM_CC)(0x00000189)
+#define    TPM_CC_TestParms                     (TPM_CC)(0x0000018A)
+#define    TPM_CC_Commit                        (TPM_CC)(0x0000018B)
+#define    TPM_CC_PolicyPassword                (TPM_CC)(0x0000018C)
+#define    TPM_CC_SM2_ZGen                      (TPM_CC)(0x0000018D)
+#define    TPM_CC_LAST                          (TPM_CC)(0x0000018D)
+
+
+//TPM_RC
+typedef UINT32 TPM_RC;
+
+// TPM_ST Constants
+typedef UINT16 TPM_ST;
+#define    TPM_ST_NULL                    (TPM_ST)(0X8000)
+#define    TPM_ST_NO_SESSIONS             (TPM_ST)(0x8001)
+#define    TPM_ST_SESSIONS                (TPM_ST)(0x8002)
+
+
+// TPM Handle types
+typedef UINT32 TPM_HANDLE;
+typedef UINT8 TPM_HT;
+
+
+// TPM_RH Constants
+typedef UINT32 TPM_RH;
+
+#define    TPM_RH_FIRST          (TPM_RH)(0x40000000)
+#define    TPM_RH_SRK            (TPM_RH)(0x40000000)
+#define    TPM_RH_OWNER          (TPM_RH)(0x40000001)
+#define    TPM_RS_PW             (TPM_RH)(0x40000009)
+#define    TPM_RH_LOCKOUT        (TPM_RH)(0x4000000A)
+#define    TPM_RH_ENDORSEMENT    (TPM_RH)(0x4000000B)
+#define    TPM_RH_PLATFORM       (TPM_RH)(0x4000000C)
+#define    TPM_RH_LAST           (TPM_RH)(0x4000000C)
+
+// Table 4 -- DocumentationClarity Types <I/O>
+typedef UINT32    TPM_ALGORITHM_ID;
+typedef UINT32    TPM_MODIFIER_INDICATOR;
+typedef UINT32    TPM_SESSION_OFFSET;
+typedef UINT16    TPM_KEY_SIZE;
+typedef UINT16    TPM_KEY_BITS;
+typedef UINT64    TPM_SYSTEM_ADDRESS;
+typedef UINT32    TPM_SPEC;
+
+// Table 29 -- TPMA_ALGORITHM Bits <I/O>
+typedef struct {
+    unsigned int asymmetric:1;
+    unsigned int symmetric:1;
+    unsigned int hash:1;
+    unsigned int object:1;
+    unsigned int reserved5:4;
+    unsigned int signing:1;
+    unsigned int encrypting:1;
+    unsigned int method:1;
+    unsigned int reserved9:21;
+} TPMA_ALGORITHM;
+
+typedef UINT32 TPMA_OBJECT;
+typedef BYTE TPMA_SESSION;
+typedef BYTE TPMA_LOCALITY;
+
+// Table 37 -- TPMI_YES_NO Type <I/O>
+typedef BYTE TPMI_YES_NO;
+
+typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
+
+// Table 38 -- TPMI_DH_OBJECT Type <I/O>
+typedef TPM_HANDLE TPMI_DH_OBJECT;
+
+// Table 39 -- TPMI_DH_PERSISTENT Type <I/O>
+typedef TPM_HANDLE TPMI_DH_PERSISTENT;
+
+// Table 42 -- TPMI_SH_AUTH_SESSION Type <I/O>
+typedef TPM_HANDLE TPMI_SH_AUTH_SESSION;
+
+// Table 40 -- TPMI_DH_ENTITY Type <I>
+typedef TPM_HANDLE TPMI_DH_ENTITY;
+
+// Table 45 -- TPMI_DH_CONTEXT Type <I/O>
+typedef TPM_HANDLE TPMI_DH_CONTEXT;
+
+// Table 46 -- TPMI_RH_HIERARCHY Type <I/O>
+typedef TPM_HANDLE TPMI_RH_HIERARCHY;
+
+// Table 47 -- TPMI_RH_HIERARCHY_AUTH Type <I>
+typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
+
+// Table 48 -- TPMI_RH_PLATFORM Type <I>
+typedef TPM_HANDLE TPMI_RH_PLATFORM;
+
+// Table 49 -- TPMI_RH_OWNER Type <I>
+typedef TPM_HANDLE TPMI_RH_OWNER;
+
+// Table 50 -- TPMI_RH_ENDORSEMENT Type <I>
+typedef TPM_HANDLE TPMI_RH_ENDORSEMENT;
+
+// Table 51 -- TPMI_RH_PROVISION Type <I>
+typedef TPM_HANDLE TPMI_RH_PROVISION;
+
+// Table 52 -- TPMI_RH_CLEAR Type <I>
+typedef TPM_HANDLE TPMI_RH_CLEAR;
+
+// Table 54 -- TPMI_RH_LOCKOUT Type <I>
+typedef TPM_HANDLE TPMI_RH_LOCKOUT;
+
+// Table 7 -- TPM_ALG_ID
+typedef UINT16 TPM_ALG_ID;
+typedef UINT16 TPM_ALG_ID;
+
+#define    TPM2_ALG_ERROR             (TPM_ALG_ID)(0x0000) // a: ; D:
+#define    TPM2_ALG_FIRST             (TPM_ALG_ID)(0x0001) // a: ; D:
+#if ALG_RSA == YES || ALG_ALL == YES
+#define    TPM2_ALG_RSA               (TPM_ALG_ID)(0x0001) // a: A O; D:
+#endif
+#if ALG_DES == YES || ALG_ALL == YES
+#define    TPM2_ALG_DES               (TPM_ALG_ID)(0x0002) // a: S; D:
+#endif
+#define    TPM2_ALG_SHA1              (TPM_ALG_ID)(0x0004) // a: H; D:
+#if ALG_HMAC == YES || ALG_ALL == YES
+#define    TPM2_ALG_HMAC              (TPM_ALG_ID)(0x0005) // a: H X; D:
+#endif
+#if ALG_AES == YES || ALG_ALL == YES
+#define    TPM2_ALG_AES               (TPM_ALG_ID)(0x0006) // a: S; D:
+#endif
+#if ALG_XOR == YES || ALG_ALL == YES
+#define    TPM2_ALG_XOR               (TPM_ALG_ID)(0x000A) // a: H S; D:
+#endif
+#if ALG_MGF1 == YES || ALG_ALL == YES
+#define    TPM2_ALG_MGF1              (TPM_ALG_ID)(0x0007) // a: H M; D:
+#endif
+#if ALG_KEYEDHASH == YES || ALG_ALL == YES
+#define    TPM2_ALG_KEYEDHASH         (TPM_ALG_ID)(0x0008) // a: H E X O; D:
+#endif
+#if ALG_SHA256 == YES || ALG_ALL == YES
+#define    TPM2_ALG_SHA256            (TPM_ALG_ID)(0x000B) // a: H; D:
+#endif
+#define    TPM2_ALG_NULL              (TPM_ALG_ID)(0x0010) // a: ; D:
+#if ALG_OAEP == YES || ALG_ALL == YES
+#define    TPM2_ALG_OAEP              (TPM_ALG_ID)(0x0017) // a: A E; D: RSA
+#endif
+#if ALG_ECC == YES || ALG_ALL == YES
+#define    TPM2_ALG_ECC               (TPM_ALG_ID)(0x0023) // a: A O; D:
+#endif
+#if ALG_SM4 == YES || ALG_ALL == YES
+#define    TPM2_ALG_SM4               (TPM_ALG_ID)(0x0013) // a: S; D:
+#endif
+#if ALG_SYMCIPHER == YES || ALG_ALL == YES
+#define    TPM2_ALG_SYMCIPHER         (TPM_ALG_ID)(0x0025) // a: O; D:
+#endif
+#if ALG_CFB == YES || ALG_ALL == YES
+#define    TPM2_ALG_CFB               (TPM_ALG_ID)(0x0043) // a: S E; D:
+#endif
+#define    TPM2_ALG_LAST              (TPM_ALG_ID)(0x0044)
+
+#define    SHA1_DIGEST_SIZE      20
+#define    SHA1_BLOCK_SIZE       64
+#define    SHA256_DIGEST_SIZE    32
+#define    SHA256_BLOCK_SIZE     64
+
+// Table 57 -- TPMI_ALG_ASYM Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_ASYM;
+
+// Table 56 -- TPMI_ALG_HASH Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_HASH;
+
+// Table 58 -- TPMI_ALG_SYM Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SYM;
+
+// Table 59 -- TPMI_ALG_SYM_OBJECT Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SYM_OBJECT;
+
+// Table 60 -- TPMI_ALG_SYM_MODE Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SYM_MODE;
+
+// Table 61 -- TPMI_ALG_KDF Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_KDF;
+
+// Table 62 -- TPMI_ALG_SIG_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SIG_SCHEME;
+
+// Table 65 -- TPMU_HA Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_SHA1
+    BYTE  sha1[SHA1_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SHA256
+    BYTE  sha256[SHA256_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SM3_256
+    BYTE  sm3_256[SM3_256_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SHA384
+    BYTE  sha384[SHA384_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SHA512
+    BYTE  sha512[SHA512_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_WHIRLPOOL512
+    BYTE  whirlpool[WHIRLPOOL512_DIGEST_SIZE];
+#endif
+
+} TPMU_HA;
+
+// Table 67 -- TPM2B_DIGEST Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[sizeof(TPMU_HA)];
+} TPM2B_DIGEST;
+
+// Table 69 -- TPM2B_NONCE Types <I/O>
+typedef TPM2B_DIGEST    TPM2B_NONCE;
+
+typedef TPM2B_DIGEST    TPM2B_DATA;
+
+// Table 70 -- TPM2B_AUTH Types <I/O>
+typedef TPM2B_DIGEST    TPM2B_AUTH;
+
+// Table 71 -- TPM2B_OPERAND Types <I/O>
+typedef TPM2B_DIGEST    TPM2B_OPERAND;
+
+// Table 66 -- TPMT_HA Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    TPMU_HA          digest;
+} TPMT_HA;
+
+//Table 80 -- TPM2B_NAME Structure
+typedef struct {
+    UINT16 size;
+    BYTE name[sizeof(TPMT_HA)];
+} TPM2B_NAME;
+
+#define    IMPLEMENTATION_PCR   24
+#define    PLATFORM_PCR         24
+#define    PCR_SELECT_MAX       ((IMPLEMENTATION_PCR+7)/8)
+
+//Table 79 -- TPMS_PCR_SELECT Structure <I/O>
+typedef struct {
+    UINT8    sizeofSelect;
+    BYTE     pcrSelect[PCR_SELECT_MAX];
+} TPMS_PCR_SELECT;
+
+// Table 80 -- TPMS_PCR_SELECTION Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hash;
+    UINT8            sizeofSelect;
+    BYTE             pcrSelect[PCR_SELECT_MAX];
+} TPMS_PCR_SELECTION;
+
+// Table 83 -- TPMT_TK_CREATION Structure <I/O>
+typedef struct {
+    TPM_ST               tag;
+    TPMI_RH_HIERARCHY    hierarchy;
+    TPM2B_DIGEST         digest;
+} TPMT_TK_CREATION;
+
+// Table 96 -- Definition of TPML_DIGEST Structure <I/O>
+typedef struct {
+    UINT32               count;
+    TPM2B_DIGEST         digests[8];
+}TPML_DIGEST;
+
+// Table 97 -- TPML_PCR_SELECTION Structure <I/O>
+typedef struct {
+    UINT32                count;
+    TPMS_PCR_SELECTION    pcrSelections[HASH_COUNT];
+} TPML_PCR_SELECTION;
+
+// Table 119 -- TPMI_AES_KEY_BITS Type <I/O>
+typedef TPM_KEY_BITS TPMI_AES_KEY_BITS;
+
+// Table 120 -- TPMI_SM4_KEY_BITS Type <I/O>
+typedef TPM_KEY_BITS TPMI_SM4_KEY_BITS;
+
+// Table 121 -- TPMU_SYM_KEY_BITS Union <I/O>
+typedef union {
+#ifdef TPM2_ALG_AES
+    TPMI_AES_KEY_BITS  aes;
+#endif
+#ifdef TPM2_ALG_SM4
+    TPMI_SM4_KEY_BITS  SM4;
+#endif
+    TPM_KEY_BITS  sym;
+#ifdef TPM2_ALG_XOR
+    TPMI_ALG_HASH  xor;
+#endif
+
+} TPMU_SYM_KEY_BITS;
+
+// Table 122 -- TPMU_SYM_MODE Union <I/O>
+typedef union {
+#ifdef TPM2_ALG_AES
+    TPMI_ALG_SYM_MODE  aes;
+#endif
+#ifdef TPM2_ALG_SM4
+    TPMI_ALG_SYM_MODE  SM4;
+#endif
+    TPMI_ALG_SYM_MODE  sym;
+} TPMU_SYM_MODE ;
+
+// Table 124 -- TPMT_SYM_DEF Structure <I/O>
+typedef struct {
+    TPMI_ALG_SYM         algorithm;
+    TPMU_SYM_KEY_BITS    keyBits;
+    TPMU_SYM_MODE        mode;
+} TPMT_SYM_DEF;
+
+// Table 125 -- TPMT_SYM_DEF_OBJECT Structure <I/O>
+typedef struct {
+    TPMI_ALG_SYM_OBJECT    algorithm;
+    TPMU_SYM_KEY_BITS      keyBits;
+    TPMU_SYM_MODE          mode;
+} TPMT_SYM_DEF_OBJECT;
+
+// Table 126 -- TPM2B_SYM_KEY Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_SYM_KEY_BYTES];
+} TPM2B_SYM_KEY;
+
+// Table 127 -- TPMS_SYMCIPHER_PARMS Structure <I/O>
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    sym;
+} TPMS_SYMCIPHER_PARMS;
+
+// Table 128 -- TPM2B_SENSITIVE_DATA Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_SYM_DATA];
+} TPM2B_SENSITIVE_DATA;
+
+// Table 129 -- TPMS_SENSITIVE_CREATE Structure <I>
+typedef struct {
+    TPM2B_AUTH              userAuth;
+    TPM2B_SENSITIVE_DATA    data;
+} TPMS_SENSITIVE_CREATE;
+
+// Table 130 -- TPM2B_SENSITIVE_CREATE Structure <I,S>
+typedef struct {
+    UINT16                   size;
+    TPMS_SENSITIVE_CREATE    sensitive;
+} TPM2B_SENSITIVE_CREATE;
+
+// Table 131 -- TPMS_SCHEME_SIGHASH Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_SIGHASH;
+
+// Table 132 -- TPMI_ALG_KEYEDHASH_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_KEYEDHASH_SCHEME;
+
+// Table 133 -- HMAC_SIG_SCHEME Types <I/O>
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_HMAC;
+
+// Table 134 -- TPMS_SCHEME_XOR Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    TPMI_ALG_KDF     kdf;
+} TPMS_SCHEME_XOR;
+
+// Table 135 -- TPMU_SCHEME_KEYEDHASH Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_HMAC
+    TPMS_SCHEME_HMAC  hmac;
+#endif
+#ifdef TPM2_ALG_XOR
+    TPMS_SCHEME_XOR  xor;
+#endif
+
+} TPMU_SCHEME_KEYEDHASH ;
+
+// Table 136 -- TPMT_KEYEDHASH_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_KEYEDHASH_SCHEME    scheme;
+    TPMU_SCHEME_KEYEDHASH        details;
+} TPMT_KEYEDHASH_SCHEME;
+
+// Table 137 -- RSA_SIG_SCHEMES Types <I/O>
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_RSASSA;
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_RSAPSS;
+
+// Table 138 -- ECC_SIG_SCHEMES Types <I/O>
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_ECDSA;
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_SM2;
+
+// Table 139 -- TPMS_SCHEME_ECDAA Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    UINT16           count;
+} TPMS_SCHEME_ECDAA;
+
+// Table 140 -- TPMS_SCHEME_ECSCHNORR Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    UINT16           count;
+} TPMS_SCHEME_ECSCHNORR;
+
+// Table 141 -- TPMU_SIG_SCHEME Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_RSASSA
+    TPMS_SCHEME_RSASSA  rsassa;
+#endif
+#ifdef TPM2_ALG_RSAPSS
+    TPMS_SCHEME_RSAPSS  rsapss;
+#endif
+#ifdef TPM2_ALG_ECDSA
+    TPMS_SCHEME_ECDSA  ecdsa;
+#endif
+#ifdef TPM2_ALG_SM2
+    TPMS_SCHEME_SM2  sm2;
+#endif
+#ifdef TPM2_ALG_ECDAA
+    TPMS_SCHEME_ECDAA  ecdaa;
+#endif
+#ifdef TPM2_ALG_ECSCHNORR
+    TPMS_SCHEME_ECSCHNORR  ecSchnorr;
+#endif
+#ifdef TPM2_ALG_HMAC
+    TPMS_SCHEME_HMAC  hmac;
+#endif
+    TPMS_SCHEME_SIGHASH  any;
+} TPMU_SIG_SCHEME;
+
+// Table 142 -- TPMT_SIG_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_SIG_SCHEME    scheme;
+    TPMU_SIG_SCHEME        details;
+} TPMT_SIG_SCHEME;
+
+// Table 143 -- TPMS_SCHEME_OAEP Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_OAEP;
+
+// Table 144 -- TPMS_SCHEME_ECDH Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_ECDH;
+
+// Table 145 -- TPMS_SCHEME_MGF1 Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_MGF1;
+
+// Table 146 -- TPMS_SCHEME_KDF1_SP800_56a Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_KDF1_SP800_56a;
+
+// Table 147 -- TPMS_SCHEME_KDF2 Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_KDF2;
+
+// Table 148 -- TPMS_SCHEME_KDF1_SP800_108 Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_KDF1_SP800_108;
+
+// Table 149 -- TPMU_KDF_SCHEME Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_MGF1
+    TPMS_SCHEME_MGF1  mgf1;
+#endif
+#ifdef TPM2_ALG_KDF1_SP800_56a
+    TPMS_SCHEME_KDF1_SP800_56a  kdf1_SP800_56a;
+#endif
+#ifdef TPM2_ALG_KDF2
+    TPMS_SCHEME_KDF2  kdf2;
+#endif
+#ifdef TPM2_ALG_KDF1_SP800_108
+    TPMS_SCHEME_KDF1_SP800_108  kdf1_sp800_108;
+#endif
+
+} TPMU_KDF_SCHEME;
+
+// Table 150 -- TPMT_KDF_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_KDF       scheme;
+    TPMU_KDF_SCHEME    details;
+} TPMT_KDF_SCHEME;
+typedef TPM_ALG_ID TPMI_ALG_ASYM_SCHEME;
+
+// Table 152 -- TPMU_ASYM_SCHEME Union <I/O>
+typedef union {
+#ifdef TPM2_ALG_RSASSA
+    TPMS_SCHEME_RSASSA  rsassa;
+#endif
+#ifdef TPM2_ALG_RSAPSS
+    TPMS_SCHEME_RSAPSS  rsapss;
+#endif
+#ifdef TPM2_ALG_OAEP
+    TPMS_SCHEME_OAEP  oaep;
+#endif
+#ifdef TPM2_ALG_ECDSA
+    TPMS_SCHEME_ECDSA  ecdsa;
+#endif
+#ifdef TPM2_ALG_SM2
+    TPMS_SCHEME_SM2  sm2;
+#endif
+#ifdef TPM2_ALG_ECDAA
+    TPMS_SCHEME_ECDAA  ecdaa;
+#endif
+#ifdef TPM2_ALG_ECSCHNORR
+    TPMS_SCHEME_ECSCHNORR  ecSchnorr;
+#endif
+    TPMS_SCHEME_SIGHASH  anySig;
+} TPMU_ASYM_SCHEME;
+
+typedef struct {
+    TPMI_ALG_ASYM_SCHEME    scheme;
+    TPMU_ASYM_SCHEME        details;
+} TPMT_ASYM_SCHEME;
+
+// Table 154 -- TPMI_ALG_RSA_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_RSA_SCHEME;
+
+// Table 155 -- TPMT_RSA_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_RSA_SCHEME    scheme;
+    TPMU_ASYM_SCHEME       details;
+} TPMT_RSA_SCHEME;
+
+// Table 156 -- TPMI_ALG_RSA_DECRYPT Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_RSA_DECRYPT;
+
+// Table 157 -- TPMT_RSA_DECRYPT Structure <I/O>
+typedef struct {
+    TPMI_ALG_RSA_DECRYPT    scheme;
+    TPMU_ASYM_SCHEME        details;
+} TPMT_RSA_DECRYPT;
+
+// Table 158 -- TPM2B_PUBLIC_KEY_RSA Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_RSA_KEY_BYTES];
+} TPM2B_PUBLIC_KEY_RSA;
+
+// Table 159 -- TPMI_RSA_KEY_BITS Type <I/O>
+typedef TPM_KEY_BITS TPMI_RSA_KEY_BITS;
+
+// Table 160 -- TPM2B_PRIVATE_KEY_RSA Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_RSA_KEY_BYTES/2];
+} TPM2B_PRIVATE_KEY_RSA;
+
+// Table 162 -- TPM2B_ECC_PARAMETER
+typedef struct {
+    UINT16 size;
+    BYTE buffer[MAX_ECC_KEY_BYTES];
+} TPM2B_ECC_PARAMETER;
+
+// Table 163 -- TPMS_ECC_POINT Structure <I/O>
+typedef struct {
+    TPM2B_ECC_PARAMETER    x;
+    TPM2B_ECC_PARAMETER    y;
+} TPMS_ECC_POINT;
+
+// Table 164 -- TPMI_ALG_ECC_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_ECC_SCHEME;
+
+typedef UINT16 TPM_ECC_CURVE;
+
+// Table 165 -- TPMI_ECC_CURVE Type <I/O>
+typedef TPM_ECC_CURVE TPMI_ECC_CURVE;
+
+// Table 166 -- TPMT_ECC_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_ECC_SCHEME    scheme;
+    TPMU_SIG_SCHEME        details;
+} TPMT_ECC_SCHEME;
+
+// Table 175 -- TPMI_ALG_PUBLIC Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_PUBLIC;
+
+// Table 176 -- TPMU_PUBLIC_ID Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_KEYEDHASH
+    TPM2B_DIGEST  keyedHash;
+#endif
+#ifdef TPM2_ALG_SYMCIPHER
+    TPM2B_DIGEST  sym;
+#endif
+#ifdef TPM2_ALG_RSA
+    TPM2B_PUBLIC_KEY_RSA  rsa;
+#endif
+#ifdef TPM2_ALG_ECC
+    TPMS_ECC_POINT  ecc;
+#endif
+} TPMU_PUBLIC_ID;
+
+// Table 177 -- TPMS_KEYEDHASH_PARMS Structure <I/O>
+typedef struct {
+    TPMT_KEYEDHASH_SCHEME    scheme;
+} TPMS_KEYEDHASH_PARMS;
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    symmetric;
+    TPMT_ASYM_SCHEME       scheme;
+} TPMS_ASYM_PARMS;
+
+// Table 179 -- TPMS_RSA_PARMS Structure <I/O>
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    symmetric;
+    TPMT_RSA_SCHEME        scheme;
+    TPMI_RSA_KEY_BITS      keyBits;
+    UINT32                 exponent;
+} TPMS_RSA_PARMS;
+
+// Table 180 -- TPMS_ECC_PARMS Structure <I/O>
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    symmetric;
+    TPMT_ECC_SCHEME        scheme;
+    TPMI_ECC_CURVE         curveID;
+    TPMT_KDF_SCHEME        kdf;
+} TPMS_ECC_PARMS;
+
+// Table 181 -- TPMU_PUBLIC_PARMS Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_KEYEDHASH
+    TPMS_KEYEDHASH_PARMS  keyedHashDetail;
+#endif
+#ifdef TPM2_ALG_SYMCIPHER
+    TPMT_SYM_DEF_OBJECT  symDetail;
+#endif
+#ifdef TPM2_ALG_RSA
+    TPMS_RSA_PARMS  rsaDetail;
+#endif
+#ifdef TPM2_ALG_ECC
+    TPMS_ECC_PARMS  eccDetail;
+#endif
+    TPMS_ASYM_PARMS  asymDetail;
+} TPMU_PUBLIC_PARMS;
+
+// Table 182 -- TPMT_PUBLIC_PARMS Structure <I/O>
+typedef struct {
+    TPMI_ALG_PUBLIC      type;
+    TPMU_PUBLIC_PARMS    parameters;
+} TPMT_PUBLIC_PARMS;
+
+// Table 183 -- TPMT_PUBLIC Structure <I/O>
+typedef struct {
+    TPMI_ALG_PUBLIC      type;
+    TPMI_ALG_HASH        nameAlg;
+    TPMA_OBJECT          objectAttributes;
+    TPM2B_DIGEST         authPolicy;
+    TPMU_PUBLIC_PARMS    parameters;
+    TPMU_PUBLIC_ID       unique;
+} TPMT_PUBLIC;
+
+// Table 184 -- TPM2B_PUBLIC
+typedef struct {
+    UINT16         size;
+    TPMT_PUBLIC    publicArea;
+} TPM2B_PUBLIC;
+
+// Table 185 -- TPMU_SENSITIVE_COMPOSITE Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_RSA
+    TPM2B_PRIVATE_KEY_RSA  rsa;
+#endif
+#ifdef TPM2_ALG_ECC
+    TPM2B_ECC_PARAMETER  ecc;
+#endif
+#ifdef TPM2_ALG_KEYEDHASH
+    TPM2B_SENSITIVE_DATA  bits;
+#endif
+#ifdef TPM2_ALG_SYMCIPHER
+    TPM2B_SYM_KEY  sym;
+#endif
+    TPM2B_SENSITIVE_DATA  any;
+} TPMU_SENSITIVE_COMPOSITE;
+
+// Table 186 -- TPMT_SENSITIVE Structure <I/O>
+typedef struct {
+    TPMI_ALG_PUBLIC             sensitiveType;
+    TPM2B_AUTH                  authValue;
+    TPM2B_DIGEST                seedValue;
+    TPMU_SENSITIVE_COMPOSITE    sensitive;
+} TPMT_SENSITIVE;
+
+// Table 187 -- TPM2B_SENSITIVE Structure <I/O>
+typedef struct {
+    UINT16            size;
+    TPMT_SENSITIVE    sensitiveArea;
+} TPM2B_SENSITIVE;
+
+typedef struct {
+    TPM2B_DIGEST      integrityOuter;
+    TPM2B_DIGEST      integrityInner;
+    TPMT_SENSITIVE    sensitive;
+} _PRIVATE;
+
+// Table 189 -- TPM2B_PRIVATE Structure <I/O,S>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[sizeof(_PRIVATE)];
+} TPM2B_PRIVATE;
+
+// Table 204 -- TPMS_CREATION_DATA <OUT>
+typedef struct {
+    TPML_PCR_SELECTION    pcrSelect;
+    TPM2B_DIGEST          pcrDigest;
+    TPMA_LOCALITY         locality;
+    TPM_ALG_ID            parentNameAlg;
+    TPM2B_NAME            parentName;
+    TPM2B_NAME            parentQualifiedName;
+    TPM2B_DATA            outsideInfo;
+} TPMS_CREATION_DATA;
+
+// Table 205 -- TPM2B_CREATION_DATA <OUT>
+typedef struct {
+    UINT16 size;
+    TPMS_CREATION_DATA creationData;
+} TPM2B_CREATION_DATA;
+
+/* the following structs is not part of standard struct defined in TPM2 spec */
+typedef struct {
+    UINT32            size;
+    TPM_RH            sessionHandle;
+    TPM2B_NONCE       nonce;
+    TPMA_SESSION      sessionAttributes;
+    TPM2B_AUTH        auth;
+} TPM_AuthArea;
+
+typedef struct {
+    TPM2B_SENSITIVE_CREATE  inSensitive;
+    TPM2B_PUBLIC            inPublic;
+    TPM2B_DATA              outsideInfo;
+    TPML_PCR_SELECTION      creationPCR;
+} TPM2_Create_Params_in;
+
+typedef TPM2_Create_Params_in    TPM2_CreatePrimary_Params_in;
+
+typedef struct {
+    TPM2B_PUBLIC        outPublic;
+    TPM2B_CREATION_DATA creationData;
+    TPM2B_DIGEST        creationHash;
+    TPMT_TK_CREATION    creationTicket;
+    TPM2B_NAME          name;
+} TPM2_CreatePrimary_Params_out;
+
+typedef struct {
+    TPM2B_PRIVATE       outPrivate;
+    TPM2B_PUBLIC        outPublic;
+    TPM2B_CREATION_DATA creationData;
+    TPM2B_DIGEST        creationHash;
+    TPMT_TK_CREATION    creationTicket;
+} TPM2_Create_Params_out;
+typedef struct {
+    TPM2B_PRIVATE    Private;
+    TPM2B_PUBLIC     Public;
+} TPM2_RSA_KEY;
+
+/*
+ * TPM 2.0 Objects
+ */
+
+#define TPM_HT_TRANSIENT        0x80
+#define HR_SHIFT                24
+#define HR_PERMANENT            (TPM_HT_TRANSIENT << HR_SHIFT)
+#define TRANSIENT_FIRST         (HR_PERMANENT)
+#define MAX_LOADED_OBJECTS      3
+#define TRANSIENT_LAST          (TRANSIENT_FIRST+MAX_LOADED_OBJECTS-1)
+/*
+ * TPMA_OBJECT Bits
+ */
+#define fixedTPM                ((1 << 1))
+#define stClear                 ((1 << 2))
+#define fixedParent             ((1 << 4))
+#define sensitiveDataOrigin     ((1 << 5))
+#define userWithAuth            ((1 << 6))
+#define adminWithPolicy         ((1 << 7))
+#define noDA                    ((1 << 10))
+#define encryptedDuplication    ((1 << 11))
+#define restricted              ((1 << 16))
+#define decrypt                 ((1 << 17))
+#define sign                    ((1 << 18))
+#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 Tue Feb 03 08:03:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYSY-0006J4-5i; Tue, 03 Feb 2015 08:03:46 +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 1YIYSW-0006Iq-Qs
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:45 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	56/88-02754-0E080D45; Tue, 03 Feb 2015 08:03:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1422950621!12034376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.2 required=7.0 tests=UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28014 invoked from network); 3 Feb 2015 08:03:42 -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;
	3 Feb 2015 08:03: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 1YIYST-0005VF-F7
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYST-0006aW-E5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:41 +0000
Date: Tue, 03 Feb 2015 08:03:41 +0000
Message-Id: <E1YIYST-0006aW-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add TPM 2.0 data structures
	and commands definition
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d5123397bdea881235128b689f5ce45b2a9a9e4b
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:40 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Add TPM 2.0 data structures and commands definition
    
    Add TPM 2.0 data structures on Trusted Platform Module Library Part 2:
    Structures and Trust Platform Module Library Part 3: Commands.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/tpm2_types.h |  978 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 978 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/tpm2_types.h b/stubdom/vtpmmgr/tpm2_types.h
new file mode 100644
index 0000000..214335c
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2_types.h
@@ -0,0 +1,978 @@
+#ifndef __TPM2_TYPES_H__
+#define __TPM2_TYPES_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+
+// "implementation.h"
+// Table 212 -- Logic Values
+#define    YES      1
+#define    NO       0
+#ifndef    TRUE
+#define    TRUE     1
+#endif
+#ifndef    FALSE
+#define    FALSE    0
+#endif
+#ifndef    true
+#define    true     1
+#endif
+#ifndef    false
+#define    false    0
+#endif
+#define    SET      1
+#define    CLEAR    0
+
+
+// Table 214 -- Implemented Algorithms
+#define    ALG_RSA               YES    // 1
+#define    ALG_DES               NO     // 0
+#define    ALG__3DES             NO     // 0
+#define    ALG_SHA1              YES    // 1
+#define    ALG_HMAC              YES    // 1
+#define    ALG_AES               YES    // 1
+#define    ALG_MGF1              YES    // 1
+#define    ALG_XOR               YES    // 1
+#define    ALG_KEYEDHASH         YES    // 1
+#define    ALG_SHA256            YES    // 1
+#define    ALG_SHA384            YES    // 0
+#define    ALG_SHA512            YES    // 0
+#define    ALG_WHIRLPOOL512      YES    // 0
+#define    ALG_SM3_256           YES    // 1
+#define    ALG_SM4               YES    // 1
+#define    ALG_RSASSA            YES    // 1
+#define    ALG_RSAES             YES    // 1
+#define    ALG_RSAPSS            YES    // 1
+#define    ALG_OAEP              YES    // 1
+#define    ALG_ECC               YES    // 1
+#define    ALG_CFB               YES    // 1
+#define    ALG_ECDH              YES    // 1
+#define    ALG_ECDSA             YES    // 1
+#define    ALG_ECDAA             YES    // 1
+#define    ALG_SM2               YES    // 1
+#define    ALG_ECSCHNORR         YES    // 1
+#define    ALG_SYMCIPHER         YES    // 1
+#define    ALG_KDF1_SP800_56a    YES    // 1
+#define    ALG_KDF2              NO     // 0
+#define    ALG_KDF1_SP800_108    YES    // 1
+#define    ALG_CTR               YES    // 1
+#define    ALG_OFB               YES    // 1
+#define    ALG_CBC               YES    // 1
+
+#define HASH_COUNT (ALG_SHA1+ALG_SHA256+ALG_SHA384+ALG_SHA512+ALG_WHIRLPOOL512+ALG_SM3_256)
+
+// Table 216 -- RSA Algorithm Constants
+#define    RSA_KEY_SIZES_BITS    2048    // {1024,2048}
+#define    MAX_RSA_KEY_BITS      2048
+#define    MAX_RSA_KEY_BYTES     ((MAX_RSA_KEY_BITS + 7) / 8)    // 256
+
+// Table 218 -- AES Algorithm Constants
+#define    AES_KEY_SIZES_BITS          128
+#define    MAX_AES_KEY_BITS            128
+#define    MAX_AES_BLOCK_SIZE_BYTES    16
+#define    MAX_AES_KEY_BYTES           ((MAX_AES_KEY_BITS + 7) / 8)    // 16
+
+
+// Table 220 -- Symmetric Algorithm Constants
+#define    MAX_SYM_KEY_BITS      MAX_AES_KEY_BITS    // 128
+#define    MAX_SYM_KEY_BYTES     MAX_AES_KEY_BYTES    // 16
+#define    MAX_SYM_BLOCK_SIZE    MAX_AES_BLOCK_SIZE_BYTES    // 16
+
+#define    MAX_SYM_DATA         128
+#define    MAX_ECC_KEY_BITS     256
+#define    MAX_ECC_KEY_BYTES    ((MAX_ECC_KEY_BITS + 7) / 8)
+
+
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint8_t       UINT8;
+typedef uint16_t      UINT16;
+typedef uint32_t      UINT32;
+typedef uint64_t      UINT64;
+
+// TPM2 command code
+
+typedef UINT32 TPM_CC;
+#define    TPM_CC_FIRST                         (TPM_CC)(0x0000011F)
+#define    TPM_CC_PP_FIRST                      (TPM_CC)(0x0000011F)
+#define    TPM_CC_NV_UndefineSpaceSpecial       (TPM_CC)(0x0000011F)
+#define    TPM_CC_EvictControl                  (TPM_CC)(0x00000120)
+#define    TPM_CC_HierarchyControl              (TPM_CC)(0x00000121)
+#define    TPM_CC_NV_UndefineSpace              (TPM_CC)(0x00000122)
+#define    TPM_CC_ChangeEPS                     (TPM_CC)(0x00000124)
+#define    TPM_CC_ChangePPS                     (TPM_CC)(0x00000125)
+#define    TPM_CC_Clear                         (TPM_CC)(0x00000126)
+#define    TPM_CC_ClearControl                  (TPM_CC)(0x00000127)
+#define    TPM_CC_ClockSet                      (TPM_CC)(0x00000128)
+#define    TPM_CC_HierarchyChangeAuth           (TPM_CC)(0x00000129)
+#define    TPM_CC_NV_DefineSpace                (TPM_CC)(0x0000012A)
+#define    TPM_CC_PCR_Allocate                  (TPM_CC)(0x0000012B)
+#define    TPM_CC_PCR_SetAuthPolicy             (TPM_CC)(0x0000012C)
+#define    TPM_CC_PP_Commands                   (TPM_CC)(0x0000012D)
+#define    TPM_CC_SetPrimaryPolicy              (TPM_CC)(0x0000012E)
+#define    TPM_CC_FieldUpgradeStart             (TPM_CC)(0x0000012F)
+#define    TPM_CC_ClockRateAdjust               (TPM_CC)(0x00000130)
+#define    TPM_CC_CreatePrimary                 (TPM_CC)(0x00000131)
+#define    TPM_CC_NV_GlobalWriteLock            (TPM_CC)(0x00000132)
+#define    TPM_CC_PP_LAST                       (TPM_CC)(0x00000132)
+#define    TPM_CC_GetCommandAuditDigest         (TPM_CC)(0x00000133)
+#define    TPM_CC_NV_Increment                  (TPM_CC)(0x00000134)
+#define    TPM_CC_NV_SetBits                    (TPM_CC)(0x00000135)
+#define    TPM_CC_NV_Extend                     (TPM_CC)(0x00000136)
+#define    TPM_CC_NV_Write                      (TPM_CC)(0x00000137)
+#define    TPM_CC_NV_WriteLock                  (TPM_CC)(0x00000138)
+#define    TPM_CC_DictionaryAttackLockReset     (TPM_CC)(0x00000139)
+#define    TPM_CC_DictionaryAttackParameters    (TPM_CC)(0x0000013A)
+#define    TPM_CC_NV_ChangeAuth                 (TPM_CC)(0x0000013B)
+#define    TPM_CC_PCR_Event                     (TPM_CC)(0x0000013C)
+#define    TPM_CC_PCR_Reset                     (TPM_CC)(0x0000013D)
+#define    TPM_CC_SequenceComplete              (TPM_CC)(0x0000013E)
+#define    TPM_CC_SetAlgorithmSet               (TPM_CC)(0x0000013F)
+#define    TPM_CC_SetCommandCodeAuditStatus     (TPM_CC)(0x00000140)
+#define    TPM_CC_FieldUpgradeData              (TPM_CC)(0x00000141)
+#define    TPM_CC_IncrementalSelfTest           (TPM_CC)(0x00000142)
+#define    TPM_CC_SelfTest                      (TPM_CC)(0x00000143)
+#define    TPM_CC_Startup                       (TPM_CC)(0x00000144)
+#define    TPM_CC_Shutdown                      (TPM_CC)(0x00000145)
+#define    TPM_CC_StirRandom                    (TPM_CC)(0x00000146)
+#define    TPM_CC_ActivateCredential            (TPM_CC)(0x00000147)
+#define    TPM_CC_Certify                       (TPM_CC)(0x00000148)
+#define    TPM_CC_PolicyNV                      (TPM_CC)(0x00000149)
+#define    TPM_CC_CertifyCreation               (TPM_CC)(0x0000014A)
+#define    TPM_CC_Duplicate                     (TPM_CC)(0x0000014B)
+#define    TPM_CC_GetTime                       (TPM_CC)(0x0000014C)
+#define    TPM_CC_GetSessionAuditDigest         (TPM_CC)(0x0000014D)
+#define    TPM_CC_NV_Read                       (TPM_CC)(0x0000014E)
+#define    TPM_CC_NV_ReadLock                   (TPM_CC)(0x0000014F)
+#define    TPM_CC_ObjectChangeAuth              (TPM_CC)(0x00000150)
+#define    TPM_CC_PolicySecret                  (TPM_CC)(0x00000151)
+#define    TPM_CC_Rewrap                        (TPM_CC)(0x00000152)
+#define    TPM_CC_Create                        (TPM_CC)(0x00000153)
+#define    TPM_CC_ECDH_ZGen                     (TPM_CC)(0x00000154)
+#define    TPM_CC_HMAC                          (TPM_CC)(0x00000155)
+#define    TPM_CC_Import                        (TPM_CC)(0x00000156)
+#define    TPM_CC_Load                          (TPM_CC)(0x00000157)
+#define    TPM_CC_Quote                         (TPM_CC)(0x00000158)
+#define    TPM_CC_RSA_Decrypt                   (TPM_CC)(0x00000159)
+#define    TPM_CC_HMAC_Start                    (TPM_CC)(0x0000015B)
+#define    TPM_CC_SequenceUpdate                (TPM_CC)(0x0000015C)
+#define    TPM_CC_Sign                          (TPM_CC)(0x0000015D)
+#define    TPM_CC_Unseal                        (TPM_CC)(0x0000015E)
+#define    TPM_CC_PolicySigned                  (TPM_CC)(0x00000160)
+#define    TPM_CC_ContextLoad                   (TPM_CC)(0x00000161)
+#define    TPM_CC_ContextSave                   (TPM_CC)(0x00000162)
+#define    TPM_CC_ECDH_KeyGen                   (TPM_CC)(0x00000163)
+#define    TPM_CC_EncryptDecrypt                (TPM_CC)(0x00000164)
+#define    TPM_CC_FlushContext                  (TPM_CC)(0x00000165)
+#define    TPM_CC_LoadExternal                  (TPM_CC)(0x00000167)
+#define    TPM_CC_MakeCredential                (TPM_CC)(0x00000168)
+#define    TPM_CC_NV_ReadPublic                 (TPM_CC)(0x00000169)
+#define    TPM_CC_PolicyAuthorize               (TPM_CC)(0x0000016A)
+#define    TPM_CC_PolicyAuthValue               (TPM_CC)(0x0000016B)
+#define    TPM_CC_PolicyCommandCode             (TPM_CC)(0x0000016C)
+#define    TPM_CC_PolicyCounterTimer            (TPM_CC)(0x0000016D)
+#define    TPM_CC_PolicyCpHash                  (TPM_CC)(0x0000016E)
+#define    TPM_CC_PolicyLocality                (TPM_CC)(0x0000016F)
+#define    TPM_CC_PolicyNameHash                (TPM_CC)(0x00000170)
+#define    TPM_CC_PolicyOR                      (TPM_CC)(0x00000171)
+#define    TPM_CC_PolicyTicket                  (TPM_CC)(0x00000172)
+#define    TPM_CC_ReadPublic                    (TPM_CC)(0x00000173)
+#define    TPM_CC_RSA_Encrypt                   (TPM_CC)(0x00000174)
+#define    TPM_CC_StartAuthSession              (TPM_CC)(0x00000176)
+#define    TPM_CC_VerifySignature               (TPM_CC)(0x00000177)
+#define    TPM_CC_ECC_Parameters                (TPM_CC)(0x00000178)
+#define    TPM_CC_FirmwareRead                  (TPM_CC)(0x00000179)
+#define    TPM_CC_GetCapability                 (TPM_CC)(0x0000017A)
+#define    TPM_CC_GetRandom                     (TPM_CC)(0x0000017B)
+#define    TPM_CC_GetTestResult                 (TPM_CC)(0x0000017C)
+#define    TPM_CC_Hash                          (TPM_CC)(0x0000017D)
+#define    TPM_CC_PCR_Read                      (TPM_CC)(0x0000017E)
+#define    TPM_CC_PolicyPCR                     (TPM_CC)(0x0000017F)
+#define    TPM_CC_PolicyRestart                 (TPM_CC)(0x00000180)
+#define    TPM_CC_ReadClock                     (TPM_CC)(0x00000181)
+#define    TPM_CC_PCR_Extend                    (TPM_CC)(0x00000182)
+#define    TPM_CC_PCR_SetAuthValue              (TPM_CC)(0x00000183)
+#define    TPM_CC_NV_Certify                    (TPM_CC)(0x00000184)
+#define    TPM_CC_EventSequenceComplete         (TPM_CC)(0x00000185)
+#define    TPM_CC_HashSequenceStart             (TPM_CC)(0x00000186)
+#define    TPM_CC_PolicyPhysicalPresence        (TPM_CC)(0x00000187)
+#define    TPM_CC_PolicyDuplicationSelect       (TPM_CC)(0x00000188)
+#define    TPM_CC_PolicyGetDigest               (TPM_CC)(0x00000189)
+#define    TPM_CC_TestParms                     (TPM_CC)(0x0000018A)
+#define    TPM_CC_Commit                        (TPM_CC)(0x0000018B)
+#define    TPM_CC_PolicyPassword                (TPM_CC)(0x0000018C)
+#define    TPM_CC_SM2_ZGen                      (TPM_CC)(0x0000018D)
+#define    TPM_CC_LAST                          (TPM_CC)(0x0000018D)
+
+
+//TPM_RC
+typedef UINT32 TPM_RC;
+
+// TPM_ST Constants
+typedef UINT16 TPM_ST;
+#define    TPM_ST_NULL                    (TPM_ST)(0X8000)
+#define    TPM_ST_NO_SESSIONS             (TPM_ST)(0x8001)
+#define    TPM_ST_SESSIONS                (TPM_ST)(0x8002)
+
+
+// TPM Handle types
+typedef UINT32 TPM_HANDLE;
+typedef UINT8 TPM_HT;
+
+
+// TPM_RH Constants
+typedef UINT32 TPM_RH;
+
+#define    TPM_RH_FIRST          (TPM_RH)(0x40000000)
+#define    TPM_RH_SRK            (TPM_RH)(0x40000000)
+#define    TPM_RH_OWNER          (TPM_RH)(0x40000001)
+#define    TPM_RS_PW             (TPM_RH)(0x40000009)
+#define    TPM_RH_LOCKOUT        (TPM_RH)(0x4000000A)
+#define    TPM_RH_ENDORSEMENT    (TPM_RH)(0x4000000B)
+#define    TPM_RH_PLATFORM       (TPM_RH)(0x4000000C)
+#define    TPM_RH_LAST           (TPM_RH)(0x4000000C)
+
+// Table 4 -- DocumentationClarity Types <I/O>
+typedef UINT32    TPM_ALGORITHM_ID;
+typedef UINT32    TPM_MODIFIER_INDICATOR;
+typedef UINT32    TPM_SESSION_OFFSET;
+typedef UINT16    TPM_KEY_SIZE;
+typedef UINT16    TPM_KEY_BITS;
+typedef UINT64    TPM_SYSTEM_ADDRESS;
+typedef UINT32    TPM_SPEC;
+
+// Table 29 -- TPMA_ALGORITHM Bits <I/O>
+typedef struct {
+    unsigned int asymmetric:1;
+    unsigned int symmetric:1;
+    unsigned int hash:1;
+    unsigned int object:1;
+    unsigned int reserved5:4;
+    unsigned int signing:1;
+    unsigned int encrypting:1;
+    unsigned int method:1;
+    unsigned int reserved9:21;
+} TPMA_ALGORITHM;
+
+typedef UINT32 TPMA_OBJECT;
+typedef BYTE TPMA_SESSION;
+typedef BYTE TPMA_LOCALITY;
+
+// Table 37 -- TPMI_YES_NO Type <I/O>
+typedef BYTE TPMI_YES_NO;
+
+typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
+
+// Table 38 -- TPMI_DH_OBJECT Type <I/O>
+typedef TPM_HANDLE TPMI_DH_OBJECT;
+
+// Table 39 -- TPMI_DH_PERSISTENT Type <I/O>
+typedef TPM_HANDLE TPMI_DH_PERSISTENT;
+
+// Table 42 -- TPMI_SH_AUTH_SESSION Type <I/O>
+typedef TPM_HANDLE TPMI_SH_AUTH_SESSION;
+
+// Table 40 -- TPMI_DH_ENTITY Type <I>
+typedef TPM_HANDLE TPMI_DH_ENTITY;
+
+// Table 45 -- TPMI_DH_CONTEXT Type <I/O>
+typedef TPM_HANDLE TPMI_DH_CONTEXT;
+
+// Table 46 -- TPMI_RH_HIERARCHY Type <I/O>
+typedef TPM_HANDLE TPMI_RH_HIERARCHY;
+
+// Table 47 -- TPMI_RH_HIERARCHY_AUTH Type <I>
+typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
+
+// Table 48 -- TPMI_RH_PLATFORM Type <I>
+typedef TPM_HANDLE TPMI_RH_PLATFORM;
+
+// Table 49 -- TPMI_RH_OWNER Type <I>
+typedef TPM_HANDLE TPMI_RH_OWNER;
+
+// Table 50 -- TPMI_RH_ENDORSEMENT Type <I>
+typedef TPM_HANDLE TPMI_RH_ENDORSEMENT;
+
+// Table 51 -- TPMI_RH_PROVISION Type <I>
+typedef TPM_HANDLE TPMI_RH_PROVISION;
+
+// Table 52 -- TPMI_RH_CLEAR Type <I>
+typedef TPM_HANDLE TPMI_RH_CLEAR;
+
+// Table 54 -- TPMI_RH_LOCKOUT Type <I>
+typedef TPM_HANDLE TPMI_RH_LOCKOUT;
+
+// Table 7 -- TPM_ALG_ID
+typedef UINT16 TPM_ALG_ID;
+typedef UINT16 TPM_ALG_ID;
+
+#define    TPM2_ALG_ERROR             (TPM_ALG_ID)(0x0000) // a: ; D:
+#define    TPM2_ALG_FIRST             (TPM_ALG_ID)(0x0001) // a: ; D:
+#if ALG_RSA == YES || ALG_ALL == YES
+#define    TPM2_ALG_RSA               (TPM_ALG_ID)(0x0001) // a: A O; D:
+#endif
+#if ALG_DES == YES || ALG_ALL == YES
+#define    TPM2_ALG_DES               (TPM_ALG_ID)(0x0002) // a: S; D:
+#endif
+#define    TPM2_ALG_SHA1              (TPM_ALG_ID)(0x0004) // a: H; D:
+#if ALG_HMAC == YES || ALG_ALL == YES
+#define    TPM2_ALG_HMAC              (TPM_ALG_ID)(0x0005) // a: H X; D:
+#endif
+#if ALG_AES == YES || ALG_ALL == YES
+#define    TPM2_ALG_AES               (TPM_ALG_ID)(0x0006) // a: S; D:
+#endif
+#if ALG_XOR == YES || ALG_ALL == YES
+#define    TPM2_ALG_XOR               (TPM_ALG_ID)(0x000A) // a: H S; D:
+#endif
+#if ALG_MGF1 == YES || ALG_ALL == YES
+#define    TPM2_ALG_MGF1              (TPM_ALG_ID)(0x0007) // a: H M; D:
+#endif
+#if ALG_KEYEDHASH == YES || ALG_ALL == YES
+#define    TPM2_ALG_KEYEDHASH         (TPM_ALG_ID)(0x0008) // a: H E X O; D:
+#endif
+#if ALG_SHA256 == YES || ALG_ALL == YES
+#define    TPM2_ALG_SHA256            (TPM_ALG_ID)(0x000B) // a: H; D:
+#endif
+#define    TPM2_ALG_NULL              (TPM_ALG_ID)(0x0010) // a: ; D:
+#if ALG_OAEP == YES || ALG_ALL == YES
+#define    TPM2_ALG_OAEP              (TPM_ALG_ID)(0x0017) // a: A E; D: RSA
+#endif
+#if ALG_ECC == YES || ALG_ALL == YES
+#define    TPM2_ALG_ECC               (TPM_ALG_ID)(0x0023) // a: A O; D:
+#endif
+#if ALG_SM4 == YES || ALG_ALL == YES
+#define    TPM2_ALG_SM4               (TPM_ALG_ID)(0x0013) // a: S; D:
+#endif
+#if ALG_SYMCIPHER == YES || ALG_ALL == YES
+#define    TPM2_ALG_SYMCIPHER         (TPM_ALG_ID)(0x0025) // a: O; D:
+#endif
+#if ALG_CFB == YES || ALG_ALL == YES
+#define    TPM2_ALG_CFB               (TPM_ALG_ID)(0x0043) // a: S E; D:
+#endif
+#define    TPM2_ALG_LAST              (TPM_ALG_ID)(0x0044)
+
+#define    SHA1_DIGEST_SIZE      20
+#define    SHA1_BLOCK_SIZE       64
+#define    SHA256_DIGEST_SIZE    32
+#define    SHA256_BLOCK_SIZE     64
+
+// Table 57 -- TPMI_ALG_ASYM Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_ASYM;
+
+// Table 56 -- TPMI_ALG_HASH Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_HASH;
+
+// Table 58 -- TPMI_ALG_SYM Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SYM;
+
+// Table 59 -- TPMI_ALG_SYM_OBJECT Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SYM_OBJECT;
+
+// Table 60 -- TPMI_ALG_SYM_MODE Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SYM_MODE;
+
+// Table 61 -- TPMI_ALG_KDF Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_KDF;
+
+// Table 62 -- TPMI_ALG_SIG_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_SIG_SCHEME;
+
+// Table 65 -- TPMU_HA Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_SHA1
+    BYTE  sha1[SHA1_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SHA256
+    BYTE  sha256[SHA256_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SM3_256
+    BYTE  sm3_256[SM3_256_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SHA384
+    BYTE  sha384[SHA384_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_SHA512
+    BYTE  sha512[SHA512_DIGEST_SIZE];
+#endif
+#ifdef TPM2_ALG_WHIRLPOOL512
+    BYTE  whirlpool[WHIRLPOOL512_DIGEST_SIZE];
+#endif
+
+} TPMU_HA;
+
+// Table 67 -- TPM2B_DIGEST Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[sizeof(TPMU_HA)];
+} TPM2B_DIGEST;
+
+// Table 69 -- TPM2B_NONCE Types <I/O>
+typedef TPM2B_DIGEST    TPM2B_NONCE;
+
+typedef TPM2B_DIGEST    TPM2B_DATA;
+
+// Table 70 -- TPM2B_AUTH Types <I/O>
+typedef TPM2B_DIGEST    TPM2B_AUTH;
+
+// Table 71 -- TPM2B_OPERAND Types <I/O>
+typedef TPM2B_DIGEST    TPM2B_OPERAND;
+
+// Table 66 -- TPMT_HA Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    TPMU_HA          digest;
+} TPMT_HA;
+
+//Table 80 -- TPM2B_NAME Structure
+typedef struct {
+    UINT16 size;
+    BYTE name[sizeof(TPMT_HA)];
+} TPM2B_NAME;
+
+#define    IMPLEMENTATION_PCR   24
+#define    PLATFORM_PCR         24
+#define    PCR_SELECT_MAX       ((IMPLEMENTATION_PCR+7)/8)
+
+//Table 79 -- TPMS_PCR_SELECT Structure <I/O>
+typedef struct {
+    UINT8    sizeofSelect;
+    BYTE     pcrSelect[PCR_SELECT_MAX];
+} TPMS_PCR_SELECT;
+
+// Table 80 -- TPMS_PCR_SELECTION Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hash;
+    UINT8            sizeofSelect;
+    BYTE             pcrSelect[PCR_SELECT_MAX];
+} TPMS_PCR_SELECTION;
+
+// Table 83 -- TPMT_TK_CREATION Structure <I/O>
+typedef struct {
+    TPM_ST               tag;
+    TPMI_RH_HIERARCHY    hierarchy;
+    TPM2B_DIGEST         digest;
+} TPMT_TK_CREATION;
+
+// Table 96 -- Definition of TPML_DIGEST Structure <I/O>
+typedef struct {
+    UINT32               count;
+    TPM2B_DIGEST         digests[8];
+}TPML_DIGEST;
+
+// Table 97 -- TPML_PCR_SELECTION Structure <I/O>
+typedef struct {
+    UINT32                count;
+    TPMS_PCR_SELECTION    pcrSelections[HASH_COUNT];
+} TPML_PCR_SELECTION;
+
+// Table 119 -- TPMI_AES_KEY_BITS Type <I/O>
+typedef TPM_KEY_BITS TPMI_AES_KEY_BITS;
+
+// Table 120 -- TPMI_SM4_KEY_BITS Type <I/O>
+typedef TPM_KEY_BITS TPMI_SM4_KEY_BITS;
+
+// Table 121 -- TPMU_SYM_KEY_BITS Union <I/O>
+typedef union {
+#ifdef TPM2_ALG_AES
+    TPMI_AES_KEY_BITS  aes;
+#endif
+#ifdef TPM2_ALG_SM4
+    TPMI_SM4_KEY_BITS  SM4;
+#endif
+    TPM_KEY_BITS  sym;
+#ifdef TPM2_ALG_XOR
+    TPMI_ALG_HASH  xor;
+#endif
+
+} TPMU_SYM_KEY_BITS;
+
+// Table 122 -- TPMU_SYM_MODE Union <I/O>
+typedef union {
+#ifdef TPM2_ALG_AES
+    TPMI_ALG_SYM_MODE  aes;
+#endif
+#ifdef TPM2_ALG_SM4
+    TPMI_ALG_SYM_MODE  SM4;
+#endif
+    TPMI_ALG_SYM_MODE  sym;
+} TPMU_SYM_MODE ;
+
+// Table 124 -- TPMT_SYM_DEF Structure <I/O>
+typedef struct {
+    TPMI_ALG_SYM         algorithm;
+    TPMU_SYM_KEY_BITS    keyBits;
+    TPMU_SYM_MODE        mode;
+} TPMT_SYM_DEF;
+
+// Table 125 -- TPMT_SYM_DEF_OBJECT Structure <I/O>
+typedef struct {
+    TPMI_ALG_SYM_OBJECT    algorithm;
+    TPMU_SYM_KEY_BITS      keyBits;
+    TPMU_SYM_MODE          mode;
+} TPMT_SYM_DEF_OBJECT;
+
+// Table 126 -- TPM2B_SYM_KEY Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_SYM_KEY_BYTES];
+} TPM2B_SYM_KEY;
+
+// Table 127 -- TPMS_SYMCIPHER_PARMS Structure <I/O>
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    sym;
+} TPMS_SYMCIPHER_PARMS;
+
+// Table 128 -- TPM2B_SENSITIVE_DATA Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_SYM_DATA];
+} TPM2B_SENSITIVE_DATA;
+
+// Table 129 -- TPMS_SENSITIVE_CREATE Structure <I>
+typedef struct {
+    TPM2B_AUTH              userAuth;
+    TPM2B_SENSITIVE_DATA    data;
+} TPMS_SENSITIVE_CREATE;
+
+// Table 130 -- TPM2B_SENSITIVE_CREATE Structure <I,S>
+typedef struct {
+    UINT16                   size;
+    TPMS_SENSITIVE_CREATE    sensitive;
+} TPM2B_SENSITIVE_CREATE;
+
+// Table 131 -- TPMS_SCHEME_SIGHASH Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_SIGHASH;
+
+// Table 132 -- TPMI_ALG_KEYEDHASH_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_KEYEDHASH_SCHEME;
+
+// Table 133 -- HMAC_SIG_SCHEME Types <I/O>
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_HMAC;
+
+// Table 134 -- TPMS_SCHEME_XOR Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    TPMI_ALG_KDF     kdf;
+} TPMS_SCHEME_XOR;
+
+// Table 135 -- TPMU_SCHEME_KEYEDHASH Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_HMAC
+    TPMS_SCHEME_HMAC  hmac;
+#endif
+#ifdef TPM2_ALG_XOR
+    TPMS_SCHEME_XOR  xor;
+#endif
+
+} TPMU_SCHEME_KEYEDHASH ;
+
+// Table 136 -- TPMT_KEYEDHASH_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_KEYEDHASH_SCHEME    scheme;
+    TPMU_SCHEME_KEYEDHASH        details;
+} TPMT_KEYEDHASH_SCHEME;
+
+// Table 137 -- RSA_SIG_SCHEMES Types <I/O>
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_RSASSA;
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_RSAPSS;
+
+// Table 138 -- ECC_SIG_SCHEMES Types <I/O>
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_ECDSA;
+typedef TPMS_SCHEME_SIGHASH    TPMS_SCHEME_SM2;
+
+// Table 139 -- TPMS_SCHEME_ECDAA Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    UINT16           count;
+} TPMS_SCHEME_ECDAA;
+
+// Table 140 -- TPMS_SCHEME_ECSCHNORR Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+    UINT16           count;
+} TPMS_SCHEME_ECSCHNORR;
+
+// Table 141 -- TPMU_SIG_SCHEME Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_RSASSA
+    TPMS_SCHEME_RSASSA  rsassa;
+#endif
+#ifdef TPM2_ALG_RSAPSS
+    TPMS_SCHEME_RSAPSS  rsapss;
+#endif
+#ifdef TPM2_ALG_ECDSA
+    TPMS_SCHEME_ECDSA  ecdsa;
+#endif
+#ifdef TPM2_ALG_SM2
+    TPMS_SCHEME_SM2  sm2;
+#endif
+#ifdef TPM2_ALG_ECDAA
+    TPMS_SCHEME_ECDAA  ecdaa;
+#endif
+#ifdef TPM2_ALG_ECSCHNORR
+    TPMS_SCHEME_ECSCHNORR  ecSchnorr;
+#endif
+#ifdef TPM2_ALG_HMAC
+    TPMS_SCHEME_HMAC  hmac;
+#endif
+    TPMS_SCHEME_SIGHASH  any;
+} TPMU_SIG_SCHEME;
+
+// Table 142 -- TPMT_SIG_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_SIG_SCHEME    scheme;
+    TPMU_SIG_SCHEME        details;
+} TPMT_SIG_SCHEME;
+
+// Table 143 -- TPMS_SCHEME_OAEP Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_OAEP;
+
+// Table 144 -- TPMS_SCHEME_ECDH Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_ECDH;
+
+// Table 145 -- TPMS_SCHEME_MGF1 Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_MGF1;
+
+// Table 146 -- TPMS_SCHEME_KDF1_SP800_56a Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_KDF1_SP800_56a;
+
+// Table 147 -- TPMS_SCHEME_KDF2 Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_KDF2;
+
+// Table 148 -- TPMS_SCHEME_KDF1_SP800_108 Structure <I/O>
+typedef struct {
+    TPMI_ALG_HASH    hashAlg;
+} TPMS_SCHEME_KDF1_SP800_108;
+
+// Table 149 -- TPMU_KDF_SCHEME Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_MGF1
+    TPMS_SCHEME_MGF1  mgf1;
+#endif
+#ifdef TPM2_ALG_KDF1_SP800_56a
+    TPMS_SCHEME_KDF1_SP800_56a  kdf1_SP800_56a;
+#endif
+#ifdef TPM2_ALG_KDF2
+    TPMS_SCHEME_KDF2  kdf2;
+#endif
+#ifdef TPM2_ALG_KDF1_SP800_108
+    TPMS_SCHEME_KDF1_SP800_108  kdf1_sp800_108;
+#endif
+
+} TPMU_KDF_SCHEME;
+
+// Table 150 -- TPMT_KDF_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_KDF       scheme;
+    TPMU_KDF_SCHEME    details;
+} TPMT_KDF_SCHEME;
+typedef TPM_ALG_ID TPMI_ALG_ASYM_SCHEME;
+
+// Table 152 -- TPMU_ASYM_SCHEME Union <I/O>
+typedef union {
+#ifdef TPM2_ALG_RSASSA
+    TPMS_SCHEME_RSASSA  rsassa;
+#endif
+#ifdef TPM2_ALG_RSAPSS
+    TPMS_SCHEME_RSAPSS  rsapss;
+#endif
+#ifdef TPM2_ALG_OAEP
+    TPMS_SCHEME_OAEP  oaep;
+#endif
+#ifdef TPM2_ALG_ECDSA
+    TPMS_SCHEME_ECDSA  ecdsa;
+#endif
+#ifdef TPM2_ALG_SM2
+    TPMS_SCHEME_SM2  sm2;
+#endif
+#ifdef TPM2_ALG_ECDAA
+    TPMS_SCHEME_ECDAA  ecdaa;
+#endif
+#ifdef TPM2_ALG_ECSCHNORR
+    TPMS_SCHEME_ECSCHNORR  ecSchnorr;
+#endif
+    TPMS_SCHEME_SIGHASH  anySig;
+} TPMU_ASYM_SCHEME;
+
+typedef struct {
+    TPMI_ALG_ASYM_SCHEME    scheme;
+    TPMU_ASYM_SCHEME        details;
+} TPMT_ASYM_SCHEME;
+
+// Table 154 -- TPMI_ALG_RSA_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_RSA_SCHEME;
+
+// Table 155 -- TPMT_RSA_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_RSA_SCHEME    scheme;
+    TPMU_ASYM_SCHEME       details;
+} TPMT_RSA_SCHEME;
+
+// Table 156 -- TPMI_ALG_RSA_DECRYPT Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_RSA_DECRYPT;
+
+// Table 157 -- TPMT_RSA_DECRYPT Structure <I/O>
+typedef struct {
+    TPMI_ALG_RSA_DECRYPT    scheme;
+    TPMU_ASYM_SCHEME        details;
+} TPMT_RSA_DECRYPT;
+
+// Table 158 -- TPM2B_PUBLIC_KEY_RSA Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_RSA_KEY_BYTES];
+} TPM2B_PUBLIC_KEY_RSA;
+
+// Table 159 -- TPMI_RSA_KEY_BITS Type <I/O>
+typedef TPM_KEY_BITS TPMI_RSA_KEY_BITS;
+
+// Table 160 -- TPM2B_PRIVATE_KEY_RSA Structure <I/O>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[MAX_RSA_KEY_BYTES/2];
+} TPM2B_PRIVATE_KEY_RSA;
+
+// Table 162 -- TPM2B_ECC_PARAMETER
+typedef struct {
+    UINT16 size;
+    BYTE buffer[MAX_ECC_KEY_BYTES];
+} TPM2B_ECC_PARAMETER;
+
+// Table 163 -- TPMS_ECC_POINT Structure <I/O>
+typedef struct {
+    TPM2B_ECC_PARAMETER    x;
+    TPM2B_ECC_PARAMETER    y;
+} TPMS_ECC_POINT;
+
+// Table 164 -- TPMI_ALG_ECC_SCHEME Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_ECC_SCHEME;
+
+typedef UINT16 TPM_ECC_CURVE;
+
+// Table 165 -- TPMI_ECC_CURVE Type <I/O>
+typedef TPM_ECC_CURVE TPMI_ECC_CURVE;
+
+// Table 166 -- TPMT_ECC_SCHEME Structure <I/O>
+typedef struct {
+    TPMI_ALG_ECC_SCHEME    scheme;
+    TPMU_SIG_SCHEME        details;
+} TPMT_ECC_SCHEME;
+
+// Table 175 -- TPMI_ALG_PUBLIC Type <I/O>
+typedef TPM_ALG_ID TPMI_ALG_PUBLIC;
+
+// Table 176 -- TPMU_PUBLIC_ID Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_KEYEDHASH
+    TPM2B_DIGEST  keyedHash;
+#endif
+#ifdef TPM2_ALG_SYMCIPHER
+    TPM2B_DIGEST  sym;
+#endif
+#ifdef TPM2_ALG_RSA
+    TPM2B_PUBLIC_KEY_RSA  rsa;
+#endif
+#ifdef TPM2_ALG_ECC
+    TPMS_ECC_POINT  ecc;
+#endif
+} TPMU_PUBLIC_ID;
+
+// Table 177 -- TPMS_KEYEDHASH_PARMS Structure <I/O>
+typedef struct {
+    TPMT_KEYEDHASH_SCHEME    scheme;
+} TPMS_KEYEDHASH_PARMS;
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    symmetric;
+    TPMT_ASYM_SCHEME       scheme;
+} TPMS_ASYM_PARMS;
+
+// Table 179 -- TPMS_RSA_PARMS Structure <I/O>
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    symmetric;
+    TPMT_RSA_SCHEME        scheme;
+    TPMI_RSA_KEY_BITS      keyBits;
+    UINT32                 exponent;
+} TPMS_RSA_PARMS;
+
+// Table 180 -- TPMS_ECC_PARMS Structure <I/O>
+typedef struct {
+    TPMT_SYM_DEF_OBJECT    symmetric;
+    TPMT_ECC_SCHEME        scheme;
+    TPMI_ECC_CURVE         curveID;
+    TPMT_KDF_SCHEME        kdf;
+} TPMS_ECC_PARMS;
+
+// Table 181 -- TPMU_PUBLIC_PARMS Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_KEYEDHASH
+    TPMS_KEYEDHASH_PARMS  keyedHashDetail;
+#endif
+#ifdef TPM2_ALG_SYMCIPHER
+    TPMT_SYM_DEF_OBJECT  symDetail;
+#endif
+#ifdef TPM2_ALG_RSA
+    TPMS_RSA_PARMS  rsaDetail;
+#endif
+#ifdef TPM2_ALG_ECC
+    TPMS_ECC_PARMS  eccDetail;
+#endif
+    TPMS_ASYM_PARMS  asymDetail;
+} TPMU_PUBLIC_PARMS;
+
+// Table 182 -- TPMT_PUBLIC_PARMS Structure <I/O>
+typedef struct {
+    TPMI_ALG_PUBLIC      type;
+    TPMU_PUBLIC_PARMS    parameters;
+} TPMT_PUBLIC_PARMS;
+
+// Table 183 -- TPMT_PUBLIC Structure <I/O>
+typedef struct {
+    TPMI_ALG_PUBLIC      type;
+    TPMI_ALG_HASH        nameAlg;
+    TPMA_OBJECT          objectAttributes;
+    TPM2B_DIGEST         authPolicy;
+    TPMU_PUBLIC_PARMS    parameters;
+    TPMU_PUBLIC_ID       unique;
+} TPMT_PUBLIC;
+
+// Table 184 -- TPM2B_PUBLIC
+typedef struct {
+    UINT16         size;
+    TPMT_PUBLIC    publicArea;
+} TPM2B_PUBLIC;
+
+// Table 185 -- TPMU_SENSITIVE_COMPOSITE Union <I/O,S>
+typedef union {
+#ifdef TPM2_ALG_RSA
+    TPM2B_PRIVATE_KEY_RSA  rsa;
+#endif
+#ifdef TPM2_ALG_ECC
+    TPM2B_ECC_PARAMETER  ecc;
+#endif
+#ifdef TPM2_ALG_KEYEDHASH
+    TPM2B_SENSITIVE_DATA  bits;
+#endif
+#ifdef TPM2_ALG_SYMCIPHER
+    TPM2B_SYM_KEY  sym;
+#endif
+    TPM2B_SENSITIVE_DATA  any;
+} TPMU_SENSITIVE_COMPOSITE;
+
+// Table 186 -- TPMT_SENSITIVE Structure <I/O>
+typedef struct {
+    TPMI_ALG_PUBLIC             sensitiveType;
+    TPM2B_AUTH                  authValue;
+    TPM2B_DIGEST                seedValue;
+    TPMU_SENSITIVE_COMPOSITE    sensitive;
+} TPMT_SENSITIVE;
+
+// Table 187 -- TPM2B_SENSITIVE Structure <I/O>
+typedef struct {
+    UINT16            size;
+    TPMT_SENSITIVE    sensitiveArea;
+} TPM2B_SENSITIVE;
+
+typedef struct {
+    TPM2B_DIGEST      integrityOuter;
+    TPM2B_DIGEST      integrityInner;
+    TPMT_SENSITIVE    sensitive;
+} _PRIVATE;
+
+// Table 189 -- TPM2B_PRIVATE Structure <I/O,S>
+typedef struct {
+    UINT16    size;
+    BYTE      buffer[sizeof(_PRIVATE)];
+} TPM2B_PRIVATE;
+
+// Table 204 -- TPMS_CREATION_DATA <OUT>
+typedef struct {
+    TPML_PCR_SELECTION    pcrSelect;
+    TPM2B_DIGEST          pcrDigest;
+    TPMA_LOCALITY         locality;
+    TPM_ALG_ID            parentNameAlg;
+    TPM2B_NAME            parentName;
+    TPM2B_NAME            parentQualifiedName;
+    TPM2B_DATA            outsideInfo;
+} TPMS_CREATION_DATA;
+
+// Table 205 -- TPM2B_CREATION_DATA <OUT>
+typedef struct {
+    UINT16 size;
+    TPMS_CREATION_DATA creationData;
+} TPM2B_CREATION_DATA;
+
+/* the following structs is not part of standard struct defined in TPM2 spec */
+typedef struct {
+    UINT32            size;
+    TPM_RH            sessionHandle;
+    TPM2B_NONCE       nonce;
+    TPMA_SESSION      sessionAttributes;
+    TPM2B_AUTH        auth;
+} TPM_AuthArea;
+
+typedef struct {
+    TPM2B_SENSITIVE_CREATE  inSensitive;
+    TPM2B_PUBLIC            inPublic;
+    TPM2B_DATA              outsideInfo;
+    TPML_PCR_SELECTION      creationPCR;
+} TPM2_Create_Params_in;
+
+typedef TPM2_Create_Params_in    TPM2_CreatePrimary_Params_in;
+
+typedef struct {
+    TPM2B_PUBLIC        outPublic;
+    TPM2B_CREATION_DATA creationData;
+    TPM2B_DIGEST        creationHash;
+    TPMT_TK_CREATION    creationTicket;
+    TPM2B_NAME          name;
+} TPM2_CreatePrimary_Params_out;
+
+typedef struct {
+    TPM2B_PRIVATE       outPrivate;
+    TPM2B_PUBLIC        outPublic;
+    TPM2B_CREATION_DATA creationData;
+    TPM2B_DIGEST        creationHash;
+    TPMT_TK_CREATION    creationTicket;
+} TPM2_Create_Params_out;
+typedef struct {
+    TPM2B_PRIVATE    Private;
+    TPM2B_PUBLIC     Public;
+} TPM2_RSA_KEY;
+
+/*
+ * TPM 2.0 Objects
+ */
+
+#define TPM_HT_TRANSIENT        0x80
+#define HR_SHIFT                24
+#define HR_PERMANENT            (TPM_HT_TRANSIENT << HR_SHIFT)
+#define TRANSIENT_FIRST         (HR_PERMANENT)
+#define MAX_LOADED_OBJECTS      3
+#define TRANSIENT_LAST          (TRANSIENT_FIRST+MAX_LOADED_OBJECTS-1)
+/*
+ * TPMA_OBJECT Bits
+ */
+#define fixedTPM                ((1 << 1))
+#define stClear                 ((1 << 2))
+#define fixedParent             ((1 << 4))
+#define sensitiveDataOrigin     ((1 << 5))
+#define userWithAuth            ((1 << 6))
+#define adminWithPolicy         ((1 << 7))
+#define noDA                    ((1 << 10))
+#define encryptedDuplication    ((1 << 11))
+#define restricted              ((1 << 16))
+#define decrypt                 ((1 << 17))
+#define sign                    ((1 << 18))
+#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 Tue Feb 03 08:03:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03: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 1YIYSi-0006KY-B9; Tue, 03 Feb 2015 08:03: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 1YIYSg-0006KO-VK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:55 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	F7/B3-03000-AE080D45; Tue, 03 Feb 2015 08:03:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950631!12130309!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1807 invoked from network); 3 Feb 2015 08:03:52 -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;
	3 Feb 2015 08:03:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSd-0005VL-L4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSd-0006au-Ji
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:51 +0000
Date: Tue, 03 Feb 2015 08:03:51 +0000
Message-Id: <E1YIYSd-0006au-Ji@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM 2.0 data structures
	marshal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a10a705b33eb25f5796a5f4008c6c477a98a716
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:41 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: TPM 2.0 data structures marshal
    
    Add TPM 2.0 data structure marshal for packing and unpacking TPM
    2.0 data structures.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/tpm2_marshal.h |  673 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 673 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/tpm2_marshal.h b/stubdom/vtpmmgr/tpm2_marshal.h
new file mode 100644
index 0000000..aaa4464
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2_marshal.h
@@ -0,0 +1,673 @@
+/*
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Authors:
+ *   Quan Xu <quan.xu@intel.com>
+ *
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef TPM2_MARSHAL_H
+#define TPM2_MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+#include "tpm2_types.h"
+#include <assert.h>
+
+#define pack_TPM_BUFFER(ptr, buf, size) pack_BUFFER(ptr, buf, size)
+#define unpack_TPM_BUFFER(ptr, buf, size) unpack_BUFFER(ptr, buf, size)
+
+inline BYTE* pack_BYTE_ARRAY(BYTE* ptr, const BYTE* array, UINT32 size)
+{
+    int i;
+    for (i = 0; i < size; i++)
+         ptr = pack_BYTE(ptr, array[i]);
+    return ptr;
+}
+
+inline BYTE* pack_TPMA_SESSION(BYTE* ptr, const TPMA_SESSION *attr)
+{
+    return pack_BYTE(ptr, (BYTE)(*attr));
+}
+
+inline BYTE* unpack_TPMA_SESSION(BYTE* ptr, TPMA_SESSION *attr)
+{
+    return unpack_BYTE(ptr, (BYTE *)attr);
+}
+
+inline BYTE* pack_TPMI_ALG_HASH(BYTE* ptr, const TPMI_ALG_HASH *hash)
+{
+    return pack_UINT16(ptr, *hash);
+}
+
+inline BYTE* unpack_TPMI_ALG_HASH(BYTE *ptr, TPMI_ALG_HASH *hash)
+{
+    return unpack_UINT16(ptr, hash);
+}
+
+#define pack_TPMA_OBJECT(ptr, t)                pack_UINT32(ptr, (UINT32)(*t))
+#define unpack_TPMA_OBJECT(ptr, t)              unpack_UINT32(ptr, (UINT32 *)(t))
+#define pack_TPM_RH(ptr, t)                     pack_UINT32(ptr, (UINT32)(*t))
+#define unpack_TPM_RH(ptr, t)                   unpack_UINT32(ptr, (UINT32 *)(t))
+#define pack_TPMA_LOCALITY(ptr, locality)       pack_BYTE(ptr, (BYTE)*locality)
+#define unpack_TPMA_LOCALITY(ptr, locality)     unpack_BYTE(ptr, (BYTE *)locality)
+#define pack_TPM_ST(ptr, tag)                   pack_UINT16(ptr, *tag)
+#define unpack_TPM_ST(ptr, tag)                 unpack_UINT16(ptr, tag)
+#define pack_TPM_KEY_BITS(ptr, t)               pack_UINT16(ptr, *t)
+#define unpack_TPM_KEY_BITS(ptr, t)             unpack_UINT16(ptr, t)
+#define pack_TPMI_AES_KEY_BITS(ptr, t)          pack_TPM_KEY_BITS(ptr, t)
+#define unpack_TPMI_AES_KEY_BITS(ptr, t)        unpack_TPM_KEY_BITS(ptr, t)
+#define pack_TPMI_RSA_KEY_BITS(ptr, t)          pack_TPM_KEY_BITS(ptr, t)
+#define unpack_TPMI_RSA_KEY_BITS(ptr, t)        unpack_TPM_KEY_BITS(ptr, t)
+#define pack_TPM_ALG_ID(ptr, id)                pack_UINT16(ptr, *id)
+#define unpack_TPM_ALG_ID(ptr, id)              unpack_UINT16(ptr, id)
+#define pack_TPM_ALG_SYM(ptr, t)                pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPM_ALG_SYM(ptr, t)              unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_ASYM(ptr, asym)           pack_TPM_ALG_ID(ptr, asym)
+#define unpack_TPMI_ALG_ASYM(ptr, asym)         unpack_TPM_ALG_ID(ptr, asym)
+#define pack_TPMI_ALG_SYM_OBJECT(ptr, t)        pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_SYM_OBJECT(ptr, t)      unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_SYM_MODE(ptr, t)          pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_SYM_MODE(ptr, t)        unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_KDF(ptr, t)               pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_KDF(ptr, t)             unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_PUBLIC(ptr, t)            pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_PUBLIC(ptr, t)          unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPM2_HANDLE(ptr, h)                pack_UINT32(ptr, *h)
+#define unpack_TPM2_HANDLE(ptr, h)              unpack_UINT32(ptr, h)
+#define pack_TPMI_ALG_RSA_SCHEME(ptr, t)        pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_RSA_SCHEME(ptr, t)      unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_DH_OBJECT(ptr, o)             pack_TPM2_HANDLE(ptr, o)
+#define unpack_TPMI_DH_OBJECT(PTR, O)           unpack_TPM2_HANDLE(ptr, o)
+#define pack_TPMI_RH_HIERACHY(ptr, h)           pack_TPM2_HANDLE(ptr, h)
+#define unpack_TPMI_RH_HIERACHY(ptr, h)         unpack_TPM2_HANDLE(ptr, h)
+#define pack_TPMI_RH_PLATFORM(ptr, p)           pack_TPM2_HANDLE(ptr, p)
+#define unpack_TPMI_RH_PLATFORM(ptr, p)         unpack_TPM2_HANDLE(ptr, p)
+#define pack_TPMI_RH_OWNER(ptr, o)              pack_TPM2_HANDLE(ptr, o)
+#define unpack_TPMI_RH_OWNER(ptr, o)            unpack_TPM2_HANDLE(ptr, o)
+#define pack_TPMI_RH_ENDORSEMENT(ptr, e)        pack_TPM2_HANDLE(ptr, e)
+#define unpack_TPMI_RH_ENDORSEMENT(ptr, e)      unpack_TPM2_HANDLE(ptr, e)
+#define pack_TPMI_RH_LOCKOUT(ptr, l)            pack_TPM2_HANDLE(ptr, l)
+#define unpack_TPMI_RH_LOCKOUT(ptr, l)          unpack_TPM2_HANDLE(ptr, l)
+
+inline BYTE* pack_TPM2B_DIGEST(BYTE* ptr, const TPM2B_DIGEST *digest)
+{
+    ptr = pack_UINT16(ptr, digest->size);
+    ptr = pack_BUFFER(ptr, digest->buffer, digest->size);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_DIGEST(BYTE* ptr, TPM2B_DIGEST *digest)
+{
+    ptr = unpack_UINT16(ptr, &digest->size);
+    ptr = unpack_BUFFER(ptr, digest->buffer, digest->size);
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_TK_CREATION(BYTE* ptr,const TPMT_TK_CREATION *ticket )
+{
+    ptr = pack_TPM_ST(ptr , &ticket->tag);
+    ptr = pack_TPMI_RH_HIERACHY(ptr , &ticket->hierarchy);
+    ptr = pack_TPM2B_DIGEST(ptr, &ticket->digest);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_TK_CREATION(BYTE* ptr, TPMT_TK_CREATION *ticket )
+{
+    ptr = unpack_TPM_ST(ptr, &ticket->tag);
+    ptr = unpack_TPMI_RH_HIERACHY(ptr, &ticket->hierarchy);
+    ptr = unpack_TPM2B_DIGEST(ptr, &ticket->digest);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_NAME(BYTE* ptr,const TPM2B_NAME *name )
+{
+    ptr = pack_UINT16(ptr, name->size);
+    ptr = pack_TPM_BUFFER(ptr, name->name, name->size);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_NAME(BYTE* ptr, TPM2B_NAME *name)
+{
+    ptr = unpack_UINT16(ptr, &name->size);
+    ptr = unpack_TPM_BUFFER(ptr, name->name, name->size);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_NONCE(BYTE* ptr, const TPM2B_NONCE *nonce)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)nonce);
+}
+
+#define unpack_TPM2B_NONCE(ptr, nonce)  unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)nonce)
+
+inline BYTE* pack_TPM2B_AUTH(BYTE* ptr, const TPM2B_AUTH *auth)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)auth);
+}
+
+#define unpack_TPM2B_AUTH(ptr, auth)    unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)auth)
+
+inline BYTE* pack_TPM2B_DATA(BYTE* ptr, const TPM2B_DATA *data)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)data);
+}
+
+#define unpack_TPM2B_DATA(ptr, data)    unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)data)
+
+inline BYTE* pack_TPM2B_SENSITIVE_DATA(BYTE* ptr, const TPM2B_SENSITIVE_DATA *data)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)data);
+}
+
+#define unpack_TPM2B_SENSITIVE_DATA(ptr, data)  unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)data)
+
+inline BYTE* pack_TPM2B_PUBLIC_KEY_RSA(BYTE* ptr, const TPM2B_PUBLIC_KEY_RSA *rsa)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)rsa);
+}
+
+#define unpack_TPM2B_PUBLIC_KEY_RSA(ptr, rsa)   unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)rsa)
+
+inline BYTE* pack_TPM2B_PRIVATE(BYTE* ptr, const TPM2B_PRIVATE *Private)
+{
+    ptr = pack_UINT16(ptr, Private->size);
+    ptr = pack_TPM_BUFFER(ptr, Private->buffer, Private->size);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_PRIVATE(BYTE* ptr, TPM2B_PRIVATE *Private)
+{
+    ptr = unpack_UINT16(ptr, &Private->size);
+    ptr = unpack_BUFFER(ptr, Private->buffer, Private->size);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_PCR_SELECTION_ARRAY(BYTE* ptr, const TPMS_PCR_SELECTION *sel, UINT32 count)
+{
+    int i;
+    for (i = 0; i < count; i++) {
+        ptr = pack_TPMI_ALG_HASH(ptr, &sel[i].hash);
+        ptr = pack_BYTE(ptr, sel[i].sizeofSelect);
+        ptr = pack_BUFFER(ptr, sel[i].pcrSelect, sel[i].sizeofSelect);
+    }
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_PCR_SELECTION_ARRAY(BYTE* ptr, TPMS_PCR_SELECTION *sel, UINT32 count)
+{
+    int i;
+    for (i = 0; i < count; i++) {
+        ptr = unpack_TPMI_ALG_HASH(ptr, &sel[i].hash);
+        ptr = unpack_BYTE(ptr, &sel[i].sizeofSelect);
+        ptr = unpack_BUFFER(ptr, sel[i].pcrSelect, sel[i].sizeofSelect);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPML_PCR_SELECTION(BYTE* ptr, const TPML_PCR_SELECTION *sel)
+{
+    ptr = pack_UINT32(ptr, sel->count);
+    ptr = pack_TPMS_PCR_SELECTION_ARRAY(ptr, sel->pcrSelections, sel->count);
+    return ptr;
+}
+
+inline BYTE* unpack_TPML_PCR_SELECTION(BYTE* ptr, TPML_PCR_SELECTION *sel)
+{
+    ptr = unpack_UINT32(ptr, &sel->count);
+    ptr = unpack_TPMS_PCR_SELECTION_ARRAY(ptr, sel->pcrSelections, sel->count);
+    return ptr;
+}
+
+inline BYTE* unpack_TPML_DIGEST(BYTE* ptr,TPML_DIGEST *digest)
+{
+    int i;
+    ptr = unpack_UINT32(ptr, &digest->count);
+    for (i=0;i<digest->count;i++)
+    {
+        ptr = unpack_TPM2B_DIGEST(ptr, &digest->digests[i]);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_CREATION_DATA(BYTE* ptr,const TPMS_CREATION_DATA *data)
+{
+    ptr = pack_TPML_PCR_SELECTION(ptr, &data->pcrSelect);
+    ptr = pack_TPM2B_DIGEST(ptr, &data->pcrDigest);
+    ptr = pack_TPMA_LOCALITY(ptr, &data->locality);
+    ptr = pack_TPM_ALG_ID(ptr, &data->parentNameAlg);
+    ptr = pack_TPM2B_NAME(ptr, &data->parentQualifiedName);
+    ptr = pack_TPM2B_DATA(ptr, &data->outsideInfo);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_CREATION_DATA(BYTE* ptr, TPMS_CREATION_DATA *data)
+{
+    ptr = unpack_TPML_PCR_SELECTION(ptr, &data->pcrSelect);
+    ptr = unpack_TPM2B_DIGEST(ptr, &data->pcrDigest);
+    ptr = unpack_TPMA_LOCALITY(ptr, &data->locality);
+    ptr = unpack_TPM_ALG_ID(ptr, &data->parentNameAlg);
+    ptr = unpack_TPM2B_NAME(ptr, &data->parentName);
+    ptr = unpack_TPM2B_NAME(ptr, &data->parentQualifiedName);
+    ptr = unpack_TPM2B_DATA(ptr, &data->outsideInfo);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_CREATION_DATA(BYTE* ptr, const TPM2B_CREATION_DATA *data )
+{
+    ptr = pack_UINT16(ptr, data->size);
+    ptr = pack_TPMS_CREATION_DATA(ptr, &data->creationData);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_CREATION_DATA(BYTE* ptr, TPM2B_CREATION_DATA * data)
+{
+    ptr = unpack_UINT16(ptr, &data->size);
+    ptr = unpack_TPMS_CREATION_DATA(ptr, &data->creationData);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_SENSITIVE_CREATE(BYTE* ptr, const TPMS_SENSITIVE_CREATE *create)
+{
+    ptr = pack_TPM2B_AUTH(ptr, &create->userAuth);
+    ptr = pack_TPM2B_SENSITIVE_DATA(ptr, &create->data);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_SENSITIVE_CREATE(BYTE* ptr, const TPM2B_SENSITIVE_CREATE *create)
+{
+    BYTE* sizePtr = ptr;
+    ptr += 2;
+    ptr = pack_TPMS_SENSITIVE_CREATE(ptr, &create->sensitive);
+    pack_UINT16(sizePtr, (UINT16)(ptr - sizePtr - 2));
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_SYM_MODE(BYTE* ptr, const TPMU_SYM_MODE *p,
+                                const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = pack_TPMI_ALG_SYM_MODE(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+        case TPM2_ALG_XOR:
+        break;
+    default:
+        ptr = pack_TPMI_ALG_SYM_MODE(ptr, &p->sym);
+    }
+    return ptr;
+}
+inline BYTE* unpack_TPMU_SYM_MODE(BYTE* ptr, TPMU_SYM_MODE *p,
+                                  const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = unpack_TPMI_ALG_SYM_MODE(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+    case TPM2_ALG_XOR:
+        break;
+    default:
+        ptr = unpack_TPMI_ALG_SYM_MODE(ptr, &p->sym);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_SYM_KEY_BITS(BYTE* ptr, const TPMU_SYM_KEY_BITS *p,
+                                    const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = pack_TPMI_AES_KEY_BITS(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_XOR:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        ptr = pack_TPM_KEY_BITS(ptr, &p->sym);
+    }
+    return ptr;
+}
+
+inline BYTE* unpack_TPMU_SYM_KEY_BITS(BYTE* ptr, TPMU_SYM_KEY_BITS *p,
+                                      const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = unpack_TPMI_AES_KEY_BITS(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_XOR:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        ptr = unpack_TPM_KEY_BITS(ptr, &p->sym);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_SYM_DEF_OBJECT(BYTE* ptr, const TPMT_SYM_DEF_OBJECT *p)
+{
+    ptr = pack_TPMI_ALG_SYM_OBJECT(ptr, &p->algorithm);
+    ptr = pack_TPMU_SYM_KEY_BITS(ptr, &p->keyBits, &p->algorithm);
+    ptr = pack_TPMU_SYM_MODE(ptr, &p->mode, &p->algorithm);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_SYM_DEF_OBJECT(BYTE *ptr, TPMT_SYM_DEF_OBJECT *p)
+{
+    ptr = unpack_TPMI_ALG_SYM_OBJECT(ptr, &p->algorithm);
+    ptr = unpack_TPMU_SYM_KEY_BITS(ptr, &p->keyBits, &p->algorithm);
+    ptr = unpack_TPMU_SYM_MODE(ptr, &p->mode, &p->algorithm);
+    return ptr;
+}
+
+#define pack_TPMS_SCHEME_OAEP(p, t)     pack_TPMI_ALG_HASH(p, &((t)->hashAlg))
+#define unpack_TPMS_SCHEME_OAEP(p, t)   unpack_TPMI_ALG_HASH(p, &((t)->hashAlg))
+
+inline BYTE* pack_TPMU_ASYM_SCHEME(BYTE *ptr, const TPMU_ASYM_SCHEME *p,
+                                   const TPMI_ALG_RSA_SCHEME *s)
+{
+    switch(*s) {
+#ifdef TPM2_ALG_RSASSA
+    case TPM2_ALG_RSASSA:
+        assert(false || "TPM2_ALG_RSASSA");
+        break;
+#endif
+#ifdef TPM2_ALG_OAEP
+    case TPM2_ALG_OAEP:
+        ptr = pack_TPMS_SCHEME_OAEP(ptr, &p->oaep);
+        break;
+#endif
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        assert(false || "DEFAULT");
+    }
+    return ptr;
+}
+
+inline BYTE* unpack_TPMU_ASYM_SCHEME(BYTE *ptr, TPMU_ASYM_SCHEME *p,
+                                     const TPMI_ALG_RSA_SCHEME *s)
+{
+    switch(*s) {
+    #ifdef TPM2_ALG_RSASSA
+    case TPM2_ALG_RSASSA:
+        printf("not support TPM_ALG_RSASSA\n");
+        assert(false);
+        break;
+    #endif
+    #ifdef TPM2_ALG_OAEP
+    case TPM2_ALG_OAEP:
+        ptr = unpack_TPMS_SCHEME_OAEP(ptr, &p->oaep);
+        break;
+    #endif
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        printf("default TPMI_ALG_RSA_SCHEME 0x%X\n", (UINT32)*s);
+        ptr = unpack_TPMI_ALG_HASH(ptr, &p->anySig.hashAlg);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_RSA_SCHEME(BYTE* ptr, const TPMT_RSA_SCHEME *p)
+{
+    ptr = pack_TPMI_ALG_RSA_SCHEME(ptr, &p->scheme);
+    ptr = pack_TPMU_ASYM_SCHEME(ptr, &p->details, &p->scheme);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_RSA_SCHEME(BYTE* ptr, TPMT_RSA_SCHEME *p)
+{
+    ptr = unpack_TPMI_ALG_RSA_SCHEME(ptr, &p->scheme);
+    ptr = unpack_TPMU_ASYM_SCHEME(ptr, &p->details, &p->scheme);
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_RSA_DECRYPT(BYTE* ptr, const TPMT_RSA_DECRYPT *p)
+{
+    ptr = pack_TPMI_ALG_RSA_SCHEME(ptr, &p->scheme);
+    ptr = pack_TPMU_ASYM_SCHEME(ptr, &p->details, &p->scheme);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_RSA_PARMS(BYTE* ptr, const TPMS_RSA_PARMS *p)
+{
+    ptr = pack_TPMT_SYM_DEF_OBJECT(ptr, &p->symmetric);
+    ptr = pack_TPMT_RSA_SCHEME(ptr, &p->scheme);
+    ptr = pack_TPMI_RSA_KEY_BITS(ptr, &p->keyBits);
+    ptr = pack_UINT32(ptr, p->exponent);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_RSA_PARMS(BYTE *ptr, TPMS_RSA_PARMS *p)
+{
+    ptr = unpack_TPMT_SYM_DEF_OBJECT(ptr, &p->symmetric);
+    ptr = unpack_TPMT_RSA_SCHEME(ptr, &p->scheme);
+    ptr = unpack_TPMI_RSA_KEY_BITS(ptr, &p->keyBits);
+    ptr = unpack_UINT32(ptr, &p->exponent);
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_PUBLIC_PARMS(BYTE* ptr, const TPMU_PUBLIC_PARMS *param,
+                                    const TPMI_ALG_PUBLIC *selector)
+{
+    switch(*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        assert(false);
+    case TPM2_ALG_SYMCIPHER:
+        assert(false);
+    case TPM2_ALG_RSA:
+        return pack_TPMS_RSA_PARMS(ptr, &param->rsaDetail);
+    case TPM2_ALG_ECC:
+        assert(false);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* unpack_TPMU_PUBLIC_PARMS(BYTE* ptr, TPMU_PUBLIC_PARMS *param,
+                                      const TPMI_ALG_PUBLIC *selector)
+{
+    switch(*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        assert(false);
+    case TPM2_ALG_SYMCIPHER:
+        assert(false);
+    case TPM2_ALG_RSA:
+        return unpack_TPMS_RSA_PARMS(ptr, &param->rsaDetail);
+    case TPM2_ALG_ECC:
+        assert(false);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* pack_TPMS_ECC_POINT(BYTE* ptr, const TPMS_ECC_POINT *point)
+{
+    assert(false);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_ECC_POINT(BYTE* ptr, TPMS_ECC_POINT *point)
+{
+    assert(false);
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_PUBLIC_ID(BYTE* ptr, const TPMU_PUBLIC_ID *id,
+                                 const TPMI_ALG_PUBLIC *selector)
+{
+    switch (*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        return pack_TPM2B_DIGEST(ptr, &id->keyedHash);
+    case TPM2_ALG_SYMCIPHER:
+        return pack_TPM2B_DIGEST(ptr, &id->sym);
+    case TPM2_ALG_RSA:
+        return pack_TPM2B_PUBLIC_KEY_RSA(ptr, &id->rsa);
+    case TPM2_ALG_ECC:
+        return pack_TPMS_ECC_POINT(ptr, &id->ecc);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* unpack_TPMU_PUBLIC_ID(BYTE* ptr, TPMU_PUBLIC_ID *id, TPMI_ALG_PUBLIC *selector)
+{
+    switch (*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        return unpack_TPM2B_DIGEST(ptr, &id->keyedHash);
+    case TPM2_ALG_SYMCIPHER:
+        return unpack_TPM2B_DIGEST(ptr, &id->sym);
+    case TPM2_ALG_RSA:
+        return unpack_TPM2B_PUBLIC_KEY_RSA(ptr, &id->rsa);
+    case TPM2_ALG_ECC:
+        return unpack_TPMS_ECC_POINT(ptr, &id->ecc);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* pack_TPMT_PUBLIC(BYTE* ptr, const TPMT_PUBLIC *public)
+{
+    ptr = pack_TPMI_ALG_PUBLIC(ptr, &public->type);
+    ptr = pack_TPMI_ALG_HASH(ptr, &public->nameAlg);
+    ptr = pack_TPMA_OBJECT(ptr, &public->objectAttributes);
+    ptr = pack_TPM2B_DIGEST(ptr, &public->authPolicy);
+    ptr = pack_TPMU_PUBLIC_PARMS(ptr, &public->parameters, &public->type);
+    ptr = pack_TPMU_PUBLIC_ID(ptr, &public->unique, &public->type);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_PUBLIC(BYTE* ptr, TPMT_PUBLIC *public)
+{
+    ptr = unpack_TPMI_ALG_PUBLIC(ptr, &public->type);
+    ptr = unpack_TPMI_ALG_HASH(ptr, &public->nameAlg);
+    ptr = unpack_TPMA_OBJECT(ptr, &public->objectAttributes);
+    ptr = unpack_TPM2B_DIGEST(ptr, &public->authPolicy);
+    ptr = unpack_TPMU_PUBLIC_PARMS(ptr, &public->parameters, &public->type);
+    ptr = unpack_TPMU_PUBLIC_ID(ptr, &public->unique, &public->type);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_PUBLIC(BYTE* ptr, const TPM2B_PUBLIC *public)
+{
+    BYTE *sizePtr = ptr;
+    ptr += 2;
+    ptr = pack_TPMT_PUBLIC(ptr, &public->publicArea);
+    pack_UINT16(sizePtr, (UINT16)(ptr - sizePtr - 2));
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_PUBLIC(BYTE* ptr, TPM2B_PUBLIC *public)
+{
+    ptr = unpack_UINT16(ptr, &public->size);
+    ptr = unpack_TPMT_PUBLIC(ptr, &public->publicArea);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_PCR_SELECTION(BYTE* ptr, const TPMS_PCR_SELECTION *selection)
+{
+    ptr = pack_TPMI_ALG_HASH(ptr, &selection->hash);
+    ptr = pack_BYTE(ptr, selection->sizeofSelect);
+    ptr = pack_BYTE_ARRAY(ptr, selection->pcrSelect, selection->sizeofSelect);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_PCR_SELECTION_Array(BYTE* ptr, const TPMS_PCR_SELECTION *selections,
+                                           const UINT32 cnt)
+{
+    int i;
+    for (i = 0; i < cnt; i++)
+        ptr = pack_TPMS_PCR_SELECTION(ptr, selections + i);
+    return ptr;
+}
+
+inline BYTE* pack_TPM_AuthArea(BYTE* ptr, const TPM_AuthArea *auth)
+{
+    BYTE* sizePtr = ptr;
+    ptr += sizeof(UINT32);
+    ptr = pack_TPM_RH(ptr, &auth->sessionHandle);
+    ptr = pack_TPM2B_NONCE(ptr, &auth->nonce);
+    ptr = pack_TPMA_SESSION(ptr, &auth->sessionAttributes);
+    ptr = pack_TPM2B_AUTH(ptr, &auth->auth);
+    pack_UINT32(sizePtr, ptr - sizePtr - sizeof(UINT32));
+    return ptr;
+}
+
+inline BYTE* unpack_TPM_AuthArea(BYTE* ptr, TPM_AuthArea *auth)
+{
+    ptr = unpack_UINT32(ptr, &auth->size);
+    ptr = unpack_TPM_RH(ptr, &auth->sessionHandle);
+    ptr = unpack_TPM2B_NONCE(ptr, &auth->nonce);
+    ptr = unpack_TPMA_SESSION(ptr, &auth->sessionAttributes);
+    ptr = unpack_TPM2B_AUTH(ptr, &auth->auth);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2_RSA_KEY(BYTE* ptr, const TPM2_RSA_KEY *key)
+{
+    ptr = pack_TPM2B_PRIVATE(ptr, &key->Private);
+    ptr = pack_TPM2B_PUBLIC(ptr, &key->Public);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2_RSA_KEY(BYTE* ptr, TPM2_RSA_KEY *key)
+{
+    ptr = unpack_TPM2B_PRIVATE(ptr, &key->Private);
+    ptr = unpack_TPM2B_PUBLIC(ptr, &key->Public);
+    return ptr;
+}
+#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 Tue Feb 03 08:03:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:03: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 1YIYSi-0006KY-B9; Tue, 03 Feb 2015 08:03: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 1YIYSg-0006KO-VK
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:55 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	F7/B3-03000-AE080D45; Tue, 03 Feb 2015 08:03:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950631!12130309!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1807 invoked from network); 3 Feb 2015 08:03:52 -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;
	3 Feb 2015 08:03:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSd-0005VL-L4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSd-0006au-Ji
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:03:51 +0000
Date: Tue, 03 Feb 2015 08:03:51 +0000
Message-Id: <E1YIYSd-0006au-Ji@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM 2.0 data structures
	marshal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a10a705b33eb25f5796a5f4008c6c477a98a716
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:41 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: TPM 2.0 data structures marshal
    
    Add TPM 2.0 data structure marshal for packing and unpacking TPM
    2.0 data structures.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/tpm2_marshal.h |  673 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 673 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/tpm2_marshal.h b/stubdom/vtpmmgr/tpm2_marshal.h
new file mode 100644
index 0000000..aaa4464
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2_marshal.h
@@ -0,0 +1,673 @@
+/*
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Authors:
+ *   Quan Xu <quan.xu@intel.com>
+ *
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef TPM2_MARSHAL_H
+#define TPM2_MARSHAL_H
+
+#include <stdlib.h>
+#include <mini-os/byteorder.h>
+#include <mini-os/endian.h>
+#include "tcg.h"
+#include "tpm2_types.h"
+#include <assert.h>
+
+#define pack_TPM_BUFFER(ptr, buf, size) pack_BUFFER(ptr, buf, size)
+#define unpack_TPM_BUFFER(ptr, buf, size) unpack_BUFFER(ptr, buf, size)
+
+inline BYTE* pack_BYTE_ARRAY(BYTE* ptr, const BYTE* array, UINT32 size)
+{
+    int i;
+    for (i = 0; i < size; i++)
+         ptr = pack_BYTE(ptr, array[i]);
+    return ptr;
+}
+
+inline BYTE* pack_TPMA_SESSION(BYTE* ptr, const TPMA_SESSION *attr)
+{
+    return pack_BYTE(ptr, (BYTE)(*attr));
+}
+
+inline BYTE* unpack_TPMA_SESSION(BYTE* ptr, TPMA_SESSION *attr)
+{
+    return unpack_BYTE(ptr, (BYTE *)attr);
+}
+
+inline BYTE* pack_TPMI_ALG_HASH(BYTE* ptr, const TPMI_ALG_HASH *hash)
+{
+    return pack_UINT16(ptr, *hash);
+}
+
+inline BYTE* unpack_TPMI_ALG_HASH(BYTE *ptr, TPMI_ALG_HASH *hash)
+{
+    return unpack_UINT16(ptr, hash);
+}
+
+#define pack_TPMA_OBJECT(ptr, t)                pack_UINT32(ptr, (UINT32)(*t))
+#define unpack_TPMA_OBJECT(ptr, t)              unpack_UINT32(ptr, (UINT32 *)(t))
+#define pack_TPM_RH(ptr, t)                     pack_UINT32(ptr, (UINT32)(*t))
+#define unpack_TPM_RH(ptr, t)                   unpack_UINT32(ptr, (UINT32 *)(t))
+#define pack_TPMA_LOCALITY(ptr, locality)       pack_BYTE(ptr, (BYTE)*locality)
+#define unpack_TPMA_LOCALITY(ptr, locality)     unpack_BYTE(ptr, (BYTE *)locality)
+#define pack_TPM_ST(ptr, tag)                   pack_UINT16(ptr, *tag)
+#define unpack_TPM_ST(ptr, tag)                 unpack_UINT16(ptr, tag)
+#define pack_TPM_KEY_BITS(ptr, t)               pack_UINT16(ptr, *t)
+#define unpack_TPM_KEY_BITS(ptr, t)             unpack_UINT16(ptr, t)
+#define pack_TPMI_AES_KEY_BITS(ptr, t)          pack_TPM_KEY_BITS(ptr, t)
+#define unpack_TPMI_AES_KEY_BITS(ptr, t)        unpack_TPM_KEY_BITS(ptr, t)
+#define pack_TPMI_RSA_KEY_BITS(ptr, t)          pack_TPM_KEY_BITS(ptr, t)
+#define unpack_TPMI_RSA_KEY_BITS(ptr, t)        unpack_TPM_KEY_BITS(ptr, t)
+#define pack_TPM_ALG_ID(ptr, id)                pack_UINT16(ptr, *id)
+#define unpack_TPM_ALG_ID(ptr, id)              unpack_UINT16(ptr, id)
+#define pack_TPM_ALG_SYM(ptr, t)                pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPM_ALG_SYM(ptr, t)              unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_ASYM(ptr, asym)           pack_TPM_ALG_ID(ptr, asym)
+#define unpack_TPMI_ALG_ASYM(ptr, asym)         unpack_TPM_ALG_ID(ptr, asym)
+#define pack_TPMI_ALG_SYM_OBJECT(ptr, t)        pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_SYM_OBJECT(ptr, t)      unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_SYM_MODE(ptr, t)          pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_SYM_MODE(ptr, t)        unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_KDF(ptr, t)               pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_KDF(ptr, t)             unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_ALG_PUBLIC(ptr, t)            pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_PUBLIC(ptr, t)          unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPM2_HANDLE(ptr, h)                pack_UINT32(ptr, *h)
+#define unpack_TPM2_HANDLE(ptr, h)              unpack_UINT32(ptr, h)
+#define pack_TPMI_ALG_RSA_SCHEME(ptr, t)        pack_TPM_ALG_ID(ptr, t)
+#define unpack_TPMI_ALG_RSA_SCHEME(ptr, t)      unpack_TPM_ALG_ID(ptr, t)
+#define pack_TPMI_DH_OBJECT(ptr, o)             pack_TPM2_HANDLE(ptr, o)
+#define unpack_TPMI_DH_OBJECT(PTR, O)           unpack_TPM2_HANDLE(ptr, o)
+#define pack_TPMI_RH_HIERACHY(ptr, h)           pack_TPM2_HANDLE(ptr, h)
+#define unpack_TPMI_RH_HIERACHY(ptr, h)         unpack_TPM2_HANDLE(ptr, h)
+#define pack_TPMI_RH_PLATFORM(ptr, p)           pack_TPM2_HANDLE(ptr, p)
+#define unpack_TPMI_RH_PLATFORM(ptr, p)         unpack_TPM2_HANDLE(ptr, p)
+#define pack_TPMI_RH_OWNER(ptr, o)              pack_TPM2_HANDLE(ptr, o)
+#define unpack_TPMI_RH_OWNER(ptr, o)            unpack_TPM2_HANDLE(ptr, o)
+#define pack_TPMI_RH_ENDORSEMENT(ptr, e)        pack_TPM2_HANDLE(ptr, e)
+#define unpack_TPMI_RH_ENDORSEMENT(ptr, e)      unpack_TPM2_HANDLE(ptr, e)
+#define pack_TPMI_RH_LOCKOUT(ptr, l)            pack_TPM2_HANDLE(ptr, l)
+#define unpack_TPMI_RH_LOCKOUT(ptr, l)          unpack_TPM2_HANDLE(ptr, l)
+
+inline BYTE* pack_TPM2B_DIGEST(BYTE* ptr, const TPM2B_DIGEST *digest)
+{
+    ptr = pack_UINT16(ptr, digest->size);
+    ptr = pack_BUFFER(ptr, digest->buffer, digest->size);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_DIGEST(BYTE* ptr, TPM2B_DIGEST *digest)
+{
+    ptr = unpack_UINT16(ptr, &digest->size);
+    ptr = unpack_BUFFER(ptr, digest->buffer, digest->size);
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_TK_CREATION(BYTE* ptr,const TPMT_TK_CREATION *ticket )
+{
+    ptr = pack_TPM_ST(ptr , &ticket->tag);
+    ptr = pack_TPMI_RH_HIERACHY(ptr , &ticket->hierarchy);
+    ptr = pack_TPM2B_DIGEST(ptr, &ticket->digest);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_TK_CREATION(BYTE* ptr, TPMT_TK_CREATION *ticket )
+{
+    ptr = unpack_TPM_ST(ptr, &ticket->tag);
+    ptr = unpack_TPMI_RH_HIERACHY(ptr, &ticket->hierarchy);
+    ptr = unpack_TPM2B_DIGEST(ptr, &ticket->digest);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_NAME(BYTE* ptr,const TPM2B_NAME *name )
+{
+    ptr = pack_UINT16(ptr, name->size);
+    ptr = pack_TPM_BUFFER(ptr, name->name, name->size);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_NAME(BYTE* ptr, TPM2B_NAME *name)
+{
+    ptr = unpack_UINT16(ptr, &name->size);
+    ptr = unpack_TPM_BUFFER(ptr, name->name, name->size);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_NONCE(BYTE* ptr, const TPM2B_NONCE *nonce)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)nonce);
+}
+
+#define unpack_TPM2B_NONCE(ptr, nonce)  unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)nonce)
+
+inline BYTE* pack_TPM2B_AUTH(BYTE* ptr, const TPM2B_AUTH *auth)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)auth);
+}
+
+#define unpack_TPM2B_AUTH(ptr, auth)    unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)auth)
+
+inline BYTE* pack_TPM2B_DATA(BYTE* ptr, const TPM2B_DATA *data)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)data);
+}
+
+#define unpack_TPM2B_DATA(ptr, data)    unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)data)
+
+inline BYTE* pack_TPM2B_SENSITIVE_DATA(BYTE* ptr, const TPM2B_SENSITIVE_DATA *data)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)data);
+}
+
+#define unpack_TPM2B_SENSITIVE_DATA(ptr, data)  unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)data)
+
+inline BYTE* pack_TPM2B_PUBLIC_KEY_RSA(BYTE* ptr, const TPM2B_PUBLIC_KEY_RSA *rsa)
+{
+    return pack_TPM2B_DIGEST(ptr, (const TPM2B_DIGEST*)rsa);
+}
+
+#define unpack_TPM2B_PUBLIC_KEY_RSA(ptr, rsa)   unpack_TPM2B_DIGEST(ptr, (TPM2B_DIGEST*)rsa)
+
+inline BYTE* pack_TPM2B_PRIVATE(BYTE* ptr, const TPM2B_PRIVATE *Private)
+{
+    ptr = pack_UINT16(ptr, Private->size);
+    ptr = pack_TPM_BUFFER(ptr, Private->buffer, Private->size);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_PRIVATE(BYTE* ptr, TPM2B_PRIVATE *Private)
+{
+    ptr = unpack_UINT16(ptr, &Private->size);
+    ptr = unpack_BUFFER(ptr, Private->buffer, Private->size);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_PCR_SELECTION_ARRAY(BYTE* ptr, const TPMS_PCR_SELECTION *sel, UINT32 count)
+{
+    int i;
+    for (i = 0; i < count; i++) {
+        ptr = pack_TPMI_ALG_HASH(ptr, &sel[i].hash);
+        ptr = pack_BYTE(ptr, sel[i].sizeofSelect);
+        ptr = pack_BUFFER(ptr, sel[i].pcrSelect, sel[i].sizeofSelect);
+    }
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_PCR_SELECTION_ARRAY(BYTE* ptr, TPMS_PCR_SELECTION *sel, UINT32 count)
+{
+    int i;
+    for (i = 0; i < count; i++) {
+        ptr = unpack_TPMI_ALG_HASH(ptr, &sel[i].hash);
+        ptr = unpack_BYTE(ptr, &sel[i].sizeofSelect);
+        ptr = unpack_BUFFER(ptr, sel[i].pcrSelect, sel[i].sizeofSelect);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPML_PCR_SELECTION(BYTE* ptr, const TPML_PCR_SELECTION *sel)
+{
+    ptr = pack_UINT32(ptr, sel->count);
+    ptr = pack_TPMS_PCR_SELECTION_ARRAY(ptr, sel->pcrSelections, sel->count);
+    return ptr;
+}
+
+inline BYTE* unpack_TPML_PCR_SELECTION(BYTE* ptr, TPML_PCR_SELECTION *sel)
+{
+    ptr = unpack_UINT32(ptr, &sel->count);
+    ptr = unpack_TPMS_PCR_SELECTION_ARRAY(ptr, sel->pcrSelections, sel->count);
+    return ptr;
+}
+
+inline BYTE* unpack_TPML_DIGEST(BYTE* ptr,TPML_DIGEST *digest)
+{
+    int i;
+    ptr = unpack_UINT32(ptr, &digest->count);
+    for (i=0;i<digest->count;i++)
+    {
+        ptr = unpack_TPM2B_DIGEST(ptr, &digest->digests[i]);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_CREATION_DATA(BYTE* ptr,const TPMS_CREATION_DATA *data)
+{
+    ptr = pack_TPML_PCR_SELECTION(ptr, &data->pcrSelect);
+    ptr = pack_TPM2B_DIGEST(ptr, &data->pcrDigest);
+    ptr = pack_TPMA_LOCALITY(ptr, &data->locality);
+    ptr = pack_TPM_ALG_ID(ptr, &data->parentNameAlg);
+    ptr = pack_TPM2B_NAME(ptr, &data->parentQualifiedName);
+    ptr = pack_TPM2B_DATA(ptr, &data->outsideInfo);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_CREATION_DATA(BYTE* ptr, TPMS_CREATION_DATA *data)
+{
+    ptr = unpack_TPML_PCR_SELECTION(ptr, &data->pcrSelect);
+    ptr = unpack_TPM2B_DIGEST(ptr, &data->pcrDigest);
+    ptr = unpack_TPMA_LOCALITY(ptr, &data->locality);
+    ptr = unpack_TPM_ALG_ID(ptr, &data->parentNameAlg);
+    ptr = unpack_TPM2B_NAME(ptr, &data->parentName);
+    ptr = unpack_TPM2B_NAME(ptr, &data->parentQualifiedName);
+    ptr = unpack_TPM2B_DATA(ptr, &data->outsideInfo);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_CREATION_DATA(BYTE* ptr, const TPM2B_CREATION_DATA *data )
+{
+    ptr = pack_UINT16(ptr, data->size);
+    ptr = pack_TPMS_CREATION_DATA(ptr, &data->creationData);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_CREATION_DATA(BYTE* ptr, TPM2B_CREATION_DATA * data)
+{
+    ptr = unpack_UINT16(ptr, &data->size);
+    ptr = unpack_TPMS_CREATION_DATA(ptr, &data->creationData);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_SENSITIVE_CREATE(BYTE* ptr, const TPMS_SENSITIVE_CREATE *create)
+{
+    ptr = pack_TPM2B_AUTH(ptr, &create->userAuth);
+    ptr = pack_TPM2B_SENSITIVE_DATA(ptr, &create->data);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_SENSITIVE_CREATE(BYTE* ptr, const TPM2B_SENSITIVE_CREATE *create)
+{
+    BYTE* sizePtr = ptr;
+    ptr += 2;
+    ptr = pack_TPMS_SENSITIVE_CREATE(ptr, &create->sensitive);
+    pack_UINT16(sizePtr, (UINT16)(ptr - sizePtr - 2));
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_SYM_MODE(BYTE* ptr, const TPMU_SYM_MODE *p,
+                                const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = pack_TPMI_ALG_SYM_MODE(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+        case TPM2_ALG_XOR:
+        break;
+    default:
+        ptr = pack_TPMI_ALG_SYM_MODE(ptr, &p->sym);
+    }
+    return ptr;
+}
+inline BYTE* unpack_TPMU_SYM_MODE(BYTE* ptr, TPMU_SYM_MODE *p,
+                                  const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = unpack_TPMI_ALG_SYM_MODE(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+    case TPM2_ALG_XOR:
+        break;
+    default:
+        ptr = unpack_TPMI_ALG_SYM_MODE(ptr, &p->sym);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_SYM_KEY_BITS(BYTE* ptr, const TPMU_SYM_KEY_BITS *p,
+                                    const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = pack_TPMI_AES_KEY_BITS(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_XOR:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        ptr = pack_TPM_KEY_BITS(ptr, &p->sym);
+    }
+    return ptr;
+}
+
+inline BYTE* unpack_TPMU_SYM_KEY_BITS(BYTE* ptr, TPMU_SYM_KEY_BITS *p,
+                                      const TPMI_ALG_SYM_OBJECT *sel)
+{
+    switch(*sel) {
+    case TPM2_ALG_AES:
+        ptr = unpack_TPMI_AES_KEY_BITS(ptr, &p->aes);
+        break;
+    case TPM2_ALG_SM4:
+        assert(false);
+        break;
+    case TPM2_ALG_XOR:
+        assert(false);
+        break;
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        ptr = unpack_TPM_KEY_BITS(ptr, &p->sym);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_SYM_DEF_OBJECT(BYTE* ptr, const TPMT_SYM_DEF_OBJECT *p)
+{
+    ptr = pack_TPMI_ALG_SYM_OBJECT(ptr, &p->algorithm);
+    ptr = pack_TPMU_SYM_KEY_BITS(ptr, &p->keyBits, &p->algorithm);
+    ptr = pack_TPMU_SYM_MODE(ptr, &p->mode, &p->algorithm);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_SYM_DEF_OBJECT(BYTE *ptr, TPMT_SYM_DEF_OBJECT *p)
+{
+    ptr = unpack_TPMI_ALG_SYM_OBJECT(ptr, &p->algorithm);
+    ptr = unpack_TPMU_SYM_KEY_BITS(ptr, &p->keyBits, &p->algorithm);
+    ptr = unpack_TPMU_SYM_MODE(ptr, &p->mode, &p->algorithm);
+    return ptr;
+}
+
+#define pack_TPMS_SCHEME_OAEP(p, t)     pack_TPMI_ALG_HASH(p, &((t)->hashAlg))
+#define unpack_TPMS_SCHEME_OAEP(p, t)   unpack_TPMI_ALG_HASH(p, &((t)->hashAlg))
+
+inline BYTE* pack_TPMU_ASYM_SCHEME(BYTE *ptr, const TPMU_ASYM_SCHEME *p,
+                                   const TPMI_ALG_RSA_SCHEME *s)
+{
+    switch(*s) {
+#ifdef TPM2_ALG_RSASSA
+    case TPM2_ALG_RSASSA:
+        assert(false || "TPM2_ALG_RSASSA");
+        break;
+#endif
+#ifdef TPM2_ALG_OAEP
+    case TPM2_ALG_OAEP:
+        ptr = pack_TPMS_SCHEME_OAEP(ptr, &p->oaep);
+        break;
+#endif
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        assert(false || "DEFAULT");
+    }
+    return ptr;
+}
+
+inline BYTE* unpack_TPMU_ASYM_SCHEME(BYTE *ptr, TPMU_ASYM_SCHEME *p,
+                                     const TPMI_ALG_RSA_SCHEME *s)
+{
+    switch(*s) {
+    #ifdef TPM2_ALG_RSASSA
+    case TPM2_ALG_RSASSA:
+        printf("not support TPM_ALG_RSASSA\n");
+        assert(false);
+        break;
+    #endif
+    #ifdef TPM2_ALG_OAEP
+    case TPM2_ALG_OAEP:
+        ptr = unpack_TPMS_SCHEME_OAEP(ptr, &p->oaep);
+        break;
+    #endif
+    case TPM2_ALG_NULL:
+        break;
+    default:
+        printf("default TPMI_ALG_RSA_SCHEME 0x%X\n", (UINT32)*s);
+        ptr = unpack_TPMI_ALG_HASH(ptr, &p->anySig.hashAlg);
+    }
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_RSA_SCHEME(BYTE* ptr, const TPMT_RSA_SCHEME *p)
+{
+    ptr = pack_TPMI_ALG_RSA_SCHEME(ptr, &p->scheme);
+    ptr = pack_TPMU_ASYM_SCHEME(ptr, &p->details, &p->scheme);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_RSA_SCHEME(BYTE* ptr, TPMT_RSA_SCHEME *p)
+{
+    ptr = unpack_TPMI_ALG_RSA_SCHEME(ptr, &p->scheme);
+    ptr = unpack_TPMU_ASYM_SCHEME(ptr, &p->details, &p->scheme);
+    return ptr;
+}
+
+inline BYTE* pack_TPMT_RSA_DECRYPT(BYTE* ptr, const TPMT_RSA_DECRYPT *p)
+{
+    ptr = pack_TPMI_ALG_RSA_SCHEME(ptr, &p->scheme);
+    ptr = pack_TPMU_ASYM_SCHEME(ptr, &p->details, &p->scheme);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_RSA_PARMS(BYTE* ptr, const TPMS_RSA_PARMS *p)
+{
+    ptr = pack_TPMT_SYM_DEF_OBJECT(ptr, &p->symmetric);
+    ptr = pack_TPMT_RSA_SCHEME(ptr, &p->scheme);
+    ptr = pack_TPMI_RSA_KEY_BITS(ptr, &p->keyBits);
+    ptr = pack_UINT32(ptr, p->exponent);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_RSA_PARMS(BYTE *ptr, TPMS_RSA_PARMS *p)
+{
+    ptr = unpack_TPMT_SYM_DEF_OBJECT(ptr, &p->symmetric);
+    ptr = unpack_TPMT_RSA_SCHEME(ptr, &p->scheme);
+    ptr = unpack_TPMI_RSA_KEY_BITS(ptr, &p->keyBits);
+    ptr = unpack_UINT32(ptr, &p->exponent);
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_PUBLIC_PARMS(BYTE* ptr, const TPMU_PUBLIC_PARMS *param,
+                                    const TPMI_ALG_PUBLIC *selector)
+{
+    switch(*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        assert(false);
+    case TPM2_ALG_SYMCIPHER:
+        assert(false);
+    case TPM2_ALG_RSA:
+        return pack_TPMS_RSA_PARMS(ptr, &param->rsaDetail);
+    case TPM2_ALG_ECC:
+        assert(false);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* unpack_TPMU_PUBLIC_PARMS(BYTE* ptr, TPMU_PUBLIC_PARMS *param,
+                                      const TPMI_ALG_PUBLIC *selector)
+{
+    switch(*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        assert(false);
+    case TPM2_ALG_SYMCIPHER:
+        assert(false);
+    case TPM2_ALG_RSA:
+        return unpack_TPMS_RSA_PARMS(ptr, &param->rsaDetail);
+    case TPM2_ALG_ECC:
+        assert(false);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* pack_TPMS_ECC_POINT(BYTE* ptr, const TPMS_ECC_POINT *point)
+{
+    assert(false);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMS_ECC_POINT(BYTE* ptr, TPMS_ECC_POINT *point)
+{
+    assert(false);
+    return ptr;
+}
+
+inline BYTE* pack_TPMU_PUBLIC_ID(BYTE* ptr, const TPMU_PUBLIC_ID *id,
+                                 const TPMI_ALG_PUBLIC *selector)
+{
+    switch (*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        return pack_TPM2B_DIGEST(ptr, &id->keyedHash);
+    case TPM2_ALG_SYMCIPHER:
+        return pack_TPM2B_DIGEST(ptr, &id->sym);
+    case TPM2_ALG_RSA:
+        return pack_TPM2B_PUBLIC_KEY_RSA(ptr, &id->rsa);
+    case TPM2_ALG_ECC:
+        return pack_TPMS_ECC_POINT(ptr, &id->ecc);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* unpack_TPMU_PUBLIC_ID(BYTE* ptr, TPMU_PUBLIC_ID *id, TPMI_ALG_PUBLIC *selector)
+{
+    switch (*selector) {
+    case TPM2_ALG_KEYEDHASH:
+        return unpack_TPM2B_DIGEST(ptr, &id->keyedHash);
+    case TPM2_ALG_SYMCIPHER:
+        return unpack_TPM2B_DIGEST(ptr, &id->sym);
+    case TPM2_ALG_RSA:
+        return unpack_TPM2B_PUBLIC_KEY_RSA(ptr, &id->rsa);
+    case TPM2_ALG_ECC:
+        return unpack_TPMS_ECC_POINT(ptr, &id->ecc);
+    }
+    assert(false);
+    return NULL;
+}
+
+inline BYTE* pack_TPMT_PUBLIC(BYTE* ptr, const TPMT_PUBLIC *public)
+{
+    ptr = pack_TPMI_ALG_PUBLIC(ptr, &public->type);
+    ptr = pack_TPMI_ALG_HASH(ptr, &public->nameAlg);
+    ptr = pack_TPMA_OBJECT(ptr, &public->objectAttributes);
+    ptr = pack_TPM2B_DIGEST(ptr, &public->authPolicy);
+    ptr = pack_TPMU_PUBLIC_PARMS(ptr, &public->parameters, &public->type);
+    ptr = pack_TPMU_PUBLIC_ID(ptr, &public->unique, &public->type);
+    return ptr;
+}
+
+inline BYTE* unpack_TPMT_PUBLIC(BYTE* ptr, TPMT_PUBLIC *public)
+{
+    ptr = unpack_TPMI_ALG_PUBLIC(ptr, &public->type);
+    ptr = unpack_TPMI_ALG_HASH(ptr, &public->nameAlg);
+    ptr = unpack_TPMA_OBJECT(ptr, &public->objectAttributes);
+    ptr = unpack_TPM2B_DIGEST(ptr, &public->authPolicy);
+    ptr = unpack_TPMU_PUBLIC_PARMS(ptr, &public->parameters, &public->type);
+    ptr = unpack_TPMU_PUBLIC_ID(ptr, &public->unique, &public->type);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2B_PUBLIC(BYTE* ptr, const TPM2B_PUBLIC *public)
+{
+    BYTE *sizePtr = ptr;
+    ptr += 2;
+    ptr = pack_TPMT_PUBLIC(ptr, &public->publicArea);
+    pack_UINT16(sizePtr, (UINT16)(ptr - sizePtr - 2));
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2B_PUBLIC(BYTE* ptr, TPM2B_PUBLIC *public)
+{
+    ptr = unpack_UINT16(ptr, &public->size);
+    ptr = unpack_TPMT_PUBLIC(ptr, &public->publicArea);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_PCR_SELECTION(BYTE* ptr, const TPMS_PCR_SELECTION *selection)
+{
+    ptr = pack_TPMI_ALG_HASH(ptr, &selection->hash);
+    ptr = pack_BYTE(ptr, selection->sizeofSelect);
+    ptr = pack_BYTE_ARRAY(ptr, selection->pcrSelect, selection->sizeofSelect);
+    return ptr;
+}
+
+inline BYTE* pack_TPMS_PCR_SELECTION_Array(BYTE* ptr, const TPMS_PCR_SELECTION *selections,
+                                           const UINT32 cnt)
+{
+    int i;
+    for (i = 0; i < cnt; i++)
+        ptr = pack_TPMS_PCR_SELECTION(ptr, selections + i);
+    return ptr;
+}
+
+inline BYTE* pack_TPM_AuthArea(BYTE* ptr, const TPM_AuthArea *auth)
+{
+    BYTE* sizePtr = ptr;
+    ptr += sizeof(UINT32);
+    ptr = pack_TPM_RH(ptr, &auth->sessionHandle);
+    ptr = pack_TPM2B_NONCE(ptr, &auth->nonce);
+    ptr = pack_TPMA_SESSION(ptr, &auth->sessionAttributes);
+    ptr = pack_TPM2B_AUTH(ptr, &auth->auth);
+    pack_UINT32(sizePtr, ptr - sizePtr - sizeof(UINT32));
+    return ptr;
+}
+
+inline BYTE* unpack_TPM_AuthArea(BYTE* ptr, TPM_AuthArea *auth)
+{
+    ptr = unpack_UINT32(ptr, &auth->size);
+    ptr = unpack_TPM_RH(ptr, &auth->sessionHandle);
+    ptr = unpack_TPM2B_NONCE(ptr, &auth->nonce);
+    ptr = unpack_TPMA_SESSION(ptr, &auth->sessionAttributes);
+    ptr = unpack_TPM2B_AUTH(ptr, &auth->auth);
+    return ptr;
+}
+
+inline BYTE* pack_TPM2_RSA_KEY(BYTE* ptr, const TPM2_RSA_KEY *key)
+{
+    ptr = pack_TPM2B_PRIVATE(ptr, &key->Private);
+    ptr = pack_TPM2B_PUBLIC(ptr, &key->Public);
+    return ptr;
+}
+
+inline BYTE* unpack_TPM2_RSA_KEY(BYTE* ptr, TPM2_RSA_KEY *key)
+{
+    ptr = unpack_TPM2B_PRIVATE(ptr, &key->Private);
+    ptr = unpack_TPM2B_PUBLIC(ptr, &key->Public);
+    return ptr;
+}
+#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 Tue Feb 03 08:04:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYSr-0006M1-Dy; Tue, 03 Feb 2015 08:04:05 +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 1YIYSq-0006Lp-8J
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:04 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	B1/39-02754-3F080D45; Tue, 03 Feb 2015 08:04:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950641!11754892!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7752 invoked from network); 3 Feb 2015 08:04:02 -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;
	3 Feb 2015 08:04:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSn-0005Vx-QJ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSn-0006bV-P6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:01 +0000
Date: Tue, 03 Feb 2015 08:04:01 +0000
Message-Id: <E1YIYSn-0006bV-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add global data in
	vtpm_globals{}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c574452cdd5dcd234c94cc086b8b9c719f207430
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:42 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Add global data in vtpm_globals{}
    
    These data is for the Mini-os to access TPM 2.0 hardware.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/vtpmmgr.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 2d9d153..0d0c604 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -44,6 +44,7 @@
 #include "uuid.h"
 #include "tcg.h"
 #include "vtpm_manager.h"
+#include "tpm2_types.h"
 
 #define RSA_KEY_SIZE 0x0800
 #define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
@@ -59,6 +60,14 @@ struct vtpm_globals {
    ctr_drbg_context    ctr_drbg;
 
    int hw_locality;
+
+    /* TPM 2.0 */
+    TPM_AuthArea       pw_auth;
+    TPM_AuthArea       srk_auth_area;
+    TPM_HANDLE         srk_handle;
+    TPM_HANDLE         sk_handle;
+    TPM2B_NAME         sk_name;
+    TPM2_RSA_KEY       tpm2_storage_key;
 };
 
 struct tpm_opaque {
--
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 Tue Feb 03 08:04:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYSr-0006M1-Dy; Tue, 03 Feb 2015 08:04:05 +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 1YIYSq-0006Lp-8J
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:04 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	B1/39-02754-3F080D45; Tue, 03 Feb 2015 08:04:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950641!11754892!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7752 invoked from network); 3 Feb 2015 08:04:02 -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;
	3 Feb 2015 08:04:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSn-0005Vx-QJ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSn-0006bV-P6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:01 +0000
Date: Tue, 03 Feb 2015 08:04:01 +0000
Message-Id: <E1YIYSn-0006bV-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add global data in
	vtpm_globals{}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c574452cdd5dcd234c94cc086b8b9c719f207430
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:42 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Add global data in vtpm_globals{}
    
    These data is for the Mini-os to access TPM 2.0 hardware.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/vtpmmgr.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 2d9d153..0d0c604 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -44,6 +44,7 @@
 #include "uuid.h"
 #include "tcg.h"
 #include "vtpm_manager.h"
+#include "tpm2_types.h"
 
 #define RSA_KEY_SIZE 0x0800
 #define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
@@ -59,6 +60,14 @@ struct vtpm_globals {
    ctr_drbg_context    ctr_drbg;
 
    int hw_locality;
+
+    /* TPM 2.0 */
+    TPM_AuthArea       pw_auth;
+    TPM_AuthArea       srk_auth_area;
+    TPM_HANDLE         srk_handle;
+    TPM_HANDLE         sk_handle;
+    TPM2B_NAME         sk_name;
+    TPM2_RSA_KEY       tpm2_storage_key;
 };
 
 struct tpm_opaque {
--
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 Tue Feb 03 08:04:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYT2-0006Nu-Gm; Tue, 03 Feb 2015 08:04: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 1YIYT1-0006Nb-0R
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:15 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	36/7B-02777-EF080D45; Tue, 03 Feb 2015 08:04:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1422950652!12358975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15977 invoked from network); 3 Feb 2015 08:04:13 -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;
	3 Feb 2015 08:04:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSx-0005W3-VF
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSx-0006by-Tv
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:11 +0000
Date: Tue, 03 Feb 2015 08:04:11 +0000
Message-Id: <E1YIYSx-0006by-Tv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add TPM 2.0 Exposed APIs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de438117e0ab8f15b167a93d615213ce38572a0c
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:43 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Add TPM 2.0 Exposed APIs
    
    These TPM 2.0 Exposed APIs for the Mini-os to access TPM 2.0
    hardware.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/Makefile |    2 +-
 stubdom/vtpmmgr/tpm2.c   |  455 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm2.h   |  104 +++++++++++
 3 files changed, 560 insertions(+), 1 deletions(-)

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
index c5e17c5..6dae034 100644
--- a/stubdom/vtpmmgr/Makefile
+++ b/stubdom/vtpmmgr/Makefile
@@ -12,7 +12,7 @@
 XEN_ROOT=../..
 
 TARGET=vtpmmgr.a
-OBJS=vtpmmgr.o vtpm_cmd_handler.o init.o tpmrsa.o tpm.o log.o
+OBJS=vtpmmgr.o vtpm_cmd_handler.o init.o tpmrsa.o tpm.o tpm2.o log.o
 OBJS += vtpm_disk.o disk_tpm.o disk_io.o disk_crypto.o disk_read.o disk_write.o
 OBJS += mgmt_authority.o
 
diff --git a/stubdom/vtpmmgr/tpm2.c b/stubdom/vtpmmgr/tpm2.c
new file mode 100644
index 0000000..1903e27
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2.c
@@ -0,0 +1,455 @@
+/*
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Authors:
+ *   Quan Xu <quan.xu@intel.com>
+ *
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "tpm2.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm2_marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+#define TPM_BEGIN(TAG, ORD) \
+    const TPM_TAG intag = TAG;\
+    TPM_TAG tag = intag;\
+    UINT32 paramSize;\
+    const TPM_COMMAND_CODE ordinal = ORD;\
+    TPM_RESULT status = TPM_SUCCESS;\
+    BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+    BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+    UINT32 out_len = sizeof(out_buf);\
+    BYTE* ptr = in_buf;\
+    /*Print a log message */\
+    vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+    /* Pack the header*/\
+    ptr = pack_TPM_TAG(ptr, tag);\
+    ptr += sizeof(UINT32);\
+    ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+    sha1_context sha1_ctx;\
+    BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+    TPM_DIGEST paramDigest;\
+    sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+    sha1_finish(&sha1_ctx, paramDigest.digest);\
+    generateAuth(&paramDigest, HMACkey, auth);\
+    ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+    generateAuth(&paramDigest, HMACkey, auth);\
+    ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+    /* Pack the command size */\
+    paramSize = ptr - in_buf;\
+    pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+    if ((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+    UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+    sha1_starts(&sha1_ctx);\
+    sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+    authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+    sha1_finish(&sha1_ctx, paramDigest.digest);\
+    ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+    if ((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+    ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+    if ((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_UNPACK_VERIFY() do { \
+    ptr = out_buf;\
+    ptr = unpack_TPM_RSP_HEADER(ptr, \
+          &(tag), &(paramSize), &(status));\
+    if ((status) != TPM_SUCCESS){ \
+        vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+    sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+    authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+    authbase = ptr;\
+} while(0)
+
+TPM_RC TPM2_PCR_Read(TPML_PCR_SELECTION pcrSelectionIn,
+                     UINT32 *pcrUpdateCounter,
+                     TPML_PCR_SELECTION *pcrSelectionOut,
+                     TPML_DIGEST *pcrValues)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS,TPM_CC_PCR_Read);
+
+    /*pack in*/
+    ptr =  pack_TPML_PCR_SELECTION(ptr, &pcrSelectionIn);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    /*unpack out*/
+    ptr = unpack_UINT32(ptr, pcrUpdateCounter);
+    ptr = unpack_TPML_PCR_SELECTION(ptr, pcrSelectionOut);
+    ptr = unpack_TPML_DIGEST(ptr, pcrValues);
+
+    goto egress;
+abort_egress:
+egress:
+    return status;
+}
+
+TPM_RC TPM2_Load(TPMI_DH_OBJECT parentHandle,
+                 TPM2B_PRIVATE *inPrivate, /* in */
+                 TPM2B_PUBLIC *inPublic, /* in */
+                 TPM_HANDLE *objectHandle, /* out */
+                 TPM2B_NAME *name /* out */)
+{
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_Load);
+
+    /* pack handle of parent for new object */
+    ptr =  pack_UINT32(ptr, parentHandle);
+
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.srk_auth_area);
+    ptr = pack_TPM2B_PRIVATE(ptr, inPrivate);
+    ptr = pack_TPM2B_PUBLIC(ptr, inPublic);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    if (objectHandle != NULL) {
+        ptr = unpack_TPM_HANDLE(ptr, objectHandle);
+    } else {
+        TPM_HANDLE tmp;
+        ptr = unpack_TPM_HANDLE(ptr, &tmp);
+    }
+
+    if (name != NULL)
+        ptr = unpack_TPM2B_NAME(ptr, name);
+    goto egress;
+
+abort_egress:
+egress:
+    return status;
+}
+
+TPM_RC TPM2_Create(TPMI_DH_OBJECT parentHandle,
+                   TPM2_Create_Params_in *in,
+                   TPM2_Create_Params_out *out)
+{
+    UINT32 param_size;
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_Create);
+
+    /* pack handle of parent for new object */
+    ptr =  pack_UINT32(ptr, parentHandle);
+
+    /* pack Auth Area */
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.srk_auth_area);
+
+    /* pack inSensitive */
+    ptr = pack_TPM2B_SENSITIVE_CREATE(ptr, &in->inSensitive);
+
+    /* pack inPublic */
+    ptr = pack_TPM2B_PUBLIC(ptr, &in->inPublic);
+
+    /* pack outside Info */
+    ptr = pack_TPM2B_DATA(ptr, &in->outsideInfo);
+
+    /* pack createPCR */
+    ptr = pack_TPML_PCR_SELECTION(ptr, &in->creationPCR);
+
+    /* Send the command to the tpm */
+    TPM_TRANSMIT();
+
+    /* Unpack and validate the header */
+    TPM_UNPACK_VERIFY();
+
+    ptr = unpack_UINT32(ptr, &param_size);
+    if (out != NULL) {
+        ptr = unpack_TPM2B_PRIVATE(ptr, &vtpm_globals.tpm2_storage_key.Private);
+        ptr = unpack_TPM2B_PUBLIC(ptr, &vtpm_globals.tpm2_storage_key.Public);
+        ptr = unpack_TPM2B_CREATION_DATA(ptr, &out->creationData);
+        ptr = unpack_TPM2B_DIGEST(ptr, &out->creationHash);
+        ptr = unpack_TPMT_TK_CREATION(ptr, &out->creationTicket);
+    } else {
+           ptr += param_size;
+    }
+    goto egress;
+
+abort_egress:
+egress:
+    return status;
+}
+
+TPM_RC TPM2_CreatePrimary(TPMI_RH_HIERARCHY primaryHandle,
+                          TPM2_Create_Params_in *in,
+                          TPM_HANDLE *objHandle,
+                          TPM2_Create_Params_out *out)
+{
+    UINT32 param_size;
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_CreatePrimary);
+
+    /* pack primary handle */
+    ptr = pack_UINT32(ptr, primaryHandle);
+
+    /* pack Auth Area */
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.pw_auth);
+
+    /* pack inSenstive */
+    ptr = pack_TPM2B_SENSITIVE_CREATE(ptr, &in->inSensitive);
+
+    /* pack inPublic */
+    ptr = pack_TPM2B_PUBLIC(ptr, &in->inPublic);
+
+    /* pack outsideInfo */
+    ptr = pack_TPM2B_DATA(ptr, &in->outsideInfo);
+
+    /* pack creationPCR */
+    ptr = pack_TPML_PCR_SELECTION(ptr, &in->creationPCR);
+
+    /* Send the command to the tpm */
+    TPM_TRANSMIT();
+
+    /* Unpack and validate the header */
+    TPM_UNPACK_VERIFY();
+
+    if (objHandle != NULL)
+        ptr = unpack_TPM_HANDLE(ptr, objHandle);
+    else {
+        TPM_HANDLE handle;
+        ptr = unpack_TPM_HANDLE(ptr, &handle);
+    }
+    ptr = unpack_UINT32(ptr, &param_size);
+
+    if (out != NULL) {
+        ptr = unpack_TPM2B_PUBLIC(ptr, &out->outPublic);
+        ptr = unpack_TPM2B_CREATION_DATA(ptr, &out->creationData);
+        ptr = unpack_TPM2B_DIGEST(ptr, &out->creationHash);
+        ptr = unpack_TPMT_TK_CREATION(ptr, &out->creationTicket);
+    } else {
+        ptr += param_size;
+    }
+
+goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
+
+TPM_RC TPM2_HierachyChangeAuth(TPMI_RH_HIERARCHY_AUTH authHandle, TPM2B_AUTH *newAuth)
+{
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_HierarchyChangeAuth);
+    ptr = pack_UINT32(ptr, authHandle);
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.pw_auth);
+    ptr = pack_TPM2B_AUTH(ptr, newAuth);
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_RSA_ENCRYPT(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *message,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *outData)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS, TPM_CC_RSA_Encrypt);
+
+    ptr = pack_UINT32(ptr, keyHandle);
+    ptr = pack_TPM2B_PUBLIC_KEY_RSA(ptr, message);
+    ptr = pack_TPMT_RSA_DECRYPT(ptr, inScheme);
+    ptr = pack_TPM2B_DATA(ptr, label);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    if (outData != NULL)
+        unpack_TPM2B_PUBLIC_KEY_RSA(ptr, outData);
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_Bind(TPMI_DH_OBJECT keyHandle,
+                 void *buf,
+                 UINT32 len,
+                 void *out)
+{
+    TPM_RC status = TPM_SUCCESS;
+    TPM2B_PUBLIC_KEY_RSA message;
+    TPMT_RSA_DECRYPT inScheme;
+    TPM2B_DATA label;
+    TPM2B_PUBLIC_KEY_RSA outData;
+
+    message.size = len;
+    memcpy(message.buffer, buf, len);
+    inScheme.scheme = TPM2_ALG_NULL;
+    label.size = 0;
+    TPMTRYRETURN(TPM2_RSA_ENCRYPT(keyHandle, &message, &inScheme, &label, &outData));
+    memcpy(out, outData.buffer, outData.size);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_RSA_Decrypt(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *cipherText,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *message)
+{
+    UINT32 param_size;
+
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_RSA_Decrypt);
+    ptr = pack_UINT32(ptr, keyHandle);
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.srk_auth_area);
+    ptr = pack_TPM2B_PUBLIC_KEY_RSA(ptr, cipherText);
+    ptr = pack_TPMT_RSA_DECRYPT(ptr, inScheme);
+    ptr = pack_TPM2B_DATA(ptr, label);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    ptr = unpack_UINT32(ptr, &param_size);
+
+    if (message)
+        ptr = unpack_TPM2B_PUBLIC_KEY_RSA(ptr, message);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_UnBind(TPMI_DH_OBJECT keyHandle,
+                   UINT32 ilen,
+                   void *in,
+                   UINT32 *olen,
+                   void *out)
+{
+    UINT32 status;
+    TPM2B_PUBLIC_KEY_RSA cipher, message;
+    TPMT_RSA_DECRYPT inScheme;
+    TPM2B_DATA label;
+
+    cipher.size = ilen;
+    memcpy(cipher.buffer, in, ilen);
+    inScheme.scheme = TPM2_ALG_NULL;
+    label.size = 0;
+
+    TPMTRYRETURN(TPM2_RSA_Decrypt(keyHandle, &cipher, &inScheme, &label, &message));
+
+    *olen = message.size;
+    memcpy(out, message.buffer, *olen);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_CLEAR(void)
+{
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_Clear);
+
+    ptr = pack_UINT32(ptr, TPM_RH_PLATFORM);
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.pw_auth);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_GetRandom(UINT32 * bytesRequested, BYTE * randomBytes)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS, TPM_CC_GetRandom);
+
+    ptr = pack_UINT16(ptr, (UINT16)*bytesRequested);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    ptr = unpack_UINT16(ptr, (UINT16 *)bytesRequested);
+    ptr = unpack_TPM_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_FlushContext(TPMI_DH_CONTEXT flushHandle)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS, TPM_CC_FlushContext);
+
+    ptr = pack_UINT32(ptr, flushHandle);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+abort_egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/tpm2.h b/stubdom/vtpmmgr/tpm2.h
new file mode 100644
index 0000000..9f597ee
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Authors:
+ *   Quan Xu <quan.xu@intel.com>
+ *
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM2_H__
+#define __TPM2_H__
+
+#include "tcg.h"
+#include "tpm2_types.h"
+
+// ------------------------------------------------------------------
+// TPM 2.0 Exposed API
+// ------------------------------------------------------------------
+
+TPM_RC TPM2_PCR_Read(TPML_PCR_SELECTION pcrSelectionIn,
+                     UINT32 *pcrUpdateCounter,
+                     TPML_PCR_SELECTION *pcrSelectionOut,
+                     TPML_DIGEST *pcrValues);
+
+TPM_RC TPM2_Load(TPMI_DH_OBJECT parentHandle,
+                 TPM2B_PRIVATE *inPrivate,
+                 TPM2B_PUBLIC *inPublic,
+                 TPM_HANDLE *objectHandle,
+                 TPM2B_NAME *name);
+
+TPM_RC TPM2_Create(TPMI_DH_OBJECT parentHandle,
+                   TPM2_Create_Params_in *in,
+                   TPM2_Create_Params_out *out);
+
+TPM_RC TPM2_CreatePrimary(TPMI_RH_HIERARCHY primaryHandle,
+                          TPM2_Create_Params_in *objHandle,
+                          TPM_HANDLE *in,
+                          TPM2_Create_Params_out *out);
+
+TPM_RC TPM2_HierachyChangeAuth(TPMI_RH_HIERARCHY_AUTH authHandle,
+                               TPM2B_AUTH *newAuth);
+
+TPM_RC TPM2_RSA_ENCRYPT(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *message,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *outData);
+
+TPM_RC TPM2_Bind(TPMI_DH_OBJECT keyHandle,
+                 void *buf,
+                 UINT32 len,
+                 void *out);
+
+TPM_RC TPM2_RSA_Decrypt(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *cipherText,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *message);
+
+TPM_RC TPM2_UnBind(TPMI_DH_OBJECT keyHandle,
+                   UINT32 ilen,
+                   void *in,
+                   UINT32 *olen,
+                   void *out);
+
+TPM_RESULT TPM2_GetRandom(UINT32* bytesRequested,
+                          BYTE* randomBytes);
+
+TPM_RC TPM2_CLEAR(void);
+
+TPM_RC TPM2_FlushContext(TPMI_DH_CONTEXT);
+#endif //TPM2_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 Tue Feb 03 08:04:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYT2-0006Nu-Gm; Tue, 03 Feb 2015 08:04: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 1YIYT1-0006Nb-0R
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:15 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	36/7B-02777-EF080D45; Tue, 03 Feb 2015 08:04:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1422950652!12358975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15977 invoked from network); 3 Feb 2015 08:04:13 -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;
	3 Feb 2015 08:04:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSx-0005W3-VF
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYSx-0006by-Tv
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:11 +0000
Date: Tue, 03 Feb 2015 08:04:11 +0000
Message-Id: <E1YIYSx-0006by-Tv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add TPM 2.0 Exposed APIs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de438117e0ab8f15b167a93d615213ce38572a0c
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:43 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Add TPM 2.0 Exposed APIs
    
    These TPM 2.0 Exposed APIs for the Mini-os to access TPM 2.0
    hardware.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/Makefile |    2 +-
 stubdom/vtpmmgr/tpm2.c   |  455 ++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm2.h   |  104 +++++++++++
 3 files changed, 560 insertions(+), 1 deletions(-)

diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
index c5e17c5..6dae034 100644
--- a/stubdom/vtpmmgr/Makefile
+++ b/stubdom/vtpmmgr/Makefile
@@ -12,7 +12,7 @@
 XEN_ROOT=../..
 
 TARGET=vtpmmgr.a
-OBJS=vtpmmgr.o vtpm_cmd_handler.o init.o tpmrsa.o tpm.o log.o
+OBJS=vtpmmgr.o vtpm_cmd_handler.o init.o tpmrsa.o tpm.o tpm2.o log.o
 OBJS += vtpm_disk.o disk_tpm.o disk_io.o disk_crypto.o disk_read.o disk_write.o
 OBJS += mgmt_authority.o
 
diff --git a/stubdom/vtpmmgr/tpm2.c b/stubdom/vtpmmgr/tpm2.c
new file mode 100644
index 0000000..1903e27
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2.c
@@ -0,0 +1,455 @@
+/*
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Authors:
+ *   Quan Xu <quan.xu@intel.com>
+ *
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <errno.h>
+#include <polarssl/sha1.h>
+
+#include "tcg.h"
+#include "tpm.h"
+#include "tpm2.h"
+#include "log.h"
+#include "marshal.h"
+#include "tpm2_marshal.h"
+#include "tpmrsa.h"
+#include "vtpmmgr.h"
+
+#define TCPA_MAX_BUFFER_LENGTH 0x2000
+#define TPM_BEGIN(TAG, ORD) \
+    const TPM_TAG intag = TAG;\
+    TPM_TAG tag = intag;\
+    UINT32 paramSize;\
+    const TPM_COMMAND_CODE ordinal = ORD;\
+    TPM_RESULT status = TPM_SUCCESS;\
+    BYTE in_buf[TCPA_MAX_BUFFER_LENGTH];\
+    BYTE out_buf[TCPA_MAX_BUFFER_LENGTH];\
+    UINT32 out_len = sizeof(out_buf);\
+    BYTE* ptr = in_buf;\
+    /*Print a log message */\
+    vtpmloginfo(VTPM_LOG_TPM, "%s\n", __func__);\
+    /* Pack the header*/\
+    ptr = pack_TPM_TAG(ptr, tag);\
+    ptr += sizeof(UINT32);\
+    ptr = pack_TPM_COMMAND_CODE(ptr, ordinal)\
+
+#define TPM_AUTH_BEGIN() \
+    sha1_context sha1_ctx;\
+    BYTE* authbase = ptr - sizeof(TPM_COMMAND_CODE);\
+    TPM_DIGEST paramDigest;\
+    sha1_starts(&sha1_ctx)
+
+#define TPM_AUTH1_GEN(HMACkey, auth) do {\
+    sha1_finish(&sha1_ctx, paramDigest.digest);\
+    generateAuth(&paramDigest, HMACkey, auth);\
+    ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_AUTH2_GEN(HMACkey, auth) do {\
+    generateAuth(&paramDigest, HMACkey, auth);\
+    ptr = pack_TPM_AUTH_SESSION(ptr, auth);\
+} while(0)
+
+#define TPM_TRANSMIT() do {\
+    /* Pack the command size */\
+    paramSize = ptr - in_buf;\
+    pack_UINT32(in_buf + sizeof(TPM_TAG), paramSize);\
+    if ((status = TPM_TransmitData(in_buf, paramSize, out_buf, &out_len)) != TPM_SUCCESS) {\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_AUTH_VERIFY_BEGIN() do {\
+    UINT32 buf[2] = { cpu_to_be32(status), cpu_to_be32(ordinal) };\
+    sha1_starts(&sha1_ctx);\
+    sha1_update(&sha1_ctx, (unsigned char*)buf, sizeof(buf));\
+    authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH1_VERIFY(HMACkey, auth) do {\
+    sha1_finish(&sha1_ctx, paramDigest.digest);\
+    ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+    if ((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_AUTH2_VERIFY(HMACkey, auth) do {\
+    ptr = unpack_TPM_AUTH_SESSION(ptr, auth);\
+    if ((status = verifyAuth(&paramDigest, HMACkey, auth)) != TPM_SUCCESS) {\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_UNPACK_VERIFY() do { \
+    ptr = out_buf;\
+    ptr = unpack_TPM_RSP_HEADER(ptr, \
+          &(tag), &(paramSize), &(status));\
+    if ((status) != TPM_SUCCESS){ \
+        vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
+        goto abort_egress;\
+    }\
+} while(0)
+
+#define TPM_AUTH_HASH() do {\
+    sha1_update(&sha1_ctx, authbase, ptr - authbase);\
+    authbase = ptr;\
+} while(0)
+
+#define TPM_AUTH_SKIP() do {\
+    authbase = ptr;\
+} while(0)
+
+TPM_RC TPM2_PCR_Read(TPML_PCR_SELECTION pcrSelectionIn,
+                     UINT32 *pcrUpdateCounter,
+                     TPML_PCR_SELECTION *pcrSelectionOut,
+                     TPML_DIGEST *pcrValues)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS,TPM_CC_PCR_Read);
+
+    /*pack in*/
+    ptr =  pack_TPML_PCR_SELECTION(ptr, &pcrSelectionIn);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    /*unpack out*/
+    ptr = unpack_UINT32(ptr, pcrUpdateCounter);
+    ptr = unpack_TPML_PCR_SELECTION(ptr, pcrSelectionOut);
+    ptr = unpack_TPML_DIGEST(ptr, pcrValues);
+
+    goto egress;
+abort_egress:
+egress:
+    return status;
+}
+
+TPM_RC TPM2_Load(TPMI_DH_OBJECT parentHandle,
+                 TPM2B_PRIVATE *inPrivate, /* in */
+                 TPM2B_PUBLIC *inPublic, /* in */
+                 TPM_HANDLE *objectHandle, /* out */
+                 TPM2B_NAME *name /* out */)
+{
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_Load);
+
+    /* pack handle of parent for new object */
+    ptr =  pack_UINT32(ptr, parentHandle);
+
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.srk_auth_area);
+    ptr = pack_TPM2B_PRIVATE(ptr, inPrivate);
+    ptr = pack_TPM2B_PUBLIC(ptr, inPublic);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    if (objectHandle != NULL) {
+        ptr = unpack_TPM_HANDLE(ptr, objectHandle);
+    } else {
+        TPM_HANDLE tmp;
+        ptr = unpack_TPM_HANDLE(ptr, &tmp);
+    }
+
+    if (name != NULL)
+        ptr = unpack_TPM2B_NAME(ptr, name);
+    goto egress;
+
+abort_egress:
+egress:
+    return status;
+}
+
+TPM_RC TPM2_Create(TPMI_DH_OBJECT parentHandle,
+                   TPM2_Create_Params_in *in,
+                   TPM2_Create_Params_out *out)
+{
+    UINT32 param_size;
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_Create);
+
+    /* pack handle of parent for new object */
+    ptr =  pack_UINT32(ptr, parentHandle);
+
+    /* pack Auth Area */
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.srk_auth_area);
+
+    /* pack inSensitive */
+    ptr = pack_TPM2B_SENSITIVE_CREATE(ptr, &in->inSensitive);
+
+    /* pack inPublic */
+    ptr = pack_TPM2B_PUBLIC(ptr, &in->inPublic);
+
+    /* pack outside Info */
+    ptr = pack_TPM2B_DATA(ptr, &in->outsideInfo);
+
+    /* pack createPCR */
+    ptr = pack_TPML_PCR_SELECTION(ptr, &in->creationPCR);
+
+    /* Send the command to the tpm */
+    TPM_TRANSMIT();
+
+    /* Unpack and validate the header */
+    TPM_UNPACK_VERIFY();
+
+    ptr = unpack_UINT32(ptr, &param_size);
+    if (out != NULL) {
+        ptr = unpack_TPM2B_PRIVATE(ptr, &vtpm_globals.tpm2_storage_key.Private);
+        ptr = unpack_TPM2B_PUBLIC(ptr, &vtpm_globals.tpm2_storage_key.Public);
+        ptr = unpack_TPM2B_CREATION_DATA(ptr, &out->creationData);
+        ptr = unpack_TPM2B_DIGEST(ptr, &out->creationHash);
+        ptr = unpack_TPMT_TK_CREATION(ptr, &out->creationTicket);
+    } else {
+           ptr += param_size;
+    }
+    goto egress;
+
+abort_egress:
+egress:
+    return status;
+}
+
+TPM_RC TPM2_CreatePrimary(TPMI_RH_HIERARCHY primaryHandle,
+                          TPM2_Create_Params_in *in,
+                          TPM_HANDLE *objHandle,
+                          TPM2_Create_Params_out *out)
+{
+    UINT32 param_size;
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_CreatePrimary);
+
+    /* pack primary handle */
+    ptr = pack_UINT32(ptr, primaryHandle);
+
+    /* pack Auth Area */
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.pw_auth);
+
+    /* pack inSenstive */
+    ptr = pack_TPM2B_SENSITIVE_CREATE(ptr, &in->inSensitive);
+
+    /* pack inPublic */
+    ptr = pack_TPM2B_PUBLIC(ptr, &in->inPublic);
+
+    /* pack outsideInfo */
+    ptr = pack_TPM2B_DATA(ptr, &in->outsideInfo);
+
+    /* pack creationPCR */
+    ptr = pack_TPML_PCR_SELECTION(ptr, &in->creationPCR);
+
+    /* Send the command to the tpm */
+    TPM_TRANSMIT();
+
+    /* Unpack and validate the header */
+    TPM_UNPACK_VERIFY();
+
+    if (objHandle != NULL)
+        ptr = unpack_TPM_HANDLE(ptr, objHandle);
+    else {
+        TPM_HANDLE handle;
+        ptr = unpack_TPM_HANDLE(ptr, &handle);
+    }
+    ptr = unpack_UINT32(ptr, &param_size);
+
+    if (out != NULL) {
+        ptr = unpack_TPM2B_PUBLIC(ptr, &out->outPublic);
+        ptr = unpack_TPM2B_CREATION_DATA(ptr, &out->creationData);
+        ptr = unpack_TPM2B_DIGEST(ptr, &out->creationHash);
+        ptr = unpack_TPMT_TK_CREATION(ptr, &out->creationTicket);
+    } else {
+        ptr += param_size;
+    }
+
+goto egress;
+
+abort_egress:
+egress:
+   return status;
+}
+
+TPM_RC TPM2_HierachyChangeAuth(TPMI_RH_HIERARCHY_AUTH authHandle, TPM2B_AUTH *newAuth)
+{
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_HierarchyChangeAuth);
+    ptr = pack_UINT32(ptr, authHandle);
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.pw_auth);
+    ptr = pack_TPM2B_AUTH(ptr, newAuth);
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_RSA_ENCRYPT(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *message,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *outData)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS, TPM_CC_RSA_Encrypt);
+
+    ptr = pack_UINT32(ptr, keyHandle);
+    ptr = pack_TPM2B_PUBLIC_KEY_RSA(ptr, message);
+    ptr = pack_TPMT_RSA_DECRYPT(ptr, inScheme);
+    ptr = pack_TPM2B_DATA(ptr, label);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    if (outData != NULL)
+        unpack_TPM2B_PUBLIC_KEY_RSA(ptr, outData);
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_Bind(TPMI_DH_OBJECT keyHandle,
+                 void *buf,
+                 UINT32 len,
+                 void *out)
+{
+    TPM_RC status = TPM_SUCCESS;
+    TPM2B_PUBLIC_KEY_RSA message;
+    TPMT_RSA_DECRYPT inScheme;
+    TPM2B_DATA label;
+    TPM2B_PUBLIC_KEY_RSA outData;
+
+    message.size = len;
+    memcpy(message.buffer, buf, len);
+    inScheme.scheme = TPM2_ALG_NULL;
+    label.size = 0;
+    TPMTRYRETURN(TPM2_RSA_ENCRYPT(keyHandle, &message, &inScheme, &label, &outData));
+    memcpy(out, outData.buffer, outData.size);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_RSA_Decrypt(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *cipherText,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *message)
+{
+    UINT32 param_size;
+
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_RSA_Decrypt);
+    ptr = pack_UINT32(ptr, keyHandle);
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.srk_auth_area);
+    ptr = pack_TPM2B_PUBLIC_KEY_RSA(ptr, cipherText);
+    ptr = pack_TPMT_RSA_DECRYPT(ptr, inScheme);
+    ptr = pack_TPM2B_DATA(ptr, label);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    ptr = unpack_UINT32(ptr, &param_size);
+
+    if (message)
+        ptr = unpack_TPM2B_PUBLIC_KEY_RSA(ptr, message);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_UnBind(TPMI_DH_OBJECT keyHandle,
+                   UINT32 ilen,
+                   void *in,
+                   UINT32 *olen,
+                   void *out)
+{
+    UINT32 status;
+    TPM2B_PUBLIC_KEY_RSA cipher, message;
+    TPMT_RSA_DECRYPT inScheme;
+    TPM2B_DATA label;
+
+    cipher.size = ilen;
+    memcpy(cipher.buffer, in, ilen);
+    inScheme.scheme = TPM2_ALG_NULL;
+    label.size = 0;
+
+    TPMTRYRETURN(TPM2_RSA_Decrypt(keyHandle, &cipher, &inScheme, &label, &message));
+
+    *olen = message.size;
+    memcpy(out, message.buffer, *olen);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_CLEAR(void)
+{
+    TPM_BEGIN(TPM_ST_SESSIONS, TPM_CC_Clear);
+
+    ptr = pack_UINT32(ptr, TPM_RH_PLATFORM);
+    ptr = pack_TPM_AuthArea(ptr, &vtpm_globals.pw_auth);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_GetRandom(UINT32 * bytesRequested, BYTE * randomBytes)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS, TPM_CC_GetRandom);
+
+    ptr = pack_UINT16(ptr, (UINT16)*bytesRequested);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+    ptr = unpack_UINT16(ptr, (UINT16 *)bytesRequested);
+    ptr = unpack_TPM_BUFFER(ptr, randomBytes, *bytesRequested);
+
+abort_egress:
+    return status;
+}
+
+TPM_RC TPM2_FlushContext(TPMI_DH_CONTEXT flushHandle)
+{
+    TPM_BEGIN(TPM_ST_NO_SESSIONS, TPM_CC_FlushContext);
+
+    ptr = pack_UINT32(ptr, flushHandle);
+
+    TPM_TRANSMIT();
+    TPM_UNPACK_VERIFY();
+
+abort_egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/tpm2.h b/stubdom/vtpmmgr/tpm2.h
new file mode 100644
index 0000000..9f597ee
--- /dev/null
+++ b/stubdom/vtpmmgr/tpm2.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Authors:
+ *   Quan Xu <quan.xu@intel.com>
+ *
+ * Copyright (c) 2010-2012 United States Government, as represented by
+ * the Secretary of Defense.  All rights reserved.
+ *
+ * based off of the original tools/vtpm_manager code base which is:
+ * Copyright (c) 2005/2006, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials provided
+ *     with the distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __TPM2_H__
+#define __TPM2_H__
+
+#include "tcg.h"
+#include "tpm2_types.h"
+
+// ------------------------------------------------------------------
+// TPM 2.0 Exposed API
+// ------------------------------------------------------------------
+
+TPM_RC TPM2_PCR_Read(TPML_PCR_SELECTION pcrSelectionIn,
+                     UINT32 *pcrUpdateCounter,
+                     TPML_PCR_SELECTION *pcrSelectionOut,
+                     TPML_DIGEST *pcrValues);
+
+TPM_RC TPM2_Load(TPMI_DH_OBJECT parentHandle,
+                 TPM2B_PRIVATE *inPrivate,
+                 TPM2B_PUBLIC *inPublic,
+                 TPM_HANDLE *objectHandle,
+                 TPM2B_NAME *name);
+
+TPM_RC TPM2_Create(TPMI_DH_OBJECT parentHandle,
+                   TPM2_Create_Params_in *in,
+                   TPM2_Create_Params_out *out);
+
+TPM_RC TPM2_CreatePrimary(TPMI_RH_HIERARCHY primaryHandle,
+                          TPM2_Create_Params_in *objHandle,
+                          TPM_HANDLE *in,
+                          TPM2_Create_Params_out *out);
+
+TPM_RC TPM2_HierachyChangeAuth(TPMI_RH_HIERARCHY_AUTH authHandle,
+                               TPM2B_AUTH *newAuth);
+
+TPM_RC TPM2_RSA_ENCRYPT(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *message,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *outData);
+
+TPM_RC TPM2_Bind(TPMI_DH_OBJECT keyHandle,
+                 void *buf,
+                 UINT32 len,
+                 void *out);
+
+TPM_RC TPM2_RSA_Decrypt(TPMI_DH_OBJECT keyHandle,
+                        TPM2B_PUBLIC_KEY_RSA *cipherText,
+                        TPMT_RSA_DECRYPT *inScheme,
+                        TPM2B_DATA *label,
+                        TPM2B_PUBLIC_KEY_RSA *message);
+
+TPM_RC TPM2_UnBind(TPMI_DH_OBJECT keyHandle,
+                   UINT32 ilen,
+                   void *in,
+                   UINT32 *olen,
+                   void *out);
+
+TPM_RESULT TPM2_GetRandom(UINT32* bytesRequested,
+                          BYTE* randomBytes);
+
+TPM_RC TPM2_CLEAR(void);
+
+TPM_RC TPM2_FlushContext(TPMI_DH_CONTEXT);
+#endif //TPM2_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 Tue Feb 03 08:04:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTC-0006Pl-M3; Tue, 03 Feb 2015 08:04: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 1YIYTA-0006PW-Mt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:24 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	54/BB-02777-80180D45; Tue, 03 Feb 2015 08:04:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1422950662!12424638!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23911 invoked from network); 3 Feb 2015 08:04:23 -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 Feb 2015 08:04:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYT8-0005W9-5v
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYT8-0006cW-4v
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:22 +0000
Date: Tue, 03 Feb 2015 08:04:22 +0000
Message-Id: <E1YIYT8-0006cW-4v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM 2.0 takes ownership and
	create SRK
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b80507775dce91d506ac4620975976e0fdcefaf6
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:44 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: TPM 2.0 takes ownership and create SRK
    
    TPM2_CreatePrimary is used to create a Primary Object under one of
    the Primary Seeds or a Temporary Object under TPM_RH_NULL. The command
    uses a TPM2B_PUBLIC as a template for the object to be created. The
    command will create and load a Primary Object. The sensitive area is
    not returned. Any type of object and attributes combination that is
    allowed by TPM2_Create() may be created by this command. The constraints
    on templates and parameters are the same as TPM2_Create() except that a
    Primary Storage Key and a Temporary Storage Key are not constrained to
    use the algorithms of their parents.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c    |   71 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpmmgr.h |    3 ++
 2 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index f3aa02f..c654071 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -51,6 +51,7 @@
 #include "vtpm_disk.h"
 #include "tpm.h"
 #include "marshal.h"
+#include "tpm2.h"
 
 struct Opts {
    enum {
@@ -509,3 +510,73 @@ void vtpmmgr_shutdown(void)
 
    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
 }
+
+/* TPM 2.0 */
+
+static void tpm2_AuthArea_ctor(const char *authValue, UINT32 authLen,
+                               TPM_AuthArea *auth)
+{
+    auth->sessionHandle = TPM_RS_PW;
+    auth->nonce.size = 0;
+    auth->sessionAttributes = 1;
+    auth->auth.size = authLen;
+    memcpy(auth->auth.buffer, authValue, authLen);
+    auth->size = 9 + authLen;
+}
+
+TPM_RC tpm2_take_ownership(void)
+{
+    TPM_RC status = TPM_SUCCESS;
+
+    tpm2_AuthArea_ctor(NULL, 0, &vtpm_globals.pw_auth);
+
+    /* create SRK */
+    TPM2_CreatePrimary_Params_in in = {
+        .inSensitive = {
+            .size = 4,
+            .sensitive = {
+                .userAuth.size = 0,
+                .userAuth.buffer = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
+                                     0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+                .data.size = 0,
+            },
+        },
+        .inPublic = {
+            .size = 60,
+            .publicArea = {
+                .type = TPM2_ALG_RSA,
+                .nameAlg = TPM2_ALG_SHA256,
+#define SRK_OBJ_ATTR (fixedTPM | fixedParent  | userWithAuth | \
+                      sensitiveDataOrigin | restricted | decrypt)
+                .objectAttributes = SRK_OBJ_ATTR,
+                .authPolicy.size = 0,
+                .parameters.rsaDetail = {
+                    .symmetric = {
+                    .algorithm = TPM2_ALG_AES,
+                    .keyBits.aes = AES_KEY_SIZES_BITS,
+                    .mode.aes = TPM2_ALG_CFB,
+                    },
+                .scheme = { TPM2_ALG_NULL },
+                .keyBits = RSA_KEY_SIZES_BITS,
+                .exponent = 0,
+                },
+                .unique.rsa.size = 0,
+            },
+        },
+            .outsideInfo.size = 0,
+            .creationPCR.count = 0,
+    };
+
+    TPMTRYRETURN(TPM2_CreatePrimary(TPM_RH_OWNER,&in,
+                                    &vtpm_globals.srk_handle, NULL));
+    vtpmloginfo(VTPM_LOG_VTPM, "SRK handle: 0x%X\n", vtpm_globals.srk_handle);
+    {
+        const char data[20] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
+                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+        tpm2_AuthArea_ctor(data, 20, &vtpm_globals.srk_auth_area);
+    }
+    /*end create SRK*/
+
+abort_egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 0d0c604..95519ba 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -93,4 +93,7 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
    return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
 }
 
+/* TPM 2.0 */
+TPM_RC tpm2_take_ownership(void);
+
 #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 Tue Feb 03 08:04:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTC-0006Pl-M3; Tue, 03 Feb 2015 08:04: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 1YIYTA-0006PW-Mt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:24 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	54/BB-02777-80180D45; Tue, 03 Feb 2015 08:04:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1422950662!12424638!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23911 invoked from network); 3 Feb 2015 08:04:23 -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 Feb 2015 08:04:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYT8-0005W9-5v
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYT8-0006cW-4v
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:22 +0000
Date: Tue, 03 Feb 2015 08:04:22 +0000
Message-Id: <E1YIYT8-0006cW-4v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM 2.0 takes ownership and
	create SRK
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b80507775dce91d506ac4620975976e0fdcefaf6
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:44 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: TPM 2.0 takes ownership and create SRK
    
    TPM2_CreatePrimary is used to create a Primary Object under one of
    the Primary Seeds or a Temporary Object under TPM_RH_NULL. The command
    uses a TPM2B_PUBLIC as a template for the object to be created. The
    command will create and load a Primary Object. The sensitive area is
    not returned. Any type of object and attributes combination that is
    allowed by TPM2_Create() may be created by this command. The constraints
    on templates and parameters are the same as TPM2_Create() except that a
    Primary Storage Key and a Temporary Storage Key are not constrained to
    use the algorithms of their parents.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c    |   71 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpmmgr.h |    3 ++
 2 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index f3aa02f..c654071 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -51,6 +51,7 @@
 #include "vtpm_disk.h"
 #include "tpm.h"
 #include "marshal.h"
+#include "tpm2.h"
 
 struct Opts {
    enum {
@@ -509,3 +510,73 @@ void vtpmmgr_shutdown(void)
 
    vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager stopped.\n");
 }
+
+/* TPM 2.0 */
+
+static void tpm2_AuthArea_ctor(const char *authValue, UINT32 authLen,
+                               TPM_AuthArea *auth)
+{
+    auth->sessionHandle = TPM_RS_PW;
+    auth->nonce.size = 0;
+    auth->sessionAttributes = 1;
+    auth->auth.size = authLen;
+    memcpy(auth->auth.buffer, authValue, authLen);
+    auth->size = 9 + authLen;
+}
+
+TPM_RC tpm2_take_ownership(void)
+{
+    TPM_RC status = TPM_SUCCESS;
+
+    tpm2_AuthArea_ctor(NULL, 0, &vtpm_globals.pw_auth);
+
+    /* create SRK */
+    TPM2_CreatePrimary_Params_in in = {
+        .inSensitive = {
+            .size = 4,
+            .sensitive = {
+                .userAuth.size = 0,
+                .userAuth.buffer = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
+                                     0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+                .data.size = 0,
+            },
+        },
+        .inPublic = {
+            .size = 60,
+            .publicArea = {
+                .type = TPM2_ALG_RSA,
+                .nameAlg = TPM2_ALG_SHA256,
+#define SRK_OBJ_ATTR (fixedTPM | fixedParent  | userWithAuth | \
+                      sensitiveDataOrigin | restricted | decrypt)
+                .objectAttributes = SRK_OBJ_ATTR,
+                .authPolicy.size = 0,
+                .parameters.rsaDetail = {
+                    .symmetric = {
+                    .algorithm = TPM2_ALG_AES,
+                    .keyBits.aes = AES_KEY_SIZES_BITS,
+                    .mode.aes = TPM2_ALG_CFB,
+                    },
+                .scheme = { TPM2_ALG_NULL },
+                .keyBits = RSA_KEY_SIZES_BITS,
+                .exponent = 0,
+                },
+                .unique.rsa.size = 0,
+            },
+        },
+            .outsideInfo.size = 0,
+            .creationPCR.count = 0,
+    };
+
+    TPMTRYRETURN(TPM2_CreatePrimary(TPM_RH_OWNER,&in,
+                                    &vtpm_globals.srk_handle, NULL));
+    vtpmloginfo(VTPM_LOG_VTPM, "SRK handle: 0x%X\n", vtpm_globals.srk_handle);
+    {
+        const char data[20] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
+                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+        tpm2_AuthArea_ctor(data, 20, &vtpm_globals.srk_auth_area);
+    }
+    /*end create SRK*/
+
+abort_egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 0d0c604..95519ba 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -93,4 +93,7 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
    return ctr_drbg_random(&vtpm_globals.ctr_drbg, bytes, num_bytes) == 0 ? 0 : TPM_FAIL;
 }
 
+/* TPM 2.0 */
+TPM_RC tpm2_take_ownership(void);
+
 #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 Tue Feb 03 08:04:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTM-0006RH-Ok; Tue, 03 Feb 2015 08:04: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 1YIYTK-0006Qz-HY
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:34 +0000
Content-Length: 4534
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	05/F9-02754-11180D45; Tue, 03 Feb 2015 08:04:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950672!11755036!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11616 invoked from network); 3 Feb 2015 08:04:33 -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;
	3 Feb 2015 08:04: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 1YIYTI-0005WH-B3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTI-0006dG-9k
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:32 +0000
Date: Tue, 03 Feb 2015 08:04:32 +0000
Message-Id: <E1YIYTI-0006dG-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Create and load SK on TPM
	2.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4177408857516679764=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4177408857516679764==
Content-Length: 4194
Content-Transfer-Encoding: quoted-printable

commit 3334d916dea80ace09829d129753b20b85a41b65
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:45 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Create and load SK on TPM 2.0
    
    TPM2_Create is used to create an object that can be loaded into a
    TPM using TPM2_Load(). If the command completes successfully, the
    TPM will create the new object and return the object=E2=80=99s creation.
    data (creationData), its public area (outPublic), and its encrypted
    sensitive area (outPrivate). Preservation of the returned data is
    the responsibility of the caller. The object will need to be loaded
    (TPM2_Load()).
    TPM2_Load is used to load objects into the TPM. This command is used
    when both a TPM2B_PUBLIC and TPM2B_PRIVATE are to be loaded. If only
    a TPM2B_PUBLIC is to be loaded, the TPM2_LoadExternal command is used.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c    |   65 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpmmgr.h |    1 +
 2 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index c654071..43ba693 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -580,3 +580,68 @@ TPM_RC tpm2_take_ownership(void)
 abort_egress:
     return status;
 }
+
+TPM_RESULT vtpmmgr2_create(void)
+{
+    TPM_RESULT status =3D TPM_SUCCESS;
+
+    TPMTRYRETURN(tpm2_take_ownership());
+
+   /* create SK */
+    TPM2_Create_Params_out out;
+    TPM2_Create_Params_in in =3D {
+        .inSensitive =3D {
+            .size =3D 4 + 20,
+            .sensitive =3D {
+                .userAuth.size =3D 20,
+                .userAuth.buffer =3D { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
+                                     0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+                .data.size =3D 0,
+            },
+        },
+        .inPublic =3D {
+            .size =3D (60),
+            .publicArea =3D {
+                 .type =3D TPM2_ALG_RSA,
+                 .nameAlg =3D TPM2_ALG_SHA256,
+#define SK_OBJ_ATTR (fixedTPM | fixedParent | userWithAuth |\
+                     sensitiveDataOrigin |decrypt)
+                 .objectAttributes =3D SK_OBJ_ATTR,
+                 .authPolicy.size =3D 0,
+                 .parameters.rsaDetail =3D {
+                     .symmetric =3D {
+                         .algorithm =3D TPM2_ALG_NULL,
+                     },
+                     .scheme =3D {
+                         TPM2_ALG_OAEP,
+                         .details.oaep.hashAlg =3D TPM2_ALG_SHA256,
+                     },
+                     .keyBits =3D RSA_KEY_SIZES_BITS,
+                     .exponent =3D 0,
+                  },
+                  .unique.rsa.size =3D 0,
+            },
+        },
+        .outsideInfo.size =3D 0,
+        .creationPCR.count =3D 0,
+    };/*end in */
+
+    TPMTRYRETURN(TPM2_Create(vtpm_globals.srk_handle, &in, &out));
+    TPMTRYRETURN(TPM2_Load(vtpm_globals.srk_handle,
+                           &vtpm_globals.tpm2_storage_key.Private,
+                           &vtpm_globals.tpm2_storage_key.Public,
+                           &vtpm_globals.sk_handle,
+                           &vtpm_globals.sk_name));
+
+    vtpmloginfo(VTPM_LOG_VTPM, "SK HANDLE: 0x%X\n", vtpm_globals.sk_handle);
+
+    /*Create new disk image*/
+    TPMTRYRETURN(vtpm_new_disk());
+
+    goto egress;
+
+abort_egress:
+egress:
+    vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+    return status;
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 95519ba..9889feb 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -95,5 +95,6 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 
 /* TPM 2.0 */
 TPM_RC tpm2_take_ownership(void);
+TPM_RESULT vtpmmgr2_create(void);
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4177408857516679764==
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
--===============4177408857516679764==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:04:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTM-0006RH-Ok; Tue, 03 Feb 2015 08:04: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 1YIYTK-0006Qz-HY
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:34 +0000
Content-Length: 4534
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	05/F9-02754-11180D45; Tue, 03 Feb 2015 08:04:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1422950672!11755036!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11616 invoked from network); 3 Feb 2015 08:04:33 -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;
	3 Feb 2015 08:04: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 1YIYTI-0005WH-B3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTI-0006dG-9k
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:32 +0000
Date: Tue, 03 Feb 2015 08:04:32 +0000
Message-Id: <E1YIYTI-0006dG-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Create and load SK on TPM
	2.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4177408857516679764=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4177408857516679764==
Content-Length: 4194
Content-Transfer-Encoding: quoted-printable

commit 3334d916dea80ace09829d129753b20b85a41b65
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:45 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: Create and load SK on TPM 2.0
    
    TPM2_Create is used to create an object that can be loaded into a
    TPM using TPM2_Load(). If the command completes successfully, the
    TPM will create the new object and return the object=E2=80=99s creation.
    data (creationData), its public area (outPublic), and its encrypted
    sensitive area (outPrivate). Preservation of the returned data is
    the responsibility of the caller. The object will need to be loaded
    (TPM2_Load()).
    TPM2_Load is used to load objects into the TPM. This command is used
    when both a TPM2B_PUBLIC and TPM2B_PRIVATE are to be loaded. If only
    a TPM2B_PUBLIC is to be loaded, the TPM2_LoadExternal command is used.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c    |   65 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpmmgr.h |    1 +
 2 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index c654071..43ba693 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -580,3 +580,68 @@ TPM_RC tpm2_take_ownership(void)
 abort_egress:
     return status;
 }
+
+TPM_RESULT vtpmmgr2_create(void)
+{
+    TPM_RESULT status =3D TPM_SUCCESS;
+
+    TPMTRYRETURN(tpm2_take_ownership());
+
+   /* create SK */
+    TPM2_Create_Params_out out;
+    TPM2_Create_Params_in in =3D {
+        .inSensitive =3D {
+            .size =3D 4 + 20,
+            .sensitive =3D {
+                .userAuth.size =3D 20,
+                .userAuth.buffer =3D { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
+                                     0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+                .data.size =3D 0,
+            },
+        },
+        .inPublic =3D {
+            .size =3D (60),
+            .publicArea =3D {
+                 .type =3D TPM2_ALG_RSA,
+                 .nameAlg =3D TPM2_ALG_SHA256,
+#define SK_OBJ_ATTR (fixedTPM | fixedParent | userWithAuth |\
+                     sensitiveDataOrigin |decrypt)
+                 .objectAttributes =3D SK_OBJ_ATTR,
+                 .authPolicy.size =3D 0,
+                 .parameters.rsaDetail =3D {
+                     .symmetric =3D {
+                         .algorithm =3D TPM2_ALG_NULL,
+                     },
+                     .scheme =3D {
+                         TPM2_ALG_OAEP,
+                         .details.oaep.hashAlg =3D TPM2_ALG_SHA256,
+                     },
+                     .keyBits =3D RSA_KEY_SIZES_BITS,
+                     .exponent =3D 0,
+                  },
+                  .unique.rsa.size =3D 0,
+            },
+        },
+        .outsideInfo.size =3D 0,
+        .creationPCR.count =3D 0,
+    };/*end in */
+
+    TPMTRYRETURN(TPM2_Create(vtpm_globals.srk_handle, &in, &out));
+    TPMTRYRETURN(TPM2_Load(vtpm_globals.srk_handle,
+                           &vtpm_globals.tpm2_storage_key.Private,
+                           &vtpm_globals.tpm2_storage_key.Public,
+                           &vtpm_globals.sk_handle,
+                           &vtpm_globals.sk_name));
+
+    vtpmloginfo(VTPM_LOG_VTPM, "SK HANDLE: 0x%X\n", vtpm_globals.sk_handle);
+
+    /*Create new disk image*/
+    TPMTRYRETURN(vtpm_new_disk());
+
+    goto egress;
+
+abort_egress:
+egress:
+    vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
+    return status;
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 95519ba..9889feb 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -95,5 +95,6 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 
 /* TPM 2.0 */
 TPM_RC tpm2_take_ownership(void);
+TPM_RESULT vtpmmgr2_create(void);
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4177408857516679764==
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
--===============4177408857516679764==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:04:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTV-0006Sp-RV; Tue, 03 Feb 2015 08:04:45 +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 1YIYTU-0006Se-Sc
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:45 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	3B/3A-02754-C1180D45; Tue, 03 Feb 2015 08:04:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1422950682!12080744!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9737 invoked from network); 3 Feb 2015 08:04:43 -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;
	3 Feb 2015 08:04:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTS-0005WN-GJ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTS-0006el-Ec
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:42 +0000
Date: Tue, 03 Feb 2015 08:04:42 +0000
Message-Id: <E1YIYTS-0006el-Ec@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM2.0 TIS initialization
	and self test.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1710fc49a0f3a3907cb94dc55413085f01dd9642
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:46 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: TPM2.0 TIS initialization and self test.
    
    call the TPM 2.0 various registers that allow communication between
    the TPM 2.0 and platform hardware and software. TPM2_SelfTest causes
    the TPM 2.0 to perform a test of its capabilities.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpm_tis.h |    1 +
 extras/mini-os/tpm_tis.c         |  156 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+), 0 deletions(-)

diff --git a/extras/mini-os/include/tpm_tis.h b/extras/mini-os/include/tpm_tis.h
index 1faca0d..86e83f1 100644
--- a/extras/mini-os/include/tpm_tis.h
+++ b/extras/mini-os/include/tpm_tis.h
@@ -36,6 +36,7 @@
 struct tpm_chip;
 
 struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned int irq);
+struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned int irq);
 void shutdown_tpm_tis(struct tpm_chip* tpm);
 
 int tpm_tis_request_locality(struct tpm_chip* tpm, int locality);
diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
index d78c465..debcc43 100644
--- a/extras/mini-os/tpm_tis.c
+++ b/extras/mini-os/tpm_tis.c
@@ -1363,5 +1363,161 @@ int tpm_tis_posix_fstat(int fd, struct stat* buf)
    return 0;
 }
 
+/* TPM 2.0 */
 
+/*TPM2.0 Selftest*/
+static void tpm2_selftest(struct tpm_chip* chip)
+{
+    uint8_t data[] = {
+        0x80, 0x1,
+        0x0, 0x0, 0x0, 0xb,
+        0x0, 0x0, 0x1, 0x43,
+        0x1,
+    };
+
+    tpm_transmit(chip, data, sizeof(data));
+}
+
+struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned int irq)
+{
+    int i;
+    unsigned long addr;
+    struct tpm_chip* tpm = NULL;
+    uint32_t didvid;
+    uint32_t intfcaps;
+    uint32_t intmask;
+
+    printk("============= Init TPM2 TIS Driver ==============\n");
+
+    /*Sanity check the localities input */
+    if (localities & ~TPM_TIS_EN_LOCLALL) {
+        printk("init_tpm2_tis Invalid locality specification! %X\n", localities);
+        goto abort_egress;
+    }
+
+    printk("IOMEM Machine Base Address: %lX\n", baseaddr);
+
+    /* Create the tpm data structure */
+    tpm = malloc(sizeof(struct tpm_chip));
+    __init_tpm_chip(tpm);
+
+    /* Set the enabled localities - if 0 we leave default as all enabled */
+    if (localities != 0) {
+        tpm->enabled_localities = localities;
+    }
+    printk("Enabled Localities: ");
+    for (i = 0; i < 5; ++i) {
+        if (locality_enabled(tpm, i)) {
+            printk("%d ", i);
+        }
+    }
+    printk("\n");
+
+    /* Set the base machine address */
+    tpm->baseaddr = baseaddr;
+
+    /* Set default timeouts */
+    tpm->timeout_a = MILLISECS(TIS_SHORT_TIMEOUT);
+    tpm->timeout_b = MILLISECS(TIS_LONG_TIMEOUT);
+    tpm->timeout_c = MILLISECS(TIS_SHORT_TIMEOUT);
+    tpm->timeout_d = MILLISECS(TIS_SHORT_TIMEOUT);
+
+    /*Map the mmio pages */
+    addr = tpm->baseaddr;
+    for (i = 0; i < 5; ++i) {
+        if (locality_enabled(tpm, i)) {
+
+            /* Map the page in now */
+            if ((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
+                printk("Unable to map iomem page a address %p\n", addr);
+                goto abort_egress;
+            }
+
+            /* Set default locality to the first enabled one */
+            if (tpm->locality < 0) {
+                if (tpm_tis_request_locality(tpm, i) < 0) {
+                    printk("Unable to request locality %d??\n", i);
+                    goto abort_egress;
+                }
+            }
+        }
+        addr += PAGE_SIZE;
+    }
+
+    /* Get the vendor and device ids */
+    didvid = ioread32(TPM_DID_VID(tpm, tpm->locality));
+    tpm->did = didvid >> 16;
+    tpm->vid = didvid & 0xFFFF;
+
+    /* Get the revision id */
+    tpm->rid = ioread8(TPM_RID(tpm, tpm->locality));
+    printk("2.0 TPM (device-id=0x%X vendor-id = %X rev-id = %X)\n",
+           tpm->did, tpm->vid, tpm->rid);
+
+    intfcaps = ioread32(TPM_INTF_CAPS(tpm, tpm->locality));
+    printk("TPM interface capabilities (0x%x):\n", intfcaps);
+    if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
+        printk("\tBurst Count Static\n");
+    if (intfcaps & TPM_INTF_CMD_READY_INT)
+        printk("\tCommand Ready Int Support\n");
+    if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
+        printk("\tInterrupt Edge Falling\n");
+    if (intfcaps & TPM_INTF_INT_EDGE_RISING)
+        printk("\tInterrupt Edge Rising\n");
+    if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
+        printk("\tInterrupt Level Low\n");
+    if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
+        printk("\tInterrupt Level High\n");
+    if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
+        printk("\tLocality Change Int Support\n");
+    if (intfcaps & TPM_INTF_STS_VALID_INT)
+        printk("\tSts Valid Int Support\n");
+    if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
+        printk("\tData Avail Int Support\n");
+
+    /*Interupt setup */
+    intmask = ioread32(TPM_INT_ENABLE(tpm, tpm->locality));
+
+    intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
+               TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
+
+    iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), intmask);
+
+    /*If interupts are enabled, handle it */
+    if (irq) {
+        if (irq != TPM_PROBE_IRQ) {
+            tpm->irq = irq;
+        } else {
+        /*FIXME add irq probing feature later */
+        printk("IRQ probing not implemented\n");
+        }
+    }
+
+    if (tpm->irq) {
+        iowrite8(TPM_INT_VECTOR(tpm, tpm->locality), tpm->irq);
+        if (bind_pirq(tpm->irq, 1, tpm_tis_irq_handler, tpm) != 0) {
+            printk("Unabled to request irq: %u for use\n", tpm->irq);
+            printk("Will use polling mode\n");
+            tpm->irq = 0;
+        } else {
+
+            /* Clear all existing */
+            iowrite32(TPM_INT_STATUS(tpm, tpm->locality),
+                                     ioread32(TPM_INT_STATUS(tpm, tpm->locality)));
+
+            /* Turn on interrupts */
+            iowrite32(TPM_INT_ENABLE(tpm, tpm->locality),
+                                     intmask | TPM_GLOBAL_INT_ENABLE);
+        }
+    }
+
+    tpm2_selftest(tpm);
+    return tpm;
+
+abort_egress:
+    if (tpm != NULL) {
+        shutdown_tpm_tis(tpm);
+    }
+    return NULL;
+}
 #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 Tue Feb 03 08:04:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTV-0006Sp-RV; Tue, 03 Feb 2015 08:04:45 +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 1YIYTU-0006Se-Sc
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:45 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	3B/3A-02754-C1180D45; Tue, 03 Feb 2015 08:04:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1422950682!12080744!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9737 invoked from network); 3 Feb 2015 08:04:43 -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;
	3 Feb 2015 08:04:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTS-0005WN-GJ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTS-0006el-Ec
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:42 +0000
Date: Tue, 03 Feb 2015 08:04:42 +0000
Message-Id: <E1YIYTS-0006el-Ec@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM2.0 TIS initialization
	and self test.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1710fc49a0f3a3907cb94dc55413085f01dd9642
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:46 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:49 2015 +0000

    vTPM/TPM2: TPM2.0 TIS initialization and self test.
    
    call the TPM 2.0 various registers that allow communication between
    the TPM 2.0 and platform hardware and software. TPM2_SelfTest causes
    the TPM 2.0 to perform a test of its capabilities.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpm_tis.h |    1 +
 extras/mini-os/tpm_tis.c         |  156 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+), 0 deletions(-)

diff --git a/extras/mini-os/include/tpm_tis.h b/extras/mini-os/include/tpm_tis.h
index 1faca0d..86e83f1 100644
--- a/extras/mini-os/include/tpm_tis.h
+++ b/extras/mini-os/include/tpm_tis.h
@@ -36,6 +36,7 @@
 struct tpm_chip;
 
 struct tpm_chip* init_tpm_tis(unsigned long baseaddr, int localities, unsigned int irq);
+struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned int irq);
 void shutdown_tpm_tis(struct tpm_chip* tpm);
 
 int tpm_tis_request_locality(struct tpm_chip* tpm, int locality);
diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
index d78c465..debcc43 100644
--- a/extras/mini-os/tpm_tis.c
+++ b/extras/mini-os/tpm_tis.c
@@ -1363,5 +1363,161 @@ int tpm_tis_posix_fstat(int fd, struct stat* buf)
    return 0;
 }
 
+/* TPM 2.0 */
 
+/*TPM2.0 Selftest*/
+static void tpm2_selftest(struct tpm_chip* chip)
+{
+    uint8_t data[] = {
+        0x80, 0x1,
+        0x0, 0x0, 0x0, 0xb,
+        0x0, 0x0, 0x1, 0x43,
+        0x1,
+    };
+
+    tpm_transmit(chip, data, sizeof(data));
+}
+
+struct tpm_chip* init_tpm2_tis(unsigned long baseaddr, int localities, unsigned int irq)
+{
+    int i;
+    unsigned long addr;
+    struct tpm_chip* tpm = NULL;
+    uint32_t didvid;
+    uint32_t intfcaps;
+    uint32_t intmask;
+
+    printk("============= Init TPM2 TIS Driver ==============\n");
+
+    /*Sanity check the localities input */
+    if (localities & ~TPM_TIS_EN_LOCLALL) {
+        printk("init_tpm2_tis Invalid locality specification! %X\n", localities);
+        goto abort_egress;
+    }
+
+    printk("IOMEM Machine Base Address: %lX\n", baseaddr);
+
+    /* Create the tpm data structure */
+    tpm = malloc(sizeof(struct tpm_chip));
+    __init_tpm_chip(tpm);
+
+    /* Set the enabled localities - if 0 we leave default as all enabled */
+    if (localities != 0) {
+        tpm->enabled_localities = localities;
+    }
+    printk("Enabled Localities: ");
+    for (i = 0; i < 5; ++i) {
+        if (locality_enabled(tpm, i)) {
+            printk("%d ", i);
+        }
+    }
+    printk("\n");
+
+    /* Set the base machine address */
+    tpm->baseaddr = baseaddr;
+
+    /* Set default timeouts */
+    tpm->timeout_a = MILLISECS(TIS_SHORT_TIMEOUT);
+    tpm->timeout_b = MILLISECS(TIS_LONG_TIMEOUT);
+    tpm->timeout_c = MILLISECS(TIS_SHORT_TIMEOUT);
+    tpm->timeout_d = MILLISECS(TIS_SHORT_TIMEOUT);
+
+    /*Map the mmio pages */
+    addr = tpm->baseaddr;
+    for (i = 0; i < 5; ++i) {
+        if (locality_enabled(tpm, i)) {
+
+            /* Map the page in now */
+            if ((tpm->pages[i] = ioremap_nocache(addr, PAGE_SIZE)) == NULL) {
+                printk("Unable to map iomem page a address %p\n", addr);
+                goto abort_egress;
+            }
+
+            /* Set default locality to the first enabled one */
+            if (tpm->locality < 0) {
+                if (tpm_tis_request_locality(tpm, i) < 0) {
+                    printk("Unable to request locality %d??\n", i);
+                    goto abort_egress;
+                }
+            }
+        }
+        addr += PAGE_SIZE;
+    }
+
+    /* Get the vendor and device ids */
+    didvid = ioread32(TPM_DID_VID(tpm, tpm->locality));
+    tpm->did = didvid >> 16;
+    tpm->vid = didvid & 0xFFFF;
+
+    /* Get the revision id */
+    tpm->rid = ioread8(TPM_RID(tpm, tpm->locality));
+    printk("2.0 TPM (device-id=0x%X vendor-id = %X rev-id = %X)\n",
+           tpm->did, tpm->vid, tpm->rid);
+
+    intfcaps = ioread32(TPM_INTF_CAPS(tpm, tpm->locality));
+    printk("TPM interface capabilities (0x%x):\n", intfcaps);
+    if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
+        printk("\tBurst Count Static\n");
+    if (intfcaps & TPM_INTF_CMD_READY_INT)
+        printk("\tCommand Ready Int Support\n");
+    if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
+        printk("\tInterrupt Edge Falling\n");
+    if (intfcaps & TPM_INTF_INT_EDGE_RISING)
+        printk("\tInterrupt Edge Rising\n");
+    if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
+        printk("\tInterrupt Level Low\n");
+    if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
+        printk("\tInterrupt Level High\n");
+    if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
+        printk("\tLocality Change Int Support\n");
+    if (intfcaps & TPM_INTF_STS_VALID_INT)
+        printk("\tSts Valid Int Support\n");
+    if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
+        printk("\tData Avail Int Support\n");
+
+    /*Interupt setup */
+    intmask = ioread32(TPM_INT_ENABLE(tpm, tpm->locality));
+
+    intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
+               TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
+
+    iowrite32(TPM_INT_ENABLE(tpm, tpm->locality), intmask);
+
+    /*If interupts are enabled, handle it */
+    if (irq) {
+        if (irq != TPM_PROBE_IRQ) {
+            tpm->irq = irq;
+        } else {
+        /*FIXME add irq probing feature later */
+        printk("IRQ probing not implemented\n");
+        }
+    }
+
+    if (tpm->irq) {
+        iowrite8(TPM_INT_VECTOR(tpm, tpm->locality), tpm->irq);
+        if (bind_pirq(tpm->irq, 1, tpm_tis_irq_handler, tpm) != 0) {
+            printk("Unabled to request irq: %u for use\n", tpm->irq);
+            printk("Will use polling mode\n");
+            tpm->irq = 0;
+        } else {
+
+            /* Clear all existing */
+            iowrite32(TPM_INT_STATUS(tpm, tpm->locality),
+                                     ioread32(TPM_INT_STATUS(tpm, tpm->locality)));
+
+            /* Turn on interrupts */
+            iowrite32(TPM_INT_ENABLE(tpm, tpm->locality),
+                                     intmask | TPM_GLOBAL_INT_ENABLE);
+        }
+    }
+
+    tpm2_selftest(tpm);
+    return tpm;
+
+abort_egress:
+    if (tpm != NULL) {
+        shutdown_tpm_tis(tpm);
+    }
+    return NULL;
+}
 #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 Tue Feb 03 08:04:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTf-0006UO-U8; Tue, 03 Feb 2015 08:04:55 +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 1YIYTe-0006UC-T4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:55 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DA/7A-02754-62180D45; Tue, 03 Feb 2015 08:04:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950692!12130582!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13195 invoked from network); 3 Feb 2015 08:04:53 -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;
	3 Feb 2015 08:04:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTc-0005WW-Lk
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTc-0006fS-Kd
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:52 +0000
Date: Tue, 03 Feb 2015 08:04:52 +0000
Message-Id: <E1YIYTc-0006fS-Kd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add main entrance
	vtpmmgr2_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 df75aa4aa63ee496002f1495f10fb2e276f6bfe7
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:47 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Add main entrance vtpmmgr2_init()
    
    Accept commands from the vtpm-stubdom domains via the mini-os TPM
    backend driver. The vTPM manager communicates directly with hardware
    TPM 2.0 using the mini-os tpm2_tis driver.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c    |  109 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpmmgr.h |    1 +
 2 files changed, 110 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index 43ba693..980f622 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -645,3 +645,112 @@ egress:
     vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
     return status;
 }
+
+static int tpm2_entropy_source(void* dummy, unsigned char* data,
+                               size_t len, size_t* olen)
+{
+    UINT32 sz = len;
+    TPM_RESULT rc = TPM2_GetRandom(&sz, data);
+    *olen = sz;
+    return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+/*TPM 2.0 Objects flush */
+static TPM_RC flush_tpm2(void)
+{
+    int i;
+
+    for (i = TRANSIENT_FIRST; i < TRANSIENT_LAST; i++)
+         TPM2_FlushContext(i);
+
+    return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpmmgr2_init(int argc, char** argv)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+
+    /* Default commandline options */
+    struct Opts opts = {
+        .tpmdriver = TPMDRV_TPM_TIS,
+        .tpmiomem = TPM_BASEADDR,
+        .tpmirq = 0,
+        .tpmlocality = 0,
+        .gen_owner_auth = 0,
+    };
+
+    if (parse_cmdline_opts(argc, argv, &opts) != 0) {
+        vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+        status = TPM_BAD_PARAMETER;
+        goto abort_egress;
+    }
+
+    /*Setup storage system*/
+    if (vtpm_storage_init() != 0) {
+        vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+        status = TPM_IOERROR;
+        goto abort_egress;
+    }
+
+    /*Setup tpmback device*/
+    init_tpmback(set_opaque, free_opaque);
+
+    /*Setup tpm access*/
+    switch(opts.tpmdriver) {
+        case TPMDRV_TPM_TIS:
+        {
+            struct tpm_chip* tpm;
+            if ((tpm = init_tpm2_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality),
+                                     opts.tpmirq)) == NULL) {
+                vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+                status = TPM_IOERROR;
+                goto abort_egress;
+            }
+            printk("init_tpm2_tis()       ...ok\n");
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+        }
+        break;
+        case TPMDRV_TPMFRONT:
+        {
+            struct tpmfront_dev* tpmfront_dev;
+            if ((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+                vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+                status = TPM_IOERROR;
+                goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+        }
+        break;
+    }
+    printk("TPM 2.0 access ...ok\n");
+    /* Blow away all stale handles left in the tpm*/
+    if (flush_tpm2() != TPM_SUCCESS) {
+        vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+    }
+
+    /* Initialize the rng */
+    entropy_init(&vtpm_globals.entropy);
+    entropy_add_source(&vtpm_globals.entropy, tpm2_entropy_source, NULL, 0);
+    entropy_gather(&vtpm_globals.entropy);
+    ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+    ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+    /* Generate Auth for Owner*/
+    if (opts.gen_owner_auth) {
+        vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+    }
+
+    /* Load the Manager data, if it fails create a new manager */
+    if (vtpm_load_disk()) {
+        vtpmloginfo(VTPM_LOG_VTPM, "Assuming first time initialization.\n");
+        TPMTRYRETURN(vtpmmgr2_create());
+    }
+
+    goto egress;
+
+abort_egress:
+    vtpmmgr_shutdown();
+egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 9889feb..c479443 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -96,5 +96,6 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 /* TPM 2.0 */
 TPM_RC tpm2_take_ownership(void);
 TPM_RESULT vtpmmgr2_create(void);
+TPM_RESULT vtpmmgr2_init(int argc, char** argv);
 
 #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 Tue Feb 03 08:04:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:04: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 1YIYTf-0006UO-U8; Tue, 03 Feb 2015 08:04:55 +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 1YIYTe-0006UC-T4
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:55 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DA/7A-02754-62180D45; Tue, 03 Feb 2015 08:04:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950692!12130582!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13195 invoked from network); 3 Feb 2015 08:04:53 -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;
	3 Feb 2015 08:04:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTc-0005WW-Lk
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTc-0006fS-Kd
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:04:52 +0000
Date: Tue, 03 Feb 2015 08:04:52 +0000
Message-Id: <E1YIYTc-0006fS-Kd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Add main entrance
	vtpmmgr2_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 df75aa4aa63ee496002f1495f10fb2e276f6bfe7
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:47 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Add main entrance vtpmmgr2_init()
    
    Accept commands from the vtpm-stubdom domains via the mini-os TPM
    backend driver. The vTPM manager communicates directly with hardware
    TPM 2.0 using the mini-os tpm2_tis driver.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c    |  109 +++++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/vtpmmgr.h |    1 +
 2 files changed, 110 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index 43ba693..980f622 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -645,3 +645,112 @@ egress:
     vtpmloginfo(VTPM_LOG_VTPM, "Finished initialized new VTPM manager\n");
     return status;
 }
+
+static int tpm2_entropy_source(void* dummy, unsigned char* data,
+                               size_t len, size_t* olen)
+{
+    UINT32 sz = len;
+    TPM_RESULT rc = TPM2_GetRandom(&sz, data);
+    *olen = sz;
+    return rc == TPM_SUCCESS ? 0 : POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
+}
+
+/*TPM 2.0 Objects flush */
+static TPM_RC flush_tpm2(void)
+{
+    int i;
+
+    for (i = TRANSIENT_FIRST; i < TRANSIENT_LAST; i++)
+         TPM2_FlushContext(i);
+
+    return TPM_SUCCESS;
+}
+
+TPM_RESULT vtpmmgr2_init(int argc, char** argv)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+
+    /* Default commandline options */
+    struct Opts opts = {
+        .tpmdriver = TPMDRV_TPM_TIS,
+        .tpmiomem = TPM_BASEADDR,
+        .tpmirq = 0,
+        .tpmlocality = 0,
+        .gen_owner_auth = 0,
+    };
+
+    if (parse_cmdline_opts(argc, argv, &opts) != 0) {
+        vtpmlogerror(VTPM_LOG_VTPM, "Command line parsing failed! exiting..\n");
+        status = TPM_BAD_PARAMETER;
+        goto abort_egress;
+    }
+
+    /*Setup storage system*/
+    if (vtpm_storage_init() != 0) {
+        vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize storage subsystem!\n");
+        status = TPM_IOERROR;
+        goto abort_egress;
+    }
+
+    /*Setup tpmback device*/
+    init_tpmback(set_opaque, free_opaque);
+
+    /*Setup tpm access*/
+    switch(opts.tpmdriver) {
+        case TPMDRV_TPM_TIS:
+        {
+            struct tpm_chip* tpm;
+            if ((tpm = init_tpm2_tis(opts.tpmiomem, TPM_TIS_LOCL_INT_TO_FLAG(opts.tpmlocality),
+                                     opts.tpmirq)) == NULL) {
+                vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+                status = TPM_IOERROR;
+                goto abort_egress;
+            }
+            printk("init_tpm2_tis()       ...ok\n");
+            vtpm_globals.tpm_fd = tpm_tis_open(tpm);
+            tpm_tis_request_locality(tpm, opts.tpmlocality);
+        }
+        break;
+        case TPMDRV_TPMFRONT:
+        {
+            struct tpmfront_dev* tpmfront_dev;
+            if ((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
+                vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize tpmfront device\n");
+                status = TPM_IOERROR;
+                goto abort_egress;
+            }
+            vtpm_globals.tpm_fd = tpmfront_open(tpmfront_dev);
+        }
+        break;
+    }
+    printk("TPM 2.0 access ...ok\n");
+    /* Blow away all stale handles left in the tpm*/
+    if (flush_tpm2() != TPM_SUCCESS) {
+        vtpmlogerror(VTPM_LOG_VTPM, "VTPM_FlushResources failed, continuing anyway..\n");
+    }
+
+    /* Initialize the rng */
+    entropy_init(&vtpm_globals.entropy);
+    entropy_add_source(&vtpm_globals.entropy, tpm2_entropy_source, NULL, 0);
+    entropy_gather(&vtpm_globals.entropy);
+    ctr_drbg_init(&vtpm_globals.ctr_drbg, entropy_func, &vtpm_globals.entropy, NULL, 0);
+    ctr_drbg_set_prediction_resistance( &vtpm_globals.ctr_drbg, CTR_DRBG_PR_OFF );
+
+    /* Generate Auth for Owner*/
+    if (opts.gen_owner_auth) {
+        vtpmmgr_rand(vtpm_globals.owner_auth, sizeof(TPM_AUTHDATA));
+    }
+
+    /* Load the Manager data, if it fails create a new manager */
+    if (vtpm_load_disk()) {
+        vtpmloginfo(VTPM_LOG_VTPM, "Assuming first time initialization.\n");
+        TPMTRYRETURN(vtpmmgr2_create());
+    }
+
+    goto egress;
+
+abort_egress:
+    vtpmmgr_shutdown();
+egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index 9889feb..c479443 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -96,5 +96,6 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 /* TPM 2.0 */
 TPM_RC tpm2_take_ownership(void);
 TPM_RESULT vtpmmgr2_create(void);
+TPM_RESULT vtpmmgr2_init(int argc, char** argv);
 
 #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 Tue Feb 03 08:05:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYTq-0006Vt-0X; Tue, 03 Feb 2015 08:05: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 1YIYTp-0006Vf-56
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:05 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	27/BD-03132-03180D45; Tue, 03 Feb 2015 08:05:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1422950703!6670147!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1212 invoked from network); 3 Feb 2015 08:05:03 -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;
	3 Feb 2015 08:05: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 1YIYTm-0005X5-S2
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTm-0006gP-Py
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:02 +0000
Date: Tue, 03 Feb 2015 08:05:02 +0000
Message-Id: <E1YIYTm-0006gP-Py@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Support 'tpm2' extra
	command line.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71a7c55ad06485217cdc5dca9419e2ae411a7fc6
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:48 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Support 'tpm2' extra command line.
    
    Make vtpm-stubdom domain compatible to launch on TPM 1.x / TPM 2.0.
    Add:
    ..
         extra="tpm2=1"
    ..
    to launch vtpm-stubdom domain on TPM 2.0, ignore it on TPM 1.x. for
    example,
    vtpm-stubdom domain configuration on TPM 2.0:
    
      kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
      memory=16
      disk=["file:/var/scale/vdisk/vmgr,hda,w"]
      name="vtpmmgr"
      iomem=["fed40,5"]
      extra="tpm2=1"
    
    vtpm-stubdom domain configuration on TPM 1.x:
    
      kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
      memory=16
      disk=["file:/var/scale/vdisk/vmgr,hda,w"]
      name="vtpmmgr"
      iomem=["fed40,5"]
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/vtpmmgr.c |   46 +++++++++++++++++++++++++++++++++++++++-----
 stubdom/vtpmmgr/vtpmmgr.h |   14 +++++++++++++
 2 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
index 270ca8a..9fddaa2 100644
--- a/stubdom/vtpmmgr/vtpmmgr.c
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -45,6 +45,27 @@
 #include "vtpmmgr.h"
 #include "tcg.h"
 
+struct tpm_hardware_version hardware_version = {
+    .hw_version = TPM1_HARDWARE,
+};
+
+int parse_cmdline_hw(int argc, char** argv)
+{
+    int i;
+
+    for (i = 1; i < argc; ++i) {
+        if (!strcmp(argv[i], TPM2_EXTRA_OPT)) {
+            hardware_version.hw_version = TPM2_HARDWARE;
+            break;
+        }
+    }
+    return 0;
+}
+
+int hw_is_tpm2(void)
+{
+    return (hardware_version.hw_version == TPM2_HARDWARE) ? 1 : 0;
+}
 
 void main_loop(void) {
    tpmcmd_t* tpmcmd;
@@ -74,12 +95,25 @@ int main(int argc, char** argv)
    sleep(2);
    vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
 
-   /* Initialize the vtpm manager */
-   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
-      rc = -1;
-      goto exit;
-   }
+    /*Parse TPM hardware in extra command line*/
+    parse_cmdline_hw(argc, argv);
+
+    /* Initialize the vtpm manager */
+    if (hw_is_tpm2()) {
+        vtpmloginfo(VTPM_LOG_VTPM, "Hardware : --- TPM 2.0 ---\n");
+        if (vtpmmgr2_init(argc, argv) != TPM_SUCCESS) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+            rc = -1;
+            goto exit;
+        }
+    }else{
+        vtpmloginfo(VTPM_LOG_VTPM, "Hardware : --- TPM 1.x ---\n");
+        if (vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+            rc = -1;
+            goto exit;
+        }
+    }
 
    main_loop();
 
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index c479443..c8cd073 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -46,9 +46,21 @@
 #include "vtpm_manager.h"
 #include "tpm2_types.h"
 
+#define TPM2_EXTRA_OPT "tpm2=1"
 #define RSA_KEY_SIZE 0x0800
 #define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
 
+enum {
+    TPM1_HARDWARE = 1,
+    TPM2_HARDWARE,
+} tpm_version;
+
+struct tpm_hardware_version {
+    int hw_version;
+};
+
+extern struct tpm_hardware_version hardware_version;
+
 struct vtpm_globals {
    int tpm_fd;
    TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
@@ -97,5 +109,7 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 TPM_RC tpm2_take_ownership(void);
 TPM_RESULT vtpmmgr2_create(void);
 TPM_RESULT vtpmmgr2_init(int argc, char** argv);
+int parse_cmdline_hw(int argc, char** argv);
+int hw_is_tpm2(void);
 
 #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 Tue Feb 03 08:05:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYTq-0006Vt-0X; Tue, 03 Feb 2015 08:05: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 1YIYTp-0006Vf-56
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:05 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	27/BD-03132-03180D45; Tue, 03 Feb 2015 08:05:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1422950703!6670147!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1212 invoked from network); 3 Feb 2015 08:05:03 -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;
	3 Feb 2015 08:05: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 1YIYTm-0005X5-S2
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTm-0006gP-Py
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:02 +0000
Date: Tue, 03 Feb 2015 08:05:02 +0000
Message-Id: <E1YIYTm-0006gP-Py@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Support 'tpm2' extra
	command line.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71a7c55ad06485217cdc5dca9419e2ae411a7fc6
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:48 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Support 'tpm2' extra command line.
    
    Make vtpm-stubdom domain compatible to launch on TPM 1.x / TPM 2.0.
    Add:
    ..
         extra="tpm2=1"
    ..
    to launch vtpm-stubdom domain on TPM 2.0, ignore it on TPM 1.x. for
    example,
    vtpm-stubdom domain configuration on TPM 2.0:
    
      kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
      memory=16
      disk=["file:/var/scale/vdisk/vmgr,hda,w"]
      name="vtpmmgr"
      iomem=["fed40,5"]
      extra="tpm2=1"
    
    vtpm-stubdom domain configuration on TPM 1.x:
    
      kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
      memory=16
      disk=["file:/var/scale/vdisk/vmgr,hda,w"]
      name="vtpmmgr"
      iomem=["fed40,5"]
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/vtpmmgr.c |   46 +++++++++++++++++++++++++++++++++++++++-----
 stubdom/vtpmmgr/vtpmmgr.h |   14 +++++++++++++
 2 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
index 270ca8a..9fddaa2 100644
--- a/stubdom/vtpmmgr/vtpmmgr.c
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -45,6 +45,27 @@
 #include "vtpmmgr.h"
 #include "tcg.h"
 
+struct tpm_hardware_version hardware_version = {
+    .hw_version = TPM1_HARDWARE,
+};
+
+int parse_cmdline_hw(int argc, char** argv)
+{
+    int i;
+
+    for (i = 1; i < argc; ++i) {
+        if (!strcmp(argv[i], TPM2_EXTRA_OPT)) {
+            hardware_version.hw_version = TPM2_HARDWARE;
+            break;
+        }
+    }
+    return 0;
+}
+
+int hw_is_tpm2(void)
+{
+    return (hardware_version.hw_version == TPM2_HARDWARE) ? 1 : 0;
+}
 
 void main_loop(void) {
    tpmcmd_t* tpmcmd;
@@ -74,12 +95,25 @@ int main(int argc, char** argv)
    sleep(2);
    vtpmloginfo(VTPM_LOG_VTPM, "Starting vTPM manager domain\n");
 
-   /* Initialize the vtpm manager */
-   if(vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
-      vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
-      rc = -1;
-      goto exit;
-   }
+    /*Parse TPM hardware in extra command line*/
+    parse_cmdline_hw(argc, argv);
+
+    /* Initialize the vtpm manager */
+    if (hw_is_tpm2()) {
+        vtpmloginfo(VTPM_LOG_VTPM, "Hardware : --- TPM 2.0 ---\n");
+        if (vtpmmgr2_init(argc, argv) != TPM_SUCCESS) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+            rc = -1;
+            goto exit;
+        }
+    }else{
+        vtpmloginfo(VTPM_LOG_VTPM, "Hardware : --- TPM 1.x ---\n");
+        if (vtpmmgr_init(argc, argv) != TPM_SUCCESS) {
+            vtpmlogerror(VTPM_LOG_VTPM, "Unable to initialize vtpmmgr domain!\n");
+            rc = -1;
+            goto exit;
+        }
+    }
 
    main_loop();
 
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index c479443..c8cd073 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -46,9 +46,21 @@
 #include "vtpm_manager.h"
 #include "tpm2_types.h"
 
+#define TPM2_EXTRA_OPT "tpm2=1"
 #define RSA_KEY_SIZE 0x0800
 #define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
 
+enum {
+    TPM1_HARDWARE = 1,
+    TPM2_HARDWARE,
+} tpm_version;
+
+struct tpm_hardware_version {
+    int hw_version;
+};
+
+extern struct tpm_hardware_version hardware_version;
+
 struct vtpm_globals {
    int tpm_fd;
    TPM_AUTH_SESSION    oiap;                // OIAP session for storageKey
@@ -97,5 +109,7 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 TPM_RC tpm2_take_ownership(void);
 TPM_RESULT vtpmmgr2_create(void);
 TPM_RESULT vtpmmgr2_init(int argc, char** argv);
+int parse_cmdline_hw(int argc, char** argv);
+int hw_is_tpm2(void);
 
 #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 Tue Feb 03 08:05:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYU0-0006Xt-6i; Tue, 03 Feb 2015 08:05: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 1YIYTz-0006Xd-Fr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:15 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	49/CB-03164-A3180D45; Tue, 03 Feb 2015 08:05:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950713!10835905!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26733 invoked from network); 3 Feb 2015 08:05:13 -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;
	3 Feb 2015 08:05:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTx-0005XB-1c
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTx-0006gv-0L
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:13 +0000
Date: Tue, 03 Feb 2015 08:05:13 +0000
Message-Id: <E1YIYTx-0006gv-0L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM 2.0 PCRs 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

commit 98cbe872432aa63db4c13810a3e32c03be8d5186
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:49 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: TPM 2.0 PCRs read
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c       |   34 ++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm2_types.h |    2 ++
 stubdom/vtpmmgr/vtpmmgr.h    |    1 +
 3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index 980f622..1506735 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -51,6 +51,7 @@
 #include "vtpm_disk.h"
 #include "tpm.h"
 #include "marshal.h"
+#include "tpm2_marshal.h"
 #include "tpm2.h"
 
 struct Opts {
@@ -754,3 +755,36 @@ abort_egress:
 egress:
     return status;
 }
+
+TPM_RC tpm2_pcr_read(int index, uint8_t *buf)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+    TPML_PCR_SELECTION pcrSelectionIn = {
+        .count = 1,};
+
+    TPMS_PCR_SELECTION tpms_pcr_selection = {
+        .hash = TPM2_ALG_SHA1,
+        .sizeofSelect = PCR_SELECT_MAX,};
+
+    UINT32 pcrUpdateCounter;
+    TPML_PCR_SELECTION pcrSelectionOut;
+    TPML_DIGEST pcrValues;
+    TPM2B_DIGEST tpm2b_digest;
+
+    tpms_pcr_selection.pcrSelect[PCR_SELECT_NUM(index)] = PCR_SELECT_VALUE(index);
+    memcpy(&pcrSelectionIn.pcrSelections[0], &tpms_pcr_selection,
+           sizeof(TPMS_PCR_SELECTION));
+
+    TPMTRYRETURN(TPM2_PCR_Read(pcrSelectionIn, &pcrUpdateCounter,
+                               &pcrSelectionOut, &pcrValues));
+
+    if (pcrValues.count < 1)
+        goto egress;
+
+    unpack_TPM2B_DIGEST((uint8_t *) &pcrValues, &tpm2b_digest);
+    memcpy(buf, tpm2b_digest.buffer, SHA1_DIGEST_SIZE);
+
+abort_egress:
+egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/tpm2_types.h b/stubdom/vtpmmgr/tpm2_types.h
index 214335c..ac2830d 100644
--- a/stubdom/vtpmmgr/tpm2_types.h
+++ b/stubdom/vtpmmgr/tpm2_types.h
@@ -432,6 +432,8 @@ typedef struct {
 #define    IMPLEMENTATION_PCR   24
 #define    PLATFORM_PCR         24
 #define    PCR_SELECT_MAX       ((IMPLEMENTATION_PCR+7)/8)
+#define    PCR_SELECT_NUM(x)    (uint8_t)(x/8)
+#define    PCR_SELECT_VALUE(x)  (uint8_t)(0x1)<<(x%8)
 
 //Table 79 -- TPMS_PCR_SELECT Structure <I/O>
 typedef struct {
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index c8cd073..46fd14f 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -107,6 +107,7 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 
 /* TPM 2.0 */
 TPM_RC tpm2_take_ownership(void);
+TPM_RC tpm2_pcr_read(int index, uint8_t *buf);
 TPM_RESULT vtpmmgr2_create(void);
 TPM_RESULT vtpmmgr2_init(int argc, char** argv);
 int parse_cmdline_hw(int argc, char** argv);
--
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 Tue Feb 03 08:05:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYU0-0006Xt-6i; Tue, 03 Feb 2015 08:05: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 1YIYTz-0006Xd-Fr
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:15 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	49/CB-03164-A3180D45; Tue, 03 Feb 2015 08:05:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950713!10835905!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26733 invoked from network); 3 Feb 2015 08:05:13 -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;
	3 Feb 2015 08:05:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTx-0005XB-1c
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYTx-0006gv-0L
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:13 +0000
Date: Tue, 03 Feb 2015 08:05:13 +0000
Message-Id: <E1YIYTx-0006gv-0L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: TPM 2.0 PCRs 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

commit 98cbe872432aa63db4c13810a3e32c03be8d5186
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:49 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: TPM 2.0 PCRs read
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/init.c       |   34 ++++++++++++++++++++++++++++++++++
 stubdom/vtpmmgr/tpm2_types.h |    2 ++
 stubdom/vtpmmgr/vtpmmgr.h    |    1 +
 3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index 980f622..1506735 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -51,6 +51,7 @@
 #include "vtpm_disk.h"
 #include "tpm.h"
 #include "marshal.h"
+#include "tpm2_marshal.h"
 #include "tpm2.h"
 
 struct Opts {
@@ -754,3 +755,36 @@ abort_egress:
 egress:
     return status;
 }
+
+TPM_RC tpm2_pcr_read(int index, uint8_t *buf)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+    TPML_PCR_SELECTION pcrSelectionIn = {
+        .count = 1,};
+
+    TPMS_PCR_SELECTION tpms_pcr_selection = {
+        .hash = TPM2_ALG_SHA1,
+        .sizeofSelect = PCR_SELECT_MAX,};
+
+    UINT32 pcrUpdateCounter;
+    TPML_PCR_SELECTION pcrSelectionOut;
+    TPML_DIGEST pcrValues;
+    TPM2B_DIGEST tpm2b_digest;
+
+    tpms_pcr_selection.pcrSelect[PCR_SELECT_NUM(index)] = PCR_SELECT_VALUE(index);
+    memcpy(&pcrSelectionIn.pcrSelections[0], &tpms_pcr_selection,
+           sizeof(TPMS_PCR_SELECTION));
+
+    TPMTRYRETURN(TPM2_PCR_Read(pcrSelectionIn, &pcrUpdateCounter,
+                               &pcrSelectionOut, &pcrValues));
+
+    if (pcrValues.count < 1)
+        goto egress;
+
+    unpack_TPM2B_DIGEST((uint8_t *) &pcrValues, &tpm2b_digest);
+    memcpy(buf, tpm2b_digest.buffer, SHA1_DIGEST_SIZE);
+
+abort_egress:
+egress:
+    return status;
+}
diff --git a/stubdom/vtpmmgr/tpm2_types.h b/stubdom/vtpmmgr/tpm2_types.h
index 214335c..ac2830d 100644
--- a/stubdom/vtpmmgr/tpm2_types.h
+++ b/stubdom/vtpmmgr/tpm2_types.h
@@ -432,6 +432,8 @@ typedef struct {
 #define    IMPLEMENTATION_PCR   24
 #define    PLATFORM_PCR         24
 #define    PCR_SELECT_MAX       ((IMPLEMENTATION_PCR+7)/8)
+#define    PCR_SELECT_NUM(x)    (uint8_t)(x/8)
+#define    PCR_SELECT_VALUE(x)  (uint8_t)(0x1)<<(x%8)
 
 //Table 79 -- TPMS_PCR_SELECT Structure <I/O>
 typedef struct {
diff --git a/stubdom/vtpmmgr/vtpmmgr.h b/stubdom/vtpmmgr/vtpmmgr.h
index c8cd073..46fd14f 100644
--- a/stubdom/vtpmmgr/vtpmmgr.h
+++ b/stubdom/vtpmmgr/vtpmmgr.h
@@ -107,6 +107,7 @@ inline TPM_RESULT vtpmmgr_rand(unsigned char* bytes, size_t num_bytes) {
 
 /* TPM 2.0 */
 TPM_RC tpm2_take_ownership(void);
+TPM_RC tpm2_pcr_read(int index, uint8_t *buf);
 TPM_RESULT vtpmmgr2_create(void);
 TPM_RESULT vtpmmgr2_init(int argc, char** argv);
 int parse_cmdline_hw(int argc, char** argv);
--
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 Tue Feb 03 08:05:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYUE-0006Ze-A0; Tue, 03 Feb 2015 08:05: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 1YIYUD-0006ZW-6K
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:29 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	58/7E-03132-84180D45; Tue, 03 Feb 2015 08:05:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1422950723!10771978!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6304 invoked from network); 3 Feb 2015 08:05:24 -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 Feb 2015 08:05: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 1YIYU7-0005XH-CI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYU7-0006hH-5F
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:23 +0000
Date: Tue, 03 Feb 2015 08:05:23 +0000
Message-Id: <E1YIYU7-0006hH-5F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Support TPM 2.0 bind and
	unbind data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b8d8733f89d8c1ac4736f39da7eb4c53d213b88b
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:50 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Support TPM 2.0 bind and unbind data
    
    Bind data with TPM2_RSA_Encrypt, which performs RSA encryption using
    the indicated padding scheme according to PKCS#1v2.1(PKCS#1). If the
    scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme
    to specify the padding scheme.
    Unbind data with TPM2_RSA_Decrypt, which performs RSA decryption using
    the indicated padding scheme according to PKCS#1v2.1(PKCS#1).
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/disk_tpm.c |   42 ++++++++++++++++++++++++++++++++++++++++--
 stubdom/vtpmmgr/disk_tpm.h |    4 ++++
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_tpm.c b/stubdom/vtpmmgr/disk_tpm.c
index d650fbc..45a326a 100644
--- a/stubdom/vtpmmgr/disk_tpm.c
+++ b/stubdom/vtpmmgr/disk_tpm.c
@@ -12,17 +12,20 @@
 #include <polarssl/sha1.h>
 
 #include "tpm.h"
+#include "tpm2.h"
 #include "tcg.h"
 
 #include "vtpmmgr.h"
 #include "vtpm_disk.h"
 #include "disk_tpm.h"
 
+#include "log.h"
 // Print out input/output of seal/unseal operations (includes keys)
 #undef DEBUG_SEAL_OPS
 
 #ifdef DEBUG_SEAL_OPS
 #include "marshal.h"
+#include "tpm2_marshal.h"
 #endif
 
 struct pcr_list {
@@ -31,11 +34,16 @@ struct pcr_list {
 
 static struct pcr_list hwtpm;
 
+/*Ignore PCR on TPM 2.0, read PCR values for TPM 1.x seal | unseal*/
 void TPM_read_pcrs(void)
 {
 	int i;
-	for(i=0; i < 24; i++)
-		TPM_PCR_Read(i, &hwtpm.pcrs[i]);
+	for (i=0; i < 24; i++) {
+        if (hw_is_tpm2())
+            tpm2_pcr_read(i, (uint8_t *)&hwtpm.pcrs[i]);
+        else
+		    TPM_PCR_Read(i, &hwtpm.pcrs[i]);
+    }
 }
 
 struct pcr_composite_3 {
@@ -138,6 +146,36 @@ int TPM_disk_seal(struct disk_seal_entry *dst, const void* src, size_t size)
 	return rc;
 }
 
+TPM_RC TPM2_disk_bind(struct disk_seal_entry *dst, void* src, unsigned int size)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+
+    TPMTRYRETURN(TPM2_Bind(vtpm_globals.sk_handle,
+                           src,
+                           size,
+                           dst->sealed_data));
+
+abort_egress:
+egress:
+   return status;
+}
+
+TPM_RC TPM2_disk_unbind(void *dst, unsigned int *size, const struct disk_seal_entry *src)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+    unsigned char buf[RSA_CIPHER_SIZE];
+
+    memcpy(buf, src->sealed_data, RSA_CIPHER_SIZE);
+    TPMTRYRETURN(TPM2_UnBind(vtpm_globals.sk_handle,
+                             RSA_CIPHER_SIZE,
+                             buf,
+                             size,
+                             dst));
+abort_egress:
+egress:
+   return status;
+}
+
 int TPM_disk_unseal(void *dst, size_t size, const struct disk_seal_entry *src)
 {
 	uint32_t rc;
diff --git a/stubdom/vtpmmgr/disk_tpm.h b/stubdom/vtpmmgr/disk_tpm.h
index b235895..57ae2a6 100644
--- a/stubdom/vtpmmgr/disk_tpm.h
+++ b/stubdom/vtpmmgr/disk_tpm.h
@@ -10,6 +10,10 @@ void TPM_pcr_digest(struct hash160 *buf, le32_t selection);
 int TPM_disk_seal(struct disk_seal_entry *dst, const void* src, size_t size);
 int TPM_disk_unseal(void *dst, size_t size, const struct disk_seal_entry *src);
 
+/*TPM 2.0 Bind and Unbind */
+TPM_RC TPM2_disk_bind(struct disk_seal_entry *dst, void* src, unsigned int size);
+TPM_RC TPM2_disk_unbind(void *dst, unsigned int *size, const struct disk_seal_entry *src);
+
 /* NVRAM to allow revocation of TM-KEY */
 int TPM_disk_nvalloc(be32_t *nvram_slot, struct tpm_authdata auth);
 int TPM_disk_nvread(void *buf, size_t bufsiz, be32_t nvram_slot, struct tpm_authdata auth);
--
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 Tue Feb 03 08:05:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYUE-0006Ze-A0; Tue, 03 Feb 2015 08:05: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 1YIYUD-0006ZW-6K
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:29 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	58/7E-03132-84180D45; Tue, 03 Feb 2015 08:05:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1422950723!10771978!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6304 invoked from network); 3 Feb 2015 08:05:24 -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 Feb 2015 08:05: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 1YIYU7-0005XH-CI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYU7-0006hH-5F
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:23 +0000
Date: Tue, 03 Feb 2015 08:05:23 +0000
Message-Id: <E1YIYU7-0006hH-5F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Support TPM 2.0 bind and
	unbind data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b8d8733f89d8c1ac4736f39da7eb4c53d213b88b
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:50 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Support TPM 2.0 bind and unbind data
    
    Bind data with TPM2_RSA_Encrypt, which performs RSA encryption using
    the indicated padding scheme according to PKCS#1v2.1(PKCS#1). If the
    scheme of keyHandle is TPM_ALG_NULL, then the caller may use inScheme
    to specify the padding scheme.
    Unbind data with TPM2_RSA_Decrypt, which performs RSA decryption using
    the indicated padding scheme according to PKCS#1v2.1(PKCS#1).
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/disk_tpm.c |   42 ++++++++++++++++++++++++++++++++++++++++--
 stubdom/vtpmmgr/disk_tpm.h |    4 ++++
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_tpm.c b/stubdom/vtpmmgr/disk_tpm.c
index d650fbc..45a326a 100644
--- a/stubdom/vtpmmgr/disk_tpm.c
+++ b/stubdom/vtpmmgr/disk_tpm.c
@@ -12,17 +12,20 @@
 #include <polarssl/sha1.h>
 
 #include "tpm.h"
+#include "tpm2.h"
 #include "tcg.h"
 
 #include "vtpmmgr.h"
 #include "vtpm_disk.h"
 #include "disk_tpm.h"
 
+#include "log.h"
 // Print out input/output of seal/unseal operations (includes keys)
 #undef DEBUG_SEAL_OPS
 
 #ifdef DEBUG_SEAL_OPS
 #include "marshal.h"
+#include "tpm2_marshal.h"
 #endif
 
 struct pcr_list {
@@ -31,11 +34,16 @@ struct pcr_list {
 
 static struct pcr_list hwtpm;
 
+/*Ignore PCR on TPM 2.0, read PCR values for TPM 1.x seal | unseal*/
 void TPM_read_pcrs(void)
 {
 	int i;
-	for(i=0; i < 24; i++)
-		TPM_PCR_Read(i, &hwtpm.pcrs[i]);
+	for (i=0; i < 24; i++) {
+        if (hw_is_tpm2())
+            tpm2_pcr_read(i, (uint8_t *)&hwtpm.pcrs[i]);
+        else
+		    TPM_PCR_Read(i, &hwtpm.pcrs[i]);
+    }
 }
 
 struct pcr_composite_3 {
@@ -138,6 +146,36 @@ int TPM_disk_seal(struct disk_seal_entry *dst, const void* src, size_t size)
 	return rc;
 }
 
+TPM_RC TPM2_disk_bind(struct disk_seal_entry *dst, void* src, unsigned int size)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+
+    TPMTRYRETURN(TPM2_Bind(vtpm_globals.sk_handle,
+                           src,
+                           size,
+                           dst->sealed_data));
+
+abort_egress:
+egress:
+   return status;
+}
+
+TPM_RC TPM2_disk_unbind(void *dst, unsigned int *size, const struct disk_seal_entry *src)
+{
+    TPM_RESULT status = TPM_SUCCESS;
+    unsigned char buf[RSA_CIPHER_SIZE];
+
+    memcpy(buf, src->sealed_data, RSA_CIPHER_SIZE);
+    TPMTRYRETURN(TPM2_UnBind(vtpm_globals.sk_handle,
+                             RSA_CIPHER_SIZE,
+                             buf,
+                             size,
+                             dst));
+abort_egress:
+egress:
+   return status;
+}
+
 int TPM_disk_unseal(void *dst, size_t size, const struct disk_seal_entry *src)
 {
 	uint32_t rc;
diff --git a/stubdom/vtpmmgr/disk_tpm.h b/stubdom/vtpmmgr/disk_tpm.h
index b235895..57ae2a6 100644
--- a/stubdom/vtpmmgr/disk_tpm.h
+++ b/stubdom/vtpmmgr/disk_tpm.h
@@ -10,6 +10,10 @@ void TPM_pcr_digest(struct hash160 *buf, le32_t selection);
 int TPM_disk_seal(struct disk_seal_entry *dst, const void* src, size_t size);
 int TPM_disk_unseal(void *dst, size_t size, const struct disk_seal_entry *src);
 
+/*TPM 2.0 Bind and Unbind */
+TPM_RC TPM2_disk_bind(struct disk_seal_entry *dst, void* src, unsigned int size);
+TPM_RC TPM2_disk_unbind(void *dst, unsigned int *size, const struct disk_seal_entry *src);
+
 /* NVRAM to allow revocation of TM-KEY */
 int TPM_disk_nvalloc(be32_t *nvram_slot, struct tpm_authdata auth);
 int TPM_disk_nvread(void *buf, size_t bufsiz, be32_t nvram_slot, struct tpm_authdata auth);
--
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 Tue Feb 03 08:05:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYUK-0006ae-Ci; Tue, 03 Feb 2015 08:05:36 +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 1YIYUJ-0006aQ-KU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:35 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	0B/4A-03164-E4180D45; Tue, 03 Feb 2015 08:05:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422950733!10813082!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15993 invoked from network); 3 Feb 2015 08:05:34 -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;
	3 Feb 2015 08:05: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 1YIYUH-0005XN-Ip
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUH-0006hs-HD
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:33 +0000
Date: Tue, 03 Feb 2015 08:05:33 +0000
Message-Id: <E1YIYUH-0006hs-HD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Bind group keys and sectors
	data on disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b80533f680b4dbdb6ff8e5ed2ace6cffe79198d1
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:51 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Bind group keys and sectors data on disk
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/disk_write.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_write.c b/stubdom/vtpmmgr/disk_write.c
index 4c825c5..ab15a9a 100644
--- a/stubdom/vtpmmgr/disk_write.c
+++ b/stubdom/vtpmmgr/disk_write.c
@@ -88,7 +88,12 @@ static void generate_group_seals(struct mem_group *src, const struct mem_tpm_mgr
 		dst->pcr_selection = src->seals[i].pcr_selection;
 		memcpy(&dst->digest_release, &src->seals[i].digest_release, 20);
 		TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
-		TPM_disk_seal(dst, &sblob, sizeof(sblob));
+
+        /*TPM 2.0 bind | TPM 1.x seal*/
+        if (hw_is_tpm2())
+            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
+        else
+            TPM_disk_seal(dst, &sblob, sizeof(sblob));
 	}
 	src->seal_bits.nr_cfgs = native_be32(src->nr_seals);
 
@@ -250,7 +255,11 @@ static void disk_write_seal_list(struct mem_tpm_mgr *mgr, struct mem_group *grou
 		memcpy(&dst->digest_release, &src->digest_release, 20);
 		TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
 
-		TPM_disk_seal(dst, &sblob, sizeof(sblob));
+        /*TPM 2.0 bind / TPM 1.x seal*/
+        if (hw_is_tpm2())
+            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
+        else
+            TPM_disk_seal(dst, &sblob, sizeof(sblob));
 	}
 
 	memcpy(seal->hdr.magic, TPM_MGR_MAGIC, 12);
--
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 Tue Feb 03 08:05:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYUK-0006ae-Ci; Tue, 03 Feb 2015 08:05:36 +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 1YIYUJ-0006aQ-KU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:35 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	0B/4A-03164-E4180D45; Tue, 03 Feb 2015 08:05:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422950733!10813082!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15993 invoked from network); 3 Feb 2015 08:05:34 -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;
	3 Feb 2015 08:05: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 1YIYUH-0005XN-Ip
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUH-0006hs-HD
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:33 +0000
Date: Tue, 03 Feb 2015 08:05:33 +0000
Message-Id: <E1YIYUH-0006hs-HD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Bind group keys and sectors
	data on disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b80533f680b4dbdb6ff8e5ed2ace6cffe79198d1
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:51 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Bind group keys and sectors data on disk
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/disk_write.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_write.c b/stubdom/vtpmmgr/disk_write.c
index 4c825c5..ab15a9a 100644
--- a/stubdom/vtpmmgr/disk_write.c
+++ b/stubdom/vtpmmgr/disk_write.c
@@ -88,7 +88,12 @@ static void generate_group_seals(struct mem_group *src, const struct mem_tpm_mgr
 		dst->pcr_selection = src->seals[i].pcr_selection;
 		memcpy(&dst->digest_release, &src->seals[i].digest_release, 20);
 		TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
-		TPM_disk_seal(dst, &sblob, sizeof(sblob));
+
+        /*TPM 2.0 bind | TPM 1.x seal*/
+        if (hw_is_tpm2())
+            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
+        else
+            TPM_disk_seal(dst, &sblob, sizeof(sblob));
 	}
 	src->seal_bits.nr_cfgs = native_be32(src->nr_seals);
 
@@ -250,7 +255,11 @@ static void disk_write_seal_list(struct mem_tpm_mgr *mgr, struct mem_group *grou
 		memcpy(&dst->digest_release, &src->digest_release, 20);
 		TPM_pcr_digest(&dst->digest_at_seal, dst->pcr_selection);
 
-		TPM_disk_seal(dst, &sblob, sizeof(sblob));
+        /*TPM 2.0 bind / TPM 1.x seal*/
+        if (hw_is_tpm2())
+            TPM2_disk_bind(dst, &sblob, sizeof(sblob));
+        else
+            TPM_disk_seal(dst, &sblob, sizeof(sblob));
 	}
 
 	memcpy(seal->hdr.magic, TPM_MGR_MAGIC, 12);
--
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 Tue Feb 03 08:05:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYUV-0006cH-FU; Tue, 03 Feb 2015 08:05: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 1YIYUU-0006c4-1q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:46 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	B2/56-02994-95180D45; Tue, 03 Feb 2015 08:05:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1422950743!10789525!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10733 invoked from network); 3 Feb 2015 08:05:44 -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;
	3 Feb 2015 08:05: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 1YIYUR-0005XV-Oc
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUR-0006j1-Nl
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:43 +0000
Date: Tue, 03 Feb 2015 08:05:43 +0000
Message-Id: <E1YIYUR-0006j1-Nl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Unind group keys and
	sectors data on disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1fee946d3f34aaef4e7a0cff445c4d941ffa955
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:52 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Unind group keys and sectors data on disk
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/disk_read.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_read.c b/stubdom/vtpmmgr/disk_read.c
index 33aacdd..e9dc20f 100644
--- a/stubdom/vtpmmgr/disk_read.c
+++ b/stubdom/vtpmmgr/disk_read.c
@@ -67,6 +67,7 @@ static int find_group_key(struct mem_group *dst,
 		const struct mem_tpm_mgr *parent)
 {
 	int i, rc, rv = 1;
+    unsigned int olen;
 	struct hash160 buf;
 	struct disk_group_sealed_data sealed;
 
@@ -88,7 +89,13 @@ static int find_group_key(struct mem_group *dst,
 		TPM_pcr_digest(&buf, cfg->pcr_selection);
 		if (memcmp(&buf, &cfg->digest_release, 20))
 			continue;
-		rc = TPM_disk_unseal(&sealed, sizeof(sealed), cfg);
+
+        /*TPM 2.0 unbind | TPM 1.x unseal*/
+        if (hw_is_tpm2())
+            rc = TPM2_disk_unbind(&sealed, &olen, cfg);
+        else
+            rc = TPM_disk_unseal(&sealed, sizeof(sealed), cfg);
+
 		if (rc)
 			continue;
 		if (memcmp(&sealed.magic, DISK_GROUP_BOUND_MAGIC, 4))
@@ -112,9 +119,15 @@ static int find_group_key(struct mem_group *dst,
 static int parse_root_key(struct mem_tpm_mgr *dst, struct disk_seal_entry *src)
 {
 	int rc;
+    unsigned int olen;
 	struct disk_root_sealed_data sealed;
 
-	rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
+    /*TPM 2.0 unbind | TPM 1.x unseal*/
+    if (hw_is_tpm2())
+        rc = TPM2_disk_unbind(&sealed, &olen, src);
+    else
+        rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
+
 	if (rc)
 		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 Tue Feb 03 08:05:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05: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 1YIYUV-0006cH-FU; Tue, 03 Feb 2015 08:05: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 1YIYUU-0006c4-1q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:46 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	B2/56-02994-95180D45; Tue, 03 Feb 2015 08:05:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1422950743!10789525!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10733 invoked from network); 3 Feb 2015 08:05:44 -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;
	3 Feb 2015 08:05: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 1YIYUR-0005XV-Oc
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUR-0006j1-Nl
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:43 +0000
Date: Tue, 03 Feb 2015 08:05:43 +0000
Message-Id: <E1YIYUR-0006j1-Nl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Unind group keys and
	sectors data on disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1fee946d3f34aaef4e7a0cff445c4d941ffa955
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:52 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Unind group keys and sectors data on disk
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpmmgr/disk_read.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/disk_read.c b/stubdom/vtpmmgr/disk_read.c
index 33aacdd..e9dc20f 100644
--- a/stubdom/vtpmmgr/disk_read.c
+++ b/stubdom/vtpmmgr/disk_read.c
@@ -67,6 +67,7 @@ static int find_group_key(struct mem_group *dst,
 		const struct mem_tpm_mgr *parent)
 {
 	int i, rc, rv = 1;
+    unsigned int olen;
 	struct hash160 buf;
 	struct disk_group_sealed_data sealed;
 
@@ -88,7 +89,13 @@ static int find_group_key(struct mem_group *dst,
 		TPM_pcr_digest(&buf, cfg->pcr_selection);
 		if (memcmp(&buf, &cfg->digest_release, 20))
 			continue;
-		rc = TPM_disk_unseal(&sealed, sizeof(sealed), cfg);
+
+        /*TPM 2.0 unbind | TPM 1.x unseal*/
+        if (hw_is_tpm2())
+            rc = TPM2_disk_unbind(&sealed, &olen, cfg);
+        else
+            rc = TPM_disk_unseal(&sealed, sizeof(sealed), cfg);
+
 		if (rc)
 			continue;
 		if (memcmp(&sealed.magic, DISK_GROUP_BOUND_MAGIC, 4))
@@ -112,9 +119,15 @@ static int find_group_key(struct mem_group *dst,
 static int parse_root_key(struct mem_tpm_mgr *dst, struct disk_seal_entry *src)
 {
 	int rc;
+    unsigned int olen;
 	struct disk_root_sealed_data sealed;
 
-	rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
+    /*TPM 2.0 unbind | TPM 1.x unseal*/
+    if (hw_is_tpm2())
+        rc = TPM2_disk_unbind(&sealed, &olen, src);
+    else
+        rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
+
 	if (rc)
 		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 Tue Feb 03 08:05:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYUf-0006dw-IE; Tue, 03 Feb 2015 08:05:57 +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 1YIYUe-0006dj-CZ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:56 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	F2/5F-03132-36180D45; Tue, 03 Feb 2015 08:05:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422950754!10813181!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18091 invoked from network); 3 Feb 2015 08:05:54 -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;
	3 Feb 2015 08:05: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 1YIYUb-0005Xe-UB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUb-0006jb-SZ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:53 +0000
Date: Tue, 03 Feb 2015 08:05:53 +0000
Message-Id: <E1YIYUb-0006jb-SZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Record some infomation in
	docs/misc/vtpmmgr.txt about
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e906a2a18afd22891bec62c85c0471e159f5fd4
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:53 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Record some infomation in docs/misc/vtpmmgr.txt about
    
    'vtpmmgr on TPM 2.0'
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/vtpmmgr.txt |  155 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 154 insertions(+), 1 deletions(-)

diff --git a/docs/misc/vtpmmgr.txt b/docs/misc/vtpmmgr.txt
index 026c52b..d4f756c 100644
--- a/docs/misc/vtpmmgr.txt
+++ b/docs/misc/vtpmmgr.txt
@@ -1,4 +1,8 @@
-Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
+================================================================================
+Authors:
+    Daniel De Graaf <dgdegra@tycho.nsa.gov>
+    Quan Xu <quan.xu@intel.com>
+================================================================================
 
 This document describes the operation and command line interface of
 vtpmmgr-stubdom. See docs/misc/vtpm.txt for details on the vTPM subsystem as a
@@ -163,3 +167,152 @@ would look like the following:
 This requires the migration domain to be added to the list of valid vTPM kernel
 hashes. In the current version of the vtpmmgr domain, this is the hash of the
 XSM label, not the kernel.
+
+================================================================================
+Appendix B: vtpmmgr on TPM 2.0
+================================================================================
+
+Manager disk image setup:
+-------------------------
+
+The vTPM Manager requires a disk image to store its encrypted data. The image
+does not require a filesystem and can live anywhere on the host disk. The image
+is not large; the Xen 4.5 vtpmmgr is limited to using the first 2MB of the image
+but can support more than 20,000 vTPMs.
+
+ dd if=/dev/zero of=/home/vtpm2/vmgr bs=16M count=1
+
+Manager config file:
+--------------------
+
+The vTPM Manager domain (vtpmmgr-stubdom) must be started like any other Xen
+virtual machine and requires a config file.  The manager requires a disk image
+for storage and permission to access the hardware memory pages for the TPM. The
+disk must be presented as "hda", and the TPM memory pages are passed using the
+iomem configuration parameter. The TPM TIS uses 5 pages of IO memory (one per
+locality) that start at physical address 0xfed40000. By default, the TPM manager
+uses locality 0 (so only the page at 0xfed40 is needed).
+
+Add:
+..
+     extra="tpm2=1"
+..
+extra option to launch vtpmmgr-stubdom domain on TPM 2.0, and ignore it on TPM
+1.x. for example:
+
+    kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
+    memory=128
+    disk=["file:/home/vtpm2/vmgr,hda,w"]
+    name="vtpmmgr"
+    iomem=["fed40,5"]
+    extra="tpm2=1"
+
+
+Key Hierarchy
+------------------------------
+
+    +------------------+
+    |  vTPM's secrets  | ...
+    +------------------+
+            |  ^
+            |  |(Bind / Unbind)
+- - - - -  -v  |- - - - - - - - TPM 2.0
+    +------------------+
+    |        SK        +
+    +------------------+
+            |  ^
+            v  |
+    +------------------+
+    |       SRK        |
+    +------------------+
+            |  ^
+            v  |
+    +------------------+
+    | TPM 2.0 Storage  |
+    |   Primary Seed   |
+    +------------------+
+
+Now the secrets for the vTPMs are only being bound to the presence of thephysical
+TPM 2.0. Since using PCRs to seal the data can be an important security feature
+that users of the vtpmmgr rely on. I will replace TPM2_Bind/TPM2_Unbind with
+TPM2_Seal/TPM2_Unseal to provide as much security as it did for TPM 1.2 in later
+series of patch.
+
+DESIGN OVERVIEW
+------------------------------
+
+The architecture of vTPM subsystem on TPM 2.0 is described below:
+
++------------------+
+|    Linux DomU    | ...
+|       |  ^       |
+|       v  |       |
+|   xen-tpmfront   |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|  vtpm-stubdom    | ...
+|       |  ^       |
+|       v  |       |
+| mini-os/tpmfront |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+| vtpmmgr-stubdom  |
+|       |  ^       |
+|       v  |       |
+| mini-os/tpm2_tis |
++------------------+
+        |  ^
+        v  |
++------------------+
+| Hardware TPM 2.0 |
++------------------+
+
+ * Linux DomU: The Linux based guest that wants to use a vTPM. There many be
+               more than one of these.
+
+ * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
+                    provides vTPM access to a para-virtualized Linux based DomU.
+
+ * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
+                    connects to this backend driver to facilitate
+                    communications between the Linux DomU and its vTPM. This
+                    driver is also used by vtpmmgr-stubdom to communicate with
+                    vtpm-stubdom.
+
+ * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
+                 one to one mapping between running vtpm-stubdom instances and
+                 logical vtpms on the system. The vTPM Platform Configuration
+                 Registers (PCRs) are all initialized to zero.
+
+ * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
+                     vtpm-stubdom uses this driver to communicate with
+                     vtpmmgr-stubdom. This driver could also be used separately to
+                     implement a mini-os domain that wishes to use a vTPM of
+                     its own.
+
+ * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager.
+               There is only one vTPM manager and it should be running during
+               the entire lifetime of the machine.  This domain regulates
+               access to the physical TPM on the system and secures the
+               persistent state of each vTPM.
+
+ * mini-os/tpm2_tis: Mini-os TPM version 2.0 TPM Interface Specification (TIS)
+                    driver. This driver used by vtpmmgr-stubdom to talk directly
+                    to the hardware TPM 2.0. Communication is facilitated by mapping
+                    hardware memory pages into vtpmmgr-stubdom.
+
+ * Hardware TPM 2.0: The physical TPM 2.0 that is soldered onto the motherboard.
+
+---------------------
+Noted:
+    functionality for a virtual guest operating system (a DomU) is still TPM 1.2.
--
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 Tue Feb 03 08:05:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:05:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYUf-0006dw-IE; Tue, 03 Feb 2015 08:05:57 +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 1YIYUe-0006dj-CZ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:56 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	F2/5F-03132-36180D45; Tue, 03 Feb 2015 08:05:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1422950754!10813181!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18091 invoked from network); 3 Feb 2015 08:05:54 -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;
	3 Feb 2015 08:05: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 1YIYUb-0005Xe-UB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUb-0006jb-SZ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:05:53 +0000
Date: Tue, 03 Feb 2015 08:05:53 +0000
Message-Id: <E1YIYUb-0006jb-SZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vTPM/TPM2: Record some infomation in
	docs/misc/vtpmmgr.txt about
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e906a2a18afd22891bec62c85c0471e159f5fd4
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Jan 15 04:21:53 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 12:54:50 2015 +0000

    vTPM/TPM2: Record some infomation in docs/misc/vtpmmgr.txt about
    
    'vtpmmgr on TPM 2.0'
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 docs/misc/vtpmmgr.txt |  155 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 154 insertions(+), 1 deletions(-)

diff --git a/docs/misc/vtpmmgr.txt b/docs/misc/vtpmmgr.txt
index 026c52b..d4f756c 100644
--- a/docs/misc/vtpmmgr.txt
+++ b/docs/misc/vtpmmgr.txt
@@ -1,4 +1,8 @@
-Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
+================================================================================
+Authors:
+    Daniel De Graaf <dgdegra@tycho.nsa.gov>
+    Quan Xu <quan.xu@intel.com>
+================================================================================
 
 This document describes the operation and command line interface of
 vtpmmgr-stubdom. See docs/misc/vtpm.txt for details on the vTPM subsystem as a
@@ -163,3 +167,152 @@ would look like the following:
 This requires the migration domain to be added to the list of valid vTPM kernel
 hashes. In the current version of the vtpmmgr domain, this is the hash of the
 XSM label, not the kernel.
+
+================================================================================
+Appendix B: vtpmmgr on TPM 2.0
+================================================================================
+
+Manager disk image setup:
+-------------------------
+
+The vTPM Manager requires a disk image to store its encrypted data. The image
+does not require a filesystem and can live anywhere on the host disk. The image
+is not large; the Xen 4.5 vtpmmgr is limited to using the first 2MB of the image
+but can support more than 20,000 vTPMs.
+
+ dd if=/dev/zero of=/home/vtpm2/vmgr bs=16M count=1
+
+Manager config file:
+--------------------
+
+The vTPM Manager domain (vtpmmgr-stubdom) must be started like any other Xen
+virtual machine and requires a config file.  The manager requires a disk image
+for storage and permission to access the hardware memory pages for the TPM. The
+disk must be presented as "hda", and the TPM memory pages are passed using the
+iomem configuration parameter. The TPM TIS uses 5 pages of IO memory (one per
+locality) that start at physical address 0xfed40000. By default, the TPM manager
+uses locality 0 (so only the page at 0xfed40 is needed).
+
+Add:
+..
+     extra="tpm2=1"
+..
+extra option to launch vtpmmgr-stubdom domain on TPM 2.0, and ignore it on TPM
+1.x. for example:
+
+    kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
+    memory=128
+    disk=["file:/home/vtpm2/vmgr,hda,w"]
+    name="vtpmmgr"
+    iomem=["fed40,5"]
+    extra="tpm2=1"
+
+
+Key Hierarchy
+------------------------------
+
+    +------------------+
+    |  vTPM's secrets  | ...
+    +------------------+
+            |  ^
+            |  |(Bind / Unbind)
+- - - - -  -v  |- - - - - - - - TPM 2.0
+    +------------------+
+    |        SK        +
+    +------------------+
+            |  ^
+            v  |
+    +------------------+
+    |       SRK        |
+    +------------------+
+            |  ^
+            v  |
+    +------------------+
+    | TPM 2.0 Storage  |
+    |   Primary Seed   |
+    +------------------+
+
+Now the secrets for the vTPMs are only being bound to the presence of thephysical
+TPM 2.0. Since using PCRs to seal the data can be an important security feature
+that users of the vtpmmgr rely on. I will replace TPM2_Bind/TPM2_Unbind with
+TPM2_Seal/TPM2_Unseal to provide as much security as it did for TPM 1.2 in later
+series of patch.
+
+DESIGN OVERVIEW
+------------------------------
+
+The architecture of vTPM subsystem on TPM 2.0 is described below:
+
++------------------+
+|    Linux DomU    | ...
+|       |  ^       |
+|       v  |       |
+|   xen-tpmfront   |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+|  vtpm-stubdom    | ...
+|       |  ^       |
+|       v  |       |
+| mini-os/tpmfront |
++------------------+
+        |  ^
+        v  |
++------------------+
+| mini-os/tpmback  |
+|       |  ^       |
+|       v  |       |
+| vtpmmgr-stubdom  |
+|       |  ^       |
+|       v  |       |
+| mini-os/tpm2_tis |
++------------------+
+        |  ^
+        v  |
++------------------+
+| Hardware TPM 2.0 |
++------------------+
+
+ * Linux DomU: The Linux based guest that wants to use a vTPM. There many be
+               more than one of these.
+
+ * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
+                    provides vTPM access to a para-virtualized Linux based DomU.
+
+ * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
+                    connects to this backend driver to facilitate
+                    communications between the Linux DomU and its vTPM. This
+                    driver is also used by vtpmmgr-stubdom to communicate with
+                    vtpm-stubdom.
+
+ * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
+                 one to one mapping between running vtpm-stubdom instances and
+                 logical vtpms on the system. The vTPM Platform Configuration
+                 Registers (PCRs) are all initialized to zero.
+
+ * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
+                     vtpm-stubdom uses this driver to communicate with
+                     vtpmmgr-stubdom. This driver could also be used separately to
+                     implement a mini-os domain that wishes to use a vTPM of
+                     its own.
+
+ * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager.
+               There is only one vTPM manager and it should be running during
+               the entire lifetime of the machine.  This domain regulates
+               access to the physical TPM on the system and secures the
+               persistent state of each vTPM.
+
+ * mini-os/tpm2_tis: Mini-os TPM version 2.0 TPM Interface Specification (TIS)
+                    driver. This driver used by vtpmmgr-stubdom to talk directly
+                    to the hardware TPM 2.0. Communication is facilitated by mapping
+                    hardware memory pages into vtpmmgr-stubdom.
+
+ * Hardware TPM 2.0: The physical TPM 2.0 that is soldered onto the motherboard.
+
+---------------------
+Noted:
+    functionality for a virtual guest operating system (a DomU) is still TPM 1.2.
--
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 Tue Feb 03 08:06:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYUq-0006fH-Ky; Tue, 03 Feb 2015 08:06:08 +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 1YIYUo-0006f0-S9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:07 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6E/3D-02999-E6180D45; Tue, 03 Feb 2015 08:06:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1422950764!11542352!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15180 invoked from network); 3 Feb 2015 08:06:05 -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;
	3 Feb 2015 08:06: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 1YIYUm-0005YD-4e
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUm-0006kY-27
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:04 +0000
Date: Tue, 03 Feb 2015 08:06:04 +0000
Message-Id: <E1YIYUm-0006kY-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: split the init_xen_time() in
	2 parts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57255adfe196780c945abafd15959a1c33f13e41
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Wed Jan 28 12:54:41 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 13:10:26 2015 +0000

    xen/arm: split the init_xen_time() in 2 parts
    
    Create preinit_xen_time() and move to it minimum required
    subset of operations needed to properly initialized
    cpu_khz and boot_count vars. This is allow us to use udelay()
    immediately after the call.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c   |    6 +++-
 xen/arch/arm/time.c    |   57 +++++++++++++++++++++++++++---------------------
 xen/include/xen/time.h |    1 +
 3 files changed, 37 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index f49569d..a916ca6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -743,6 +743,10 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     init_IRQ();
 
+    platform_init();
+
+    preinit_xen_time();
+
     dt_uart_init();
     console_init_preirq();
     console_init_ring();
@@ -751,8 +755,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     processor_id();
 
-    platform_init();
-
     smp_init_cpus();
     cpus = smp_get_max_cpus();
 
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 455f217..37b85cd 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -61,56 +61,63 @@ unsigned int timer_get_irq(enum timer_ppi ppi)
     return muldiv64(ns, 1000 * cpu_khz, SECONDS(1));
 }
 
-/* Set up the timer on the boot CPU */
-int __init init_xen_time(void)
+static __initdata struct dt_device_node *timer;
+
+/* Set up the timer on the boot CPU (early init function) */
+void __init preinit_xen_time(void)
 {
     static const struct dt_device_match timer_ids[] __initconst =
     {
         DT_MATCH_TIMER,
         { /* sentinel */ },
     };
-    struct dt_device_node *dev;
     int res;
-    unsigned int i;
     u32 rate;
 
-    dev = dt_find_matching_node(NULL, timer_ids);
-    if ( !dev )
+    timer = dt_find_matching_node(NULL, timer_ids);
+    if ( !timer )
         panic("Unable to find a compatible timer in the device tree");
 
-    dt_device_set_used_by(dev, DOMID_XEN);
+    dt_device_set_used_by(timer, DOMID_XEN);
+
+    res = platform_init_time();
+    if ( res )
+        panic("Timer: Cannot initialize platform timer");
+
+    res = dt_property_read_u32(timer, "clock-frequency", &rate);
+    if ( res )
+        cpu_khz = rate / 1000;
+    else
+        cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
+
+    boot_count = READ_SYSREG64(CNTPCT_EL0);
+}
+
+/* Set up the timer on the boot CPU (late init function) */
+int __init init_xen_time(void)
+{
+    int res;
+    unsigned int i;
 
     /* Retrieve all IRQs for the timer */
     for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ )
     {
-        res = platform_get_irq(dev, i);
+        res = platform_get_irq(timer, i);
 
         if ( res < 0 )
             panic("Timer: Unable to retrieve IRQ %u from the device tree", i);
         timer_irq[i] = res;
     }
 
-    printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
-           timer_irq[TIMER_PHYS_NONSECURE_PPI],
-           timer_irq[TIMER_HYP_PPI],
-           timer_irq[TIMER_VIRT_PPI]);
-
-    res = platform_init_time();
-    if ( res )
-        panic("Timer: Cannot initialize platform timer");
-
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
         panic("CPU does not support the Generic Timer v1 interface");
 
-    res = dt_property_read_u32(dev, "clock-frequency", &rate);
-    if ( res )
-        cpu_khz = rate / 1000;
-    else
-        cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
-
-    boot_count = READ_SYSREG64(CNTPCT_EL0);
-    printk("Using generic timer at %lu KHz\n", cpu_khz);
+    printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u Freq: %lu KHz\n",
+           timer_irq[TIMER_PHYS_NONSECURE_PPI],
+           timer_irq[TIMER_HYP_PPI],
+           timer_irq[TIMER_VIRT_PPI],
+           cpu_khz);
 
     return 0;
 }
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 709501f..bb6259d 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -12,6 +12,7 @@
 #include <public/xen.h>
 
 extern int init_xen_time(void);
+void preinit_xen_time(void);
 extern void cstate_restore_tsc(void);
 
 extern unsigned long cpu_khz;
--
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 Tue Feb 03 08:06:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YIYUq-0006fH-Ky; Tue, 03 Feb 2015 08:06:08 +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 1YIYUo-0006f0-S9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:07 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6E/3D-02999-E6180D45; Tue, 03 Feb 2015 08:06:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1422950764!11542352!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15180 invoked from network); 3 Feb 2015 08:06:05 -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;
	3 Feb 2015 08:06: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 1YIYUm-0005YD-4e
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUm-0006kY-27
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:04 +0000
Date: Tue, 03 Feb 2015 08:06:04 +0000
Message-Id: <E1YIYUm-0006kY-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: split the init_xen_time() in
	2 parts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57255adfe196780c945abafd15959a1c33f13e41
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Wed Jan 28 12:54:41 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 13:10:26 2015 +0000

    xen/arm: split the init_xen_time() in 2 parts
    
    Create preinit_xen_time() and move to it minimum required
    subset of operations needed to properly initialized
    cpu_khz and boot_count vars. This is allow us to use udelay()
    immediately after the call.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c   |    6 +++-
 xen/arch/arm/time.c    |   57 +++++++++++++++++++++++++++---------------------
 xen/include/xen/time.h |    1 +
 3 files changed, 37 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index f49569d..a916ca6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -743,6 +743,10 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     init_IRQ();
 
+    platform_init();
+
+    preinit_xen_time();
+
     dt_uart_init();
     console_init_preirq();
     console_init_ring();
@@ -751,8 +755,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     processor_id();
 
-    platform_init();
-
     smp_init_cpus();
     cpus = smp_get_max_cpus();
 
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 455f217..37b85cd 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -61,56 +61,63 @@ unsigned int timer_get_irq(enum timer_ppi ppi)
     return muldiv64(ns, 1000 * cpu_khz, SECONDS(1));
 }
 
-/* Set up the timer on the boot CPU */
-int __init init_xen_time(void)
+static __initdata struct dt_device_node *timer;
+
+/* Set up the timer on the boot CPU (early init function) */
+void __init preinit_xen_time(void)
 {
     static const struct dt_device_match timer_ids[] __initconst =
     {
         DT_MATCH_TIMER,
         { /* sentinel */ },
     };
-    struct dt_device_node *dev;
     int res;
-    unsigned int i;
     u32 rate;
 
-    dev = dt_find_matching_node(NULL, timer_ids);
-    if ( !dev )
+    timer = dt_find_matching_node(NULL, timer_ids);
+    if ( !timer )
         panic("Unable to find a compatible timer in the device tree");
 
-    dt_device_set_used_by(dev, DOMID_XEN);
+    dt_device_set_used_by(timer, DOMID_XEN);
+
+    res = platform_init_time();
+    if ( res )
+        panic("Timer: Cannot initialize platform timer");
+
+    res = dt_property_read_u32(timer, "clock-frequency", &rate);
+    if ( res )
+        cpu_khz = rate / 1000;
+    else
+        cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
+
+    boot_count = READ_SYSREG64(CNTPCT_EL0);
+}
+
+/* Set up the timer on the boot CPU (late init function) */
+int __init init_xen_time(void)
+{
+    int res;
+    unsigned int i;
 
     /* Retrieve all IRQs for the timer */
     for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ )
     {
-        res = platform_get_irq(dev, i);
+        res = platform_get_irq(timer, i);
 
         if ( res < 0 )
             panic("Timer: Unable to retrieve IRQ %u from the device tree", i);
         timer_irq[i] = res;
     }
 
-    printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
-           timer_irq[TIMER_PHYS_NONSECURE_PPI],
-           timer_irq[TIMER_HYP_PPI],
-           timer_irq[TIMER_VIRT_PPI]);
-
-    res = platform_init_time();
-    if ( res )
-        panic("Timer: Cannot initialize platform timer");
-
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
         panic("CPU does not support the Generic Timer v1 interface");
 
-    res = dt_property_read_u32(dev, "clock-frequency", &rate);
-    if ( res )
-        cpu_khz = rate / 1000;
-    else
-        cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
-
-    boot_count = READ_SYSREG64(CNTPCT_EL0);
-    printk("Using generic timer at %lu KHz\n", cpu_khz);
+    printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u Freq: %lu KHz\n",
+           timer_irq[TIMER_PHYS_NONSECURE_PPI],
+           timer_irq[TIMER_HYP_PPI],
+           timer_irq[TIMER_VIRT_PPI],
+           cpu_khz);
 
     return 0;
 }
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 709501f..bb6259d 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -12,6 +12,7 @@
 #include <public/xen.h>
 
 extern int init_xen_time(void);
+void preinit_xen_time(void);
 extern void cstate_restore_tsc(void);
 
 extern unsigned long cpu_khz;
--
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 Tue Feb 03 08:06:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYV1-0006h5-Po; Tue, 03 Feb 2015 08:06:19 +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 1YIYUy-0006gm-N9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:17 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	6B/C1-03165-87180D45; Tue, 03 Feb 2015 08:06:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1422950774!10783607!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32419 invoked from network); 3 Feb 2015 08:06:15 -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;
	3 Feb 2015 08:06: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 1YIYUw-0005YJ-Ef
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUw-0006lA-8g
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:14 +0000
Date: Tue, 03 Feb 2015 08:06:14 +0000
Message-Id: <E1YIYUw-0006lA-8g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xenctrl: Check return values
	from hypercalls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3380f5b6270e6fa4b24313f8808e7625e4c5a6ba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 20:38:11 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 13:10:56 2015 +0000

    ocaml/xenctrl: Check return values from hypercalls
    
    rather than blindly continuing and possibly using negative values.
    
    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: Dave Scott <dave.scott@eu.citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index f0810eb..92d064f 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -457,6 +457,9 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 	int i, len = xc_get_max_cpus(_H(xch));
 	int retval;
 
+	if (len < 1)
+		failwith_xc(_H(xch));
+
 	c_cpumap = xc_cpumap_alloc(_H(xch));
 	if (c_cpumap == NULL)
 		failwith_xc(_H(xch));
@@ -821,6 +824,12 @@ CAMLprim value stub_xc_version_version(value xch)
 
 	caml_enter_blocking_section();
 	packed = xc_version(_H(xch), XENVER_version, NULL);
+	caml_leave_blocking_section();
+
+	if (packed < 0)
+		failwith_xc(_H(xch));
+
+	caml_enter_blocking_section();
 	retval = xc_version(_H(xch), XENVER_extraversion, &extra);
 	caml_leave_blocking_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 Tue Feb 03 08:06:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYV1-0006h5-Po; Tue, 03 Feb 2015 08:06:19 +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 1YIYUy-0006gm-N9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:17 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	6B/C1-03165-87180D45; Tue, 03 Feb 2015 08:06:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1422950774!10783607!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32419 invoked from network); 3 Feb 2015 08:06:15 -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;
	3 Feb 2015 08:06: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 1YIYUw-0005YJ-Ef
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYUw-0006lA-8g
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:14 +0000
Date: Tue, 03 Feb 2015 08:06:14 +0000
Message-Id: <E1YIYUw-0006lA-8g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xenctrl: Check return values
	from hypercalls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3380f5b6270e6fa4b24313f8808e7625e4c5a6ba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 20:38:11 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 13:10:56 2015 +0000

    ocaml/xenctrl: Check return values from hypercalls
    
    rather than blindly continuing and possibly using negative values.
    
    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: Dave Scott <dave.scott@eu.citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index f0810eb..92d064f 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -457,6 +457,9 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 	int i, len = xc_get_max_cpus(_H(xch));
 	int retval;
 
+	if (len < 1)
+		failwith_xc(_H(xch));
+
 	c_cpumap = xc_cpumap_alloc(_H(xch));
 	if (c_cpumap == NULL)
 		failwith_xc(_H(xch));
@@ -821,6 +824,12 @@ CAMLprim value stub_xc_version_version(value xch)
 
 	caml_enter_blocking_section();
 	packed = xc_version(_H(xch), XENVER_version, NULL);
+	caml_leave_blocking_section();
+
+	if (packed < 0)
+		failwith_xc(_H(xch));
+
+	caml_enter_blocking_section();
 	retval = xc_version(_H(xch), XENVER_extraversion, &extra);
 	caml_leave_blocking_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 Tue Feb 03 08:06:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVA-0006iP-ST; Tue, 03 Feb 2015 08:06: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 1YIYV8-0006iB-WA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:27 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	42/F6-03170-28180D45; Tue, 03 Feb 2015 08:06:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1422950784!12413363!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2479 invoked from network); 3 Feb 2015 08:06:25 -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;
	3 Feb 2015 08:06: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 1YIYV6-0005YP-LM
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYV6-0006mJ-J1
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:24 +0000
Date: Tue, 03 Feb 2015 08:06:24 +0000
Message-Id: <E1YIYV6-0006mJ-J1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Disable CONFIG_MIGRATE in
	stubdom environments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 755a7aaee0944800ff8666715ec32b88775816b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 16:58:06 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 13:28:46 2015 +0000

    tools/libxc: Disable CONFIG_MIGRATE in stubdom environments
    
    The legacy save/restore infrastructure requires several function pointers from
    the toolstack (libxl or Xend in the past) in order to work, and for HVM guests
    also need to be able to play around in dom0's filesystem to move the device
    model save record.
    
    Migration v2 changes some of this, but is similarly dependent on
    toolstack-provided function pointers.
    
    Someone who wishes to re-architect the interaction of moving parts for running
    a domain might be in a position to re-enabled this, but for now, explicitly
    fail with ENOSYS (from xc_nomigrate.c) rather than failing with an error about
    a missing function pointer (or indeed falling over a NULL pointer on certain
    paths).
    
    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/libxc/Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 7587d4c..6fa88c7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -4,6 +4,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 4.5
 MINOR    = 0
 
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+# Save/restore of a domain is currently incompatible with a stubdom environment
+override CONFIG_MIGRATE := n
+endif
+
 CTRL_SRCS-y       :=
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
--
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 Tue Feb 03 08:06:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVA-0006iP-ST; Tue, 03 Feb 2015 08:06: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 1YIYV8-0006iB-WA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:27 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	42/F6-03170-28180D45; Tue, 03 Feb 2015 08:06:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1422950784!12413363!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2479 invoked from network); 3 Feb 2015 08:06:25 -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;
	3 Feb 2015 08:06: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 1YIYV6-0005YP-LM
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYV6-0006mJ-J1
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:24 +0000
Date: Tue, 03 Feb 2015 08:06:24 +0000
Message-Id: <E1YIYV6-0006mJ-J1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Disable CONFIG_MIGRATE in
	stubdom environments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 755a7aaee0944800ff8666715ec32b88775816b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 16:58:06 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 13:28:46 2015 +0000

    tools/libxc: Disable CONFIG_MIGRATE in stubdom environments
    
    The legacy save/restore infrastructure requires several function pointers from
    the toolstack (libxl or Xend in the past) in order to work, and for HVM guests
    also need to be able to play around in dom0's filesystem to move the device
    model save record.
    
    Migration v2 changes some of this, but is similarly dependent on
    toolstack-provided function pointers.
    
    Someone who wishes to re-architect the interaction of moving parts for running
    a domain might be in a position to re-enabled this, but for now, explicitly
    fail with ENOSYS (from xc_nomigrate.c) rather than failing with an error about
    a missing function pointer (or indeed falling over a NULL pointer on certain
    paths).
    
    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/libxc/Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 7587d4c..6fa88c7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -4,6 +4,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR    = 4.5
 MINOR    = 0
 
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+# Save/restore of a domain is currently incompatible with a stubdom environment
+override CONFIG_MIGRATE := n
+endif
+
 CTRL_SRCS-y       :=
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
--
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 Tue Feb 03 08:06:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVK-0006js-V0; Tue, 03 Feb 2015 08:06: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 1YIYVI-0006jc-VQ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:37 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	5B/2D-02754-C8180D45; Tue, 03 Feb 2015 08:06:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1422950795!8658637!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24235 invoked from network); 3 Feb 2015 08:06:35 -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;
	3 Feb 2015 08:06: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 1YIYVG-0005YX-Rt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVG-0006nf-Q9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:34 +0000
Date: Tue, 03 Feb 2015 08:06:34 +0000
Message-Id: <E1YIYVG-0006nf-Q9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correct function name
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4a0066eb132154e925d3d427ae883aaf3e78cbd
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Jan 28 13:26:21 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 14:07:28 2015 +0000

    libxl: correct function name
    
    spaw_ -> spawn_
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 73de5c3..8599a6a 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -981,9 +981,9 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
                               libxl__multidev *aodevs,
                               int rc);
 
-static void spaw_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
-                                           libxl__destroy_domid_state *dis,
-                                           int rc);
+static void spawn_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
+                                            libxl__destroy_domid_state *dis,
+                                            int rc);
 
 char *libxl__stub_dm_name(libxl__gc *gc, const char *guest_name)
 {
@@ -1278,7 +1278,7 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
         if (dm_domid) {
             sdss->dis.ao = ao;
             sdss->dis.domid = dm_domid;
-            sdss->dis.callback = spaw_stubdom_pvqemu_destroy_cb;
+            sdss->dis.callback = spawn_stubdom_pvqemu_destroy_cb;
             libxl__destroy_domid(egc, &sdss->dis);
             return;
         }
@@ -1286,9 +1286,9 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
     sdss->callback(egc, &sdss->dm, rc);
 }
 
-static void spaw_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
-                                           libxl__destroy_domid_state *dis,
-                                           int rc)
+static void spawn_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
+                                            libxl__destroy_domid_state *dis,
+                                            int rc)
 {
     libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(dis, *sdss, dis);
     STATE_AO_GC(sdss->dis.ao);
--
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 Tue Feb 03 08:06:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVK-0006js-V0; Tue, 03 Feb 2015 08:06: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 1YIYVI-0006jc-VQ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:37 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	5B/2D-02754-C8180D45; Tue, 03 Feb 2015 08:06:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1422950795!8658637!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24235 invoked from network); 3 Feb 2015 08:06:35 -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;
	3 Feb 2015 08:06: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 1YIYVG-0005YX-Rt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVG-0006nf-Q9
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:34 +0000
Date: Tue, 03 Feb 2015 08:06:34 +0000
Message-Id: <E1YIYVG-0006nf-Q9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correct function name
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4a0066eb132154e925d3d427ae883aaf3e78cbd
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Jan 28 13:26:21 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 28 14:07:28 2015 +0000

    libxl: correct function name
    
    spaw_ -> spawn_
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 73de5c3..8599a6a 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -981,9 +981,9 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
                               libxl__multidev *aodevs,
                               int rc);
 
-static void spaw_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
-                                           libxl__destroy_domid_state *dis,
-                                           int rc);
+static void spawn_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
+                                            libxl__destroy_domid_state *dis,
+                                            int rc);
 
 char *libxl__stub_dm_name(libxl__gc *gc, const char *guest_name)
 {
@@ -1278,7 +1278,7 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
         if (dm_domid) {
             sdss->dis.ao = ao;
             sdss->dis.domid = dm_domid;
-            sdss->dis.callback = spaw_stubdom_pvqemu_destroy_cb;
+            sdss->dis.callback = spawn_stubdom_pvqemu_destroy_cb;
             libxl__destroy_domid(egc, &sdss->dis);
             return;
         }
@@ -1286,9 +1286,9 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
     sdss->callback(egc, &sdss->dm, rc);
 }
 
-static void spaw_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
-                                           libxl__destroy_domid_state *dis,
-                                           int rc)
+static void spawn_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
+                                            libxl__destroy_domid_state *dis,
+                                            int rc)
 {
     libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(dis, *sdss, dis);
     STATE_AO_GC(sdss->dis.ao);
--
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 Tue Feb 03 08:06:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVV-0006lM-24; Tue, 03 Feb 2015 08:06: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 1YIYVT-0006lB-Ru
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:48 +0000
Received: from [85.158.139.211] by server-8.bemta-5.messagelabs.com id
	10/10-03712-79180D45; Tue, 03 Feb 2015 08:06:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950805!10836320!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3743 invoked from network); 3 Feb 2015 08:06:46 -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;
	3 Feb 2015 08:06: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 1YIYVR-0005Yd-1I
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVR-0006oJ-05
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:45 +0000
Date: Tue, 03 Feb 2015 08:06:45 +0000
Message-Id: <E1YIYVR-0006oJ-05@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: also use tzcnt instead of bsf in
	__scanbit()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2eb41660bf1d1210e56856a084b998a5a514c3e2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 28 16:29:46 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:29:46 2015 +0100

    x86: also use tzcnt instead of bsf in __scanbit()
    
    ... when available, i.e. by runtime patching. This saves the
    conditional move, having a back-to-back dependency on BSF's (EFLAGS)
    result.
    
    The need to include asm/cpufeatures.h from asm/bitops.h requires a
    workaround for an otherwise resulting circular header file dependency:
    Provide a mode by which the including site of the former header can
    request to only get the X86_FEATURE_* defines (and very little more)
    from it, allowing it to nevertheless be included in its entirety later
    on.
    
    While doing this I also noticed that the function's "max" parameter was
    pointlessly "unsigned long" - the function only returning
    "unsigned int", this can't be of any use, and hence gets converted at
    once, along with the necessary adjustments to CMOVZ's output operands.
    
    Note that while only alternative_io() is needed by this change (and
    hence gets pulled over from Linux), for completeness its input-only
    counterpart alternative_input() gets added as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/alternative.h |   21 +++++++++++++++++++++
 xen/include/asm-x86/bitops.h      |   16 +++++++++++++---
 xen/include/asm-x86/cpufeature.h  |   10 ++++++----
 3 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/alternative.h
index c746047..23c9b9f 100644
--- a/xen/include/asm-x86/alternative.h
+++ b/xen/include/asm-x86/alternative.h
@@ -12,6 +12,7 @@
         .byte \alt_len
 .endm
 #else
+#include <xen/stringify.h>
 #include <xen/types.h>
 
 struct alt_instr {
@@ -73,6 +74,26 @@ extern void alternative_instructions(void);
 #define alternative(oldinstr, newinstr, feature)                        \
         asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) : : : "memory")
 
+/*
+ * Alternative inline assembly with input.
+ *
+ * Pecularities:
+ * No memory clobber here.
+ * Argument numbers start with 1.
+ * Best is to use constraints that are fixed size (like (%1) ... "r")
+ * If you use variable sized constraints like "m" or "g" in the
+ * replacement make sure to pad to the worst case length.
+ * Leaving an unused argument 0 to keep API compatibility.
+ */
+#define alternative_input(oldinstr, newinstr, feature, input...)	\
+	asm volatile (ALTERNATIVE(oldinstr, newinstr, feature)		\
+		: : "i" (0), ## input)
+
+/* Like alternative_input, but with a single output argument */
+#define alternative_io(oldinstr, newinstr, feature, output, input...)	\
+	asm volatile (ALTERNATIVE(oldinstr, newinstr, feature)		\
+		: output : "i" (0), ## input)
+
 #endif  /*  __ASSEMBLY__  */
 
 #endif /* __X86_ALTERNATIVE_H__ */
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 6f0f34b..52e6358 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -5,7 +5,9 @@
  * Copyright 1992, Linus Torvalds.
  */
 
-#include <xen/config.h>
+#include <asm/alternative.h>
+#define X86_FEATURES_ONLY
+#include <asm/cpufeature.h>
 
 /*
  * We specify the memory operand as both input and output because the memory
@@ -313,9 +315,17 @@ extern unsigned int __find_first_zero_bit(
 extern unsigned int __find_next_zero_bit(
     const unsigned long *addr, unsigned int size, unsigned int offset);
 
-static inline unsigned int __scanbit(unsigned long val, unsigned long max)
+static inline unsigned int __scanbit(unsigned long val, unsigned int max)
 {
-    asm ( "bsf %1,%0 ; cmovz %2,%0" : "=&r" (val) : "r" (val), "r" (max) );
+    if ( __builtin_constant_p(max) && max == BITS_PER_LONG )
+        alternative_io("bsf %[in],%[out]; cmovz %[max],%k[out]",
+                       "rep; bsf %[in],%[out]",
+                       X86_FEATURE_BMI1,
+                       [out] "=&r" (val),
+                       [in] "r" (val), [max] "r" (max));
+    else
+        asm ( "bsf %1,%0 ; cmovz %2,%k0"
+              : "=&r" (val) : "r" (val), "r" (max) );
     return (unsigned int)val;
 }
 
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index d3bd14d..7963a3a 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -5,10 +5,8 @@
  */
 
 #ifndef __ASM_I386_CPUFEATURE_H
+#ifndef X86_FEATURES_ONLY
 #define __ASM_I386_CPUFEATURE_H
-
-#ifndef __ASSEMBLY__
-#include <xen/bitops.h>
 #endif
 
 #define NCAPINTS	8	/* N 32-bit words worth of info */
@@ -155,7 +153,9 @@
 #define X86_FEATURE_ADX		(7*32+19) /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
-#ifndef __ASSEMBLY__
+#if !defined(__ASSEMBLY__) && !defined(X86_FEATURES_ONLY)
+#include <xen/bitops.h>
+
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
 #define cpufeat_mask(idx)       (1u << ((idx) & 31))
@@ -262,6 +262,8 @@ struct cpuid4_info {
 int cpuid4_cache_lookup(int index, struct cpuid4_info *this_leaf);
 #endif
 
+#undef X86_FEATURES_ONLY
+
 #endif /* __ASM_I386_CPUFEATURE_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 Tue Feb 03 08:06:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVV-0006lM-24; Tue, 03 Feb 2015 08:06: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 1YIYVT-0006lB-Ru
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:48 +0000
Received: from [85.158.139.211] by server-8.bemta-5.messagelabs.com id
	10/10-03712-79180D45; Tue, 03 Feb 2015 08:06:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1422950805!10836320!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3743 invoked from network); 3 Feb 2015 08:06:46 -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;
	3 Feb 2015 08:06: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 1YIYVR-0005Yd-1I
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVR-0006oJ-05
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:45 +0000
Date: Tue, 03 Feb 2015 08:06:45 +0000
Message-Id: <E1YIYVR-0006oJ-05@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: also use tzcnt instead of bsf in
	__scanbit()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2eb41660bf1d1210e56856a084b998a5a514c3e2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 28 16:29:46 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:29:46 2015 +0100

    x86: also use tzcnt instead of bsf in __scanbit()
    
    ... when available, i.e. by runtime patching. This saves the
    conditional move, having a back-to-back dependency on BSF's (EFLAGS)
    result.
    
    The need to include asm/cpufeatures.h from asm/bitops.h requires a
    workaround for an otherwise resulting circular header file dependency:
    Provide a mode by which the including site of the former header can
    request to only get the X86_FEATURE_* defines (and very little more)
    from it, allowing it to nevertheless be included in its entirety later
    on.
    
    While doing this I also noticed that the function's "max" parameter was
    pointlessly "unsigned long" - the function only returning
    "unsigned int", this can't be of any use, and hence gets converted at
    once, along with the necessary adjustments to CMOVZ's output operands.
    
    Note that while only alternative_io() is needed by this change (and
    hence gets pulled over from Linux), for completeness its input-only
    counterpart alternative_input() gets added as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/alternative.h |   21 +++++++++++++++++++++
 xen/include/asm-x86/bitops.h      |   16 +++++++++++++---
 xen/include/asm-x86/cpufeature.h  |   10 ++++++----
 3 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/alternative.h
index c746047..23c9b9f 100644
--- a/xen/include/asm-x86/alternative.h
+++ b/xen/include/asm-x86/alternative.h
@@ -12,6 +12,7 @@
         .byte \alt_len
 .endm
 #else
+#include <xen/stringify.h>
 #include <xen/types.h>
 
 struct alt_instr {
@@ -73,6 +74,26 @@ extern void alternative_instructions(void);
 #define alternative(oldinstr, newinstr, feature)                        \
         asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) : : : "memory")
 
+/*
+ * Alternative inline assembly with input.
+ *
+ * Pecularities:
+ * No memory clobber here.
+ * Argument numbers start with 1.
+ * Best is to use constraints that are fixed size (like (%1) ... "r")
+ * If you use variable sized constraints like "m" or "g" in the
+ * replacement make sure to pad to the worst case length.
+ * Leaving an unused argument 0 to keep API compatibility.
+ */
+#define alternative_input(oldinstr, newinstr, feature, input...)	\
+	asm volatile (ALTERNATIVE(oldinstr, newinstr, feature)		\
+		: : "i" (0), ## input)
+
+/* Like alternative_input, but with a single output argument */
+#define alternative_io(oldinstr, newinstr, feature, output, input...)	\
+	asm volatile (ALTERNATIVE(oldinstr, newinstr, feature)		\
+		: output : "i" (0), ## input)
+
 #endif  /*  __ASSEMBLY__  */
 
 #endif /* __X86_ALTERNATIVE_H__ */
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 6f0f34b..52e6358 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -5,7 +5,9 @@
  * Copyright 1992, Linus Torvalds.
  */
 
-#include <xen/config.h>
+#include <asm/alternative.h>
+#define X86_FEATURES_ONLY
+#include <asm/cpufeature.h>
 
 /*
  * We specify the memory operand as both input and output because the memory
@@ -313,9 +315,17 @@ extern unsigned int __find_first_zero_bit(
 extern unsigned int __find_next_zero_bit(
     const unsigned long *addr, unsigned int size, unsigned int offset);
 
-static inline unsigned int __scanbit(unsigned long val, unsigned long max)
+static inline unsigned int __scanbit(unsigned long val, unsigned int max)
 {
-    asm ( "bsf %1,%0 ; cmovz %2,%0" : "=&r" (val) : "r" (val), "r" (max) );
+    if ( __builtin_constant_p(max) && max == BITS_PER_LONG )
+        alternative_io("bsf %[in],%[out]; cmovz %[max],%k[out]",
+                       "rep; bsf %[in],%[out]",
+                       X86_FEATURE_BMI1,
+                       [out] "=&r" (val),
+                       [in] "r" (val), [max] "r" (max));
+    else
+        asm ( "bsf %1,%0 ; cmovz %2,%k0"
+              : "=&r" (val) : "r" (val), "r" (max) );
     return (unsigned int)val;
 }
 
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index d3bd14d..7963a3a 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -5,10 +5,8 @@
  */
 
 #ifndef __ASM_I386_CPUFEATURE_H
+#ifndef X86_FEATURES_ONLY
 #define __ASM_I386_CPUFEATURE_H
-
-#ifndef __ASSEMBLY__
-#include <xen/bitops.h>
 #endif
 
 #define NCAPINTS	8	/* N 32-bit words worth of info */
@@ -155,7 +153,9 @@
 #define X86_FEATURE_ADX		(7*32+19) /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
-#ifndef __ASSEMBLY__
+#if !defined(__ASSEMBLY__) && !defined(X86_FEATURES_ONLY)
+#include <xen/bitops.h>
+
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
 #define cpufeat_mask(idx)       (1u << ((idx) & 31))
@@ -262,6 +262,8 @@ struct cpuid4_info {
 int cpuid4_cache_lookup(int index, struct cpuid4_info *this_leaf);
 #endif
 
+#undef X86_FEATURES_ONLY
+
 #endif /* __ASM_I386_CPUFEATURE_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 Tue Feb 03 08:06:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVf-0006mo-4h; Tue, 03 Feb 2015 08:06: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 1YIYVd-0006mZ-Er
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:57 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	08/04-02749-0A180D45; Tue, 03 Feb 2015 08:06:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950815!12131164!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28936 invoked from network); 3 Feb 2015 08:06:56 -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;
	3 Feb 2015 08:06: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 1YIYVb-0005Ym-9j
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVb-0006oh-5C
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:55 +0000
Date: Tue, 03 Feb 2015 08:06:55 +0000
Message-Id: <E1YIYVb-0006oh-5C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/commandline: correct information
	for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 28 16:31:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:31:07 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 0fc7559..2274e74 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1378,9 +1378,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
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 Tue Feb 03 08:06:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:06: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 1YIYVf-0006mo-4h; Tue, 03 Feb 2015 08:06: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 1YIYVd-0006mZ-Er
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:57 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	08/04-02749-0A180D45; Tue, 03 Feb 2015 08:06:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1422950815!12131164!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28936 invoked from network); 3 Feb 2015 08:06:56 -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;
	3 Feb 2015 08:06: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 1YIYVb-0005Ym-9j
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVb-0006oh-5C
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:06:55 +0000
Date: Tue, 03 Feb 2015 08:06:55 +0000
Message-Id: <E1YIYVb-0006oh-5C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/commandline: correct information
	for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 28 16:31:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:31:07 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 0fc7559..2274e74 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1378,9 +1378,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
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 Tue Feb 03 08:07:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYVr-0006o8-7T; Tue, 03 Feb 2015 08:07:11 +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 1YIYVq-0006nr-03
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:10 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	CB/FD-02754-DA180D45; Tue, 03 Feb 2015 08:07:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950825!12112715!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23932 invoked from network); 3 Feb 2015 08:07:06 -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;
	3 Feb 2015 08:07: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 1YIYVl-0005ZL-Ig
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVl-0006pP-Dv
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:05 +0000
Date: Tue, 03 Feb 2015 08:07:05 +0000
Message-Id: <E1YIYVl-0006pP-Dv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] kexec: prefer __copy_to_guest() when
	possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c2ba001caf5125412bb82325f8a21f3eacf17958
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 28 16:32:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:32:01 2015 +0100

    kexec: prefer __copy_to_guest() when possible
    
    It's slightly cheaper and safe as long a copy_from_guest() for the same
    guest address range was issued before.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/kexec.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 05d5de7..3b4275e 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -662,8 +662,8 @@ static int kexec_get_range(XEN_GUEST_HANDLE_PARAM(void) uarg)
 
     ret = kexec_get_range_internal(&range);
 
-    if ( ret == 0 && unlikely(copy_to_guest(uarg, &range, 1)) )
-        return -EFAULT;
+    if ( ret == 0 && unlikely(__copy_to_guest(uarg, &range, 1)) )
+        ret = -EFAULT;
 
     return ret;
 }
@@ -686,10 +686,11 @@ static int kexec_get_range_compat(XEN_GUEST_HANDLE_PARAM(void) uarg)
     if ( (range.start | range.size) & ~(unsigned long)(~0u) )
         return -ERANGE;
 
-    if ( ret == 0 ) {
+    if ( ret == 0 )
+    {
         XLAT_kexec_range(&compat_range, &range);
-        if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) )
-             return -EFAULT;
+        if ( unlikely(__copy_to_guest(uarg, &compat_range, 1)) )
+             ret = -EFAULT;
     }
 
     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 Tue Feb 03 08:07:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYVr-0006o8-7T; Tue, 03 Feb 2015 08:07:11 +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 1YIYVq-0006nr-03
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:10 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	CB/FD-02754-DA180D45; Tue, 03 Feb 2015 08:07:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1422950825!12112715!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23932 invoked from network); 3 Feb 2015 08:07:06 -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;
	3 Feb 2015 08:07: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 1YIYVl-0005ZL-Ig
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVl-0006pP-Dv
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:05 +0000
Date: Tue, 03 Feb 2015 08:07:05 +0000
Message-Id: <E1YIYVl-0006pP-Dv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] kexec: prefer __copy_to_guest() when
	possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c2ba001caf5125412bb82325f8a21f3eacf17958
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 28 16:32:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:32:01 2015 +0100

    kexec: prefer __copy_to_guest() when possible
    
    It's slightly cheaper and safe as long a copy_from_guest() for the same
    guest address range was issued before.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/kexec.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 05d5de7..3b4275e 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -662,8 +662,8 @@ static int kexec_get_range(XEN_GUEST_HANDLE_PARAM(void) uarg)
 
     ret = kexec_get_range_internal(&range);
 
-    if ( ret == 0 && unlikely(copy_to_guest(uarg, &range, 1)) )
-        return -EFAULT;
+    if ( ret == 0 && unlikely(__copy_to_guest(uarg, &range, 1)) )
+        ret = -EFAULT;
 
     return ret;
 }
@@ -686,10 +686,11 @@ static int kexec_get_range_compat(XEN_GUEST_HANDLE_PARAM(void) uarg)
     if ( (range.start | range.size) & ~(unsigned long)(~0u) )
         return -ERANGE;
 
-    if ( ret == 0 ) {
+    if ( ret == 0 )
+    {
         XLAT_kexec_range(&compat_range, &range);
-        if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) )
-             return -EFAULT;
+        if ( unlikely(__copy_to_guest(uarg, &compat_range, 1)) )
+             ret = -EFAULT;
     }
 
     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 Tue Feb 03 08:07:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYW0-0006ph-A0; Tue, 03 Feb 2015 08:07:20 +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 1YIYVy-0006pJ-Fu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:18 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	59/73-03164-5B180D45; Tue, 03 Feb 2015 08:07:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1422950835!11525644!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18199 invoked from network); 3 Feb 2015 08:07:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:07: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 1YIYVv-0005ZS-OQ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVv-0006qE-NB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:15 +0000
Date: Tue, 03 Feb 2015 08:07:15 +0000
Message-Id: <E1YIYVv-0006qE-NB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow reading MSR_IA32_TSC with
	XENPF_resource_op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f6c9698d7f65eca5c1ef5ed325e12252a2fb89fd
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Wed Jan 28 16:33:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:36:36 2015 +0100

    x86: allow reading MSR_IA32_TSC with XENPF_resource_op
    
    Memory bandwidth monitoring requires system time information returned
    along with the monitoring counter to verify the correctness of the
    counter value and to calculate the time elapsed between two samplings.
    
    Add MSR_IA32_TSC to the read path and it returns scaled system time(ns)
    instead of raw timestamp to elimanate the needs to convert. The return
    time is obfuscated with booting random to eliminate the potential abuse
    of it. RESOURCE_ACCESS_MAX_ENTRIES is also increased to 3 so MSR_IA32_TSC
    can be used together with an MSR write/read operation pair.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    
    Fix uninitialized variable build error.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c |   38 ++++++++++++++++++++++++++++++++++--
 xen/common/random.c               |    9 ++++++++
 xen/include/public/platform.h     |   10 +++++++++
 xen/include/xen/random.h          |    3 ++
 4 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 32f39b2..a8dd434 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -61,7 +61,7 @@ long cpu_down_helper(void *data);
 long core_parking_helper(void *data);
 uint32_t get_cur_idle_nums(void);
 
-#define RESOURCE_ACCESS_MAX_ENTRIES 2
+#define RESOURCE_ACCESS_MAX_ENTRIES 3
 struct xen_resource_access {
     unsigned int nr_done;
     unsigned int nr_entries;
@@ -75,6 +75,7 @@ static bool_t allow_access_msr(unsigned int msr)
     /* MSR for CMT, refer to chapter 17.14 of Intel SDM. */
     case MSR_IA32_CMT_EVTSEL:
     case MSR_IA32_CMT_CTR:
+    case MSR_IA32_TSC:
         return 1;
     }
 
@@ -124,6 +125,7 @@ static void resource_access(void *info)
 {
     struct xen_resource_access *ra = info;
     unsigned int i;
+    u64 tsc = 0;
 
     for ( i = 0; i < ra->nr_done; i++ )
     {
@@ -133,10 +135,40 @@ static void resource_access(void *info)
         switch ( entry->u.cmd )
         {
         case XEN_RESOURCE_OP_MSR_READ:
-            ret = rdmsr_safe(entry->idx, entry->val);
+            if ( unlikely(entry->idx == MSR_IA32_TSC) )
+            {
+                /* Return obfuscated scaled time instead of raw timestamp */
+                entry->val = get_s_time_fixed(tsc)
+                             + SECONDS(boot_random) - boot_random;
+                ret = 0;
+            }
+            else
+            {
+                unsigned long flags = 0;
+                /*
+                 * If next entry is MSR_IA32_TSC read, then the actual rdtscll
+                 * is performed together with current entry, with IRQ disabled.
+                 */
+                bool_t read_tsc = (i < ra->nr_done - 1 &&
+                                   unlikely(entry[1].idx == MSR_IA32_TSC));
+
+                if ( unlikely(read_tsc) )
+                    local_irq_save(flags);
+
+                ret = rdmsr_safe(entry->idx, entry->val);
+
+                if ( unlikely(read_tsc) )
+                {
+                    rdtscll(tsc);
+                    local_irq_restore(flags);
+                }
+            }
             break;
         case XEN_RESOURCE_OP_MSR_WRITE:
-            ret = wrmsr_safe(entry->idx, entry->val);
+            if ( unlikely(entry->idx == MSR_IA32_TSC) )
+                ret = -EPERM;
+            else
+                ret = wrmsr_safe(entry->idx, entry->val);
             break;
         default:
             BUG();
diff --git a/xen/common/random.c b/xen/common/random.c
index 4a28a24..cb9187c 100644
--- a/xen/common/random.c
+++ b/xen/common/random.c
@@ -1,9 +1,11 @@
+#include <xen/init.h>
 #include <xen/percpu.h>
 #include <xen/random.h>
 #include <xen/time.h>
 #include <asm/random.h>
 
 static DEFINE_PER_CPU(unsigned int, seed);
+unsigned int __read_mostly boot_random;
 
 unsigned int get_random(void)
 {
@@ -27,3 +29,10 @@ unsigned int get_random(void)
 
     return val;
 }
+
+static int __init init_boot_random(void)
+{
+    boot_random = get_random();
+    return 0;
+}
+__initcall(init_boot_random);
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index 5c57615..3e340b4 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -540,6 +540,16 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
 #define XEN_RESOURCE_OP_MSR_READ  0
 #define XEN_RESOURCE_OP_MSR_WRITE 1
 
+/*
+ * Specially handled MSRs:
+ * - MSR_IA32_TSC
+ * READ: Returns the scaled system time(ns) instead of raw timestamp. In
+ *       multiple entry case, if other MSR read is followed by a MSR_IA32_TSC
+ *       read, then both reads are guaranteed to be performed atomically (with
+ *       IRQ disabled). The return time indicates the point of reading that MSR.
+ * WRITE: Not supported.
+ */
+
 struct xenpf_resource_entry {
     union {
         uint32_t cmd;   /* IN: XEN_RESOURCE_OP_* */
diff --git a/xen/include/xen/random.h b/xen/include/xen/random.h
index 7c43d87..b950f03 100644
--- a/xen/include/xen/random.h
+++ b/xen/include/xen/random.h
@@ -3,4 +3,7 @@
 
 unsigned int get_random(void);
 
+/* The value keeps unchange once initialized for each booting */
+extern unsigned int boot_random;
+
 #endif /* __XEN_RANDOM_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 Tue Feb 03 08:07:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYW0-0006ph-A0; Tue, 03 Feb 2015 08:07:20 +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 1YIYVy-0006pJ-Fu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:18 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	59/73-03164-5B180D45; Tue, 03 Feb 2015 08:07:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1422950835!11525644!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18199 invoked from network); 3 Feb 2015 08:07:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:07: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 1YIYVv-0005ZS-OQ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYVv-0006qE-NB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:15 +0000
Date: Tue, 03 Feb 2015 08:07:15 +0000
Message-Id: <E1YIYVv-0006qE-NB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow reading MSR_IA32_TSC with
	XENPF_resource_op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f6c9698d7f65eca5c1ef5ed325e12252a2fb89fd
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Wed Jan 28 16:33:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:36:36 2015 +0100

    x86: allow reading MSR_IA32_TSC with XENPF_resource_op
    
    Memory bandwidth monitoring requires system time information returned
    along with the monitoring counter to verify the correctness of the
    counter value and to calculate the time elapsed between two samplings.
    
    Add MSR_IA32_TSC to the read path and it returns scaled system time(ns)
    instead of raw timestamp to elimanate the needs to convert. The return
    time is obfuscated with booting random to eliminate the potential abuse
    of it. RESOURCE_ACCESS_MAX_ENTRIES is also increased to 3 so MSR_IA32_TSC
    can be used together with an MSR write/read operation pair.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    
    Fix uninitialized variable build error.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c |   38 ++++++++++++++++++++++++++++++++++--
 xen/common/random.c               |    9 ++++++++
 xen/include/public/platform.h     |   10 +++++++++
 xen/include/xen/random.h          |    3 ++
 4 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 32f39b2..a8dd434 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -61,7 +61,7 @@ long cpu_down_helper(void *data);
 long core_parking_helper(void *data);
 uint32_t get_cur_idle_nums(void);
 
-#define RESOURCE_ACCESS_MAX_ENTRIES 2
+#define RESOURCE_ACCESS_MAX_ENTRIES 3
 struct xen_resource_access {
     unsigned int nr_done;
     unsigned int nr_entries;
@@ -75,6 +75,7 @@ static bool_t allow_access_msr(unsigned int msr)
     /* MSR for CMT, refer to chapter 17.14 of Intel SDM. */
     case MSR_IA32_CMT_EVTSEL:
     case MSR_IA32_CMT_CTR:
+    case MSR_IA32_TSC:
         return 1;
     }
 
@@ -124,6 +125,7 @@ static void resource_access(void *info)
 {
     struct xen_resource_access *ra = info;
     unsigned int i;
+    u64 tsc = 0;
 
     for ( i = 0; i < ra->nr_done; i++ )
     {
@@ -133,10 +135,40 @@ static void resource_access(void *info)
         switch ( entry->u.cmd )
         {
         case XEN_RESOURCE_OP_MSR_READ:
-            ret = rdmsr_safe(entry->idx, entry->val);
+            if ( unlikely(entry->idx == MSR_IA32_TSC) )
+            {
+                /* Return obfuscated scaled time instead of raw timestamp */
+                entry->val = get_s_time_fixed(tsc)
+                             + SECONDS(boot_random) - boot_random;
+                ret = 0;
+            }
+            else
+            {
+                unsigned long flags = 0;
+                /*
+                 * If next entry is MSR_IA32_TSC read, then the actual rdtscll
+                 * is performed together with current entry, with IRQ disabled.
+                 */
+                bool_t read_tsc = (i < ra->nr_done - 1 &&
+                                   unlikely(entry[1].idx == MSR_IA32_TSC));
+
+                if ( unlikely(read_tsc) )
+                    local_irq_save(flags);
+
+                ret = rdmsr_safe(entry->idx, entry->val);
+
+                if ( unlikely(read_tsc) )
+                {
+                    rdtscll(tsc);
+                    local_irq_restore(flags);
+                }
+            }
             break;
         case XEN_RESOURCE_OP_MSR_WRITE:
-            ret = wrmsr_safe(entry->idx, entry->val);
+            if ( unlikely(entry->idx == MSR_IA32_TSC) )
+                ret = -EPERM;
+            else
+                ret = wrmsr_safe(entry->idx, entry->val);
             break;
         default:
             BUG();
diff --git a/xen/common/random.c b/xen/common/random.c
index 4a28a24..cb9187c 100644
--- a/xen/common/random.c
+++ b/xen/common/random.c
@@ -1,9 +1,11 @@
+#include <xen/init.h>
 #include <xen/percpu.h>
 #include <xen/random.h>
 #include <xen/time.h>
 #include <asm/random.h>
 
 static DEFINE_PER_CPU(unsigned int, seed);
+unsigned int __read_mostly boot_random;
 
 unsigned int get_random(void)
 {
@@ -27,3 +29,10 @@ unsigned int get_random(void)
 
     return val;
 }
+
+static int __init init_boot_random(void)
+{
+    boot_random = get_random();
+    return 0;
+}
+__initcall(init_boot_random);
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index 5c57615..3e340b4 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -540,6 +540,16 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
 #define XEN_RESOURCE_OP_MSR_READ  0
 #define XEN_RESOURCE_OP_MSR_WRITE 1
 
+/*
+ * Specially handled MSRs:
+ * - MSR_IA32_TSC
+ * READ: Returns the scaled system time(ns) instead of raw timestamp. In
+ *       multiple entry case, if other MSR read is followed by a MSR_IA32_TSC
+ *       read, then both reads are guaranteed to be performed atomically (with
+ *       IRQ disabled). The return time indicates the point of reading that MSR.
+ * WRITE: Not supported.
+ */
+
 struct xenpf_resource_entry {
     union {
         uint32_t cmd;   /* IN: XEN_RESOURCE_OP_* */
diff --git a/xen/include/xen/random.h b/xen/include/xen/random.h
index 7c43d87..b950f03 100644
--- a/xen/include/xen/random.h
+++ b/xen/include/xen/random.h
@@ -3,4 +3,7 @@
 
 unsigned int get_random(void);
 
+/* The value keeps unchange once initialized for each booting */
+extern unsigned int boot_random;
+
 #endif /* __XEN_RANDOM_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 Tue Feb 03 08:07:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYWA-0006rY-F0; Tue, 03 Feb 2015 08:07: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 1YIYW9-0006rO-QE
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:29 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	9A/F1-03132-1C180D45; Tue, 03 Feb 2015 08:07:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1422950846!10785798!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30265 invoked from network); 3 Feb 2015 08:07:26 -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;
	3 Feb 2015 08:07: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 1YIYW5-0005Za-Ui
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYW5-0006qp-SV
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:25 +0000
Date: Tue, 03 Feb 2015 08:07:25 +0000
Message-Id: <E1YIYW5-0006qp-SV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: skip further initialization for
	idle domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5f317bda12a99d72e80f1fd639a53e36d377c44
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 28 16:38:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:38:20 2015 +0100

    x86: skip further initialization for idle domains
    
    While in the end not really found necessary, early versions of the
    patches to follow pointed out that we needlessly set up paging for idle
    domains. Arranging for that to be skipped made me notice that we can at
    once skip vMCE setup for them. Leverage to adjustment to further
    re-arrange the way FPU setup gets skipped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c |   19 +++++++++++--------
 xen/arch/x86/i387.c   |   10 +---------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 50b361b..cfe7945 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -427,12 +427,15 @@ int vcpu_initialise(struct vcpu *v)
     if ( rc )
         return rc;
 
-    paging_vcpu_init(v);
+    if ( !is_idle_domain(d) )
+    {
+        paging_vcpu_init(v);
 
-    if ( (rc = vcpu_init_fpu(v)) != 0 )
-        return rc;
+        if ( (rc = vcpu_init_fpu(v)) != 0 )
+            return rc;
 
-    vmce_init_vcpu(v);
+        vmce_init_vcpu(v);
+    }
 
     if ( has_hvm_container_domain(d) )
     {
@@ -559,12 +562,12 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     HYPERVISOR_COMPAT_VIRT_START(d) =
         is_pv_domain(d) ? __HYPERVISOR_COMPAT_VIRT_START : ~0u;
 
-    if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
-        goto fail;
-    paging_initialised = 1;
-
     if ( !is_idle_domain(d) )
     {
+        if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
+            goto fail;
+        paging_initialised = 1;
+
         d->arch.cpuids = xmalloc_array(cpuid_input_t, MAX_CPUID_INPUT);
         rc = -ENOMEM;
         if ( d->arch.cpuids == NULL )
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index a372e0b..14f2a79 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -303,12 +303,8 @@ void save_fpu_enable(void)
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
-    int rc = 0;
+    int rc;
     
-    /* Idle domain doesn't have FPU state allocated */
-    if ( is_idle_vcpu(v) )
-        goto done;
-
     if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
 
@@ -318,13 +314,9 @@ int vcpu_init_fpu(struct vcpu *v)
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
         if ( !v->arch.fpu_ctxt )
-        {
             rc = -ENOMEM;
-            goto done;
-        }
     }
 
-done:
     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 Tue Feb 03 08:07:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYWA-0006rY-F0; Tue, 03 Feb 2015 08:07: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 1YIYW9-0006rO-QE
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:29 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	9A/F1-03132-1C180D45; Tue, 03 Feb 2015 08:07:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1422950846!10785798!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30265 invoked from network); 3 Feb 2015 08:07:26 -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;
	3 Feb 2015 08:07: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 1YIYW5-0005Za-Ui
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYW5-0006qp-SV
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:25 +0000
Date: Tue, 03 Feb 2015 08:07:25 +0000
Message-Id: <E1YIYW5-0006qp-SV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: skip further initialization for
	idle domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5f317bda12a99d72e80f1fd639a53e36d377c44
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 28 16:38:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:38:20 2015 +0100

    x86: skip further initialization for idle domains
    
    While in the end not really found necessary, early versions of the
    patches to follow pointed out that we needlessly set up paging for idle
    domains. Arranging for that to be skipped made me notice that we can at
    once skip vMCE setup for them. Leverage to adjustment to further
    re-arrange the way FPU setup gets skipped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c |   19 +++++++++++--------
 xen/arch/x86/i387.c   |   10 +---------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 50b361b..cfe7945 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -427,12 +427,15 @@ int vcpu_initialise(struct vcpu *v)
     if ( rc )
         return rc;
 
-    paging_vcpu_init(v);
+    if ( !is_idle_domain(d) )
+    {
+        paging_vcpu_init(v);
 
-    if ( (rc = vcpu_init_fpu(v)) != 0 )
-        return rc;
+        if ( (rc = vcpu_init_fpu(v)) != 0 )
+            return rc;
 
-    vmce_init_vcpu(v);
+        vmce_init_vcpu(v);
+    }
 
     if ( has_hvm_container_domain(d) )
     {
@@ -559,12 +562,12 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     HYPERVISOR_COMPAT_VIRT_START(d) =
         is_pv_domain(d) ? __HYPERVISOR_COMPAT_VIRT_START : ~0u;
 
-    if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
-        goto fail;
-    paging_initialised = 1;
-
     if ( !is_idle_domain(d) )
     {
+        if ( (rc = paging_domain_init(d, domcr_flags)) != 0 )
+            goto fail;
+        paging_initialised = 1;
+
         d->arch.cpuids = xmalloc_array(cpuid_input_t, MAX_CPUID_INPUT);
         rc = -ENOMEM;
         if ( d->arch.cpuids == NULL )
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index a372e0b..14f2a79 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -303,12 +303,8 @@ void save_fpu_enable(void)
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
-    int rc = 0;
+    int rc;
     
-    /* Idle domain doesn't have FPU state allocated */
-    if ( is_idle_vcpu(v) )
-        goto done;
-
     if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
 
@@ -318,13 +314,9 @@ int vcpu_init_fpu(struct vcpu *v)
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
         if ( !v->arch.fpu_ctxt )
-        {
             rc = -ENOMEM;
-            goto done;
-        }
     }
 
-done:
     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 Tue Feb 03 08:07:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYWJ-0006st-Hb; Tue, 03 Feb 2015 08:07: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 1YIYWI-0006sd-NJ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:38 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	16/A5-03219-9C180D45; Tue, 03 Feb 2015 08:07:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1422950856!11542823!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11629 invoked from network); 3 Feb 2015 08:07:37 -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;
	3 Feb 2015 08:07: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 1YIYWG-0005Zi-A6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWG-0006s3-1v
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:36 +0000
Date: Tue, 03 Feb 2015 08:07:36 +0000
Message-Id: <E1YIYWG-0006s3-1v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] bunzip2: off by one in get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39798e95a954eec660a3f5f21489c30ef78daf6d
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Wed Jan 28 16:50:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:50:08 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
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 Tue Feb 03 08:07:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYWJ-0006st-Hb; Tue, 03 Feb 2015 08:07: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 1YIYWI-0006sd-NJ
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:38 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	16/A5-03219-9C180D45; Tue, 03 Feb 2015 08:07:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1422950856!11542823!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11629 invoked from network); 3 Feb 2015 08:07:37 -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;
	3 Feb 2015 08:07: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 1YIYWG-0005Zi-A6
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWG-0006s3-1v
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:36 +0000
Date: Tue, 03 Feb 2015 08:07:36 +0000
Message-Id: <E1YIYWG-0006s3-1v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] bunzip2: off by one in get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39798e95a954eec660a3f5f21489c30ef78daf6d
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Wed Jan 28 16:50:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 28 16:50:08 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
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 Tue Feb 03 08:07:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYWT-0006uR-KS; Tue, 03 Feb 2015 08:07:49 +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 1YIYWS-0006uE-Nt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	B1/55-02749-4D180D45; Tue, 03 Feb 2015 08:07:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1422950866!12128290!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16233 invoked from network); 3 Feb 2015 08:07:47 -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;
	3 Feb 2015 08:07: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 1YIYWQ-0005Zo-Fb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWQ-0006sU-ES
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:46 +0000
Date: Tue, 03 Feb 2015 08:07:46 +0000
Message-Id: <E1YIYWQ-0006sU-ES@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: make some log-dirty
	handling functions static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c2550884d07fc81a96db1b177b497a9900a2202
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Thu Jan 29 11:18:32 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 11:55:15 2015 +0000

    x86/shadow: make some log-dirty handling functions static
    
    Noticed while introducing the stub replacement for disabling shadow
    paging support at build time.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |   14 +++++++++-----
 xen/include/asm-x86/shadow.h    |    9 ---------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index a5eed28..b523a1c 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -41,6 +41,10 @@
 
 DEFINE_PER_CPU(uint32_t,trace_shadow_path_flags);
 
+static int sh_enable_log_dirty(struct domain *, bool_t log_global);
+static int sh_disable_log_dirty(struct domain *);
+static void sh_clean_dirty_bitmap(struct domain *);
+
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called for every domain from arch_domain_create() */
 void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
@@ -49,8 +53,8 @@ void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.pinned_shadows);
 
     /* Use shadow pagetables for log-dirty support */
-    paging_log_dirty_init(d, shadow_enable_log_dirty, 
-                          shadow_disable_log_dirty, shadow_clean_dirty_bitmap);
+    paging_log_dirty_init(d, sh_enable_log_dirty,
+                          sh_disable_log_dirty, sh_clean_dirty_bitmap);
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
     d->arch.paging.shadow.oos_active = 0;
@@ -3420,7 +3424,7 @@ shadow_write_p2m_entry(struct domain *d, unsigned long gfn,
 /* Shadow specific code which is called in paging_log_dirty_enable().
  * Return 0 if no problem found.
  */
-int shadow_enable_log_dirty(struct domain *d, bool_t log_global)
+static int sh_enable_log_dirty(struct domain *d, bool_t log_global)
 {
     int ret;
 
@@ -3448,7 +3452,7 @@ int shadow_enable_log_dirty(struct domain *d, bool_t log_global)
 }
 
 /* shadow specfic code which is called in paging_log_dirty_disable() */
-int shadow_disable_log_dirty(struct domain *d)
+static int sh_disable_log_dirty(struct domain *d)
 {
     int ret;
 
@@ -3462,7 +3466,7 @@ int shadow_disable_log_dirty(struct domain *d)
 /* This function is called when we CLEAN log dirty bitmap. See 
  * paging_log_dirty_op() for details. 
  */
-void shadow_clean_dirty_bitmap(struct domain *d)
+static void sh_clean_dirty_bitmap(struct domain *d)
 {
     paging_lock(d);
     /* Need to revoke write access to the domain's pages again.
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index f40cab4..f2ce352 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -77,15 +77,6 @@ void shadow_teardown(struct domain *d);
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
 
-/* shadow code to call when log dirty is enabled */
-int shadow_enable_log_dirty(struct domain *d, bool_t log_global);
-
-/* shadow code to call when log dirty is disabled */
-int shadow_disable_log_dirty(struct domain *d);
-
-/* shadow code to call when bitmap is being cleaned */
-void shadow_clean_dirty_bitmap(struct domain *d);
-
 /* Update all the things that are derived from the guest's CR0/CR3/CR4.
  * Called to initialize paging structures if the paging mode
  * has changed, and when bringing up a VCPU for the first time. */
--
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 Tue Feb 03 08:07:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:07: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 1YIYWT-0006uR-KS; Tue, 03 Feb 2015 08:07:49 +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 1YIYWS-0006uE-Nt
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	B1/55-02749-4D180D45; Tue, 03 Feb 2015 08:07:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1422950866!12128290!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16233 invoked from network); 3 Feb 2015 08:07:47 -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;
	3 Feb 2015 08:07: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 1YIYWQ-0005Zo-Fb
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWQ-0006sU-ES
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:46 +0000
Date: Tue, 03 Feb 2015 08:07:46 +0000
Message-Id: <E1YIYWQ-0006sU-ES@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: make some log-dirty
	handling functions static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c2550884d07fc81a96db1b177b497a9900a2202
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Thu Jan 29 11:18:32 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 11:55:15 2015 +0000

    x86/shadow: make some log-dirty handling functions static
    
    Noticed while introducing the stub replacement for disabling shadow
    paging support at build time.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |   14 +++++++++-----
 xen/include/asm-x86/shadow.h    |    9 ---------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index a5eed28..b523a1c 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -41,6 +41,10 @@
 
 DEFINE_PER_CPU(uint32_t,trace_shadow_path_flags);
 
+static int sh_enable_log_dirty(struct domain *, bool_t log_global);
+static int sh_disable_log_dirty(struct domain *);
+static void sh_clean_dirty_bitmap(struct domain *);
+
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called for every domain from arch_domain_create() */
 void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
@@ -49,8 +53,8 @@ void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.pinned_shadows);
 
     /* Use shadow pagetables for log-dirty support */
-    paging_log_dirty_init(d, shadow_enable_log_dirty, 
-                          shadow_disable_log_dirty, shadow_clean_dirty_bitmap);
+    paging_log_dirty_init(d, sh_enable_log_dirty,
+                          sh_disable_log_dirty, sh_clean_dirty_bitmap);
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
     d->arch.paging.shadow.oos_active = 0;
@@ -3420,7 +3424,7 @@ shadow_write_p2m_entry(struct domain *d, unsigned long gfn,
 /* Shadow specific code which is called in paging_log_dirty_enable().
  * Return 0 if no problem found.
  */
-int shadow_enable_log_dirty(struct domain *d, bool_t log_global)
+static int sh_enable_log_dirty(struct domain *d, bool_t log_global)
 {
     int ret;
 
@@ -3448,7 +3452,7 @@ int shadow_enable_log_dirty(struct domain *d, bool_t log_global)
 }
 
 /* shadow specfic code which is called in paging_log_dirty_disable() */
-int shadow_disable_log_dirty(struct domain *d)
+static int sh_disable_log_dirty(struct domain *d)
 {
     int ret;
 
@@ -3462,7 +3466,7 @@ int shadow_disable_log_dirty(struct domain *d)
 /* This function is called when we CLEAN log dirty bitmap. See 
  * paging_log_dirty_op() for details. 
  */
-void shadow_clean_dirty_bitmap(struct domain *d)
+static void sh_clean_dirty_bitmap(struct domain *d)
 {
     paging_lock(d);
     /* Need to revoke write access to the domain's pages again.
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index f40cab4..f2ce352 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -77,15 +77,6 @@ void shadow_teardown(struct domain *d);
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
 
-/* shadow code to call when log dirty is enabled */
-int shadow_enable_log_dirty(struct domain *d, bool_t log_global);
-
-/* shadow code to call when log dirty is disabled */
-int shadow_disable_log_dirty(struct domain *d);
-
-/* shadow code to call when bitmap is being cleaned */
-void shadow_clean_dirty_bitmap(struct domain *d);
-
 /* Update all the things that are derived from the guest's CR0/CR3/CR4.
  * Called to initialize paging structures if the paging mode
  * has changed, and when bringing up a VCPU for the first time. */
--
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 Tue Feb 03 08:08:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYWe-0006vs-NH; Tue, 03 Feb 2015 08:08: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 1YIYWd-0006vj-BM
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:59 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	14/C3-02757-ED180D45; Tue, 03 Feb 2015 08:07:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1422950876!5500181!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32766 invoked from network); 3 Feb 2015 08:07:57 -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;
	3 Feb 2015 08:07: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 1YIYWa-0005Zx-LU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWa-0006su-KB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:56 +0000
Date: Tue, 03 Feb 2015 08:07:56 +0000
Message-Id: <E1YIYWa-0006su-KB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant-table: refactor grant copy to
	reduce duplicate code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c72f8c2cf19f735d813081c836f03e3078ee5c1
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Jan 29 14:21:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 14:21:00 2015 +0100

    grant-table: refactor grant copy to reduce duplicate code
    
    Much of the grant copy operation is identical for the source and
    destination buffers.  Refactor the code into per-buffer functions.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/common/grant_table.c         |  289 +++++++++++++++++++++++++-------------
 xen/include/public/grant_table.h |    2 +-
 2 files changed, 192 insertions(+), 99 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index fb9d8f7..f5b25bc 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2077,139 +2077,230 @@ __acquire_grant_for_copy(
     return rc;
 }
 
-static void
-__gnttab_copy(
-    struct gnttab_copy *op)
-{
-    struct domain *sd = NULL, *dd = NULL;
-    unsigned long s_frame, d_frame;
-    struct page_info *s_pg = NULL, *d_pg = NULL;
-    char *sp, *dp;
-    s16 rc = GNTST_okay;
-    int have_d_grant = 0, have_s_grant = 0;
-    int src_is_gref, dest_is_gref;
+struct gnttab_copy_buf {
+    /* Guest provided. */
+    struct gnttab_copy_ptr ptr;
+    uint16_t len;
 
-    if ( ((op->source.offset + op->len) > PAGE_SIZE) ||
-         ((op->dest.offset + op->len) > PAGE_SIZE) )
-        PIN_FAIL(error_out, GNTST_bad_copy_arg, "copy beyond page area.\n");
+    /* Mapped etc. */
+    struct domain *domain;
+    unsigned long frame;
+    struct page_info *page;
+    void *virt;
+    bool_t read_only;
+    bool_t have_grant;
+    bool_t have_type;
+};
 
-    src_is_gref = op->flags & GNTCOPY_source_gref;
-    dest_is_gref = op->flags & GNTCOPY_dest_gref;
+static int gnttab_copy_lock_domain(domid_t domid, unsigned int gref_flag,
+                                   struct gnttab_copy_buf *buf)
+{
+    int rc;
 
-    if ( (op->source.domid != DOMID_SELF && !src_is_gref ) ||
-         (op->dest.domid   != DOMID_SELF && !dest_is_gref)   )
-        PIN_FAIL(error_out, GNTST_permission_denied,
+    if ( domid != DOMID_SELF && !gref_flag )
+        PIN_FAIL(out, GNTST_permission_denied,
                  "only allow copy-by-mfn for DOMID_SELF.\n");
 
-    if ( op->source.domid == DOMID_SELF )
-        sd = rcu_lock_current_domain();
-    else if ( (sd = rcu_lock_domain_by_id(op->source.domid)) == NULL )
-        PIN_FAIL(error_out, GNTST_bad_domain,
-                 "couldn't find %d\n", op->source.domid);
+    if ( domid == DOMID_SELF )
+        buf->domain = rcu_lock_current_domain();
+    else
+    {
+        buf->domain = rcu_lock_domain_by_id(domid);
+        if ( buf->domain == NULL )
+            PIN_FAIL(out, GNTST_bad_domain, "couldn't find %d\n", domid);
+    }
 
-    if ( op->dest.domid == DOMID_SELF )
-        dd = rcu_lock_current_domain();
-    else if ( (dd = rcu_lock_domain_by_id(op->dest.domid)) == NULL )
-        PIN_FAIL(error_out, GNTST_bad_domain,
-                 "couldn't find %d\n", op->dest.domid);
+    buf->ptr.domid = domid;
+    rc = GNTST_okay;
+ out:
+    return rc;
+}
 
-    rc = xsm_grant_copy(XSM_HOOK, sd, dd);
-    if ( rc )
+static void gnttab_copy_unlock_domains(struct gnttab_copy_buf *src,
+                                       struct gnttab_copy_buf *dest)
+{
+    if ( src->domain )
+    {
+        rcu_unlock_domain(src->domain);
+        src->domain = NULL;
+    }
+    if ( dest->domain )
+    {
+        rcu_unlock_domain(dest->domain);
+        dest->domain = NULL;
+    }
+}
+
+static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
+                                    struct gnttab_copy_buf *src,
+                                    struct gnttab_copy_buf *dest)
+{
+    int rc;
+
+    rc = gnttab_copy_lock_domain(op->source.domid,
+                                 op->flags & GNTCOPY_source_gref, src);
+    if ( rc < 0 )
+        goto error;
+    rc = gnttab_copy_lock_domain(op->dest.domid,
+                                 op->flags & GNTCOPY_dest_gref, dest);
+    if ( rc < 0 )
+        goto error;
+
+    rc = xsm_grant_copy(XSM_HOOK, src->domain, dest->domain);
+    if ( rc < 0 )
     {
         rc = GNTST_permission_denied;
-        goto error_out;
+        goto error;
     }
+    return 0;
+
+ error:
+    gnttab_copy_unlock_domains(src, dest);
+    return rc;
+}
 
-    if ( src_is_gref )
+static void gnttab_copy_release_buf(struct gnttab_copy_buf *buf)
+{
+    if ( buf->virt )
     {
-        uint16_t source_off, source_len;
-        rc = __acquire_grant_for_copy(sd, op->source.u.ref,
-                                      current->domain->domain_id, 1,
-                                      &s_frame, &s_pg,
-                                      &source_off, &source_len, 1);
-        if ( rc != GNTST_okay )
-            goto error_out;
-        have_s_grant = 1;
-        if ( op->source.offset < source_off ||
-             op->len > source_len )
-            PIN_FAIL(error_out, GNTST_general_error,
-                     "copy source out of bounds: %d < %d || %d > %d\n",
-                     op->source.offset, source_off,
-                     op->len, source_len);
+        unmap_domain_page(buf->virt);
+        buf->virt = NULL;
     }
-    else
+    if ( buf->have_type )
     {
-        rc = __get_paged_frame(op->source.u.gmfn, &s_frame, &s_pg, 1, sd);
-        if ( rc != GNTST_okay )
-            PIN_FAIL(error_out, rc,
-                     "source frame %lx invalid.\n", s_frame);
+        put_page_type(buf->page);
+        buf->have_type = 0;
+    }
+    if ( buf->page )
+    {
+        put_page(buf->page);
+        buf->page = NULL;
+    }
+    if ( buf->have_grant )
+    {
+        __release_grant_for_copy(buf->domain, buf->ptr.u.ref, buf->read_only);
+        buf->have_grant = 0;
     }
+}
+
+static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
+                                 const struct gnttab_copy_ptr *ptr,
+                                 struct gnttab_copy_buf *buf,
+                                 unsigned int gref_flag)
+{
+    int rc;
+
+    buf->read_only = gref_flag == GNTCOPY_source_gref;
 
-    if ( dest_is_gref )
+    if ( op->flags & gref_flag )
     {
-        uint16_t dest_off, dest_len;
-        rc = __acquire_grant_for_copy(dd, op->dest.u.ref,
-                                      current->domain->domain_id, 0,
-                                      &d_frame, &d_pg, &dest_off, &dest_len, 1);
+        rc = __acquire_grant_for_copy(buf->domain, ptr->u.ref,
+                                      current->domain->domain_id,
+                                      buf->read_only,
+                                      &buf->frame, &buf->page,
+                                      &buf->ptr.offset, &buf->len, 1);
         if ( rc != GNTST_okay )
-            goto error_out;
-        have_d_grant = 1;
-        if ( op->dest.offset < dest_off ||
-             op->len > dest_len )
-            PIN_FAIL(error_out, GNTST_general_error,
-                     "copy dest out of bounds: %d < %d || %d > %d\n",
-                     op->dest.offset, dest_off,
-                     op->len, dest_len);
+            goto out;
+        buf->ptr.u.ref = ptr->u.ref;
+        buf->have_grant = 1;
     }
     else
     {
-        rc = __get_paged_frame(op->dest.u.gmfn, &d_frame, &d_pg, 0, dd);
+        rc = __get_paged_frame(ptr->u.gmfn, &buf->frame, &buf->page,
+                               buf->read_only, buf->domain);
         if ( rc != GNTST_okay )
-            PIN_FAIL(error_out, rc,
-                     "destination frame %lx invalid.\n", d_frame);
+            PIN_FAIL(out, rc,
+                     "source frame %lx invalid.\n", ptr->u.gmfn);
+
+        buf->ptr.u.gmfn = ptr->u.gmfn;
+        buf->ptr.offset = 0;
+        buf->len = PAGE_SIZE;
     }
 
-    if ( !get_page_type(d_pg, PGT_writable_page) )
+    if ( !buf->read_only )
     {
-        if ( !dd->is_dying )
-            gdprintk(XENLOG_WARNING, "Could not get dst frame %lx\n", d_frame);
-        rc = GNTST_general_error;
-        goto error_out;
+        if ( !get_page_type(buf->page, PGT_writable_page) )
+        {
+            if ( !buf->domain->is_dying )
+                gdprintk(XENLOG_WARNING, "Could not get writable frame %lx\n", buf->frame);
+            rc = GNTST_general_error;
+            goto out;
+        }
+        buf->have_type = 1;
     }
 
-    sp = map_domain_page(s_frame);
-    dp = map_domain_page(d_frame);
+    buf->virt = map_domain_page(buf->frame);
+    rc = GNTST_okay;
 
-    memcpy(dp + op->dest.offset, sp + op->source.offset, op->len);
+ out:
+    return rc;
+}
 
-    unmap_domain_page(dp);
-    unmap_domain_page(sp);
+static int gnttab_copy_buf(const struct gnttab_copy *op,
+                           struct gnttab_copy_buf *dest,
+                           const struct gnttab_copy_buf *src)
+{
+    int rc;
 
-    gnttab_mark_dirty(dd, d_frame);
+    if ( ((op->source.offset + op->len) > PAGE_SIZE) ||
+         ((op->dest.offset + op->len) > PAGE_SIZE) )
+        PIN_FAIL(out, GNTST_bad_copy_arg, "copy beyond page area.\n");
+
+    if ( op->source.offset < src->ptr.offset ||
+         op->source.offset + op->len > src->ptr.offset + src->len )
+        PIN_FAIL(out, GNTST_general_error,
+                 "copy source out of bounds: %d < %d || %d > %d\n",
+                 op->source.offset, src->ptr.offset,
+                 op->len, src->len);
+
+    if ( op->dest.offset < dest->ptr.offset ||
+         op->dest.offset + op->len > dest->ptr.offset + dest->len )
+        PIN_FAIL(out, GNTST_general_error,
+                 "copy dest out of bounds: %d < %d || %d > %d\n",
+                 op->dest.offset, dest->ptr.offset,
+                 op->len, dest->len);
+
+    memcpy(dest->virt + op->dest.offset, src->virt + op->source.offset,
+           op->len);
+    gnttab_mark_dirty(dest->domain, dest->frame);
+    rc = GNTST_okay;
+ out:
+    return rc;
+}
 
-    put_page_type(d_pg);
- error_out:
-    if ( d_pg )
-        put_page(d_pg);
-    if ( s_pg )
-        put_page(s_pg);
-    if ( have_s_grant )
-        __release_grant_for_copy(sd, op->source.u.ref, 1);
-    if ( have_d_grant )
-        __release_grant_for_copy(dd, op->dest.u.ref, 0);
-    if ( sd )
-        rcu_unlock_domain(sd);
-    if ( dd )
-        rcu_unlock_domain(dd);
-    op->status = rc;
+static int gnttab_copy_one(const struct gnttab_copy *op,
+                           struct gnttab_copy_buf *dest,
+                           struct gnttab_copy_buf *src)
+{
+    int rc;
+
+    rc = gnttab_copy_lock_domains(op, src, dest);
+    if ( rc < 0 )
+        goto out;
+
+    rc = gnttab_copy_claim_buf(op, &op->source, src, GNTCOPY_source_gref);
+    if ( rc < 0 )
+        goto out;
+
+    rc = gnttab_copy_claim_buf(op, &op->dest, dest, GNTCOPY_dest_gref);
+    if ( rc < 0 )
+        goto out;
+
+    rc = gnttab_copy_buf(op, dest, src);
+ out:
+    gnttab_copy_release_buf(src);
+    gnttab_copy_release_buf(dest);
+    gnttab_copy_unlock_domains(src, dest);
+    return rc;
 }
 
-static long
-gnttab_copy(
+static long gnttab_copy(
     XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) uop, unsigned int count)
 {
-    int i;
+    unsigned int i;
     struct gnttab_copy op;
+    struct gnttab_copy_buf src = {};
+    struct gnttab_copy_buf dest = {};
 
     for ( i = 0; i < count; i++ )
     {
@@ -2217,7 +2308,9 @@ gnttab_copy(
             return i;
         if ( unlikely(__copy_from_guest(&op, uop, 1)) )
             return -EFAULT;
-        __gnttab_copy(&op);
+
+        op.status = gnttab_copy_one(&op, &dest, &src);
+
         if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
             return -EFAULT;
         guest_handle_add_offset(uop, 1);
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index 20d4e77..c8619ed 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -453,7 +453,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_t);
 
 struct gnttab_copy {
     /* IN parameters. */
-    struct {
+    struct gnttab_copy_ptr {
         union {
             grant_ref_t ref;
             xen_pfn_t   gmfn;
--
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 Tue Feb 03 08:08:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYWe-0006vs-NH; Tue, 03 Feb 2015 08:08: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 1YIYWd-0006vj-BM
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:59 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	14/C3-02757-ED180D45; Tue, 03 Feb 2015 08:07:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1422950876!5500181!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32766 invoked from network); 3 Feb 2015 08:07:57 -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;
	3 Feb 2015 08:07: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 1YIYWa-0005Zx-LU
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWa-0006su-KB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:07:56 +0000
Date: Tue, 03 Feb 2015 08:07:56 +0000
Message-Id: <E1YIYWa-0006su-KB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant-table: refactor grant copy to
	reduce duplicate code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c72f8c2cf19f735d813081c836f03e3078ee5c1
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Jan 29 14:21:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 14:21:00 2015 +0100

    grant-table: refactor grant copy to reduce duplicate code
    
    Much of the grant copy operation is identical for the source and
    destination buffers.  Refactor the code into per-buffer functions.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/common/grant_table.c         |  289 +++++++++++++++++++++++++-------------
 xen/include/public/grant_table.h |    2 +-
 2 files changed, 192 insertions(+), 99 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index fb9d8f7..f5b25bc 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2077,139 +2077,230 @@ __acquire_grant_for_copy(
     return rc;
 }
 
-static void
-__gnttab_copy(
-    struct gnttab_copy *op)
-{
-    struct domain *sd = NULL, *dd = NULL;
-    unsigned long s_frame, d_frame;
-    struct page_info *s_pg = NULL, *d_pg = NULL;
-    char *sp, *dp;
-    s16 rc = GNTST_okay;
-    int have_d_grant = 0, have_s_grant = 0;
-    int src_is_gref, dest_is_gref;
+struct gnttab_copy_buf {
+    /* Guest provided. */
+    struct gnttab_copy_ptr ptr;
+    uint16_t len;
 
-    if ( ((op->source.offset + op->len) > PAGE_SIZE) ||
-         ((op->dest.offset + op->len) > PAGE_SIZE) )
-        PIN_FAIL(error_out, GNTST_bad_copy_arg, "copy beyond page area.\n");
+    /* Mapped etc. */
+    struct domain *domain;
+    unsigned long frame;
+    struct page_info *page;
+    void *virt;
+    bool_t read_only;
+    bool_t have_grant;
+    bool_t have_type;
+};
 
-    src_is_gref = op->flags & GNTCOPY_source_gref;
-    dest_is_gref = op->flags & GNTCOPY_dest_gref;
+static int gnttab_copy_lock_domain(domid_t domid, unsigned int gref_flag,
+                                   struct gnttab_copy_buf *buf)
+{
+    int rc;
 
-    if ( (op->source.domid != DOMID_SELF && !src_is_gref ) ||
-         (op->dest.domid   != DOMID_SELF && !dest_is_gref)   )
-        PIN_FAIL(error_out, GNTST_permission_denied,
+    if ( domid != DOMID_SELF && !gref_flag )
+        PIN_FAIL(out, GNTST_permission_denied,
                  "only allow copy-by-mfn for DOMID_SELF.\n");
 
-    if ( op->source.domid == DOMID_SELF )
-        sd = rcu_lock_current_domain();
-    else if ( (sd = rcu_lock_domain_by_id(op->source.domid)) == NULL )
-        PIN_FAIL(error_out, GNTST_bad_domain,
-                 "couldn't find %d\n", op->source.domid);
+    if ( domid == DOMID_SELF )
+        buf->domain = rcu_lock_current_domain();
+    else
+    {
+        buf->domain = rcu_lock_domain_by_id(domid);
+        if ( buf->domain == NULL )
+            PIN_FAIL(out, GNTST_bad_domain, "couldn't find %d\n", domid);
+    }
 
-    if ( op->dest.domid == DOMID_SELF )
-        dd = rcu_lock_current_domain();
-    else if ( (dd = rcu_lock_domain_by_id(op->dest.domid)) == NULL )
-        PIN_FAIL(error_out, GNTST_bad_domain,
-                 "couldn't find %d\n", op->dest.domid);
+    buf->ptr.domid = domid;
+    rc = GNTST_okay;
+ out:
+    return rc;
+}
 
-    rc = xsm_grant_copy(XSM_HOOK, sd, dd);
-    if ( rc )
+static void gnttab_copy_unlock_domains(struct gnttab_copy_buf *src,
+                                       struct gnttab_copy_buf *dest)
+{
+    if ( src->domain )
+    {
+        rcu_unlock_domain(src->domain);
+        src->domain = NULL;
+    }
+    if ( dest->domain )
+    {
+        rcu_unlock_domain(dest->domain);
+        dest->domain = NULL;
+    }
+}
+
+static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
+                                    struct gnttab_copy_buf *src,
+                                    struct gnttab_copy_buf *dest)
+{
+    int rc;
+
+    rc = gnttab_copy_lock_domain(op->source.domid,
+                                 op->flags & GNTCOPY_source_gref, src);
+    if ( rc < 0 )
+        goto error;
+    rc = gnttab_copy_lock_domain(op->dest.domid,
+                                 op->flags & GNTCOPY_dest_gref, dest);
+    if ( rc < 0 )
+        goto error;
+
+    rc = xsm_grant_copy(XSM_HOOK, src->domain, dest->domain);
+    if ( rc < 0 )
     {
         rc = GNTST_permission_denied;
-        goto error_out;
+        goto error;
     }
+    return 0;
+
+ error:
+    gnttab_copy_unlock_domains(src, dest);
+    return rc;
+}
 
-    if ( src_is_gref )
+static void gnttab_copy_release_buf(struct gnttab_copy_buf *buf)
+{
+    if ( buf->virt )
     {
-        uint16_t source_off, source_len;
-        rc = __acquire_grant_for_copy(sd, op->source.u.ref,
-                                      current->domain->domain_id, 1,
-                                      &s_frame, &s_pg,
-                                      &source_off, &source_len, 1);
-        if ( rc != GNTST_okay )
-            goto error_out;
-        have_s_grant = 1;
-        if ( op->source.offset < source_off ||
-             op->len > source_len )
-            PIN_FAIL(error_out, GNTST_general_error,
-                     "copy source out of bounds: %d < %d || %d > %d\n",
-                     op->source.offset, source_off,
-                     op->len, source_len);
+        unmap_domain_page(buf->virt);
+        buf->virt = NULL;
     }
-    else
+    if ( buf->have_type )
     {
-        rc = __get_paged_frame(op->source.u.gmfn, &s_frame, &s_pg, 1, sd);
-        if ( rc != GNTST_okay )
-            PIN_FAIL(error_out, rc,
-                     "source frame %lx invalid.\n", s_frame);
+        put_page_type(buf->page);
+        buf->have_type = 0;
+    }
+    if ( buf->page )
+    {
+        put_page(buf->page);
+        buf->page = NULL;
+    }
+    if ( buf->have_grant )
+    {
+        __release_grant_for_copy(buf->domain, buf->ptr.u.ref, buf->read_only);
+        buf->have_grant = 0;
     }
+}
+
+static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
+                                 const struct gnttab_copy_ptr *ptr,
+                                 struct gnttab_copy_buf *buf,
+                                 unsigned int gref_flag)
+{
+    int rc;
+
+    buf->read_only = gref_flag == GNTCOPY_source_gref;
 
-    if ( dest_is_gref )
+    if ( op->flags & gref_flag )
     {
-        uint16_t dest_off, dest_len;
-        rc = __acquire_grant_for_copy(dd, op->dest.u.ref,
-                                      current->domain->domain_id, 0,
-                                      &d_frame, &d_pg, &dest_off, &dest_len, 1);
+        rc = __acquire_grant_for_copy(buf->domain, ptr->u.ref,
+                                      current->domain->domain_id,
+                                      buf->read_only,
+                                      &buf->frame, &buf->page,
+                                      &buf->ptr.offset, &buf->len, 1);
         if ( rc != GNTST_okay )
-            goto error_out;
-        have_d_grant = 1;
-        if ( op->dest.offset < dest_off ||
-             op->len > dest_len )
-            PIN_FAIL(error_out, GNTST_general_error,
-                     "copy dest out of bounds: %d < %d || %d > %d\n",
-                     op->dest.offset, dest_off,
-                     op->len, dest_len);
+            goto out;
+        buf->ptr.u.ref = ptr->u.ref;
+        buf->have_grant = 1;
     }
     else
     {
-        rc = __get_paged_frame(op->dest.u.gmfn, &d_frame, &d_pg, 0, dd);
+        rc = __get_paged_frame(ptr->u.gmfn, &buf->frame, &buf->page,
+                               buf->read_only, buf->domain);
         if ( rc != GNTST_okay )
-            PIN_FAIL(error_out, rc,
-                     "destination frame %lx invalid.\n", d_frame);
+            PIN_FAIL(out, rc,
+                     "source frame %lx invalid.\n", ptr->u.gmfn);
+
+        buf->ptr.u.gmfn = ptr->u.gmfn;
+        buf->ptr.offset = 0;
+        buf->len = PAGE_SIZE;
     }
 
-    if ( !get_page_type(d_pg, PGT_writable_page) )
+    if ( !buf->read_only )
     {
-        if ( !dd->is_dying )
-            gdprintk(XENLOG_WARNING, "Could not get dst frame %lx\n", d_frame);
-        rc = GNTST_general_error;
-        goto error_out;
+        if ( !get_page_type(buf->page, PGT_writable_page) )
+        {
+            if ( !buf->domain->is_dying )
+                gdprintk(XENLOG_WARNING, "Could not get writable frame %lx\n", buf->frame);
+            rc = GNTST_general_error;
+            goto out;
+        }
+        buf->have_type = 1;
     }
 
-    sp = map_domain_page(s_frame);
-    dp = map_domain_page(d_frame);
+    buf->virt = map_domain_page(buf->frame);
+    rc = GNTST_okay;
 
-    memcpy(dp + op->dest.offset, sp + op->source.offset, op->len);
+ out:
+    return rc;
+}
 
-    unmap_domain_page(dp);
-    unmap_domain_page(sp);
+static int gnttab_copy_buf(const struct gnttab_copy *op,
+                           struct gnttab_copy_buf *dest,
+                           const struct gnttab_copy_buf *src)
+{
+    int rc;
 
-    gnttab_mark_dirty(dd, d_frame);
+    if ( ((op->source.offset + op->len) > PAGE_SIZE) ||
+         ((op->dest.offset + op->len) > PAGE_SIZE) )
+        PIN_FAIL(out, GNTST_bad_copy_arg, "copy beyond page area.\n");
+
+    if ( op->source.offset < src->ptr.offset ||
+         op->source.offset + op->len > src->ptr.offset + src->len )
+        PIN_FAIL(out, GNTST_general_error,
+                 "copy source out of bounds: %d < %d || %d > %d\n",
+                 op->source.offset, src->ptr.offset,
+                 op->len, src->len);
+
+    if ( op->dest.offset < dest->ptr.offset ||
+         op->dest.offset + op->len > dest->ptr.offset + dest->len )
+        PIN_FAIL(out, GNTST_general_error,
+                 "copy dest out of bounds: %d < %d || %d > %d\n",
+                 op->dest.offset, dest->ptr.offset,
+                 op->len, dest->len);
+
+    memcpy(dest->virt + op->dest.offset, src->virt + op->source.offset,
+           op->len);
+    gnttab_mark_dirty(dest->domain, dest->frame);
+    rc = GNTST_okay;
+ out:
+    return rc;
+}
 
-    put_page_type(d_pg);
- error_out:
-    if ( d_pg )
-        put_page(d_pg);
-    if ( s_pg )
-        put_page(s_pg);
-    if ( have_s_grant )
-        __release_grant_for_copy(sd, op->source.u.ref, 1);
-    if ( have_d_grant )
-        __release_grant_for_copy(dd, op->dest.u.ref, 0);
-    if ( sd )
-        rcu_unlock_domain(sd);
-    if ( dd )
-        rcu_unlock_domain(dd);
-    op->status = rc;
+static int gnttab_copy_one(const struct gnttab_copy *op,
+                           struct gnttab_copy_buf *dest,
+                           struct gnttab_copy_buf *src)
+{
+    int rc;
+
+    rc = gnttab_copy_lock_domains(op, src, dest);
+    if ( rc < 0 )
+        goto out;
+
+    rc = gnttab_copy_claim_buf(op, &op->source, src, GNTCOPY_source_gref);
+    if ( rc < 0 )
+        goto out;
+
+    rc = gnttab_copy_claim_buf(op, &op->dest, dest, GNTCOPY_dest_gref);
+    if ( rc < 0 )
+        goto out;
+
+    rc = gnttab_copy_buf(op, dest, src);
+ out:
+    gnttab_copy_release_buf(src);
+    gnttab_copy_release_buf(dest);
+    gnttab_copy_unlock_domains(src, dest);
+    return rc;
 }
 
-static long
-gnttab_copy(
+static long gnttab_copy(
     XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) uop, unsigned int count)
 {
-    int i;
+    unsigned int i;
     struct gnttab_copy op;
+    struct gnttab_copy_buf src = {};
+    struct gnttab_copy_buf dest = {};
 
     for ( i = 0; i < count; i++ )
     {
@@ -2217,7 +2308,9 @@ gnttab_copy(
             return i;
         if ( unlikely(__copy_from_guest(&op, uop, 1)) )
             return -EFAULT;
-        __gnttab_copy(&op);
+
+        op.status = gnttab_copy_one(&op, &dest, &src);
+
         if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
             return -EFAULT;
         guest_handle_add_offset(uop, 1);
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index 20d4e77..c8619ed 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -453,7 +453,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_t);
 
 struct gnttab_copy {
     /* IN parameters. */
-    struct {
+    struct gnttab_copy_ptr {
         union {
             grant_ref_t ref;
             xen_pfn_t   gmfn;
--
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 Tue Feb 03 08:08:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYWo-0006x9-Q6; Tue, 03 Feb 2015 08:08: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 1YIYWn-0006wt-HB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:09 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A6/15-03164-8E180D45; Tue, 03 Feb 2015 08:08:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1422950887!11542995!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16255 invoked from network); 3 Feb 2015 08:08:08 -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;
	3 Feb 2015 08:08: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 1YIYWk-0005aV-Qz
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWk-0006tu-Q3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:06 +0000
Date: Tue, 03 Feb 2015 08:08:06 +0000
Message-Id: <E1YIYWk-0006tu-Q3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant-table: defer releasing pages
	acquired in a grant copy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d28f42f2703e483116bafd2b0b76a32af67d83ad
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Jan 29 14:22:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 14:22:22 2015 +0100

    grant-table: defer releasing pages acquired in a grant copy
    
    Acquiring a page for the source or destination of a grant copy is an
    expensive operation.  A common use case is for two adjacent grant copy
    ops to operate on either the same source or the same destination page.
    
    Instead of always acquiring and releasing destination and source pages
    for each operation, release the page once it is no longer valid for
    the next op.
    
    If either the source or destination domains changes both pages are
    released as it is unlikely that either will still be valid.
    
    XenServer's performance benchmarks show modest improvements in network
    receive throughput (netback uses grant copy in the guest Rx path) and
    no regressions in disk performance (using tapdisk3 which grant copies
    as the backend).
    
                             Baseline   Deferred Release
    Interhost receive to VM   7.2 Gb/s  ~9 Gbit/s
    Interhost aggregate      24 Gb/s    28 Gb/s
    Intrahost single stream  14 Gb/s    14 Gb/s
    Intrahost aggregate      34 Gb/s    36 Gb/s
    Aggregate disk write    900 MB/s   900 MB/s
    Aggregate disk read     890 MB/s   890 MB/s
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c |   83 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 66 insertions(+), 17 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f5b25bc..e44fe20 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2236,6 +2236,17 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
     return rc;
 }
 
+static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
+                                    const struct gnttab_copy_buf *b,
+                                    bool_t has_gref)
+{
+    if ( !b->virt )
+        return 0;
+    if ( has_gref )
+        return b->have_grant && p->u.ref == b->ptr.u.ref;
+    return p->u.gmfn == b->ptr.u.gmfn;
+}
+
 static int gnttab_copy_buf(const struct gnttab_copy *op,
                            struct gnttab_copy_buf *dest,
                            const struct gnttab_copy_buf *src)
@@ -2274,23 +2285,40 @@ static int gnttab_copy_one(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domains(op, src, dest);
-    if ( rc < 0 )
-        goto out;
+    if ( !src->domain || op->source.domid != src->ptr.domid ||
+         !dest->domain || op->dest.domid != dest->ptr.domid )
+    {
+        gnttab_copy_release_buf(src);
+        gnttab_copy_release_buf(dest);
+        gnttab_copy_unlock_domains(src, dest);
 
-    rc = gnttab_copy_claim_buf(op, &op->source, src, GNTCOPY_source_gref);
-    if ( rc < 0 )
-        goto out;
+        rc = gnttab_copy_lock_domains(op, src, dest);
+        if ( rc < 0 )
+            goto out;
+    }
 
-    rc = gnttab_copy_claim_buf(op, &op->dest, dest, GNTCOPY_dest_gref);
-    if ( rc < 0 )
-        goto out;
+    /* Different source? */
+    if ( !gnttab_copy_buf_valid(&op->source, src,
+                                op->flags & GNTCOPY_source_gref) )
+    {
+        gnttab_copy_release_buf(src);
+        rc = gnttab_copy_claim_buf(op, &op->source, src, GNTCOPY_source_gref);
+        if ( rc < 0 )
+            goto out;
+    }
+
+    /* Different dest? */
+    if ( !gnttab_copy_buf_valid(&op->dest, dest,
+                                op->flags & GNTCOPY_dest_gref) )
+    {
+        gnttab_copy_release_buf(dest);
+        rc = gnttab_copy_claim_buf(op, &op->dest, dest, GNTCOPY_dest_gref);
+        if ( rc < 0 )
+            goto out;
+    }
 
     rc = gnttab_copy_buf(op, dest, src);
  out:
-    gnttab_copy_release_buf(src);
-    gnttab_copy_release_buf(dest);
-    gnttab_copy_unlock_domains(src, dest);
     return rc;
 }
 
@@ -2301,21 +2329,42 @@ static long gnttab_copy(
     struct gnttab_copy op;
     struct gnttab_copy_buf src = {};
     struct gnttab_copy_buf dest = {};
+    long rc = 0;
 
     for ( i = 0; i < count; i++ )
     {
-        if (i && hypercall_preempt_check())
-            return i;
+        if ( i && hypercall_preempt_check() )
+        {
+            rc = i;
+            break;
+        }
+
         if ( unlikely(__copy_from_guest(&op, uop, 1)) )
-            return -EFAULT;
+        {
+            rc = -EFAULT;
+            break;
+        }
 
         op.status = gnttab_copy_one(&op, &dest, &src);
+        if ( op.status != GNTST_okay )
+        {
+            gnttab_copy_release_buf(&src);
+            gnttab_copy_release_buf(&dest);
+        }
 
         if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
-            return -EFAULT;
+        {
+            rc = -EFAULT;
+            break;
+        }
         guest_handle_add_offset(uop, 1);
     }
-    return 0;
+
+    gnttab_copy_release_buf(&src);
+    gnttab_copy_release_buf(&dest);
+    gnttab_copy_unlock_domains(&src, &dest);
+
+    return rc;
 }
 
 static long
--
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 Tue Feb 03 08:08:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYWo-0006x9-Q6; Tue, 03 Feb 2015 08:08: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 1YIYWn-0006wt-HB
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:09 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A6/15-03164-8E180D45; Tue, 03 Feb 2015 08:08:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1422950887!11542995!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16255 invoked from network); 3 Feb 2015 08:08:08 -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;
	3 Feb 2015 08:08: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 1YIYWk-0005aV-Qz
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWk-0006tu-Q3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:06 +0000
Date: Tue, 03 Feb 2015 08:08:06 +0000
Message-Id: <E1YIYWk-0006tu-Q3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant-table: defer releasing pages
	acquired in a grant copy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d28f42f2703e483116bafd2b0b76a32af67d83ad
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Jan 29 14:22:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 14:22:22 2015 +0100

    grant-table: defer releasing pages acquired in a grant copy
    
    Acquiring a page for the source or destination of a grant copy is an
    expensive operation.  A common use case is for two adjacent grant copy
    ops to operate on either the same source or the same destination page.
    
    Instead of always acquiring and releasing destination and source pages
    for each operation, release the page once it is no longer valid for
    the next op.
    
    If either the source or destination domains changes both pages are
    released as it is unlikely that either will still be valid.
    
    XenServer's performance benchmarks show modest improvements in network
    receive throughput (netback uses grant copy in the guest Rx path) and
    no regressions in disk performance (using tapdisk3 which grant copies
    as the backend).
    
                             Baseline   Deferred Release
    Interhost receive to VM   7.2 Gb/s  ~9 Gbit/s
    Interhost aggregate      24 Gb/s    28 Gb/s
    Intrahost single stream  14 Gb/s    14 Gb/s
    Intrahost aggregate      34 Gb/s    36 Gb/s
    Aggregate disk write    900 MB/s   900 MB/s
    Aggregate disk read     890 MB/s   890 MB/s
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c |   83 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 66 insertions(+), 17 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f5b25bc..e44fe20 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2236,6 +2236,17 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
     return rc;
 }
 
+static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
+                                    const struct gnttab_copy_buf *b,
+                                    bool_t has_gref)
+{
+    if ( !b->virt )
+        return 0;
+    if ( has_gref )
+        return b->have_grant && p->u.ref == b->ptr.u.ref;
+    return p->u.gmfn == b->ptr.u.gmfn;
+}
+
 static int gnttab_copy_buf(const struct gnttab_copy *op,
                            struct gnttab_copy_buf *dest,
                            const struct gnttab_copy_buf *src)
@@ -2274,23 +2285,40 @@ static int gnttab_copy_one(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domains(op, src, dest);
-    if ( rc < 0 )
-        goto out;
+    if ( !src->domain || op->source.domid != src->ptr.domid ||
+         !dest->domain || op->dest.domid != dest->ptr.domid )
+    {
+        gnttab_copy_release_buf(src);
+        gnttab_copy_release_buf(dest);
+        gnttab_copy_unlock_domains(src, dest);
 
-    rc = gnttab_copy_claim_buf(op, &op->source, src, GNTCOPY_source_gref);
-    if ( rc < 0 )
-        goto out;
+        rc = gnttab_copy_lock_domains(op, src, dest);
+        if ( rc < 0 )
+            goto out;
+    }
 
-    rc = gnttab_copy_claim_buf(op, &op->dest, dest, GNTCOPY_dest_gref);
-    if ( rc < 0 )
-        goto out;
+    /* Different source? */
+    if ( !gnttab_copy_buf_valid(&op->source, src,
+                                op->flags & GNTCOPY_source_gref) )
+    {
+        gnttab_copy_release_buf(src);
+        rc = gnttab_copy_claim_buf(op, &op->source, src, GNTCOPY_source_gref);
+        if ( rc < 0 )
+            goto out;
+    }
+
+    /* Different dest? */
+    if ( !gnttab_copy_buf_valid(&op->dest, dest,
+                                op->flags & GNTCOPY_dest_gref) )
+    {
+        gnttab_copy_release_buf(dest);
+        rc = gnttab_copy_claim_buf(op, &op->dest, dest, GNTCOPY_dest_gref);
+        if ( rc < 0 )
+            goto out;
+    }
 
     rc = gnttab_copy_buf(op, dest, src);
  out:
-    gnttab_copy_release_buf(src);
-    gnttab_copy_release_buf(dest);
-    gnttab_copy_unlock_domains(src, dest);
     return rc;
 }
 
@@ -2301,21 +2329,42 @@ static long gnttab_copy(
     struct gnttab_copy op;
     struct gnttab_copy_buf src = {};
     struct gnttab_copy_buf dest = {};
+    long rc = 0;
 
     for ( i = 0; i < count; i++ )
     {
-        if (i && hypercall_preempt_check())
-            return i;
+        if ( i && hypercall_preempt_check() )
+        {
+            rc = i;
+            break;
+        }
+
         if ( unlikely(__copy_from_guest(&op, uop, 1)) )
-            return -EFAULT;
+        {
+            rc = -EFAULT;
+            break;
+        }
 
         op.status = gnttab_copy_one(&op, &dest, &src);
+        if ( op.status != GNTST_okay )
+        {
+            gnttab_copy_release_buf(&src);
+            gnttab_copy_release_buf(&dest);
+        }
 
         if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
-            return -EFAULT;
+        {
+            rc = -EFAULT;
+            break;
+        }
         guest_handle_add_offset(uop, 1);
     }
-    return 0;
+
+    gnttab_copy_release_buf(&src);
+    gnttab_copy_release_buf(&dest);
+    gnttab_copy_unlock_domains(&src, &dest);
+
+    return rc;
 }
 
 static long
--
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 Tue Feb 03 08:08:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYWz-0006z8-Uu; Tue, 03 Feb 2015 08:08: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 1YIYWy-0006yu-Ku
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	56/3B-02994-3F180D45; Tue, 03 Feb 2015 08:08:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1422950897!3208215!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10520 invoked from network); 3 Feb 2015 08:08:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:08: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 1YIYWv-0005ab-2t
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWu-0006uK-VL
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:16 +0000
Date: Tue, 03 Feb 2015 08:08:16 +0000
Message-Id: <E1YIYWu-0006uK-VL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: support SMBIOS v3
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 54057a28f22b4f398933d8d136475285bdfd4f83
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 14:24:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 14:24:04 2015 +0100

    x86: support SMBIOS v3
    
    While presumably of primary use to ARM64 (once the code gets
    generalized), we should still support this more modern variant,
    allowing for the actual DMI data to reside in memory above 4Gb.
    
    While based on draft version 3.0.0d, it is assumed that the final
    version of the specification will not render this implementation
    invalid (not the least because Linux 3.19 already makes the same
    assumption).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/dmi_scan.c  |  303 +++++++++++++++++++++++++++++++++++-----------
 xen/arch/x86/e820.c      |   18 ++-
 xen/common/efi/boot.c    |   11 ++-
 xen/common/efi/runtime.c |    1 +
 xen/include/xen/dmi.h    |    4 +-
 xen/include/xen/efi.h    |    1 +
 6 files changed, 260 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c
index 500133a..187c01e 100644
--- a/xen/arch/x86/dmi_scan.c
+++ b/xen/arch/x86/dmi_scan.c
@@ -38,6 +38,18 @@ struct __packed smbios_eps {
 	struct dmi_eps dmi;
 };
 
+struct __packed smbios3_eps {
+	char anchor[5];			/* "_SM3_" */
+	u8 checksum;
+	u8 length;
+	u8 major, minor;
+	u8 docrev;
+	u8 revision;
+	u8 _rsrvd_;
+	u32 max_size;
+	u64 address;
+};
+
 struct dmi_header
 {
 	u8	type;
@@ -45,6 +57,53 @@ struct dmi_header
 	u16	handle;
 };
 
+enum dmi_entry_type {
+	DMI_ENTRY_BIOS = 0,
+	DMI_ENTRY_SYSTEM,
+	DMI_ENTRY_BASEBOARD,
+	DMI_ENTRY_CHASSIS,
+	DMI_ENTRY_PROCESSOR,
+	DMI_ENTRY_MEM_CONTROLLER,
+	DMI_ENTRY_MEM_MODULE,
+	DMI_ENTRY_CACHE,
+	DMI_ENTRY_PORT_CONNECTOR,
+	DMI_ENTRY_SYSTEM_SLOT,
+	DMI_ENTRY_ONBOARD_DEVICE,
+	DMI_ENTRY_OEMSTRINGS,
+	DMI_ENTRY_SYSCONF,
+	DMI_ENTRY_BIOS_LANG,
+	DMI_ENTRY_GROUP_ASSOC,
+	DMI_ENTRY_SYSTEM_EVENT_LOG,
+	DMI_ENTRY_PHYS_MEM_ARRAY,
+	DMI_ENTRY_MEM_DEVICE,
+	DMI_ENTRY_32_MEM_ERROR,
+	DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
+	DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
+	DMI_ENTRY_BUILTIN_POINTING_DEV,
+	DMI_ENTRY_PORTABLE_BATTERY,
+	DMI_ENTRY_SYSTEM_RESET,
+	DMI_ENTRY_HW_SECURITY,
+	DMI_ENTRY_SYSTEM_POWER_CONTROLS,
+	DMI_ENTRY_VOLTAGE_PROBE,
+	DMI_ENTRY_COOLING_DEV,
+	DMI_ENTRY_TEMP_PROBE,
+	DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
+	DMI_ENTRY_OOB_REMOTE_ACCESS,
+	DMI_ENTRY_BIS_ENTRY,
+	DMI_ENTRY_SYSTEM_BOOT,
+	DMI_ENTRY_MGMT_DEV,
+	DMI_ENTRY_MGMT_DEV_COMPONENT,
+	DMI_ENTRY_MGMT_DEV_THRES,
+	DMI_ENTRY_MEM_CHANNEL,
+	DMI_ENTRY_IPMI_DEV,
+	DMI_ENTRY_SYS_POWER_SUPPLY,
+	DMI_ENTRY_ADDITIONAL,
+	DMI_ENTRY_ONBOARD_DEV_EXT,
+	DMI_ENTRY_MGMT_CONTROLLER_HOST,
+	DMI_ENTRY_INACTIVE = 126,
+	DMI_ENTRY_END_OF_TABLE = 127,
+};
+
 #undef DMI_DEBUG
 
 #ifdef DMI_DEBUG
@@ -74,7 +133,8 @@ static char * __init dmi_string(struct dmi_header *dm, u8 s)
  *	pointing to completely the wrong place for example
  */
  
-static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dmi_header *))
+static int __init dmi_table(paddr_t base, u32 len, int num,
+			    void (*decode)(struct dmi_header *))
 {
 	u8 *buf;
 	struct dmi_header *dm;
@@ -92,7 +152,7 @@ static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dm
  	 *	OR we run off the end of the table (also happens)
  	 */
  
-	while(i<num && data-buf+sizeof(struct dmi_header)<=len)
+	while((num < 0 || i < num) && data-buf+sizeof(struct dmi_header)<=len)
 	{
 		dm=(struct dmi_header *)data;
 		/*
@@ -105,6 +165,8 @@ static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dm
 			data++;
 		if(data-buf<len-1)
 			decode(dm);
+		if (dm->type == DMI_ENTRY_END_OF_TABLE)
+		    break;
 		data+=2;
 		i++;
 	}
@@ -127,16 +189,28 @@ static inline bool_t __init dmi_checksum(const void __iomem *buf,
 
 static u32 __initdata efi_dmi_address;
 static u32 __initdata efi_dmi_size;
+static u64 __initdata efi_smbios3_address;
+static u32 __initdata efi_smbios3_size;
 
 /*
  * Important: This function gets called while still in EFI
  * (pseudo-)physical mode.
  */
-void __init dmi_efi_get_table(void *smbios)
+void __init dmi_efi_get_table(const void *smbios, const void *smbios3)
 {
-	struct smbios_eps *eps = smbios;
+	const struct smbios_eps *eps = smbios;
+	const struct smbios3_eps *eps3 = smbios3;
+
+	if (eps3 && memcmp(eps3->anchor, "_SM3_", 5) &&
+	    eps3->length >= sizeof(*eps3) &&
+	    dmi_checksum(eps3, eps3->length)) {
+		efi_smbios3_address = eps3->address;
+		efi_smbios3_size = eps3->max_size;
+		return;
+	}
 
-	if (memcmp(eps->anchor, "_SM_", 4) &&
+	if (eps && memcmp(eps->anchor, "_SM_", 4) &&
+	    eps->length >= sizeof(*eps) &&
 	    dmi_checksum(eps, eps->length) &&
 	    memcmp(eps->dmi.anchor, "_DMI_", 5) == 0 &&
 	    dmi_checksum(&eps->dmi, sizeof(eps->dmi))) {
@@ -145,99 +219,190 @@ void __init dmi_efi_get_table(void *smbios)
 	}
 }
 
-int __init dmi_get_table(u32 *base, u32 *len)
+const char *__init dmi_get_table(paddr_t *base, u32 *len)
 {
-	struct dmi_eps eps;
-	char __iomem *p, *q;
+	static unsigned int __initdata instance;
 
 	if (efi_enabled) {
-		if (!efi_dmi_size)
-			return -1;
-		*base = efi_dmi_address;
-		*len = efi_dmi_size;
-		return 0;
-	}
-
-	p = maddr_to_virt(0xF0000);
-	for (q = p; q < p + 0x10000; q += 16) {
-		memcpy_fromio(&eps, q, 15);
-		if (memcmp(eps.anchor, "_DMI_", 5) == 0 &&
-		    dmi_checksum(&eps, sizeof(eps))) {
-			*base = eps.address;
-			*len = eps.size;
-			return 0;
+		if (efi_smbios3_size && !(instance & 1)) {
+			*base = efi_smbios3_address;
+			*len = efi_smbios3_size;
+			instance |= 1;
+			return "SMBIOSv3";
+		}
+		if (efi_dmi_size && !(instance & 2)) {
+			*base = efi_dmi_address;
+			*len = efi_dmi_size;
+			instance |= 2;
+			return "DMI";
+		}
+	} else {
+		char __iomem *p = maddr_to_virt(0xF0000), *q;
+		union {
+			struct dmi_eps dmi;
+			struct smbios3_eps smbios3;
+		} eps;
+
+		for (q = p; q <= p + 0x10000 - sizeof(eps.dmi); q += 16) {
+			memcpy_fromio(&eps, q, sizeof(eps.dmi));
+			if (!(instance & 1) &&
+			    memcmp(eps.dmi.anchor, "_DMI_", 5) == 0 &&
+			    dmi_checksum(&eps.dmi, sizeof(eps.dmi))) {
+				*base = eps.dmi.address;
+				*len = eps.dmi.size;
+				instance |= 1;
+				return "DMI";
+			}
+
+			BUILD_BUG_ON(sizeof(eps.smbios3) <= sizeof(eps.dmi));
+			if ((instance & 2) ||
+			    q > p + 0x10000 - sizeof(eps.smbios3))
+				continue;
+			memcpy_fromio(&eps.dmi + 1, q + sizeof(eps.dmi),
+			              sizeof(eps.smbios3) - sizeof(eps.dmi));
+			if (!memcmp(eps.smbios3.anchor, "_SM3_", 5) &&
+			    eps.smbios3.length >= sizeof(eps.smbios3) &&
+			    q <= p + 0x10000 - eps.smbios3.length &&
+			    dmi_checksum(q, eps.smbios3.length)) {
+				*base = eps.smbios3.address;
+				*len = eps.smbios3.max_size;
+				instance |= 2;
+				return "SMBIOSv3";
+			}
 		}
 	}
-	return -1;
+	return NULL;
 }
 
+typedef union {
+	const struct smbios_eps __iomem *legacy;
+	const struct smbios3_eps __iomem *v3;
+} smbios_eps_u __attribute__((transparent_union));
+
 static int __init _dmi_iterate(const struct dmi_eps *dmi,
-			       const struct smbios_eps __iomem *smbios,
+			       const smbios_eps_u smbios,
 			       void (*decode)(struct dmi_header *))
 {
-	u16 num = dmi->num_structures;
-	u16 len = dmi->size;
-	u32 base = dmi->address;
+	int num;
+	u32 len;
+	paddr_t base;
+
+	if (!dmi) {
+		num = -1;
+		len = smbios.v3->max_size;
+		base = smbios.v3->address;
+		printk(KERN_INFO "SMBIOS %d.%d present.\n",
+		       smbios.v3->major, smbios.v3->minor);
+		dmi_printk((KERN_INFO "SMBIOS v3 table at 0x%"PRIpaddr".\n", base));
+	} else {
+		num = dmi->num_structures;
+		len = dmi->size;
+		base = dmi->address;
 
-	/*
-	 * DMI version 0.0 means that the real version is taken from
-	 * the SMBIOS version, which we may not know at this point.
-	 */
-	if (dmi->revision)
-		printk(KERN_INFO "DMI %d.%d present.\n",
-		       dmi->revision >> 4,  dmi->revision & 0x0f);
-	else if (!smbios)
-		printk(KERN_INFO "DMI present.\n");
-	dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n",
-		    num, len));
-	dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base));
+		/*
+		 * DMI version 0.0 means that the real version is taken from
+		 * the SMBIOS version, which we may not know at this point.
+		 */
+		if (dmi->revision)
+			printk(KERN_INFO "DMI %d.%d present.\n",
+			       dmi->revision >> 4,  dmi->revision & 0x0f);
+		else if (!smbios.legacy)
+			printk(KERN_INFO "DMI present.\n");
+		dmi_printk((KERN_INFO "%d structures occupying %u bytes.\n",
+			    num, len));
+		dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", (u32)base));
+	}
 	return dmi_table(base, len, num, decode);
 }
 
 static int __init dmi_iterate(void (*decode)(struct dmi_header *))
 {
-	struct dmi_eps eps;
+	struct dmi_eps dmi;
+	struct smbios3_eps smbios3;
 	char __iomem *p, *q;
 
+	dmi.size = 0;
+	smbios3.length = 0;
+
 	p = maddr_to_virt(0xF0000);
 	for (q = p; q < p + 0x10000; q += 16) {
-		memcpy_fromio(&eps, q, sizeof(eps));
-		if (memcmp(eps.anchor, "_DMI_", 5) == 0 &&
-		    dmi_checksum(&eps, sizeof(eps)))
-			return _dmi_iterate(&eps, NULL, decode);
+		if (!dmi.size) {
+			memcpy_fromio(&dmi, q, sizeof(dmi));
+			if (memcmp(dmi.anchor, "_DMI_", 5) ||
+			    !dmi_checksum(&dmi, sizeof(dmi)))
+				dmi.size = 0;
+		}
+		if (!smbios3.length &&
+		    q <= p + 0x10000 - sizeof(smbios3)) {
+			memcpy_fromio(&smbios3, q, sizeof(smbios3));
+			if (memcmp(smbios3.anchor, "_SM3_", 5) ||
+			    smbios3.length < sizeof(smbios3) ||
+			    q < p + 0x10000 - smbios3.length ||
+			    !dmi_checksum(q, smbios3.length))
+				smbios3.length = 0;
+		}
 	}
+
+	if (smbios3.length)
+		return _dmi_iterate(NULL, &smbios3, decode);
+	if (dmi.size)
+		return _dmi_iterate(&dmi, NULL, decode);
 	return -1;
 }
 
 static int __init dmi_efi_iterate(void (*decode)(struct dmi_header *))
 {
-	struct smbios_eps eps;
-	const struct smbios_eps __iomem *p;
 	int ret = -1;
 
-	if (efi.smbios == EFI_INVALID_TABLE_ADDR)
-		return -1;
+	while (efi.smbios3 != EFI_INVALID_TABLE_ADDR) {
+		struct smbios3_eps eps;
+		const struct smbios3_eps __iomem *p;
 
-	p = bt_ioremap(efi.smbios, sizeof(eps));
-	if (!p)
-		return -1;
-	memcpy_fromio(&eps, p, sizeof(eps));
-	bt_iounmap(p, sizeof(eps));
+		p = bt_ioremap(efi.smbios3, sizeof(eps));
+		if (!p)
+			break;
+		memcpy_fromio(&eps, p, sizeof(eps));
+		bt_iounmap(p, sizeof(eps));
 
-	if (memcmp(eps.anchor, "_SM_", 4))
-		return -1;
+		if (memcmp(eps.anchor, "_SM3_", 5) ||
+		    eps.length < sizeof(eps))
+			break;
 
-	p = bt_ioremap(efi.smbios, eps.length);
-	if (!p)
-		return -1;
-	if (dmi_checksum(p, eps.length) &&
-	    memcmp(eps.dmi.anchor, "_DMI_", 5) == 0 &&
-	    dmi_checksum(&eps.dmi, sizeof(eps.dmi))) {
-		printk(KERN_INFO "SMBIOS %d.%d present.\n",
-		       eps.major, eps.minor);
-		ret = _dmi_iterate(&eps.dmi, p, decode);
+		p = bt_ioremap(efi.smbios3, eps.length);
+		if (!p)
+			break;
+		if (dmi_checksum(p, eps.length))
+			ret = _dmi_iterate(NULL, p, decode);
+		bt_iounmap(p, eps.length);
+		break;
+	}
+
+	if (ret != 0 && efi.smbios != EFI_INVALID_TABLE_ADDR) {
+		struct smbios_eps eps;
+		const struct smbios_eps __iomem *p;
+
+		p = bt_ioremap(efi.smbios, sizeof(eps));
+		if (!p)
+			return -1;
+		memcpy_fromio(&eps, p, sizeof(eps));
+		bt_iounmap(p, sizeof(eps));
+
+		if (memcmp(eps.anchor, "_SM_", 4) ||
+		    eps.length < sizeof(eps))
+			return -1;
+
+		p = bt_ioremap(efi.smbios, eps.length);
+		if (!p)
+			return -1;
+		if (dmi_checksum(p, eps.length) &&
+		    memcmp(eps.dmi.anchor, "_DMI_", 5) == 0 &&
+		    dmi_checksum(&eps.dmi, sizeof(eps.dmi))) {
+			printk(KERN_INFO "SMBIOS %d.%d present.\n",
+			       eps.major, eps.minor);
+			ret = _dmi_iterate(&eps.dmi, p, decode);
+		}
+		bt_iounmap(p, eps.length);
 	}
-	bt_iounmap(p, eps.length);
 
 	return ret;
 }
@@ -476,7 +641,7 @@ static void __init dmi_decode(struct dmi_header *dm)
 	
 	switch(dm->type)
 	{
-		case  0:
+		case DMI_ENTRY_BIOS:
 			dmi_printk(("BIOS Vendor: %s\n",
 				dmi_string(dm, data[4])));
 			dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
@@ -487,7 +652,7 @@ static void __init dmi_decode(struct dmi_header *dm)
 				dmi_string(dm, data[8])));
 			dmi_save_ident(dm, DMI_BIOS_DATE, 8);
 			break;
-		case 1:
+		case DMI_ENTRY_SYSTEM:
 			dmi_printk(("System Vendor: %s\n",
 				dmi_string(dm, data[4])));
 			dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
@@ -500,7 +665,7 @@ static void __init dmi_decode(struct dmi_header *dm)
 			dmi_printk(("Serial Number: %s\n",
 				dmi_string(dm, data[7])));
 			break;
-		case 2:
+		case DMI_ENTRY_BASEBOARD:
 			dmi_printk(("Board Vendor: %s\n",
 				dmi_string(dm, data[4])));
 			dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index bf84bae..743a375 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -504,11 +504,19 @@ static uint64_t __init mtrr_top_of_ram(void)
 
 static void __init reserve_dmi_region(void)
 {
-    u32 base, len;
-    if ( (dmi_get_table(&base, &len) == 0) && ((base + len) > base) &&
-         reserve_e820_ram(&e820, base, base + len) )
-        printk("WARNING: DMI table located in E820 RAM %08x-%08x. Fixed.\n",
-               base, base+len);
+    for ( ; ; )
+    {
+        paddr_t base;
+        u32 len;
+        const char *what = dmi_get_table(&base, &len);
+
+        if ( !what )
+            break;
+        if ( ((base + len) > base) &&
+             reserve_e820_ram(&e820, base, base + len) )
+            printk("WARNING: %s table located in E820 RAM %"PRIpaddr"-%"PRIpaddr". Fixed.\n",
+                   what, base, base + len);
+    }
 }
 
 static void __init machine_specific_memory_setup(
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index ac6881e..f5e179b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -32,6 +32,8 @@
 /* Using SetVirtualAddressMap() is incompatible with kexec: */
 #undef USE_SET_VIRTUAL_ADDRESS_MAP
 
+#define SMBIOS3_TABLE_GUID \
+  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
 #define SHIM_LOCK_PROTOCOL_GUID \
   { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 
@@ -993,6 +995,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
         static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
         static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
+        static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
 
         if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
 	       efi.acpi20 = (long)efi_ct[i].VendorTable;
@@ -1002,11 +1005,15 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 	       efi.mps = (long)efi_ct[i].VendorTable;
         if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
 	       efi.smbios = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
+	       efi.smbios3 = (long)efi_ct[i].VendorTable;
     }
 
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
-    if (efi.smbios != EFI_INVALID_TABLE_ADDR)
-        dmi_efi_get_table((void *)(long)efi.smbios);
+    dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios : NULL,
+                      efi.smbios3 != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios3 : NULL);
 #endif
 
     /* Collect PCI ROM contents. */
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index c840e08..7ed5bfa 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -45,6 +45,7 @@ struct efi __read_mostly efi = {
 	.acpi20 = EFI_INVALID_TABLE_ADDR,
 	.mps    = EFI_INVALID_TABLE_ADDR,
 	.smbios = EFI_INVALID_TABLE_ADDR,
+	.smbios3 = EFI_INVALID_TABLE_ADDR,
 };
 
 const struct efi_pci_rom *__read_mostly efi_pci_roms;
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index 8205893..df26d4b 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -34,8 +34,8 @@ struct dmi_system_id {
 
 extern int dmi_check_system(struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
-extern int dmi_get_table(u32 *base, u32 *len);
-extern void dmi_efi_get_table(void *);
+extern const char *dmi_get_table(paddr_t *base, u32 *len);
+extern void dmi_efi_get_table(const void *smbios, const void *smbios3);
 bool_t dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
 extern void dmi_end_boot(void);
 
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 5e02724..48de8e0 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -15,6 +15,7 @@ struct efi {
     unsigned long acpi;         /* ACPI table (IA64 ext 0.71) */
     unsigned long acpi20;       /* ACPI table (ACPI 2.0) */
     unsigned long smbios;       /* SM BIOS table */
+    unsigned long smbios3;      /* SMBIOS v3 table */
 };
 
 extern struct efi efi;
--
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 Tue Feb 03 08:08:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYWz-0006z8-Uu; Tue, 03 Feb 2015 08:08: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 1YIYWy-0006yu-Ku
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	56/3B-02994-3F180D45; Tue, 03 Feb 2015 08:08:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1422950897!3208215!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10520 invoked from network); 3 Feb 2015 08:08:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Feb 2015 08:08: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 1YIYWv-0005ab-2t
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYWu-0006uK-VL
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:16 +0000
Date: Tue, 03 Feb 2015 08:08:16 +0000
Message-Id: <E1YIYWu-0006uK-VL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: support SMBIOS v3
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 54057a28f22b4f398933d8d136475285bdfd4f83
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 14:24:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 14:24:04 2015 +0100

    x86: support SMBIOS v3
    
    While presumably of primary use to ARM64 (once the code gets
    generalized), we should still support this more modern variant,
    allowing for the actual DMI data to reside in memory above 4Gb.
    
    While based on draft version 3.0.0d, it is assumed that the final
    version of the specification will not render this implementation
    invalid (not the least because Linux 3.19 already makes the same
    assumption).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/dmi_scan.c  |  303 +++++++++++++++++++++++++++++++++++-----------
 xen/arch/x86/e820.c      |   18 ++-
 xen/common/efi/boot.c    |   11 ++-
 xen/common/efi/runtime.c |    1 +
 xen/include/xen/dmi.h    |    4 +-
 xen/include/xen/efi.h    |    1 +
 6 files changed, 260 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c
index 500133a..187c01e 100644
--- a/xen/arch/x86/dmi_scan.c
+++ b/xen/arch/x86/dmi_scan.c
@@ -38,6 +38,18 @@ struct __packed smbios_eps {
 	struct dmi_eps dmi;
 };
 
+struct __packed smbios3_eps {
+	char anchor[5];			/* "_SM3_" */
+	u8 checksum;
+	u8 length;
+	u8 major, minor;
+	u8 docrev;
+	u8 revision;
+	u8 _rsrvd_;
+	u32 max_size;
+	u64 address;
+};
+
 struct dmi_header
 {
 	u8	type;
@@ -45,6 +57,53 @@ struct dmi_header
 	u16	handle;
 };
 
+enum dmi_entry_type {
+	DMI_ENTRY_BIOS = 0,
+	DMI_ENTRY_SYSTEM,
+	DMI_ENTRY_BASEBOARD,
+	DMI_ENTRY_CHASSIS,
+	DMI_ENTRY_PROCESSOR,
+	DMI_ENTRY_MEM_CONTROLLER,
+	DMI_ENTRY_MEM_MODULE,
+	DMI_ENTRY_CACHE,
+	DMI_ENTRY_PORT_CONNECTOR,
+	DMI_ENTRY_SYSTEM_SLOT,
+	DMI_ENTRY_ONBOARD_DEVICE,
+	DMI_ENTRY_OEMSTRINGS,
+	DMI_ENTRY_SYSCONF,
+	DMI_ENTRY_BIOS_LANG,
+	DMI_ENTRY_GROUP_ASSOC,
+	DMI_ENTRY_SYSTEM_EVENT_LOG,
+	DMI_ENTRY_PHYS_MEM_ARRAY,
+	DMI_ENTRY_MEM_DEVICE,
+	DMI_ENTRY_32_MEM_ERROR,
+	DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
+	DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
+	DMI_ENTRY_BUILTIN_POINTING_DEV,
+	DMI_ENTRY_PORTABLE_BATTERY,
+	DMI_ENTRY_SYSTEM_RESET,
+	DMI_ENTRY_HW_SECURITY,
+	DMI_ENTRY_SYSTEM_POWER_CONTROLS,
+	DMI_ENTRY_VOLTAGE_PROBE,
+	DMI_ENTRY_COOLING_DEV,
+	DMI_ENTRY_TEMP_PROBE,
+	DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
+	DMI_ENTRY_OOB_REMOTE_ACCESS,
+	DMI_ENTRY_BIS_ENTRY,
+	DMI_ENTRY_SYSTEM_BOOT,
+	DMI_ENTRY_MGMT_DEV,
+	DMI_ENTRY_MGMT_DEV_COMPONENT,
+	DMI_ENTRY_MGMT_DEV_THRES,
+	DMI_ENTRY_MEM_CHANNEL,
+	DMI_ENTRY_IPMI_DEV,
+	DMI_ENTRY_SYS_POWER_SUPPLY,
+	DMI_ENTRY_ADDITIONAL,
+	DMI_ENTRY_ONBOARD_DEV_EXT,
+	DMI_ENTRY_MGMT_CONTROLLER_HOST,
+	DMI_ENTRY_INACTIVE = 126,
+	DMI_ENTRY_END_OF_TABLE = 127,
+};
+
 #undef DMI_DEBUG
 
 #ifdef DMI_DEBUG
@@ -74,7 +133,8 @@ static char * __init dmi_string(struct dmi_header *dm, u8 s)
  *	pointing to completely the wrong place for example
  */
  
-static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dmi_header *))
+static int __init dmi_table(paddr_t base, u32 len, int num,
+			    void (*decode)(struct dmi_header *))
 {
 	u8 *buf;
 	struct dmi_header *dm;
@@ -92,7 +152,7 @@ static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dm
  	 *	OR we run off the end of the table (also happens)
  	 */
  
-	while(i<num && data-buf+sizeof(struct dmi_header)<=len)
+	while((num < 0 || i < num) && data-buf+sizeof(struct dmi_header)<=len)
 	{
 		dm=(struct dmi_header *)data;
 		/*
@@ -105,6 +165,8 @@ static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dm
 			data++;
 		if(data-buf<len-1)
 			decode(dm);
+		if (dm->type == DMI_ENTRY_END_OF_TABLE)
+		    break;
 		data+=2;
 		i++;
 	}
@@ -127,16 +189,28 @@ static inline bool_t __init dmi_checksum(const void __iomem *buf,
 
 static u32 __initdata efi_dmi_address;
 static u32 __initdata efi_dmi_size;
+static u64 __initdata efi_smbios3_address;
+static u32 __initdata efi_smbios3_size;
 
 /*
  * Important: This function gets called while still in EFI
  * (pseudo-)physical mode.
  */
-void __init dmi_efi_get_table(void *smbios)
+void __init dmi_efi_get_table(const void *smbios, const void *smbios3)
 {
-	struct smbios_eps *eps = smbios;
+	const struct smbios_eps *eps = smbios;
+	const struct smbios3_eps *eps3 = smbios3;
+
+	if (eps3 && memcmp(eps3->anchor, "_SM3_", 5) &&
+	    eps3->length >= sizeof(*eps3) &&
+	    dmi_checksum(eps3, eps3->length)) {
+		efi_smbios3_address = eps3->address;
+		efi_smbios3_size = eps3->max_size;
+		return;
+	}
 
-	if (memcmp(eps->anchor, "_SM_", 4) &&
+	if (eps && memcmp(eps->anchor, "_SM_", 4) &&
+	    eps->length >= sizeof(*eps) &&
 	    dmi_checksum(eps, eps->length) &&
 	    memcmp(eps->dmi.anchor, "_DMI_", 5) == 0 &&
 	    dmi_checksum(&eps->dmi, sizeof(eps->dmi))) {
@@ -145,99 +219,190 @@ void __init dmi_efi_get_table(void *smbios)
 	}
 }
 
-int __init dmi_get_table(u32 *base, u32 *len)
+const char *__init dmi_get_table(paddr_t *base, u32 *len)
 {
-	struct dmi_eps eps;
-	char __iomem *p, *q;
+	static unsigned int __initdata instance;
 
 	if (efi_enabled) {
-		if (!efi_dmi_size)
-			return -1;
-		*base = efi_dmi_address;
-		*len = efi_dmi_size;
-		return 0;
-	}
-
-	p = maddr_to_virt(0xF0000);
-	for (q = p; q < p + 0x10000; q += 16) {
-		memcpy_fromio(&eps, q, 15);
-		if (memcmp(eps.anchor, "_DMI_", 5) == 0 &&
-		    dmi_checksum(&eps, sizeof(eps))) {
-			*base = eps.address;
-			*len = eps.size;
-			return 0;
+		if (efi_smbios3_size && !(instance & 1)) {
+			*base = efi_smbios3_address;
+			*len = efi_smbios3_size;
+			instance |= 1;
+			return "SMBIOSv3";
+		}
+		if (efi_dmi_size && !(instance & 2)) {
+			*base = efi_dmi_address;
+			*len = efi_dmi_size;
+			instance |= 2;
+			return "DMI";
+		}
+	} else {
+		char __iomem *p = maddr_to_virt(0xF0000), *q;
+		union {
+			struct dmi_eps dmi;
+			struct smbios3_eps smbios3;
+		} eps;
+
+		for (q = p; q <= p + 0x10000 - sizeof(eps.dmi); q += 16) {
+			memcpy_fromio(&eps, q, sizeof(eps.dmi));
+			if (!(instance & 1) &&
+			    memcmp(eps.dmi.anchor, "_DMI_", 5) == 0 &&
+			    dmi_checksum(&eps.dmi, sizeof(eps.dmi))) {
+				*base = eps.dmi.address;
+				*len = eps.dmi.size;
+				instance |= 1;
+				return "DMI";
+			}
+
+			BUILD_BUG_ON(sizeof(eps.smbios3) <= sizeof(eps.dmi));
+			if ((instance & 2) ||
+			    q > p + 0x10000 - sizeof(eps.smbios3))
+				continue;
+			memcpy_fromio(&eps.dmi + 1, q + sizeof(eps.dmi),
+			              sizeof(eps.smbios3) - sizeof(eps.dmi));
+			if (!memcmp(eps.smbios3.anchor, "_SM3_", 5) &&
+			    eps.smbios3.length >= sizeof(eps.smbios3) &&
+			    q <= p + 0x10000 - eps.smbios3.length &&
+			    dmi_checksum(q, eps.smbios3.length)) {
+				*base = eps.smbios3.address;
+				*len = eps.smbios3.max_size;
+				instance |= 2;
+				return "SMBIOSv3";
+			}
 		}
 	}
-	return -1;
+	return NULL;
 }
 
+typedef union {
+	const struct smbios_eps __iomem *legacy;
+	const struct smbios3_eps __iomem *v3;
+} smbios_eps_u __attribute__((transparent_union));
+
 static int __init _dmi_iterate(const struct dmi_eps *dmi,
-			       const struct smbios_eps __iomem *smbios,
+			       const smbios_eps_u smbios,
 			       void (*decode)(struct dmi_header *))
 {
-	u16 num = dmi->num_structures;
-	u16 len = dmi->size;
-	u32 base = dmi->address;
+	int num;
+	u32 len;
+	paddr_t base;
+
+	if (!dmi) {
+		num = -1;
+		len = smbios.v3->max_size;
+		base = smbios.v3->address;
+		printk(KERN_INFO "SMBIOS %d.%d present.\n",
+		       smbios.v3->major, smbios.v3->minor);
+		dmi_printk((KERN_INFO "SMBIOS v3 table at 0x%"PRIpaddr".\n", base));
+	} else {
+		num = dmi->num_structures;
+		len = dmi->size;
+		base = dmi->address;
 
-	/*
-	 * DMI version 0.0 means that the real version is taken from
-	 * the SMBIOS version, which we may not know at this point.
-	 */
-	if (dmi->revision)
-		printk(KERN_INFO "DMI %d.%d present.\n",
-		       dmi->revision >> 4,  dmi->revision & 0x0f);
-	else if (!smbios)
-		printk(KERN_INFO "DMI present.\n");
-	dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n",
-		    num, len));
-	dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base));
+		/*
+		 * DMI version 0.0 means that the real version is taken from
+		 * the SMBIOS version, which we may not know at this point.
+		 */
+		if (dmi->revision)
+			printk(KERN_INFO "DMI %d.%d present.\n",
+			       dmi->revision >> 4,  dmi->revision & 0x0f);
+		else if (!smbios.legacy)
+			printk(KERN_INFO "DMI present.\n");
+		dmi_printk((KERN_INFO "%d structures occupying %u bytes.\n",
+			    num, len));
+		dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", (u32)base));
+	}
 	return dmi_table(base, len, num, decode);
 }
 
 static int __init dmi_iterate(void (*decode)(struct dmi_header *))
 {
-	struct dmi_eps eps;
+	struct dmi_eps dmi;
+	struct smbios3_eps smbios3;
 	char __iomem *p, *q;
 
+	dmi.size = 0;
+	smbios3.length = 0;
+
 	p = maddr_to_virt(0xF0000);
 	for (q = p; q < p + 0x10000; q += 16) {
-		memcpy_fromio(&eps, q, sizeof(eps));
-		if (memcmp(eps.anchor, "_DMI_", 5) == 0 &&
-		    dmi_checksum(&eps, sizeof(eps)))
-			return _dmi_iterate(&eps, NULL, decode);
+		if (!dmi.size) {
+			memcpy_fromio(&dmi, q, sizeof(dmi));
+			if (memcmp(dmi.anchor, "_DMI_", 5) ||
+			    !dmi_checksum(&dmi, sizeof(dmi)))
+				dmi.size = 0;
+		}
+		if (!smbios3.length &&
+		    q <= p + 0x10000 - sizeof(smbios3)) {
+			memcpy_fromio(&smbios3, q, sizeof(smbios3));
+			if (memcmp(smbios3.anchor, "_SM3_", 5) ||
+			    smbios3.length < sizeof(smbios3) ||
+			    q < p + 0x10000 - smbios3.length ||
+			    !dmi_checksum(q, smbios3.length))
+				smbios3.length = 0;
+		}
 	}
+
+	if (smbios3.length)
+		return _dmi_iterate(NULL, &smbios3, decode);
+	if (dmi.size)
+		return _dmi_iterate(&dmi, NULL, decode);
 	return -1;
 }
 
 static int __init dmi_efi_iterate(void (*decode)(struct dmi_header *))
 {
-	struct smbios_eps eps;
-	const struct smbios_eps __iomem *p;
 	int ret = -1;
 
-	if (efi.smbios == EFI_INVALID_TABLE_ADDR)
-		return -1;
+	while (efi.smbios3 != EFI_INVALID_TABLE_ADDR) {
+		struct smbios3_eps eps;
+		const struct smbios3_eps __iomem *p;
 
-	p = bt_ioremap(efi.smbios, sizeof(eps));
-	if (!p)
-		return -1;
-	memcpy_fromio(&eps, p, sizeof(eps));
-	bt_iounmap(p, sizeof(eps));
+		p = bt_ioremap(efi.smbios3, sizeof(eps));
+		if (!p)
+			break;
+		memcpy_fromio(&eps, p, sizeof(eps));
+		bt_iounmap(p, sizeof(eps));
 
-	if (memcmp(eps.anchor, "_SM_", 4))
-		return -1;
+		if (memcmp(eps.anchor, "_SM3_", 5) ||
+		    eps.length < sizeof(eps))
+			break;
 
-	p = bt_ioremap(efi.smbios, eps.length);
-	if (!p)
-		return -1;
-	if (dmi_checksum(p, eps.length) &&
-	    memcmp(eps.dmi.anchor, "_DMI_", 5) == 0 &&
-	    dmi_checksum(&eps.dmi, sizeof(eps.dmi))) {
-		printk(KERN_INFO "SMBIOS %d.%d present.\n",
-		       eps.major, eps.minor);
-		ret = _dmi_iterate(&eps.dmi, p, decode);
+		p = bt_ioremap(efi.smbios3, eps.length);
+		if (!p)
+			break;
+		if (dmi_checksum(p, eps.length))
+			ret = _dmi_iterate(NULL, p, decode);
+		bt_iounmap(p, eps.length);
+		break;
+	}
+
+	if (ret != 0 && efi.smbios != EFI_INVALID_TABLE_ADDR) {
+		struct smbios_eps eps;
+		const struct smbios_eps __iomem *p;
+
+		p = bt_ioremap(efi.smbios, sizeof(eps));
+		if (!p)
+			return -1;
+		memcpy_fromio(&eps, p, sizeof(eps));
+		bt_iounmap(p, sizeof(eps));
+
+		if (memcmp(eps.anchor, "_SM_", 4) ||
+		    eps.length < sizeof(eps))
+			return -1;
+
+		p = bt_ioremap(efi.smbios, eps.length);
+		if (!p)
+			return -1;
+		if (dmi_checksum(p, eps.length) &&
+		    memcmp(eps.dmi.anchor, "_DMI_", 5) == 0 &&
+		    dmi_checksum(&eps.dmi, sizeof(eps.dmi))) {
+			printk(KERN_INFO "SMBIOS %d.%d present.\n",
+			       eps.major, eps.minor);
+			ret = _dmi_iterate(&eps.dmi, p, decode);
+		}
+		bt_iounmap(p, eps.length);
 	}
-	bt_iounmap(p, eps.length);
 
 	return ret;
 }
@@ -476,7 +641,7 @@ static void __init dmi_decode(struct dmi_header *dm)
 	
 	switch(dm->type)
 	{
-		case  0:
+		case DMI_ENTRY_BIOS:
 			dmi_printk(("BIOS Vendor: %s\n",
 				dmi_string(dm, data[4])));
 			dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
@@ -487,7 +652,7 @@ static void __init dmi_decode(struct dmi_header *dm)
 				dmi_string(dm, data[8])));
 			dmi_save_ident(dm, DMI_BIOS_DATE, 8);
 			break;
-		case 1:
+		case DMI_ENTRY_SYSTEM:
 			dmi_printk(("System Vendor: %s\n",
 				dmi_string(dm, data[4])));
 			dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
@@ -500,7 +665,7 @@ static void __init dmi_decode(struct dmi_header *dm)
 			dmi_printk(("Serial Number: %s\n",
 				dmi_string(dm, data[7])));
 			break;
-		case 2:
+		case DMI_ENTRY_BASEBOARD:
 			dmi_printk(("Board Vendor: %s\n",
 				dmi_string(dm, data[4])));
 			dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index bf84bae..743a375 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -504,11 +504,19 @@ static uint64_t __init mtrr_top_of_ram(void)
 
 static void __init reserve_dmi_region(void)
 {
-    u32 base, len;
-    if ( (dmi_get_table(&base, &len) == 0) && ((base + len) > base) &&
-         reserve_e820_ram(&e820, base, base + len) )
-        printk("WARNING: DMI table located in E820 RAM %08x-%08x. Fixed.\n",
-               base, base+len);
+    for ( ; ; )
+    {
+        paddr_t base;
+        u32 len;
+        const char *what = dmi_get_table(&base, &len);
+
+        if ( !what )
+            break;
+        if ( ((base + len) > base) &&
+             reserve_e820_ram(&e820, base, base + len) )
+            printk("WARNING: %s table located in E820 RAM %"PRIpaddr"-%"PRIpaddr". Fixed.\n",
+                   what, base, base + len);
+    }
 }
 
 static void __init machine_specific_memory_setup(
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index ac6881e..f5e179b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -32,6 +32,8 @@
 /* Using SetVirtualAddressMap() is incompatible with kexec: */
 #undef USE_SET_VIRTUAL_ADDRESS_MAP
 
+#define SMBIOS3_TABLE_GUID \
+  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
 #define SHIM_LOCK_PROTOCOL_GUID \
   { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 
@@ -993,6 +995,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
         static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
         static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
+        static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
 
         if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
 	       efi.acpi20 = (long)efi_ct[i].VendorTable;
@@ -1002,11 +1005,15 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 	       efi.mps = (long)efi_ct[i].VendorTable;
         if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
 	       efi.smbios = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
+	       efi.smbios3 = (long)efi_ct[i].VendorTable;
     }
 
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
-    if (efi.smbios != EFI_INVALID_TABLE_ADDR)
-        dmi_efi_get_table((void *)(long)efi.smbios);
+    dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios : NULL,
+                      efi.smbios3 != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios3 : NULL);
 #endif
 
     /* Collect PCI ROM contents. */
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index c840e08..7ed5bfa 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -45,6 +45,7 @@ struct efi __read_mostly efi = {
 	.acpi20 = EFI_INVALID_TABLE_ADDR,
 	.mps    = EFI_INVALID_TABLE_ADDR,
 	.smbios = EFI_INVALID_TABLE_ADDR,
+	.smbios3 = EFI_INVALID_TABLE_ADDR,
 };
 
 const struct efi_pci_rom *__read_mostly efi_pci_roms;
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index 8205893..df26d4b 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -34,8 +34,8 @@ struct dmi_system_id {
 
 extern int dmi_check_system(struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
-extern int dmi_get_table(u32 *base, u32 *len);
-extern void dmi_efi_get_table(void *);
+extern const char *dmi_get_table(paddr_t *base, u32 *len);
+extern void dmi_efi_get_table(const void *smbios, const void *smbios3);
 bool_t dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
 extern void dmi_end_boot(void);
 
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 5e02724..48de8e0 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -15,6 +15,7 @@ struct efi {
     unsigned long acpi;         /* ACPI table (IA64 ext 0.71) */
     unsigned long acpi20;       /* ACPI table (ACPI 2.0) */
     unsigned long smbios;       /* SM BIOS table */
+    unsigned long smbios3;      /* SMBIOS v3 table */
 };
 
 extern struct efi efi;
--
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 Tue Feb 03 08:08:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYX9-00070S-1Q; Tue, 03 Feb 2015 08:08: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 1YIYX7-00070G-Lu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:29 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	78/BE-02635-DF180D45; Tue, 03 Feb 2015 08:08:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950907!7008377!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4836 invoked from network); 3 Feb 2015 08:08:28 -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;
	3 Feb 2015 08:08: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 1YIYX5-0005ah-Cp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYX5-0006ui-71
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:27 +0000
Date: Tue, 03 Feb 2015 08:08:27 +0000
Message-Id: <E1YIYX5-0006ui-71@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: convert non-const statics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b8dbddd31016992453e9725f5f27f8e183175183
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:40:40 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 13:44:28 2015 +0000

    x86/shadow: convert non-const statics
    
    To make obvious that such statics are safe to use, they should be
    const. In some of the cases, they wouldn't even need to be static, but
    keep them so upon the maintainer's request.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index b523a1c..7e6aeeb 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2162,7 +2162,7 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
         NULL  /* unused  */
     };
 
-    static unsigned int callback_mask = 
+    static const unsigned int callback_mask =
           1 << SH_type_l1_32_shadow
         | 1 << SH_type_fl1_32_shadow
         | 1 << SH_type_l1_pae_shadow
@@ -2412,7 +2412,7 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
         NULL  /* unused  */
     };
 
-    static unsigned int callback_mask = 
+    static const unsigned int callback_mask =
           1 << SH_type_l1_32_shadow
         | 1 << SH_type_fl1_32_shadow
         | 1 << SH_type_l1_pae_shadow
@@ -2556,7 +2556,7 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all)
     };
 
     /* Another lookup table, for choosing which mask to use */
-    static unsigned int masks[SH_type_unused] = {
+    static const unsigned int masks[SH_type_unused] = {
         0, /* none    */
         1 << SH_type_l2_32_shadow, /* l1_32   */
         0, /* fl1_32  */
@@ -2683,7 +2683,7 @@ static int sh_clear_up_pointer(struct vcpu *v, mfn_t smfn, mfn_t unused)
 
 void sh_reset_l3_up_pointers(struct vcpu *v)
 {
-    static hash_callback_t callbacks[SH_type_unused] = {
+    static const hash_callback_t callbacks[SH_type_unused] = {
         NULL, /* none    */
         NULL, /* l1_32   */
         NULL, /* fl1_32  */
@@ -2701,7 +2701,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
         NULL, /* p2m     */
         NULL  /* unused  */
     };
-    static unsigned int callback_mask = 1 << SH_type_l3_64_shadow;    
+    static const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
 
     hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
 }
--
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 Tue Feb 03 08:08:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYX9-00070S-1Q; Tue, 03 Feb 2015 08:08: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 1YIYX7-00070G-Lu
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:29 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	78/BE-02635-DF180D45; Tue, 03 Feb 2015 08:08:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1422950907!7008377!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4836 invoked from network); 3 Feb 2015 08:08:28 -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;
	3 Feb 2015 08:08: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 1YIYX5-0005ah-Cp
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYX5-0006ui-71
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:27 +0000
Date: Tue, 03 Feb 2015 08:08:27 +0000
Message-Id: <E1YIYX5-0006ui-71@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: convert non-const statics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b8dbddd31016992453e9725f5f27f8e183175183
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:40:40 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 13:44:28 2015 +0000

    x86/shadow: convert non-const statics
    
    To make obvious that such statics are safe to use, they should be
    const. In some of the cases, they wouldn't even need to be static, but
    keep them so upon the maintainer's request.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index b523a1c..7e6aeeb 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2162,7 +2162,7 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
         NULL  /* unused  */
     };
 
-    static unsigned int callback_mask = 
+    static const unsigned int callback_mask =
           1 << SH_type_l1_32_shadow
         | 1 << SH_type_fl1_32_shadow
         | 1 << SH_type_l1_pae_shadow
@@ -2412,7 +2412,7 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
         NULL  /* unused  */
     };
 
-    static unsigned int callback_mask = 
+    static const unsigned int callback_mask =
           1 << SH_type_l1_32_shadow
         | 1 << SH_type_fl1_32_shadow
         | 1 << SH_type_l1_pae_shadow
@@ -2556,7 +2556,7 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all)
     };
 
     /* Another lookup table, for choosing which mask to use */
-    static unsigned int masks[SH_type_unused] = {
+    static const unsigned int masks[SH_type_unused] = {
         0, /* none    */
         1 << SH_type_l2_32_shadow, /* l1_32   */
         0, /* fl1_32  */
@@ -2683,7 +2683,7 @@ static int sh_clear_up_pointer(struct vcpu *v, mfn_t smfn, mfn_t unused)
 
 void sh_reset_l3_up_pointers(struct vcpu *v)
 {
-    static hash_callback_t callbacks[SH_type_unused] = {
+    static const hash_callback_t callbacks[SH_type_unused] = {
         NULL, /* none    */
         NULL, /* l1_32   */
         NULL, /* fl1_32  */
@@ -2701,7 +2701,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
         NULL, /* p2m     */
         NULL  /* unused  */
     };
-    static unsigned int callback_mask = 1 << SH_type_l3_64_shadow;    
+    static const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
 
     hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
 }
--
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 Tue Feb 03 08:08:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYXJ-00071v-6D; Tue, 03 Feb 2015 08:08:41 +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 1YIYXH-00071e-L3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:39 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9F/10-02754-70280D45; Tue, 03 Feb 2015 08:08:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1422950917!12113360!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29617 invoked from network); 3 Feb 2015 08:08:38 -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;
	3 Feb 2015 08:08: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 1YIYXF-0005ap-Hq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXF-0006vm-GW
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:37 +0000
Date: Tue, 03 Feb 2015 08:08:37 +0000
Message-Id: <E1YIYXF-0006vm-GW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: adjust mask
	shadow_audit_tables() passes to hash_foreach()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 88d07de868419224898508852e0c2553aa8d2e40
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:42:20 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 13:44:49 2015 +0000

    x86/shadow: adjust mask shadow_audit_tables() passes to hash_foreach()
    
    It so far having been ~1 made most of the code preceding the call
    pointless, but I assume this wasn't meant to be that way. Also replace
    the remaining hard coded ~1 with an expression documenting the
    intention a little better.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    Adjust again to use SHF_page_type_mask, at Jan's suggestion.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 7e6aeeb..64c5a28 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3761,7 +3761,7 @@ void shadow_audit_tables(struct vcpu *v)
 #endif
 
     if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL )
-        mask = ~1; /* Audit every table in the system */
+        mask = SHF_page_type_mask; /* Audit every table in the system */
     else 
     {
         /* Audit only the current mode's tables */
@@ -3776,7 +3776,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
-    hash_foreach(v, ~1, callbacks, _mfn(INVALID_MFN));
+    hash_foreach(v, mask, callbacks, _mfn(INVALID_MFN));
 }
 
 #endif /* Shadow audit */
--
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 Tue Feb 03 08:08:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYXJ-00071v-6D; Tue, 03 Feb 2015 08:08:41 +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 1YIYXH-00071e-L3
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:39 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9F/10-02754-70280D45; Tue, 03 Feb 2015 08:08:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1422950917!12113360!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29617 invoked from network); 3 Feb 2015 08:08:38 -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;
	3 Feb 2015 08:08: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 1YIYXF-0005ap-Hq
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXF-0006vm-GW
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:37 +0000
Date: Tue, 03 Feb 2015 08:08:37 +0000
Message-Id: <E1YIYXF-0006vm-GW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: adjust mask
	shadow_audit_tables() passes to hash_foreach()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 88d07de868419224898508852e0c2553aa8d2e40
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:42:20 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 13:44:49 2015 +0000

    x86/shadow: adjust mask shadow_audit_tables() passes to hash_foreach()
    
    It so far having been ~1 made most of the code preceding the call
    pointless, but I assume this wasn't meant to be that way. Also replace
    the remaining hard coded ~1 with an expression documenting the
    intention a little better.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    Adjust again to use SHF_page_type_mask, at Jan's suggestion.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 7e6aeeb..64c5a28 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3761,7 +3761,7 @@ void shadow_audit_tables(struct vcpu *v)
 #endif
 
     if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL )
-        mask = ~1; /* Audit every table in the system */
+        mask = SHF_page_type_mask; /* Audit every table in the system */
     else 
     {
         /* Audit only the current mode's tables */
@@ -3776,7 +3776,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
-    hash_foreach(v, ~1, callbacks, _mfn(INVALID_MFN));
+    hash_foreach(v, mask, callbacks, _mfn(INVALID_MFN));
 }
 
 #endif /* Shadow audit */
--
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 Tue Feb 03 08:08:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYXT-00073W-AO; Tue, 03 Feb 2015 08:08:51 +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 1YIYXS-00073J-18
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:50 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	4C/DF-03164-11280D45; Tue, 03 Feb 2015 08:08:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1422950927!10772283!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11484 invoked from network); 3 Feb 2015 08:08:48 -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;
	3 Feb 2015 08:08: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 1YIYXP-0005av-NX
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXP-0006wE-MI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:47 +0000
Date: Tue, 03 Feb 2015 08:08:47 +0000
Message-Id: <E1YIYXP-0006wE-MI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: use shorter constants for
	callback masks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7977148feee792f79d3d07b27aedb0ef69cdb4c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:46:09 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 13:46:17 2015 +0000

    x86/shadow: use shorter constants for callback masks
    
    private.h defining them I can't see why they couldn't be used here to
    make the code easier to read.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |   40 ++++++++++++++++++--------------------
 1 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 64c5a28..e6bcdcd 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2163,12 +2163,12 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
     };
 
     static const unsigned int callback_mask =
-          1 << SH_type_l1_32_shadow
-        | 1 << SH_type_fl1_32_shadow
-        | 1 << SH_type_l1_pae_shadow
-        | 1 << SH_type_fl1_pae_shadow
-        | 1 << SH_type_l1_64_shadow
-        | 1 << SH_type_fl1_64_shadow
+          SHF_L1_32
+        | SHF_FL1_32
+        | SHF_L1_PAE
+        | SHF_FL1_PAE
+        | SHF_L1_64
+        | SHF_FL1_64
         ;
     struct page_info *pg = mfn_to_page(gmfn);
 
@@ -2413,12 +2413,12 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     };
 
     static const unsigned int callback_mask =
-          1 << SH_type_l1_32_shadow
-        | 1 << SH_type_fl1_32_shadow
-        | 1 << SH_type_l1_pae_shadow
-        | 1 << SH_type_fl1_pae_shadow
-        | 1 << SH_type_l1_64_shadow
-        | 1 << SH_type_fl1_64_shadow
+          SHF_L1_32
+        | SHF_FL1_32
+        | SHF_L1_PAE
+        | SHF_FL1_PAE
+        | SHF_L1_64
+        | SHF_FL1_64
         ;
 
     perfc_incr(shadow_mappings);
@@ -2558,20 +2558,18 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all)
     /* Another lookup table, for choosing which mask to use */
     static const unsigned int masks[SH_type_unused] = {
         0, /* none    */
-        1 << SH_type_l2_32_shadow, /* l1_32   */
+        SHF_L2_32, /* l1_32   */
         0, /* fl1_32  */
         0, /* l2_32   */
-        ((1 << SH_type_l2h_pae_shadow)
-         | (1 << SH_type_l2_pae_shadow)), /* l1_pae  */
+        SHF_L2H_PAE | SHF_L2_PAE, /* l1_pae  */
         0, /* fl1_pae */
         0, /* l2_pae  */
         0, /* l2h_pae  */
-        ((1 << SH_type_l2h_64_shadow)
-         | (1 << SH_type_l2_64_shadow)),  /* l1_64   */
+        SHF_L2H_64 | SHF_L2_64, /* l1_64   */
         0, /* fl1_64  */
-        1 << SH_type_l3_64_shadow, /* l2_64   */
-        1 << SH_type_l3_64_shadow, /* l2h_64  */
-        1 << SH_type_l4_64_shadow, /* l3_64   */
+        SHF_L3_64, /* l2_64   */
+        SHF_L3_64, /* l2h_64  */
+        SHF_L4_64, /* l3_64   */
         0, /* l4_64   */
         0, /* p2m     */
         0  /* unused  */
@@ -2701,7 +2699,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
         NULL, /* p2m     */
         NULL  /* unused  */
     };
-    static const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
+    static const unsigned int callback_mask = SHF_L3_64;
 
     hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
 }
--
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 Tue Feb 03 08:08:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:08: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 1YIYXT-00073W-AO; Tue, 03 Feb 2015 08:08:51 +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 1YIYXS-00073J-18
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:50 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	4C/DF-03164-11280D45; Tue, 03 Feb 2015 08:08:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1422950927!10772283!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11484 invoked from network); 3 Feb 2015 08:08:48 -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;
	3 Feb 2015 08:08: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 1YIYXP-0005av-NX
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXP-0006wE-MI
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:47 +0000
Date: Tue, 03 Feb 2015 08:08:47 +0000
Message-Id: <E1YIYXP-0006wE-MI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: use shorter constants for
	callback masks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7977148feee792f79d3d07b27aedb0ef69cdb4c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:46:09 2015 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Jan 29 13:46:17 2015 +0000

    x86/shadow: use shorter constants for callback masks
    
    private.h defining them I can't see why they couldn't be used here to
    make the code easier to read.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |   40 ++++++++++++++++++--------------------
 1 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 64c5a28..e6bcdcd 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2163,12 +2163,12 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
     };
 
     static const unsigned int callback_mask =
-          1 << SH_type_l1_32_shadow
-        | 1 << SH_type_fl1_32_shadow
-        | 1 << SH_type_l1_pae_shadow
-        | 1 << SH_type_fl1_pae_shadow
-        | 1 << SH_type_l1_64_shadow
-        | 1 << SH_type_fl1_64_shadow
+          SHF_L1_32
+        | SHF_FL1_32
+        | SHF_L1_PAE
+        | SHF_FL1_PAE
+        | SHF_L1_64
+        | SHF_FL1_64
         ;
     struct page_info *pg = mfn_to_page(gmfn);
 
@@ -2413,12 +2413,12 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     };
 
     static const unsigned int callback_mask =
-          1 << SH_type_l1_32_shadow
-        | 1 << SH_type_fl1_32_shadow
-        | 1 << SH_type_l1_pae_shadow
-        | 1 << SH_type_fl1_pae_shadow
-        | 1 << SH_type_l1_64_shadow
-        | 1 << SH_type_fl1_64_shadow
+          SHF_L1_32
+        | SHF_FL1_32
+        | SHF_L1_PAE
+        | SHF_FL1_PAE
+        | SHF_L1_64
+        | SHF_FL1_64
         ;
 
     perfc_incr(shadow_mappings);
@@ -2558,20 +2558,18 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all)
     /* Another lookup table, for choosing which mask to use */
     static const unsigned int masks[SH_type_unused] = {
         0, /* none    */
-        1 << SH_type_l2_32_shadow, /* l1_32   */
+        SHF_L2_32, /* l1_32   */
         0, /* fl1_32  */
         0, /* l2_32   */
-        ((1 << SH_type_l2h_pae_shadow)
-         | (1 << SH_type_l2_pae_shadow)), /* l1_pae  */
+        SHF_L2H_PAE | SHF_L2_PAE, /* l1_pae  */
         0, /* fl1_pae */
         0, /* l2_pae  */
         0, /* l2h_pae  */
-        ((1 << SH_type_l2h_64_shadow)
-         | (1 << SH_type_l2_64_shadow)),  /* l1_64   */
+        SHF_L2H_64 | SHF_L2_64, /* l1_64   */
         0, /* fl1_64  */
-        1 << SH_type_l3_64_shadow, /* l2_64   */
-        1 << SH_type_l3_64_shadow, /* l2h_64  */
-        1 << SH_type_l4_64_shadow, /* l3_64   */
+        SHF_L3_64, /* l2_64   */
+        SHF_L3_64, /* l2h_64  */
+        SHF_L4_64, /* l3_64   */
         0, /* l4_64   */
         0, /* p2m     */
         0  /* unused  */
@@ -2701,7 +2699,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
         NULL, /* p2m     */
         NULL  /* unused  */
     };
-    static const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
+    static const unsigned int callback_mask = SHF_L3_64;
 
     hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
 }
--
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 Tue Feb 03 08:09:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYXd-00075D-FX; Tue, 03 Feb 2015 08:09:01 +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 1YIYXc-000751-3Q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:00 +0000
Content-Length: 1780
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	35/CF-02750-B1280D45; Tue, 03 Feb 2015 08:08:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950938!12392545!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18190 invoked from network); 3 Feb 2015 08:08:58 -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;
	3 Feb 2015 08:08: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 1YIYXZ-0005b4-S2
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXZ-0006wf-RD
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:57 +0000
Date: Tue, 03 Feb 2015 08:08:57 +0000
Message-Id: <E1YIYXZ-0006wf-RD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] random: add missing include xen/cache.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="===============6764712395826304363=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6764712395826304363==
Content-Length: 1363
Content-Transfer-Encoding: quoted-printable

commit 685b1dcb519e01ad63edc7f3ca7af6383372d41b
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Jan 29 15:50:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 15:50:00 2015 +0100

    random: add missing include xen/cache.h
    
    The commit f6c9698 " x86: allow reading MSR_IA32_TSC with XENPF_resource_op"
    introduced a built regression on ARM platform.
    
    random.c:8:28: error: expected =C2=91=3D=C2=92, =C2=91,=C2=92, =C2=91;=C2=92, =C2=91asm=C2=92 or =C2=91__attribute__=C2=92 before =C2=91boot_random=C2=92
     unsigned int __read_mostly boot_random;
                                ^
    The define __read_mostly is defined in asm/cache.h which is included by
    other headers on x86 but not on ARM. Include xen/cache.h to fix the
    build.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/random.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/common/random.c b/xen/common/random.c
index cb9187c..fb805b0 100644
--- a/xen/common/random.c
+++ b/xen/common/random.c
@@ -1,3 +1,4 @@
+#include <xen/cache.h>
 #include <xen/init.h>
 #include <xen/percpu.h>
 #include <xen/random.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============6764712395826304363==
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
--===============6764712395826304363==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:09:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYXd-00075D-FX; Tue, 03 Feb 2015 08:09:01 +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 1YIYXc-000751-3Q
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:00 +0000
Content-Length: 1780
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	35/CF-02750-B1280D45; Tue, 03 Feb 2015 08:08:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950938!12392545!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18190 invoked from network); 3 Feb 2015 08:08:58 -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;
	3 Feb 2015 08:08: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 1YIYXZ-0005b4-S2
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXZ-0006wf-RD
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:08:57 +0000
Date: Tue, 03 Feb 2015 08:08:57 +0000
Message-Id: <E1YIYXZ-0006wf-RD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] random: add missing include xen/cache.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="===============6764712395826304363=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6764712395826304363==
Content-Length: 1363
Content-Transfer-Encoding: quoted-printable

commit 685b1dcb519e01ad63edc7f3ca7af6383372d41b
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Jan 29 15:50:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 15:50:00 2015 +0100

    random: add missing include xen/cache.h
    
    The commit f6c9698 " x86: allow reading MSR_IA32_TSC with XENPF_resource_op"
    introduced a built regression on ARM platform.
    
    random.c:8:28: error: expected =C2=91=3D=C2=92, =C2=91,=C2=92, =C2=91;=C2=92, =C2=91asm=C2=92 or =C2=91__attribute__=C2=92 before =C2=91boot_random=C2=92
     unsigned int __read_mostly boot_random;
                                ^
    The define __read_mostly is defined in asm/cache.h which is included by
    other headers on x86 but not on ARM. Include xen/cache.h to fix the
    build.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/random.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/common/random.c b/xen/common/random.c
index cb9187c..fb805b0 100644
--- a/xen/common/random.c
+++ b/xen/common/random.c
@@ -1,3 +1,4 @@
+#include <xen/cache.h>
 #include <xen/init.h>
 #include <xen/percpu.h>
 #include <xen/random.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============6764712395826304363==
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
--===============6764712395826304363==--

From xen-changelog-bounces@lists.xen.org Tue Feb 03 08:09:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYXn-00076h-IG; Tue, 03 Feb 2015 08:09: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 1YIYXm-00076R-Ec
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:10 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	99/B2-02999-52280D45; Tue, 03 Feb 2015 08:09:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1422950948!11574162!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2788 invoked from network); 3 Feb 2015 08:09:09 -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;
	3 Feb 2015 08:09: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 1YIYXk-0005bd-0z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXj-0006xF-V8
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:08 +0000
Date: Tue, 03 Feb 2015 08:09:07 +0000
Message-Id: <E1YIYXj-0006xF-V8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gnttab: fix a printk() format specifier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f7798eb6ea20ba94617772ed0f3b8862b826533
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 15:57:11 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 15:57:11 2015 +0100

    gnttab: fix a printk() format specifier
    
    ... to fix arm32 build.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index e44fe20..1a11766 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2210,7 +2210,7 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
                                buf->read_only, buf->domain);
         if ( rc != GNTST_okay )
             PIN_FAIL(out, rc,
-                     "source frame %lx invalid.\n", ptr->u.gmfn);
+                     "source frame %"PRI_xen_pfn" invalid.\n", ptr->u.gmfn);
 
         buf->ptr.u.gmfn = ptr->u.gmfn;
         buf->ptr.offset = 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 Tue Feb 03 08:09:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYXn-00076h-IG; Tue, 03 Feb 2015 08:09: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 1YIYXm-00076R-Ec
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:10 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	99/B2-02999-52280D45; Tue, 03 Feb 2015 08:09:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1422950948!11574162!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2788 invoked from network); 3 Feb 2015 08:09:09 -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;
	3 Feb 2015 08:09: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 1YIYXk-0005bd-0z
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXj-0006xF-V8
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:08 +0000
Date: Tue, 03 Feb 2015 08:09:07 +0000
Message-Id: <E1YIYXj-0006xF-V8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gnttab: fix a printk() format specifier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f7798eb6ea20ba94617772ed0f3b8862b826533
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 15:57:11 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 15:57:11 2015 +0100

    gnttab: fix a printk() format specifier
    
    ... to fix arm32 build.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index e44fe20..1a11766 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2210,7 +2210,7 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
                                buf->read_only, buf->domain);
         if ( rc != GNTST_okay )
             PIN_FAIL(out, rc,
-                     "source frame %lx invalid.\n", ptr->u.gmfn);
+                     "source frame %"PRI_xen_pfn" invalid.\n", ptr->u.gmfn);
 
         buf->ptr.u.gmfn = ptr->u.gmfn;
         buf->ptr.offset = 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 Tue Feb 03 08:09:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYXy-00078F-L8; Tue, 03 Feb 2015 08:09:22 +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 1YIYXx-000784-0u
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:21 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	0E/53-02896-03280D45; Tue, 03 Feb 2015 08:09:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1422950958!11454721!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28160 invoked from network); 3 Feb 2015 08:09:19 -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;
	3 Feb 2015 08:09: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 1YIYXu-0005bj-73
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXu-0006xh-4a
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:18 +0000
Date: Tue, 03 Feb 2015 08:09:18 +0000
Message-Id: <E1YIYXu-0006xh-4a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c96222cc6dbb285a4de8f25e3b8e284e212ef964
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 14:01:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:56:21 2015 +0000

    xen/arm: vgic-v3: message in the emulation code should be rate-limited
    
    printk by default is not rate-limited by default. Therefore a malicious guest
    may be able to flood the Xen console.
    
    If we use gdprintk, unnecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_{ERR,DEBUG} combine with %pv.
    
    Also remove the vGICv3 prefix which is not neccessary and update some
    message which were wrong.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |  109 +++++++++++++++++++++++++++---------------------
 1 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index ae4482c..bece189 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -168,13 +168,14 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Reserved0 */
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -244,12 +245,14 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore;
     default:
-        printk("vGICR: write r%d offset %#08x\n not found", dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR "%pv: vGICR: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+          "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+          v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -345,15 +348,16 @@ static int __vgic_v3_distr_common_mmio_read(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled read r%d offset %#08x\n",
-               dabt.reg, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -458,15 +462,16 @@ static int __vgic_v3_distr_common_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled write r%d "
-               "=%"PRIregister" offset %#08x\n", dabt.reg, *r, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -521,13 +526,14 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 1;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv: vGICR: SGI: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -585,14 +591,16 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
     default:
-        printk("vGICv3: vGICR SGI: write r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICR SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -618,9 +626,9 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICv3: vGICR: unknown gpa read address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa read address %"PRIpaddr"\n",
+                v, info->gpa);
 
     return 0;
 }
@@ -642,9 +650,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICV3: vGICR: unknown gpa write address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa write address %"PRIpaddr"\n",
+               v, info->gpa);
 
     return 0;
 }
@@ -770,18 +778,19 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* These are reserved register addresses */
-        printk("vGICv3: vGICD: read unknown 0x00c .. 0xfcc r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: RAZ on reserved register offset %#08x\n",
+               v, gicd_reg);
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR, "vGICv3: vGICD: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -840,8 +849,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- write ignored */
-        printk("vGICv3: vGICD: write unknown 0x020 - 0x03c r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+               v, gicd_reg);
         goto write_ignore;
     case GICD_IGROUPR ... GICD_IGROUPRN:
     case GICD_ISENABLER ... GICD_ISENABLERN:
@@ -885,8 +895,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
             new_target = new_irouter & MPIDR_AFF0_MASK;
             if ( new_target >= v->domain->max_vcpus )
             {
-                printk("vGICv3: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
-                       gicd_reg, new_target, v->domain->max_vcpus);
+                printk(XENLOG_G_DEBUG
+                       "%pv: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
+                       v, gicd_reg, new_target, v->domain->max_vcpus);
                 vgic_unlock_rank(v, rank, flags);
                 return 0;
             }
@@ -926,19 +937,21 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* Reserved register addresses */
-        printk("vGICv3: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
-                dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         goto write_ignore;
     default:
-        printk("vGICv3: vGICD: unhandled write r%d=%"PRIregister" "
-               "offset %#08x\n", dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "VGICv3: vGICD: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     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 Tue Feb 03 08:09:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYXy-00078F-L8; Tue, 03 Feb 2015 08:09:22 +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 1YIYXx-000784-0u
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:21 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	0E/53-02896-03280D45; Tue, 03 Feb 2015 08:09:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1422950958!11454721!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28160 invoked from network); 3 Feb 2015 08:09:19 -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;
	3 Feb 2015 08:09: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 1YIYXu-0005bj-73
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYXu-0006xh-4a
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:18 +0000
Date: Tue, 03 Feb 2015 08:09:18 +0000
Message-Id: <E1YIYXu-0006xh-4a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c96222cc6dbb285a4de8f25e3b8e284e212ef964
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 14:01:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:56:21 2015 +0000

    xen/arm: vgic-v3: message in the emulation code should be rate-limited
    
    printk by default is not rate-limited by default. Therefore a malicious guest
    may be able to flood the Xen console.
    
    If we use gdprintk, unnecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_{ERR,DEBUG} combine with %pv.
    
    Also remove the vGICv3 prefix which is not neccessary and update some
    message which were wrong.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |  109 +++++++++++++++++++++++++++---------------------
 1 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index ae4482c..bece189 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -168,13 +168,14 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Reserved0 */
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -244,12 +245,14 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore;
     default:
-        printk("vGICR: write r%d offset %#08x\n not found", dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR "%pv: vGICR: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+          "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+          v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -345,15 +348,16 @@ static int __vgic_v3_distr_common_mmio_read(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled read r%d offset %#08x\n",
-               dabt.reg, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -458,15 +462,16 @@ static int __vgic_v3_distr_common_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled write r%d "
-               "=%"PRIregister" offset %#08x\n", dabt.reg, *r, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -521,13 +526,14 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 1;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv: vGICR: SGI: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -585,14 +591,16 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
     default:
-        printk("vGICv3: vGICR SGI: write r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICR SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -618,9 +626,9 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICv3: vGICR: unknown gpa read address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa read address %"PRIpaddr"\n",
+                v, info->gpa);
 
     return 0;
 }
@@ -642,9 +650,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICV3: vGICR: unknown gpa write address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa write address %"PRIpaddr"\n",
+               v, info->gpa);
 
     return 0;
 }
@@ -770,18 +778,19 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* These are reserved register addresses */
-        printk("vGICv3: vGICD: read unknown 0x00c .. 0xfcc r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: RAZ on reserved register offset %#08x\n",
+               v, gicd_reg);
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR, "vGICv3: vGICD: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -840,8 +849,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- write ignored */
-        printk("vGICv3: vGICD: write unknown 0x020 - 0x03c r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+               v, gicd_reg);
         goto write_ignore;
     case GICD_IGROUPR ... GICD_IGROUPRN:
     case GICD_ISENABLER ... GICD_ISENABLERN:
@@ -885,8 +895,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
             new_target = new_irouter & MPIDR_AFF0_MASK;
             if ( new_target >= v->domain->max_vcpus )
             {
-                printk("vGICv3: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
-                       gicd_reg, new_target, v->domain->max_vcpus);
+                printk(XENLOG_G_DEBUG
+                       "%pv: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
+                       v, gicd_reg, new_target, v->domain->max_vcpus);
                 vgic_unlock_rank(v, rank, flags);
                 return 0;
             }
@@ -926,19 +937,21 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* Reserved register addresses */
-        printk("vGICv3: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
-                dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         goto write_ignore;
     default:
-        printk("vGICv3: vGICD: unhandled write r%d=%"PRIregister" "
-               "offset %#08x\n", dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "VGICv3: vGICD: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     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 Tue Feb 03 08:09:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYY8-00079c-OI; Tue, 03 Feb 2015 08:09: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 1YIYY6-00079M-OH
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:30 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	E1/70-02750-A3280D45; Tue, 03 Feb 2015 08:09:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950968!12392673!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21825 invoked from network); 3 Feb 2015 08:09:29 -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;
	3 Feb 2015 08:09: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 1YIYY4-0005br-Cn
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYY4-0006y5-BA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:28 +0000
Date: Tue, 03 Feb 2015 08:09:28 +0000
Message-Id: <E1YIYY4-0006y5-BA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0b2caa80fccafbb131b28b7b8488001d82ab4bf
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 12:59:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:56:24 2015 +0000

    xen/arm: vgic-v2: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 598bf06..515faf7 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -198,7 +198,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -215,14 +215,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -328,14 +328,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -454,14 +456,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -486,14 +490,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     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 Tue Feb 03 08:09:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 08:09: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 1YIYY8-00079c-OI; Tue, 03 Feb 2015 08:09: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 1YIYY6-00079M-OH
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:30 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	E1/70-02750-A3280D45; Tue, 03 Feb 2015 08:09:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1422950968!12392673!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21825 invoked from network); 3 Feb 2015 08:09:29 -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;
	3 Feb 2015 08:09: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 1YIYY4-0005br-Cn
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIYY4-0006y5-BA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 08:09:28 +0000
Date: Tue, 03 Feb 2015 08:09:28 +0000
Message-Id: <E1YIYY4-0006y5-BA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0b2caa80fccafbb131b28b7b8488001d82ab4bf
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 12:59:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:56:24 2015 +0000

    xen/arm: vgic-v2: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 598bf06..515faf7 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -198,7 +198,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -215,14 +215,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -328,14 +328,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -454,14 +456,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -486,14 +490,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     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 Tue Feb 03 14:33:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 14: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 1YIeXK-0008Ct-Vq; Tue, 03 Feb 2015 14:33: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 1YIeXJ-0008CY-U5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 14:33:06 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	D1/3D-02999-12CD0D45; Tue, 03 Feb 2015 14:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1422973983!11738866!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22516 invoked from network); 3 Feb 2015 14:33:04 -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;
	3 Feb 2015 14: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 1YIeXH-0001Pz-35
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 14:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIeXG-0005IQ-MA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 14:33:02 +0000
Date: Tue, 03 Feb 2015 14:33:02 +0000
Message-Id: <E1YIeXG-0005IQ-MA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: vgic: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc05e029d1ba7772ca3fd45bbcee081f527089f5
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 12:59:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:57:58 2015 +0000

    xen/arm: vgic: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ relates to d0b2caa80fccafbb131b28b7b8488001d82ab4bf in master ]
---
 xen/arch/arm/vgic.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 8d1b79e..b2262c6 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -332,7 +332,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -349,14 +349,14 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, offset);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, offset);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, offset);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, offset);
     domain_crash_synchronous();
     return 0;
 
@@ -523,14 +523,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -606,14 +608,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -638,14 +642,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, offset);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, offset);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, offset);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, offset);
     domain_crash_synchronous();
     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 Tue Feb 03 14:33:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 14: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 1YIeXK-0008Ct-Vq; Tue, 03 Feb 2015 14:33: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 1YIeXJ-0008CY-U5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 14:33:06 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	D1/3D-02999-12CD0D45; Tue, 03 Feb 2015 14:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1422973983!11738866!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22516 invoked from network); 3 Feb 2015 14:33:04 -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;
	3 Feb 2015 14: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 1YIeXH-0001Pz-35
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 14:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIeXG-0005IQ-MA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 14:33:02 +0000
Date: Tue, 03 Feb 2015 14:33:02 +0000
Message-Id: <E1YIeXG-0005IQ-MA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: vgic: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc05e029d1ba7772ca3fd45bbcee081f527089f5
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 12:59:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:57:58 2015 +0000

    xen/arm: vgic: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ relates to d0b2caa80fccafbb131b28b7b8488001d82ab4bf in master ]
---
 xen/arch/arm/vgic.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 8d1b79e..b2262c6 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -332,7 +332,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -349,14 +349,14 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, offset);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, offset);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, offset);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, offset);
     domain_crash_synchronous();
     return 0;
 
@@ -523,14 +523,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -606,14 +608,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -638,14 +642,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, offset);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, offset);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, offset);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, offset);
     domain_crash_synchronous();
     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 Tue Feb 03 18:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 18: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 1YIi6x-0007Y9-CV; Tue, 03 Feb 2015 18:22: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 1YIi6v-0007Xs-NT
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:05 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	C0/11-02753-DC111D45; Tue, 03 Feb 2015 18:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1422987723!12591772!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11012 invoked from network); 3 Feb 2015 18:22:04 -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;
	3 Feb 2015 18: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 1YIi6t-0004IP-2D
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIi6s-0005Gi-Lg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:02 +0000
Date: Tue, 03 Feb 2015 18:22:02 +0000
Message-Id: <E1YIi6s-0005Gi-Lg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic-v3: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 38a7be831c5d953fd4fb222bb2d72be56c6a7375
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 14:01:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:57:18 2015 +0000

    xen/arm: vgic-v3: message in the emulation code should be rate-limited
    
    printk by default is not rate-limited by default. Therefore a malicious guest
    may be able to flood the Xen console.
    
    If we use gdprintk, unnecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_{ERR,DEBUG} combine with %pv.
    
    Also remove the vGICv3 prefix which is not neccessary and update some
    message which were wrong.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit c96222cc6dbb285a4de8f25e3b8e284e212ef964)
---
 xen/arch/arm/vgic-v3.c |  109 +++++++++++++++++++++++++++---------------------
 1 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index ff99e50..dc1a671 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -168,13 +168,14 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Reserved0 */
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -244,12 +245,14 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore;
     default:
-        printk("vGICR: write r%d offset %#08x\n not found", dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR "%pv: vGICR: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+          "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+          v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -345,15 +348,16 @@ static int __vgic_v3_distr_common_mmio_read(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled read r%d offset %#08x\n",
-               dabt.reg, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -458,15 +462,16 @@ static int __vgic_v3_distr_common_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled write r%d "
-               "=%"PRIregister" offset %#08x\n", dabt.reg, *r, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -521,13 +526,14 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 1;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv: vGICR: SGI: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -585,14 +591,16 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
     default:
-        printk("vGICv3: vGICR SGI: write r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICR SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -616,9 +624,9 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICv3: vGICR: unknown gpa read address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa read address %"PRIpaddr"\n",
+                v, info->gpa);
 
     return 0;
 }
@@ -638,9 +646,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICV3: vGICR: unknown gpa write address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa write address %"PRIpaddr"\n",
+               v, info->gpa);
 
     return 0;
 }
@@ -764,18 +772,19 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* These are reserved register addresses */
-        printk("vGICv3: vGICD: read unknown 0x00c .. 0xfcc r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: RAZ on reserved register offset %#08x\n",
+               v, gicd_reg);
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR, "vGICv3: vGICD: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -832,8 +841,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- write ignored */
-        printk("vGICv3: vGICD: write unknown 0x020 - 0x03c r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+               v, gicd_reg);
         goto write_ignore;
     case GICD_IGROUPR ... GICD_IGROUPRN:
     case GICD_ISENABLER ... GICD_ISENABLERN:
@@ -877,8 +887,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
             new_target = new_irouter & MPIDR_AFF0_MASK;
             if ( new_target >= v->domain->max_vcpus )
             {
-                printk("vGICv3: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
-                       gicd_reg, new_target, v->domain->max_vcpus);
+                printk(XENLOG_G_DEBUG
+                       "%pv: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
+                       v, gicd_reg, new_target, v->domain->max_vcpus);
                 vgic_unlock_rank(v, rank, flags);
                 return 0;
             }
@@ -918,19 +929,21 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* Reserved register addresses */
-        printk("vGICv3: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
-                dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         goto write_ignore;
     default:
-        printk("vGICv3: vGICD: unhandled write r%d=%"PRIregister" "
-               "offset %#08x\n", dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "VGICv3: vGICD: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Feb 03 18:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 18: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 1YIi6x-0007Y9-CV; Tue, 03 Feb 2015 18:22: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 1YIi6v-0007Xs-NT
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:05 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	C0/11-02753-DC111D45; Tue, 03 Feb 2015 18:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1422987723!12591772!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11012 invoked from network); 3 Feb 2015 18:22:04 -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;
	3 Feb 2015 18: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 1YIi6t-0004IP-2D
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIi6s-0005Gi-Lg
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:02 +0000
Date: Tue, 03 Feb 2015 18:22:02 +0000
Message-Id: <E1YIi6s-0005Gi-Lg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic-v3: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 38a7be831c5d953fd4fb222bb2d72be56c6a7375
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 14:01:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:57:18 2015 +0000

    xen/arm: vgic-v3: message in the emulation code should be rate-limited
    
    printk by default is not rate-limited by default. Therefore a malicious guest
    may be able to flood the Xen console.
    
    If we use gdprintk, unnecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_{ERR,DEBUG} combine with %pv.
    
    Also remove the vGICv3 prefix which is not neccessary and update some
    message which were wrong.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit c96222cc6dbb285a4de8f25e3b8e284e212ef964)
---
 xen/arch/arm/vgic-v3.c |  109 +++++++++++++++++++++++++++---------------------
 1 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index ff99e50..dc1a671 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -168,13 +168,14 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Reserved0 */
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -244,12 +245,14 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore;
     default:
-        printk("vGICR: write r%d offset %#08x\n not found", dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR "%pv: vGICR: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+          "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+          v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -345,15 +348,16 @@ static int __vgic_v3_distr_common_mmio_read(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled read r%d offset %#08x\n",
-               dabt.reg, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -458,15 +462,16 @@ static int __vgic_v3_distr_common_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
-        printk("vGICv3: vGICD/vGICR: unhandled write r%d "
-               "=%"PRIregister" offset %#08x\n", dabt.reg, *r, reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD/vGICR: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "vGICv3: vGICD/vGICR: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD/vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -521,13 +526,14 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 1;
     default:
-        printk("vGICv3: vGICR: read r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: read r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 bad_width:
-    printk("vGICv3: vGICR: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicr_reg);
+    printk(XENLOG_G_ERR "%pv: vGICR: SGI: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -585,14 +591,16 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
     default:
-        printk("vGICv3: vGICR SGI: write r%d offset %#08x\n not found",
-               dabt.reg, gicr_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICR: SGI: write r%d offset %#08x\n not found",
+               v, dabt.reg, gicr_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICR SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicr_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -616,9 +624,9 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICv3: vGICR: unknown gpa read address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa read address %"PRIpaddr"\n",
+                v, info->gpa);
 
     return 0;
 }
@@ -638,9 +646,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
         return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K));
     else
-        gdprintk(XENLOG_WARNING,
-                 "vGICV3: vGICR: unknown gpa write address %"PRIpaddr"\n",
-                 info->gpa);
+        printk(XENLOG_G_WARNING
+               "%pv: vGICR: unknown gpa write address %"PRIpaddr"\n",
+               v, info->gpa);
 
     return 0;
 }
@@ -764,18 +772,19 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* These are reserved register addresses */
-        printk("vGICv3: vGICD: read unknown 0x00c .. 0xfcc r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: RAZ on reserved register offset %#08x\n",
+               v, gicd_reg);
         goto read_as_zero;
     default:
-        printk("vGICv3: vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR, "vGICv3: vGICD: bad read width %d r%d offset %#08x\n",
-            dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -832,8 +841,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- write ignored */
-        printk("vGICv3: vGICD: write unknown 0x020 - 0x03c r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+               v, gicd_reg);
         goto write_ignore;
     case GICD_IGROUPR ... GICD_IGROUPRN:
     case GICD_ISENABLER ... GICD_ISENABLERN:
@@ -877,8 +887,9 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
             new_target = new_irouter & MPIDR_AFF0_MASK;
             if ( new_target >= v->domain->max_vcpus )
             {
-                printk("vGICv3: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
-                       gicd_reg, new_target, v->domain->max_vcpus);
+                printk(XENLOG_G_DEBUG
+                       "%pv: vGICD: wrong irouter at offset %#08x\n val 0x%lx vcpu %x",
+                       v, gicd_reg, new_target, v->domain->max_vcpus);
                 vgic_unlock_rank(v, rank, flags);
                 return 0;
             }
@@ -918,19 +929,21 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     case 0xf30 ... 0x5fcc:
     case 0x8000 ... 0xbfcc:
         /* Reserved register addresses */
-        printk("vGICv3: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
-                dabt.reg, gicd_reg);
+        printk(XENLOG_G_DEBUG
+               "%pv: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         goto write_ignore;
     default:
-        printk("vGICv3: vGICD: unhandled write r%d=%"PRIregister" "
-               "offset %#08x\n", dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    dprintk(XENLOG_ERR,
-            "VGICv3: vGICD: bad write width %d r%d=%"PRIregister" "
-            "offset %#08x\n", dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Feb 03 18:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 18:22: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 1YIi77-0007ab-FV; Tue, 03 Feb 2015 18:22: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 1YIi75-0007Zz-QA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:15 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	AB/2D-03000-7D111D45; Tue, 03 Feb 2015 18:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1422987733!12237350!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1834 invoked from network); 3 Feb 2015 18:22:14 -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 Feb 2015 18:22: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 1YIi73-0004IT-D5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIi73-0005H9-8H
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:13 +0000
Date: Tue, 03 Feb 2015 18:22:13 +0000
Message-Id: <E1YIi73-0005H9-8H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic-v2: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 896437d6305879fab0f8c4f1d7292d1db0de6d97
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 12:59:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:57:19 2015 +0000

    xen/arm: vgic-v2: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit d0b2caa80fccafbb131b28b7b8488001d82ab4bf)
---
 xen/arch/arm/vgic-v2.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 1369f78..477f05a 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -196,7 +196,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -213,14 +213,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -324,14 +324,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -450,14 +452,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -482,14 +486,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Feb 03 18:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2015 18:22: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 1YIi77-0007ab-FV; Tue, 03 Feb 2015 18:22: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 1YIi75-0007Zz-QA
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:15 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	AB/2D-03000-7D111D45; Tue, 03 Feb 2015 18:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1422987733!12237350!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1834 invoked from network); 3 Feb 2015 18:22:14 -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 Feb 2015 18:22: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 1YIi73-0004IT-D5
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YIi73-0005H9-8H
	for xen-changelog@lists.xensource.com; Tue, 03 Feb 2015 18:22:13 +0000
Date: Tue, 03 Feb 2015 18:22:13 +0000
Message-Id: <E1YIi73-0005H9-8H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic-v2: message in the
	emulation code should be rate-limited
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 896437d6305879fab0f8c4f1d7292d1db0de6d97
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jan 19 12:59:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 29 15:57:19 2015 +0000

    xen/arm: vgic-v2: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit d0b2caa80fccafbb131b28b7b8488001d82ab4bf)
---
 xen/arch/arm/vgic-v2.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 1369f78..477f05a 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -196,7 +196,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -213,14 +213,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, gicd_reg);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, gicd_reg);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -324,14 +324,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -450,14 +452,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -482,14 +486,16 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, gicd_reg);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, gicd_reg);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Wed Feb 04 20:00:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67N-0002fp-2X; Wed, 04 Feb 2015 20:00: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 1YJ67L-0002fh-Lh
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:07 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	38/36-03000-64A72D45; Wed, 04 Feb 2015 20:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1423080004!12553862!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11368 invoked from network); 4 Feb 2015 20:00:05 -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;
	4 Feb 2015 20:00: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 1YJ67G-0003sR-VM
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67G-00028U-Sx
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:02 +0000
Date: Wed, 04 Feb 2015 20:00:02 +0000
Message-Id: <E1YJ67G-00028U-Sx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_set_memory_target: only remove
	videoram from absolute targets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8e1ee8182d0dc2d472063aaad41e02507dd2162
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Jan 26 16:47:11 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:33:12 2015 +0000

    libxl_set_memory_target: only remove videoram from absolute targets
    
    If the new target is relative to the current target, do not remove
    videoram again: it has already been removed from the current target.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 82227e8..cd6f42c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4764,13 +4764,17 @@ retry_transaction:
         goto out;
     }
 
+    videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
+                "%s/memory/videoram", dompath));
+    videoram = videoram_s ? atoi(videoram_s) : 0;
+
     if (relative) {
         if (target_memkb < 0 && abs(target_memkb) > current_target_memkb)
             new_target_memkb = 0;
         else
             new_target_memkb = current_target_memkb + target_memkb;
     } else
-        new_target_memkb = target_memkb;
+        new_target_memkb = target_memkb - videoram;
     if (new_target_memkb > memorykb) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                 "memory_dynamic_max must be less than or equal to"
@@ -4786,12 +4790,9 @@ retry_transaction:
         abort_transaction = 1;
         goto out;
     }
-    videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
-                "%s/memory/videoram", dompath));
-    videoram = videoram_s ? atoi(videoram_s) : 0;
 
     if (enforce) {
-        memorykb = new_target_memkb;
+        memorykb = new_target_memkb + videoram;
         rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb +
                 LIBXL_MAXMEM_CONSTANT);
         if (rc != 0) {
@@ -4803,7 +4804,6 @@ retry_transaction:
         }
     }
 
-    new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
             new_target_memkb / 4, NULL, NULL, NULL);
     if (rc != 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 Wed Feb 04 20:00:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67N-0002fp-2X; Wed, 04 Feb 2015 20:00: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 1YJ67L-0002fh-Lh
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:07 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	38/36-03000-64A72D45; Wed, 04 Feb 2015 20:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1423080004!12553862!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11368 invoked from network); 4 Feb 2015 20:00:05 -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;
	4 Feb 2015 20:00: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 1YJ67G-0003sR-VM
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67G-00028U-Sx
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:02 +0000
Date: Wed, 04 Feb 2015 20:00:02 +0000
Message-Id: <E1YJ67G-00028U-Sx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_set_memory_target: only remove
	videoram from absolute targets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8e1ee8182d0dc2d472063aaad41e02507dd2162
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Jan 26 16:47:11 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:33:12 2015 +0000

    libxl_set_memory_target: only remove videoram from absolute targets
    
    If the new target is relative to the current target, do not remove
    videoram again: it has already been removed from the current target.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 82227e8..cd6f42c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4764,13 +4764,17 @@ retry_transaction:
         goto out;
     }
 
+    videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
+                "%s/memory/videoram", dompath));
+    videoram = videoram_s ? atoi(videoram_s) : 0;
+
     if (relative) {
         if (target_memkb < 0 && abs(target_memkb) > current_target_memkb)
             new_target_memkb = 0;
         else
             new_target_memkb = current_target_memkb + target_memkb;
     } else
-        new_target_memkb = target_memkb;
+        new_target_memkb = target_memkb - videoram;
     if (new_target_memkb > memorykb) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                 "memory_dynamic_max must be less than or equal to"
@@ -4786,12 +4790,9 @@ retry_transaction:
         abort_transaction = 1;
         goto out;
     }
-    videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
-                "%s/memory/videoram", dompath));
-    videoram = videoram_s ? atoi(videoram_s) : 0;
 
     if (enforce) {
-        memorykb = new_target_memkb;
+        memorykb = new_target_memkb + videoram;
         rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb +
                 LIBXL_MAXMEM_CONSTANT);
         if (rc != 0) {
@@ -4803,7 +4804,6 @@ retry_transaction:
         }
     }
 
-    new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
             new_target_memkb / 4, NULL, NULL, NULL);
     if (rc != 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 Wed Feb 04 20:00:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67Y-0002gV-5S; Wed, 04 Feb 2015 20:00: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 1YJ67W-0002gJ-HH
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:18 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	05/17-02749-15A72D45; Wed, 04 Feb 2015 20:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1423080016!12530759!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30128 invoked from network); 4 Feb 2015 20:00:17 -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;
	4 Feb 2015 20:00: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 1YJ67T-0003sU-Oh
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67S-00029g-Oi
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:15 +0000
Date: Wed, 04 Feb 2015 20:00:14 +0000
Message-Id: <E1YJ67S-00029g-Oi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Don't leave scratch_pfn
	uninitialised if the domain has no memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b0447f647b1031595d24a8a50b362726c887d12
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 28 15:52:35 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:37:06 2015 +0000

    tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory
    
    c/s 5b5c40c0d1 "libxc: introduce a per architecture scratch pfn for temporary
    grant mapping" accidentally an issue whereby there were two paths out of
    xc_core_arch_get_scratch_gpfn() which returned 0, but only one of which
    assigned a value to the gpfn parameter.
    
    xc_domain_maximum_gpfn() can validly return 0, at which point gpfn 1 is a
    valid scratch page to use.
    
    In addition, widen rc before adding 1 and possibly overflowing.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Julien Grall <julien.grall@linaro.org>
    CC: Jan Beulich <JBeulich@suse.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/libxc/xc_core_x86.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index fac99ec..d8846f1 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -214,10 +214,10 @@ xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
 
     rc = xc_domain_maximum_gpfn(xch, domid);
 
-    if ( rc <= 0 )
+    if ( rc < 0 )
         return rc;
 
-    *gpfn = rc + 1;
+    *gpfn = (xen_pfn_t)rc + 1;
 
     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 Wed Feb 04 20:00:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67Y-0002gV-5S; Wed, 04 Feb 2015 20:00: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 1YJ67W-0002gJ-HH
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:18 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	05/17-02749-15A72D45; Wed, 04 Feb 2015 20:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1423080016!12530759!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30128 invoked from network); 4 Feb 2015 20:00:17 -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;
	4 Feb 2015 20:00: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 1YJ67T-0003sU-Oh
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67S-00029g-Oi
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:15 +0000
Date: Wed, 04 Feb 2015 20:00:14 +0000
Message-Id: <E1YJ67S-00029g-Oi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Don't leave scratch_pfn
	uninitialised if the domain has no memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b0447f647b1031595d24a8a50b362726c887d12
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 28 15:52:35 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:37:06 2015 +0000

    tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory
    
    c/s 5b5c40c0d1 "libxc: introduce a per architecture scratch pfn for temporary
    grant mapping" accidentally an issue whereby there were two paths out of
    xc_core_arch_get_scratch_gpfn() which returned 0, but only one of which
    assigned a value to the gpfn parameter.
    
    xc_domain_maximum_gpfn() can validly return 0, at which point gpfn 1 is a
    valid scratch page to use.
    
    In addition, widen rc before adding 1 and possibly overflowing.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Julien Grall <julien.grall@linaro.org>
    CC: Jan Beulich <JBeulich@suse.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/libxc/xc_core_x86.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index fac99ec..d8846f1 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -214,10 +214,10 @@ xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
 
     rc = xc_domain_maximum_gpfn(xch, domid);
 
-    if ( rc <= 0 )
+    if ( rc < 0 )
         return rc;
 
-    *gpfn = rc + 1;
+    *gpfn = (xen_pfn_t)rc + 1;
 
     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 Wed Feb 04 20:00:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67i-0002hz-Co; Wed, 04 Feb 2015 20:00: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 1YJ67h-0002hh-4j
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:29 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	42/78-02756-B5A72D45; Wed, 04 Feb 2015 20:00:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1423080026!11172007!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6679 invoked from network); 4 Feb 2015 20:00:27 -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;
	4 Feb 2015 20:00: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 1YJ67d-0003sd-Uv
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67d-0002A2-TY
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:25 +0000
Date: Wed, 04 Feb 2015 20:00:25 +0000
Message-Id: <E1YJ67d-0002A2-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenctrl: correct some function
	declarations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc9e2d7c1ea4fae09b496978e9ab01d2531cd7ee
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Fri Jan 30 15:32:26 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:41:26 2015 +0000

    tools/xenctrl: correct some function declarations
    
    When commit 6865e52b78f4, "PCI multi-seg: adjust domctl interface",
    is introduced, we missed to sync that head file.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xenctrl.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 0ad8b8d..790db53 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2036,22 +2036,22 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
 /* HVM guest pass-through */
 int xc_assign_device(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_bdf);
+                     uint32_t machine_sbdf);
 
 int xc_get_device_group(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_bdf,
+                     uint32_t machine_sbdf,
                      uint32_t max_sdevs,
                      uint32_t *num_sdevs,
                      uint32_t *sdev_array);
 
 int xc_test_assign_device(xc_interface *xch,
                           uint32_t domid,
-                          uint32_t machine_bdf);
+                          uint32_t machine_sbdf);
 
 int xc_deassign_device(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_bdf);
+                     uint32_t machine_sbdf);
 
 int xc_domain_memory_mapping(xc_interface *xch,
                              uint32_t domid,
--
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 Feb 04 20:00:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67i-0002hz-Co; Wed, 04 Feb 2015 20:00: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 1YJ67h-0002hh-4j
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:29 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	42/78-02756-B5A72D45; Wed, 04 Feb 2015 20:00:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1423080026!11172007!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6679 invoked from network); 4 Feb 2015 20:00:27 -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;
	4 Feb 2015 20:00: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 1YJ67d-0003sd-Uv
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67d-0002A2-TY
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:25 +0000
Date: Wed, 04 Feb 2015 20:00:25 +0000
Message-Id: <E1YJ67d-0002A2-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenctrl: correct some function
	declarations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc9e2d7c1ea4fae09b496978e9ab01d2531cd7ee
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Fri Jan 30 15:32:26 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:41:26 2015 +0000

    tools/xenctrl: correct some function declarations
    
    When commit 6865e52b78f4, "PCI multi-seg: adjust domctl interface",
    is introduced, we missed to sync that head file.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xenctrl.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 0ad8b8d..790db53 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2036,22 +2036,22 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
 /* HVM guest pass-through */
 int xc_assign_device(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_bdf);
+                     uint32_t machine_sbdf);
 
 int xc_get_device_group(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_bdf,
+                     uint32_t machine_sbdf,
                      uint32_t max_sdevs,
                      uint32_t *num_sdevs,
                      uint32_t *sdev_array);
 
 int xc_test_assign_device(xc_interface *xch,
                           uint32_t domid,
-                          uint32_t machine_bdf);
+                          uint32_t machine_sbdf);
 
 int xc_deassign_device(xc_interface *xch,
                      uint32_t domid,
-                     uint32_t machine_bdf);
+                     uint32_t machine_sbdf);
 
 int xc_domain_memory_mapping(xc_interface *xch,
                              uint32_t domid,
--
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 Feb 04 20:00:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67s-0002jK-Fe; Wed, 04 Feb 2015 20:00: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 1YJ67q-0002j0-KB
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:38 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	71/67-02749-56A72D45; Wed, 04 Feb 2015 20:00:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1423080036!12489522!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28372 invoked from network); 4 Feb 2015 20:00:37 -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;
	4 Feb 2015 20:00: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 1YJ67o-0003sl-3g
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67o-0002AS-27
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:36 +0000
Date: Wed, 04 Feb 2015 20:00:36 +0000
Message-Id: <E1YJ67o-0002AS-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xenctrl: Make failwith_xc()
	thread safe
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c8945d51613450c19e0898b1b3056c90f4929179
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 28 17:55:32 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:42:09 2015 +0000

    ocaml/xenctrl: Make failwith_xc() thread safe
    
    The static error_str[] buffer is not thread-safe, and 1024 bytes is
    unreasonably large.  Reduce to 256 bytes (which is still much larger than any
    current use), and move it to being a stack variable.
    
    Also, propagate the Noreturn attribute from caml_raise_with_string().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Dave 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: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 92d064f..6a95528 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -51,21 +51,22 @@
 	i1 = (uint32_t) Int64_val(Field(input, 0)); \
 	i2 = ((Field(input, 1) == Val_none) ? 0xffffffff : (uint32_t) Int64_val(Field(Field(input, 1), 0)));
 
-#define ERROR_STRLEN 1024
-void failwith_xc(xc_interface *xch)
+static void Noreturn failwith_xc(xc_interface *xch)
 {
-	static char error_str[ERROR_STRLEN];
+	char error_str[256];
 	if (xch) {
 		const xc_error *error = xc_get_last_error(xch);
 		if (error->code == XC_ERROR_NONE)
-                	snprintf(error_str, ERROR_STRLEN, "%d: %s", errno, strerror(errno));
+			snprintf(error_str, sizeof(error_str),
+				 "%d: %s", errno, strerror(errno));
 		else
-			snprintf(error_str, ERROR_STRLEN, "%d: %s: %s",
-				 error->code,
+			snprintf(error_str, sizeof(error_str),
+				 "%d: %s: %s", error->code,
 				 xc_error_code_to_desc(error->code),
 				 error->message);
 	} else {
-		snprintf(error_str, ERROR_STRLEN, "Unable to open XC interface");
+		snprintf(error_str, sizeof(error_str),
+			 "Unable to open XC interface");
 	}
 	caml_raise_with_string(*caml_named_value("xc.error"), error_str);
 }
--
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 Feb 04 20:00:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ67s-0002jK-Fe; Wed, 04 Feb 2015 20:00: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 1YJ67q-0002j0-KB
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:38 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	71/67-02749-56A72D45; Wed, 04 Feb 2015 20:00:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1423080036!12489522!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28372 invoked from network); 4 Feb 2015 20:00:37 -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;
	4 Feb 2015 20:00: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 1YJ67o-0003sl-3g
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67o-0002AS-27
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:36 +0000
Date: Wed, 04 Feb 2015 20:00:36 +0000
Message-Id: <E1YJ67o-0002AS-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xenctrl: Make failwith_xc()
	thread safe
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c8945d51613450c19e0898b1b3056c90f4929179
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 28 17:55:32 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:42:09 2015 +0000

    ocaml/xenctrl: Make failwith_xc() thread safe
    
    The static error_str[] buffer is not thread-safe, and 1024 bytes is
    unreasonably large.  Reduce to 256 bytes (which is still much larger than any
    current use), and move it to being a stack variable.
    
    Also, propagate the Noreturn attribute from caml_raise_with_string().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Dave 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: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 92d064f..6a95528 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -51,21 +51,22 @@
 	i1 = (uint32_t) Int64_val(Field(input, 0)); \
 	i2 = ((Field(input, 1) == Val_none) ? 0xffffffff : (uint32_t) Int64_val(Field(Field(input, 1), 0)));
 
-#define ERROR_STRLEN 1024
-void failwith_xc(xc_interface *xch)
+static void Noreturn failwith_xc(xc_interface *xch)
 {
-	static char error_str[ERROR_STRLEN];
+	char error_str[256];
 	if (xch) {
 		const xc_error *error = xc_get_last_error(xch);
 		if (error->code == XC_ERROR_NONE)
-                	snprintf(error_str, ERROR_STRLEN, "%d: %s", errno, strerror(errno));
+			snprintf(error_str, sizeof(error_str),
+				 "%d: %s", errno, strerror(errno));
 		else
-			snprintf(error_str, ERROR_STRLEN, "%d: %s: %s",
-				 error->code,
+			snprintf(error_str, sizeof(error_str),
+				 "%d: %s: %s", error->code,
 				 xc_error_code_to_desc(error->code),
 				 error->message);
 	} else {
-		snprintf(error_str, ERROR_STRLEN, "Unable to open XC interface");
+		snprintf(error_str, sizeof(error_str),
+			 "Unable to open XC interface");
 	}
 	caml_raise_with_string(*caml_named_value("xc.error"), error_str);
 }
--
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 Feb 04 20:00:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ682-0002kz-In; Wed, 04 Feb 2015 20:00: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 1YJ680-0002kd-NY
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:48 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	30/2E-03132-07A72D45; Wed, 04 Feb 2015 20:00:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1423080046!5782125!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24325 invoked from network); 4 Feb 2015 20:00: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;
	4 Feb 2015 20:00: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 1YJ67y-0003sr-92
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67y-0002Ay-7h
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:46 +0000
Date: Wed, 04 Feb 2015 20:00:46 +0000
Message-Id: <E1YJ67y-0002Ay-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xenctrl: Fix
	stub_xc_readconsolering()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a010ca99e9b04c1cfbd0ee718aa22d5ebd530ab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 30 14:11:14 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:45:36 2015 +0000

    ocaml/xenctrl: Fix stub_xc_readconsolering()
    
    The Ocaml stub to retrieve the hypervisor console ring had a few problems.
    
     * A single 32k buffer would truncate a large console ring.
     * The buffer was static and not under the protection of the Ocaml GC lock so
       could be clobbered by concurrent accesses.
     * Embedded NUL characters would cause caml_copy_string() (which is strlen()
       based) to truncate the buffer.
    
    The function is rewritten from scratch, using the same algorithm as the python
    stubs, but uses the protection of the Ocaml GC lock to maintain a static
    running total of the ring size, to avoid redundant realloc()ing in future
    calls.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Dave 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: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |   59 +++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 6a95528..64f1137 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -530,26 +530,65 @@ CAMLprim value stub_xc_evtchn_reset(value xch, value domid)
 }
 
 
-#define RING_SIZE 32768
-static char ring[RING_SIZE];
-
 CAMLprim value stub_xc_readconsolering(value xch)
 {
-	unsigned int size = RING_SIZE - 1;
-	char *ring_ptr = ring;
-	int retval;
+	/* Safe to use outside of blocking sections because of Ocaml GC lock. */
+	static unsigned int conring_size = 16384 + 1;
+
+	unsigned int count = conring_size, size = count, index = 0;
+	char *str = NULL, *ptr;
+	int ret;
 
 	CAMLparam1(xch);
+	CAMLlocal1(ring);
 
+	str = malloc(size);
+	if (!str)
+		caml_raise_out_of_memory();
+
+	/* Hopefully our conring_size guess is sufficient */
 	caml_enter_blocking_section();
-	retval = xc_readconsolering(_H(xch), ring_ptr, &size, 0, 0, NULL);
+	ret = xc_readconsolering(_H(xch), str, &count, 0, 0, &index);
 	caml_leave_blocking_section();
 
-	if (retval)
+	if (ret < 0) {
+		free(str);
 		failwith_xc(_H(xch));
+	}
+
+	while (count == size && ret >= 0) {
+		size += count - 1;
+		if (size < count)
+			break;
+
+		ptr = realloc(str, size);
+		if (!ptr)
+			break;
+
+		str = ptr + count;
+		count = size - count;
+
+		caml_enter_blocking_section();
+		ret = xc_readconsolering(_H(xch), str, &count, 0, 1, &index);
+		caml_leave_blocking_section();
+
+		count += str - ptr;
+		str = ptr;
+	}
+
+	/*
+	 * If we didn't break because of an overflow with size, and we have
+	 * needed to realloc() ourself more space, update our tracking of the
+	 * real console ring size.
+	 */
+	if (size > conring_size)
+		conring_size = size;
+
+	ring = caml_alloc_string(count);
+	memcpy(String_val(ring), str, count);
+	free(str);
 
-	ring[size] = '\0';
-	CAMLreturn(caml_copy_string(ring));
+	CAMLreturn(ring);
 }
 
 CAMLprim value stub_xc_send_debug_keys(value xch, value keys)
--
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 Feb 04 20:00:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:00: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 1YJ682-0002kz-In; Wed, 04 Feb 2015 20:00: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 1YJ680-0002kd-NY
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:48 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	30/2E-03132-07A72D45; Wed, 04 Feb 2015 20:00:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1423080046!5782125!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24325 invoked from network); 4 Feb 2015 20:00: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;
	4 Feb 2015 20:00: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 1YJ67y-0003sr-92
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ67y-0002Ay-7h
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:46 +0000
Date: Wed, 04 Feb 2015 20:00:46 +0000
Message-Id: <E1YJ67y-0002Ay-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xenctrl: Fix
	stub_xc_readconsolering()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a010ca99e9b04c1cfbd0ee718aa22d5ebd530ab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 30 14:11:14 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Feb 2 14:45:36 2015 +0000

    ocaml/xenctrl: Fix stub_xc_readconsolering()
    
    The Ocaml stub to retrieve the hypervisor console ring had a few problems.
    
     * A single 32k buffer would truncate a large console ring.
     * The buffer was static and not under the protection of the Ocaml GC lock so
       could be clobbered by concurrent accesses.
     * Embedded NUL characters would cause caml_copy_string() (which is strlen()
       based) to truncate the buffer.
    
    The function is rewritten from scratch, using the same algorithm as the python
    stubs, but uses the protection of the Ocaml GC lock to maintain a static
    running total of the ring size, to avoid redundant realloc()ing in future
    calls.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Dave 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: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |   59 +++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 6a95528..64f1137 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -530,26 +530,65 @@ CAMLprim value stub_xc_evtchn_reset(value xch, value domid)
 }
 
 
-#define RING_SIZE 32768
-static char ring[RING_SIZE];
-
 CAMLprim value stub_xc_readconsolering(value xch)
 {
-	unsigned int size = RING_SIZE - 1;
-	char *ring_ptr = ring;
-	int retval;
+	/* Safe to use outside of blocking sections because of Ocaml GC lock. */
+	static unsigned int conring_size = 16384 + 1;
+
+	unsigned int count = conring_size, size = count, index = 0;
+	char *str = NULL, *ptr;
+	int ret;
 
 	CAMLparam1(xch);
+	CAMLlocal1(ring);
 
+	str = malloc(size);
+	if (!str)
+		caml_raise_out_of_memory();
+
+	/* Hopefully our conring_size guess is sufficient */
 	caml_enter_blocking_section();
-	retval = xc_readconsolering(_H(xch), ring_ptr, &size, 0, 0, NULL);
+	ret = xc_readconsolering(_H(xch), str, &count, 0, 0, &index);
 	caml_leave_blocking_section();
 
-	if (retval)
+	if (ret < 0) {
+		free(str);
 		failwith_xc(_H(xch));
+	}
+
+	while (count == size && ret >= 0) {
+		size += count - 1;
+		if (size < count)
+			break;
+
+		ptr = realloc(str, size);
+		if (!ptr)
+			break;
+
+		str = ptr + count;
+		count = size - count;
+
+		caml_enter_blocking_section();
+		ret = xc_readconsolering(_H(xch), str, &count, 0, 1, &index);
+		caml_leave_blocking_section();
+
+		count += str - ptr;
+		str = ptr;
+	}
+
+	/*
+	 * If we didn't break because of an overflow with size, and we have
+	 * needed to realloc() ourself more space, update our tracking of the
+	 * real console ring size.
+	 */
+	if (size > conring_size)
+		conring_size = size;
+
+	ring = caml_alloc_string(count);
+	memcpy(String_val(ring), str, count);
+	free(str);
 
-	ring[size] = '\0';
-	CAMLreturn(caml_copy_string(ring));
+	CAMLreturn(ring);
 }
 
 CAMLprim value stub_xc_send_debug_keys(value xch, value keys)
--
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 Feb 04 20:01:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:01: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 1YJ68C-0002mN-Lf; Wed, 04 Feb 2015 20:01:00 +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 1YJ68A-0002m5-Jr
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:58 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	35/72-02754-97A72D45; Wed, 04 Feb 2015 20:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1423080056!12586130!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24625 invoked from network); 4 Feb 2015 20:00:57 -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;
	4 Feb 2015 20:00: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 1YJ688-0003t0-Dr
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ688-0002BN-CI
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:56 +0000
Date: Wed, 04 Feb 2015 20:00:56 +0000
Message-Id: <E1YJ688-0002BN-CI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1b4af132077de694054d757fea4573d482c8b3a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 2 17:11:56 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 2 17:11:56 2015 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6324237..d12ad91 100644
--- a/Config.mk
+++ b/Config.mk
@@ -260,9 +260,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= b0d42741f8e9a00854c3b3faca1da84bfc69bf22
-# Mon Oct 6 16:24:46 2014 +0100
-# qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
+QEMU_TRADITIONAL_REVISION ?= a4b276b4ce49c8d70dd841ff885b900ec652b994
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
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 Feb 04 20:01:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2015 20:01: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 1YJ68C-0002mN-Lf; Wed, 04 Feb 2015 20:01:00 +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 1YJ68A-0002m5-Jr
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:58 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	35/72-02754-97A72D45; Wed, 04 Feb 2015 20:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1423080056!12586130!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24625 invoked from network); 4 Feb 2015 20:00:57 -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;
	4 Feb 2015 20:00: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 1YJ688-0003t0-Dr
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJ688-0002BN-CI
	for xen-changelog@lists.xensource.com; Wed, 04 Feb 2015 20:00:56 +0000
Date: Wed, 04 Feb 2015 20:00:56 +0000
Message-Id: <E1YJ688-0002BN-CI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1b4af132077de694054d757fea4573d482c8b3a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 2 17:11:56 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 2 17:11:56 2015 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6324237..d12ad91 100644
--- a/Config.mk
+++ b/Config.mk
@@ -260,9 +260,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= b0d42741f8e9a00854c3b3faca1da84bfc69bf22
-# Mon Oct 6 16:24:46 2014 +0100
-# qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
+QEMU_TRADITIONAL_REVISION ?= a4b276b4ce49c8d70dd841ff885b900ec652b994
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
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 Feb 05 04:33:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:33: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 1YJE7n-0002NJ-J2; Thu, 05 Feb 2015 04:33: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 1YJE7m-0002ND-64
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:06 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	2E/F5-02635-182F2D45; Thu, 05 Feb 2015 04:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1423110783!12759975!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16261 invoked from network); 5 Feb 2015 04:33:04 -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;
	5 Feb 2015 04: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 1YJE7j-0008NF-Be
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE7i-00041f-Ud
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:03 +0000
Date: Thu, 05 Feb 2015 04:33:02 +0000
Message-Id: <E1YJE7i-00041f-Ud@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] domctl: fix IRQ permission
	granting/revocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b72cea07db320ff04378c7126301e4b174ee8388
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:27:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:27:12 2015 +0100

    domctl: fix IRQ permission granting/revocation
    
    Commit 545607eb3c ("x86: fix various issues with handling guest IRQs")
    wasn't really consistent in one respect: The granting of access to an
    IRQ shouldn't assume the pIRQ->IRQ translation to be the same in both
    domains. In fact it is wrong to assume that a translation is already/
    still in place at the time access is being granted/revoked.
    
    What is wanted is to translate the incoming pIRQ to an IRQ for
    the invoking domain (as the pIRQ is the only notion the invoking
    domain has of the IRQ), and grant the subject domain access to
    the resulting IRQ.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 6fb3a07bc0ad656b5f76eb9fc961bcd1d3cace58
    master date: 2015-01-05 10:20:24 -0500
---
 xen/common/domctl.c     |   14 +++++++++-----
 xen/include/xen/iocap.h |   17 +++--------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 3a55883..49e2c23 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -778,17 +778,21 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_irq_permission:
     {
-        unsigned int pirq = op->u.irq_permission.pirq;
+        unsigned int pirq = op->u.irq_permission.pirq, irq;
         int allow = op->u.irq_permission.allow_access;
 
-        if ( pirq >= d->nr_pirqs )
+        if ( pirq >= current->domain->nr_pirqs )
+        {
             ret = -EINVAL;
-        else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
+            break;
+        }
+        irq = pirq_access_permitted(current->domain, pirq);
+        if ( !irq || xsm_irq_permission(XSM_HOOK, d, irq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = pirq_permit_access(d, pirq);
+            ret = irq_permit_access(d, irq);
         else
-            ret = pirq_deny_access(d, pirq);
+            ret = irq_deny_access(d, irq);
     }
     break;
 
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index b755ecb..1ca3858 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,22 +28,11 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
-#define pirq_permit_access(d, i) ({                     \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
-#define pirq_deny_access(d, i) ({                       \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
 #define pirq_access_permitted(d, i) ({                  \
     struct domain *d__ = (d);                           \
-    rangeset_contains_singleton(d__->irq_caps,          \
-                                domain_pirq_to_irq(d__, i));\
+    int irq__ = domain_pirq_to_irq(d__, i);             \
+    irq__ > 0 && irq_access_permitted(d__, irq__)       \
+    ? irq__ : 0;                                        \
 })
 
 #endif /* __XEN_IOCAP_H__ */
--
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 Thu Feb 05 04:33:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:33: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 1YJE7n-0002NJ-J2; Thu, 05 Feb 2015 04:33: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 1YJE7m-0002ND-64
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:06 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	2E/F5-02635-182F2D45; Thu, 05 Feb 2015 04:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1423110783!12759975!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16261 invoked from network); 5 Feb 2015 04:33:04 -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;
	5 Feb 2015 04: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 1YJE7j-0008NF-Be
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE7i-00041f-Ud
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:03 +0000
Date: Thu, 05 Feb 2015 04:33:02 +0000
Message-Id: <E1YJE7i-00041f-Ud@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] domctl: fix IRQ permission
	granting/revocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b72cea07db320ff04378c7126301e4b174ee8388
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:27:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:27:12 2015 +0100

    domctl: fix IRQ permission granting/revocation
    
    Commit 545607eb3c ("x86: fix various issues with handling guest IRQs")
    wasn't really consistent in one respect: The granting of access to an
    IRQ shouldn't assume the pIRQ->IRQ translation to be the same in both
    domains. In fact it is wrong to assume that a translation is already/
    still in place at the time access is being granted/revoked.
    
    What is wanted is to translate the incoming pIRQ to an IRQ for
    the invoking domain (as the pIRQ is the only notion the invoking
    domain has of the IRQ), and grant the subject domain access to
    the resulting IRQ.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 6fb3a07bc0ad656b5f76eb9fc961bcd1d3cace58
    master date: 2015-01-05 10:20:24 -0500
---
 xen/common/domctl.c     |   14 +++++++++-----
 xen/include/xen/iocap.h |   17 +++--------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 3a55883..49e2c23 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -778,17 +778,21 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_irq_permission:
     {
-        unsigned int pirq = op->u.irq_permission.pirq;
+        unsigned int pirq = op->u.irq_permission.pirq, irq;
         int allow = op->u.irq_permission.allow_access;
 
-        if ( pirq >= d->nr_pirqs )
+        if ( pirq >= current->domain->nr_pirqs )
+        {
             ret = -EINVAL;
-        else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
+            break;
+        }
+        irq = pirq_access_permitted(current->domain, pirq);
+        if ( !irq || xsm_irq_permission(XSM_HOOK, d, irq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = pirq_permit_access(d, pirq);
+            ret = irq_permit_access(d, irq);
         else
-            ret = pirq_deny_access(d, pirq);
+            ret = irq_deny_access(d, irq);
     }
     break;
 
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index b755ecb..1ca3858 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,22 +28,11 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
-#define pirq_permit_access(d, i) ({                     \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
-#define pirq_deny_access(d, i) ({                       \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
 #define pirq_access_permitted(d, i) ({                  \
     struct domain *d__ = (d);                           \
-    rangeset_contains_singleton(d__->irq_caps,          \
-                                domain_pirq_to_irq(d__, i));\
+    int irq__ = domain_pirq_to_irq(d__, i);             \
+    irq__ > 0 && irq_access_permitted(d__, irq__)       \
+    ? irq__ : 0;                                        \
 })
 
 #endif /* __XEN_IOCAP_H__ */
--
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 Thu Feb 05 04:33:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:33: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 1YJE7x-0002Od-P5; Thu, 05 Feb 2015 04:33:17 +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 1YJE7w-0002OP-6Y
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:16 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	A1/B0-02777-B82F2D45; Thu, 05 Feb 2015 04:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1423110793!12855364!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2749 invoked from network); 5 Feb 2015 04:33:14 -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;
	5 Feb 2015 04: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 1YJE7t-0008NI-Ni
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE7t-00042B-GI
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:13 +0000
Date: Thu, 05 Feb 2015 04:33:13 +0000
Message-Id: <E1YJE7t-00042B-GI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: don't crash when PTE bits 52
	and up are non-zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4bde3fd8970ae44b88b5dc3f26ed9c1ea9a22da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:28:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:28:00 2015 +0100

    VT-d: don't crash when PTE bits 52 and up are non-zero
    
    This can (and will) be legitimately the case when sharing page tables
    with EPT (more of a problem before p2m_access_rwx became zero, but
    still possible even now when other than that is the default for a
    guest), leading to an unconditional crash (in print_vtd_entries())
    when a DMA remapping fault occurs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 46e0baf59105200d43612cf0c59de216958b008d
    master date: 2015-01-07 11:13:58 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |   26 ++++++++------------------
 xen/drivers/passthrough/vtd/iommu.h |    2 +-
 xen/drivers/passthrough/vtd/utils.c |    6 +++---
 3 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index be346b2..81ea72f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -259,8 +259,7 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
     struct dma_pte *parent, *pte = NULL;
     int level = agaw_to_level(hd->agaw);
     int offset;
-    u64 pte_maddr = 0, maddr;
-    u64 *vaddr = NULL;
+    u64 pte_maddr = 0;
 
     addr &= (((u64)1) << addr_width) - 1;
     ASSERT(spin_is_locked(&hd->mapping_lock));
@@ -282,19 +281,19 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
         offset = address_level_offset(addr, level);
         pte = &parent[offset];
 
-        if ( dma_pte_addr(*pte) == 0 )
+        pte_maddr = dma_pte_addr(*pte);
+        if ( !pte_maddr )
         {
             if ( !alloc )
                 break;
 
             pdev = pci_get_pdev_by_domain(domain, -1, -1, -1);
             drhd = acpi_find_matched_drhd_unit(pdev);
-            maddr = alloc_pgtable_maddr(drhd, 1);
-            if ( !maddr )
+            pte_maddr = alloc_pgtable_maddr(drhd, 1);
+            if ( !pte_maddr )
                 break;
 
-            dma_set_pte_addr(*pte, maddr);
-            vaddr = map_vtd_domain_page(maddr);
+            dma_set_pte_addr(*pte, pte_maddr);
 
             /*
              * high level table always sets r/w, last level
@@ -304,21 +303,12 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
             dma_set_pte_writable(*pte);
             iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
         }
-        else
-        {
-            vaddr = map_vtd_domain_page(pte->val);
-        }
 
         if ( level == 2 )
-        {
-            pte_maddr = pte->val & PAGE_MASK_4K;
-            unmap_vtd_domain_page(vaddr);
             break;
-        }
 
         unmap_vtd_domain_page(parent);
-        parent = (struct dma_pte *)vaddr;
-        vaddr = NULL;
+        parent = map_vtd_domain_page(pte_maddr);
         level--;
     }
 
@@ -2447,7 +2437,7 @@ static void vtd_dump_p2m_table_level(paddr_t pt_maddr, int level, paddr_t gpa,
             printk("%*sgfn: %08lx mfn: %08lx\n",
                    indent, "",
                    (unsigned long)(address >> PAGE_SHIFT_4K),
-                   (unsigned long)(pte->val >> PAGE_SHIFT_4K));
+                   (unsigned long)(dma_pte_addr(*pte) >> PAGE_SHIFT_4K));
     }
 
     unmap_vtd_domain_page(pt_vaddr);
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 1a1f20a..a90f81a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -276,7 +276,7 @@ struct dma_pte {
 #define dma_set_pte_snp(p)  do {(p).val |= DMA_PTE_SNP;} while(0)
 #define dma_set_pte_prot(p, prot) \
             do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
-#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K)
+#define dma_pte_addr(p) ((p).val & PADDR_MASK & PAGE_MASK_4K)
 #define dma_set_pte_addr(p, addr) do {\
             (p).val |= ((addr) & PAGE_MASK_4K); } while (0)
 #define dma_pte_present(p) (((p).val & 3) != 0)
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index a33564b..db4c326 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -170,16 +170,16 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
         l_index = get_level_index(gmfn, level);
         printk("    l%d_index = %x\n", level, l_index);
 
-        pte.val = val = l[l_index];
+        pte.val = l[l_index];
         unmap_vtd_domain_page(l);
-        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, val);
+        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, pte.val);
 
-        pte.val = val;
         if ( !dma_pte_present(pte) )
         {
             printk("    l%d[%x] not present\n", level, l_index);
             break;
         }
+        val = dma_pte_addr(pte);
     } while ( --level );
 }
 
--
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 Thu Feb 05 04:33:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:33: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 1YJE7x-0002Od-P5; Thu, 05 Feb 2015 04:33:17 +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 1YJE7w-0002OP-6Y
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:16 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	A1/B0-02777-B82F2D45; Thu, 05 Feb 2015 04:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1423110793!12855364!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2749 invoked from network); 5 Feb 2015 04:33:14 -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;
	5 Feb 2015 04: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 1YJE7t-0008NI-Ni
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE7t-00042B-GI
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:13 +0000
Date: Thu, 05 Feb 2015 04:33:13 +0000
Message-Id: <E1YJE7t-00042B-GI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: don't crash when PTE bits 52
	and up are non-zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4bde3fd8970ae44b88b5dc3f26ed9c1ea9a22da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:28:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:28:00 2015 +0100

    VT-d: don't crash when PTE bits 52 and up are non-zero
    
    This can (and will) be legitimately the case when sharing page tables
    with EPT (more of a problem before p2m_access_rwx became zero, but
    still possible even now when other than that is the default for a
    guest), leading to an unconditional crash (in print_vtd_entries())
    when a DMA remapping fault occurs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 46e0baf59105200d43612cf0c59de216958b008d
    master date: 2015-01-07 11:13:58 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |   26 ++++++++------------------
 xen/drivers/passthrough/vtd/iommu.h |    2 +-
 xen/drivers/passthrough/vtd/utils.c |    6 +++---
 3 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index be346b2..81ea72f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -259,8 +259,7 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
     struct dma_pte *parent, *pte = NULL;
     int level = agaw_to_level(hd->agaw);
     int offset;
-    u64 pte_maddr = 0, maddr;
-    u64 *vaddr = NULL;
+    u64 pte_maddr = 0;
 
     addr &= (((u64)1) << addr_width) - 1;
     ASSERT(spin_is_locked(&hd->mapping_lock));
@@ -282,19 +281,19 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
         offset = address_level_offset(addr, level);
         pte = &parent[offset];
 
-        if ( dma_pte_addr(*pte) == 0 )
+        pte_maddr = dma_pte_addr(*pte);
+        if ( !pte_maddr )
         {
             if ( !alloc )
                 break;
 
             pdev = pci_get_pdev_by_domain(domain, -1, -1, -1);
             drhd = acpi_find_matched_drhd_unit(pdev);
-            maddr = alloc_pgtable_maddr(drhd, 1);
-            if ( !maddr )
+            pte_maddr = alloc_pgtable_maddr(drhd, 1);
+            if ( !pte_maddr )
                 break;
 
-            dma_set_pte_addr(*pte, maddr);
-            vaddr = map_vtd_domain_page(maddr);
+            dma_set_pte_addr(*pte, pte_maddr);
 
             /*
              * high level table always sets r/w, last level
@@ -304,21 +303,12 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
             dma_set_pte_writable(*pte);
             iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
         }
-        else
-        {
-            vaddr = map_vtd_domain_page(pte->val);
-        }
 
         if ( level == 2 )
-        {
-            pte_maddr = pte->val & PAGE_MASK_4K;
-            unmap_vtd_domain_page(vaddr);
             break;
-        }
 
         unmap_vtd_domain_page(parent);
-        parent = (struct dma_pte *)vaddr;
-        vaddr = NULL;
+        parent = map_vtd_domain_page(pte_maddr);
         level--;
     }
 
@@ -2447,7 +2437,7 @@ static void vtd_dump_p2m_table_level(paddr_t pt_maddr, int level, paddr_t gpa,
             printk("%*sgfn: %08lx mfn: %08lx\n",
                    indent, "",
                    (unsigned long)(address >> PAGE_SHIFT_4K),
-                   (unsigned long)(pte->val >> PAGE_SHIFT_4K));
+                   (unsigned long)(dma_pte_addr(*pte) >> PAGE_SHIFT_4K));
     }
 
     unmap_vtd_domain_page(pt_vaddr);
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 1a1f20a..a90f81a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -276,7 +276,7 @@ struct dma_pte {
 #define dma_set_pte_snp(p)  do {(p).val |= DMA_PTE_SNP;} while(0)
 #define dma_set_pte_prot(p, prot) \
             do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
-#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K)
+#define dma_pte_addr(p) ((p).val & PADDR_MASK & PAGE_MASK_4K)
 #define dma_set_pte_addr(p, addr) do {\
             (p).val |= ((addr) & PAGE_MASK_4K); } while (0)
 #define dma_pte_present(p) (((p).val & 3) != 0)
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index a33564b..db4c326 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -170,16 +170,16 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
         l_index = get_level_index(gmfn, level);
         printk("    l%d_index = %x\n", level, l_index);
 
-        pte.val = val = l[l_index];
+        pte.val = l[l_index];
         unmap_vtd_domain_page(l);
-        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, val);
+        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, pte.val);
 
-        pte.val = val;
         if ( !dma_pte_present(pte) )
         {
             printk("    l%d[%x] not present\n", level, l_index);
             break;
         }
+        val = dma_pte_addr(pte);
     } while ( --level );
 }
 
--
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 Thu Feb 05 04:33:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE87-0002Q2-Rd; Thu, 05 Feb 2015 04:33: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 1YJE86-0002Pp-GU
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:26 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	30/26-02635-592F2D45; Thu, 05 Feb 2015 04:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1423110804!12870587!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3930 invoked from network); 5 Feb 2015 04:33:24 -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;
	5 Feb 2015 04: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 1YJE83-0008NR-T5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE83-00042X-R7
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:23 +0000
Date: Thu, 05 Feb 2015 04:33:23 +0000
Message-Id: <E1YJE83-00042X-R7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/VPMU: Clear last_vcpu when
	destroying VPMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2dcdc46d789316baf7126c17f5d39b60153c1bed
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 12:28:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:28:40 2015 +0100

    x86/VPMU: Clear last_vcpu when destroying VPMU
    
    We need to make sure that last_vcpu is not pointing to VCPU whose
    VPMU is being destroyed. Otherwise we may try to dereference it in
    the future, when VCPU is gone.
    
    We have to do this via IPI since otherwise there is a (somewheat
    theoretical) chance that between test and subsequent clearing
    of last_vcpu the remote processor (i.e. vpmu->last_pcpu) might do
    both vpmu_load() and then vpmu_save() for another VCPU. The former
    will clear last_vcpu and the latter will set it to something else.
    
    Performing this operation via IPI will guarantee that nothing can
    happen on the remote processor between testing and clearing of
    last_vcpu.
    
    We should also check for VPMU_CONTEXT_ALLOCATED in vpmu_destroy() to
    avoid unnecessary percpu tests and arch-specific destroy ops. Thus
    checks in AMD and Intel routines are no longer needed.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: ed8017155607db1bbe1f6ca41eac696b7ef8082b
    master date: 2015-01-07 11:12:27 +0100
---
 xen/arch/x86/hvm/svm/vpmu.c       |    3 ---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    2 --
 xen/arch/x86/hvm/vpmu.c           |   20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 66a3815..d7ab815 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -398,9 +398,6 @@ static void amd_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
-
     if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index f6e8ec0..833d710 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -809,8 +809,6 @@ static void core2_vpmu_destroy(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
     xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
     if ( cpu_has_vmx_msr_bitmap )
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 21fbaba..27441e2 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -247,10 +247,30 @@ void vpmu_initialise(struct vcpu *v)
     }
 }
 
+static void vpmu_clear_last(void *arg)
+{
+    if ( this_cpu(last_vcpu) == arg )
+        this_cpu(last_vcpu) = NULL;
+}
+
 void vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+        return;
+
+    /*
+     * Need to clear last_vcpu in case it points to v.
+     * We can check here non-atomically whether it is 'v' since
+     * last_vcpu can never become 'v' again at this point.
+     * We will test it again in vpmu_clear_last() with interrupts
+     * disabled to make sure we don't clear someone else.
+     */
+    if ( per_cpu(last_vcpu, vpmu->last_pcpu) == v )
+        on_selected_cpus(cpumask_of(vpmu->last_pcpu),
+                         vpmu_clear_last, v, 1);
+
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_destroy )
         vpmu->arch_vpmu_ops->arch_vpmu_destroy(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 Thu Feb 05 04:33:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE87-0002Q2-Rd; Thu, 05 Feb 2015 04:33: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 1YJE86-0002Pp-GU
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:26 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	30/26-02635-592F2D45; Thu, 05 Feb 2015 04:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1423110804!12870587!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3930 invoked from network); 5 Feb 2015 04:33:24 -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;
	5 Feb 2015 04: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 1YJE83-0008NR-T5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE83-00042X-R7
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:23 +0000
Date: Thu, 05 Feb 2015 04:33:23 +0000
Message-Id: <E1YJE83-00042X-R7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/VPMU: Clear last_vcpu when
	destroying VPMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2dcdc46d789316baf7126c17f5d39b60153c1bed
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 12:28:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:28:40 2015 +0100

    x86/VPMU: Clear last_vcpu when destroying VPMU
    
    We need to make sure that last_vcpu is not pointing to VCPU whose
    VPMU is being destroyed. Otherwise we may try to dereference it in
    the future, when VCPU is gone.
    
    We have to do this via IPI since otherwise there is a (somewheat
    theoretical) chance that between test and subsequent clearing
    of last_vcpu the remote processor (i.e. vpmu->last_pcpu) might do
    both vpmu_load() and then vpmu_save() for another VCPU. The former
    will clear last_vcpu and the latter will set it to something else.
    
    Performing this operation via IPI will guarantee that nothing can
    happen on the remote processor between testing and clearing of
    last_vcpu.
    
    We should also check for VPMU_CONTEXT_ALLOCATED in vpmu_destroy() to
    avoid unnecessary percpu tests and arch-specific destroy ops. Thus
    checks in AMD and Intel routines are no longer needed.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: ed8017155607db1bbe1f6ca41eac696b7ef8082b
    master date: 2015-01-07 11:12:27 +0100
---
 xen/arch/x86/hvm/svm/vpmu.c       |    3 ---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    2 --
 xen/arch/x86/hvm/vpmu.c           |   20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 66a3815..d7ab815 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -398,9 +398,6 @@ static void amd_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
-
     if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index f6e8ec0..833d710 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -809,8 +809,6 @@ static void core2_vpmu_destroy(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
     xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
     if ( cpu_has_vmx_msr_bitmap )
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 21fbaba..27441e2 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -247,10 +247,30 @@ void vpmu_initialise(struct vcpu *v)
     }
 }
 
+static void vpmu_clear_last(void *arg)
+{
+    if ( this_cpu(last_vcpu) == arg )
+        this_cpu(last_vcpu) = NULL;
+}
+
 void vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+        return;
+
+    /*
+     * Need to clear last_vcpu in case it points to v.
+     * We can check here non-atomically whether it is 'v' since
+     * last_vcpu can never become 'v' again at this point.
+     * We will test it again in vpmu_clear_last() with interrupts
+     * disabled to make sure we don't clear someone else.
+     */
+    if ( per_cpu(last_vcpu, vpmu->last_pcpu) == v )
+        on_selected_cpus(cpumask_of(vpmu->last_pcpu),
+                         vpmu_clear_last, v, 1);
+
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_destroy )
         vpmu->arch_vpmu_ops->arch_vpmu_destroy(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 Thu Feb 05 04:33:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE8H-0002Rm-Ut; Thu, 05 Feb 2015 04:33:37 +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 1YJE8G-0002RV-K4
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:36 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	C3/77-10964-0A2F2D45; Thu, 05 Feb 2015 04:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1423110814!12906560!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21440 invoked from network); 5 Feb 2015 04:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Feb 2015 04:33: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 1YJE8E-0008NZ-14
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8D-00042y-W3
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:34 +0000
Date: Thu, 05 Feb 2015 04:33:33 +0000
Message-Id: <E1YJE8D-00042y-W3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86emul: tighten CLFLUSH emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b27f551db361b8ec04b25d15197617626ac0de83
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:30:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:30:12 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 25571c6..cb172e9 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4311,7 +4311,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
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 Thu Feb 05 04:33:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE8H-0002Rm-Ut; Thu, 05 Feb 2015 04:33:37 +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 1YJE8G-0002RV-K4
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:36 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	C3/77-10964-0A2F2D45; Thu, 05 Feb 2015 04:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1423110814!12906560!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21440 invoked from network); 5 Feb 2015 04:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Feb 2015 04:33: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 1YJE8E-0008NZ-14
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8D-00042y-W3
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:34 +0000
Date: Thu, 05 Feb 2015 04:33:33 +0000
Message-Id: <E1YJE8D-00042y-W3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86emul: tighten CLFLUSH emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b27f551db361b8ec04b25d15197617626ac0de83
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:30:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:30:12 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 25571c6..cb172e9 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4311,7 +4311,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
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 Thu Feb 05 04:33:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:33: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 1YJE8S-0002TT-18; Thu, 05 Feb 2015 04:33: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 1YJE8R-0002TF-6Z
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:47 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	94/01-02995-AA2F2D45; Thu, 05 Feb 2015 04:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1423110824!12085823!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4623 invoked from network); 5 Feb 2015 04:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Feb 2015 04: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 1YJE8O-0008Nf-AJ
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8O-00043t-4r
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:44 +0000
Date: Thu, 05 Feb 2015 04:33:44 +0000
Message-Id: <E1YJE8O-00043t-4r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] common/memory: fix an XSM error
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f9c133f3cc8010b460ffc386874825ffaf646239
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:30:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:30:59 2015 +0100

    common/memory: fix an XSM error path
    
    XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
    return the extent at which failure was detected, not error indicators.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 76d4ff26d9647088353acaf4a56388a354a5d6e9
    master date: 2015-01-19 11:59:05 +0100
---
 xen/common/memory.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 4d6ffee..38f79b3 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -744,11 +744,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
--
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 Thu Feb 05 04:33:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:33: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 1YJE8S-0002TT-18; Thu, 05 Feb 2015 04:33: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 1YJE8R-0002TF-6Z
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:47 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	94/01-02995-AA2F2D45; Thu, 05 Feb 2015 04:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1423110824!12085823!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4623 invoked from network); 5 Feb 2015 04:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Feb 2015 04: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 1YJE8O-0008Nf-AJ
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8O-00043t-4r
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:44 +0000
Date: Thu, 05 Feb 2015 04:33:44 +0000
Message-Id: <E1YJE8O-00043t-4r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] common/memory: fix an XSM error
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f9c133f3cc8010b460ffc386874825ffaf646239
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:30:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:30:59 2015 +0100

    common/memory: fix an XSM error path
    
    XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
    return the extent at which failure was detected, not error indicators.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 76d4ff26d9647088353acaf4a56388a354a5d6e9
    master date: 2015-01-19 11:59:05 +0100
---
 xen/common/memory.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 4d6ffee..38f79b3 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -744,11 +744,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
--
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 Thu Feb 05 04:33:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE8c-0002Uw-3s; Thu, 05 Feb 2015 04:33: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 1YJE8b-0002Uj-2g
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:57 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	2F/66-02991-4B2F2D45; Thu, 05 Feb 2015 04:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1423110834!12158688!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9575 invoked from network); 5 Feb 2015 04:33:55 -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;
	5 Feb 2015 04: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 1YJE8Y-0008No-IE
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8Y-00044J-DF
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:54 +0000
Date: Thu, 05 Feb 2015 04:33:54 +0000
Message-Id: <E1YJE8Y-00044J-DF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xsm/evtchn: never pretend to have
	successfully created a Xen event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0bc9ab7a164665a6a9fc35e9514ff67d18008d1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:31:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:31:31 2015 +0100

    xsm/evtchn: never pretend to have successfully created a Xen event channel
    
    Xen event channels are not internal resources.  They still have one end in a
    domain, and are created at the request of privileged domains.  This logic
    which "successfully" creates a Xen event channel opens up undesirable failure
    cases with ill-specified XSM policies.
    
    If a domain is permitted to create ioreq servers or memevent listeners, but
    not to create event channels, the ioreq/memevent creation will succeed but
    attempting to bind the returned event channel will fail without any indication
    of a permission error.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 09aa4759faa29c1fe735266de4c79f17329bd67b
    master date: 2015-01-20 10:42:26 +0100
---
 xen/common/event_channel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6fd4a2c..2774cbb 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1140,21 +1140,25 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&d->event_lock);
 
-    if ( (port = get_free_port(d)) < 0 )
+    rc = get_free_port(d);
+    if ( rc < 0 )
         goto out;
+    port = rc;
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    if ( rc )
+        goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
+    chn->u.unbound.remote_domid = remote_domid;
 
  out:
     spin_unlock(&d->event_lock);
 
-    return port;
+    return rc < 0 ? rc : port;
 }
 
 
--
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 Thu Feb 05 04:33:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE8c-0002Uw-3s; Thu, 05 Feb 2015 04:33: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 1YJE8b-0002Uj-2g
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:57 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	2F/66-02991-4B2F2D45; Thu, 05 Feb 2015 04:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1423110834!12158688!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9575 invoked from network); 5 Feb 2015 04:33:55 -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;
	5 Feb 2015 04: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 1YJE8Y-0008No-IE
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8Y-00044J-DF
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:33:54 +0000
Date: Thu, 05 Feb 2015 04:33:54 +0000
Message-Id: <E1YJE8Y-00044J-DF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xsm/evtchn: never pretend to have
	successfully created a Xen event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0bc9ab7a164665a6a9fc35e9514ff67d18008d1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:31:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:31:31 2015 +0100

    xsm/evtchn: never pretend to have successfully created a Xen event channel
    
    Xen event channels are not internal resources.  They still have one end in a
    domain, and are created at the request of privileged domains.  This logic
    which "successfully" creates a Xen event channel opens up undesirable failure
    cases with ill-specified XSM policies.
    
    If a domain is permitted to create ioreq servers or memevent listeners, but
    not to create event channels, the ioreq/memevent creation will succeed but
    attempting to bind the returned event channel will fail without any indication
    of a permission error.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 09aa4759faa29c1fe735266de4c79f17329bd67b
    master date: 2015-01-20 10:42:26 +0100
---
 xen/common/event_channel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6fd4a2c..2774cbb 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1140,21 +1140,25 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&d->event_lock);
 
-    if ( (port = get_free_port(d)) < 0 )
+    rc = get_free_port(d);
+    if ( rc < 0 )
         goto out;
+    port = rc;
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    if ( rc )
+        goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
+    chn->u.unbound.remote_domid = remote_domid;
 
  out:
     spin_unlock(&d->event_lock);
 
-    return port;
+    return rc < 0 ? rc : port;
 }
 
 
--
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 Thu Feb 05 04:34:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:34: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 1YJE8n-0002WU-6W; Thu, 05 Feb 2015 04:34: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 1YJE8l-0002W9-FB
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:07 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	BE/EF-02898-EB2F2D45; Thu, 05 Feb 2015 04:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1423110845!12171767!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10792 invoked from network); 5 Feb 2015 04:34:06 -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;
	5 Feb 2015 04: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 1YJE8i-0008ON-QS
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8i-00044p-Lr
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:04 +0000
Date: Thu, 05 Feb 2015 04:34:04 +0000
Message-Id: <E1YJE8i-00044p-Lr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: don't expose XSAVES
	capability to PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b450aefa4eb155af1270df7bd724f79f82d4c0d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:32:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:32:25 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
    master date: 2015-01-22 12:47:56 +0100
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index feb7cb0..dfff472 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -747,7 +747,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -765,7 +765,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -835,9 +835,19 @@ void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 9e74929..421e351 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -299,12 +302,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 unsigned int xstate_ctxt_size(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 5617963..a2a8d84 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -16,6 +16,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -35,6 +38,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct xsave_struct
--
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 Thu Feb 05 04:34:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:34: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 1YJE8n-0002WU-6W; Thu, 05 Feb 2015 04:34: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 1YJE8l-0002W9-FB
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:07 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	BE/EF-02898-EB2F2D45; Thu, 05 Feb 2015 04:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1423110845!12171767!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10792 invoked from network); 5 Feb 2015 04:34:06 -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;
	5 Feb 2015 04: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 1YJE8i-0008ON-QS
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8i-00044p-Lr
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:04 +0000
Date: Thu, 05 Feb 2015 04:34:04 +0000
Message-Id: <E1YJE8i-00044p-Lr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: don't expose XSAVES
	capability to PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b450aefa4eb155af1270df7bd724f79f82d4c0d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:32:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:32:25 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
    master date: 2015-01-22 12:47:56 +0100
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index feb7cb0..dfff472 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -747,7 +747,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -765,7 +765,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -835,9 +835,19 @@ void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 9e74929..421e351 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -299,12 +302,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 unsigned int xstate_ctxt_size(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 5617963..a2a8d84 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -16,6 +16,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -35,6 +38,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct xsave_struct
--
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 Thu Feb 05 04:34:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE8x-0002YN-BV; Thu, 05 Feb 2015 04:34: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 1YJE8v-0002Y0-QH
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:17 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	49/8F-03219-9C2F2D45; Thu, 05 Feb 2015 04:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1423110855!12145559!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 783 invoked from network); 5 Feb 2015 04:34:16 -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;
	5 Feb 2015 04: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 1YJE8t-0008OT-6A
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8s-00045D-UV
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:14 +0000
Date: Thu, 05 Feb 2015 04:34:14 +0000
Message-Id: <E1YJE8s-00045D-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: correctly check for sub-leaf
	zero of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce36be75fce0d777fec0dc1847254926467a69d3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:33:06 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:33:06 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
    master date: 2015-01-22 12:48:40 +0100
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index dfff472..9b03c17 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -787,7 +787,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_PSE36, &d);
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -822,7 +822,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
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 Thu Feb 05 04:34:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE8x-0002YN-BV; Thu, 05 Feb 2015 04:34: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 1YJE8v-0002Y0-QH
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:17 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	49/8F-03219-9C2F2D45; Thu, 05 Feb 2015 04:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1423110855!12145559!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.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 783 invoked from network); 5 Feb 2015 04:34:16 -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;
	5 Feb 2015 04: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 1YJE8t-0008OT-6A
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE8s-00045D-UV
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:14 +0000
Date: Thu, 05 Feb 2015 04:34:14 +0000
Message-Id: <E1YJE8s-00045D-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: correctly check for sub-leaf
	zero of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce36be75fce0d777fec0dc1847254926467a69d3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:33:06 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:33:06 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
    master date: 2015-01-22 12:48:40 +0100
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index dfff472..9b03c17 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -787,7 +787,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_PSE36, &d);
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -822,7 +822,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
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 Thu Feb 05 04:34:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:34: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 1YJE97-0002Zy-EC; Thu, 05 Feb 2015 04:34: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 1YJE95-0002Zj-RG
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:27 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	08/03-03000-3D2F2D45; Thu, 05 Feb 2015 04:34:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1423110865!5309741!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7243 invoked from network); 5 Feb 2015 04:34:26 -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;
	5 Feb 2015 04:34: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 1YJE93-0008OZ-F5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE93-00045i-AE
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:25 +0000
Date: Thu, 05 Feb 2015 04:34:25 +0000
Message-Id: <E1YJE93-00045i-AE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: vcpu_destroy_pagetables()
	must not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 818e40bb2581def3ae855e92ccb220d1a21bd219
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Feb 3 12:33:41 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:33:41 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: de4f284b3d7b47d3b9807f354552ecf3e0fff56b
    master date: 2015-01-26 12:51:09 +0100
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c086755..088ce35 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2693,7 +2693,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
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 Thu Feb 05 04:34:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04:34: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 1YJE97-0002Zy-EC; Thu, 05 Feb 2015 04:34: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 1YJE95-0002Zj-RG
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:27 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	08/03-03000-3D2F2D45; Thu, 05 Feb 2015 04:34:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1423110865!5309741!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7243 invoked from network); 5 Feb 2015 04:34:26 -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;
	5 Feb 2015 04:34: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 1YJE93-0008OZ-F5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE93-00045i-AE
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:25 +0000
Date: Thu, 05 Feb 2015 04:34:25 +0000
Message-Id: <E1YJE93-00045i-AE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: vcpu_destroy_pagetables()
	must not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 818e40bb2581def3ae855e92ccb220d1a21bd219
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Feb 3 12:33:41 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:33:41 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: de4f284b3d7b47d3b9807f354552ecf3e0fff56b
    master date: 2015-01-26 12:51:09 +0100
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c086755..088ce35 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2693,7 +2693,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
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 Thu Feb 05 04:34:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE9H-0002bU-I3; Thu, 05 Feb 2015 04:34:39 +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 1YJE9F-0002bD-Na
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:37 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	CA/13-03000-DD2F2D45; Thu, 05 Feb 2015 04:34:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1423110875!12608323!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12212 invoked from network); 5 Feb 2015 04:34: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;
	5 Feb 2015 04: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 1YJE9D-0008Oh-JP
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE9D-00046H-I5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:35 +0000
Date: Thu, 05 Feb 2015 04:34:35 +0000
Message-Id: <E1YJE9D-00046H-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] docs/commandline: correct
	information for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0b941e7734009341a70d1d13aff9af683a8d5ae
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:34:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:34:31 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
    master date: 2015-01-28 16:31:07 +0100
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index e2cd3e3..b50a753 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1047,9 +1047,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
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 Thu Feb 05 04:34:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE9H-0002bU-I3; Thu, 05 Feb 2015 04:34:39 +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 1YJE9F-0002bD-Na
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:37 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	CA/13-03000-DD2F2D45; Thu, 05 Feb 2015 04:34:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1423110875!12608323!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12212 invoked from network); 5 Feb 2015 04:34: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;
	5 Feb 2015 04: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 1YJE9D-0008Oh-JP
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE9D-00046H-I5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:35 +0000
Date: Thu, 05 Feb 2015 04:34:35 +0000
Message-Id: <E1YJE9D-00046H-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] docs/commandline: correct
	information for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0b941e7734009341a70d1d13aff9af683a8d5ae
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:34:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:34:31 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
    master date: 2015-01-28 16:31:07 +0100
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index e2cd3e3..b50a753 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1047,9 +1047,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
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 Thu Feb 05 04:34:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE9R-0002d3-LU; Thu, 05 Feb 2015 04:34:49 +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 1YJE9Q-0002cs-BV
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:48 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	D6/14-02601-7E2F2D45; Thu, 05 Feb 2015 04:34:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1423110886!7503909!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16741 invoked from network); 5 Feb 2015 04:34:46 -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;
	5 Feb 2015 04:34: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 1YJE9N-0008On-O5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE9N-00047S-Mm
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:45 +0000
Date: Thu, 05 Feb 2015 04:34:45 +0000
Message-Id: <E1YJE9N-00047S-Mm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] bunzip2: off by one in
	get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52e190cacf95046c99a52947aa12d7c0a2225b4d
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue Feb 3 12:34:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:34:56 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 39798e95a954eec660a3f5f21489c30ef78daf6d
    master date: 2015-01-28 16:50:08 +0100
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
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 Thu Feb 05 04:34:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2015 04: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 1YJE9R-0002d3-LU; Thu, 05 Feb 2015 04:34:49 +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 1YJE9Q-0002cs-BV
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:48 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	D6/14-02601-7E2F2D45; Thu, 05 Feb 2015 04:34:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1423110886!7503909!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16741 invoked from network); 5 Feb 2015 04:34:46 -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;
	5 Feb 2015 04:34: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 1YJE9N-0008On-O5
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJE9N-00047S-Mm
	for xen-changelog@lists.xensource.com; Thu, 05 Feb 2015 04:34:45 +0000
Date: Thu, 05 Feb 2015 04:34:45 +0000
Message-Id: <E1YJE9N-00047S-Mm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] bunzip2: off by one in
	get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52e190cacf95046c99a52947aa12d7c0a2225b4d
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue Feb 3 12:34:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:34:56 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 39798e95a954eec660a3f5f21489c30ef78daf6d
    master date: 2015-01-28 16:50:08 +0100
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
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 Feb 06 15:11:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkYm-0001PV-K8; Fri, 06 Feb 2015 15:11:08 +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 1YJkYk-0001PH-Vv
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:07 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	6F/0C-03168-A89D4D45; Fri, 06 Feb 2015 15:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1423235464!11840905!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4411 invoked from network); 6 Feb 2015 15:11:05 -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;
	6 Feb 2015 15: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 1YJkYi-0007bn-6V
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkYi-00045P-3X
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:04 +0000
Date: Fri, 06 Feb 2015 15:11:04 +0000
Message-Id: <E1YJkYi-00045P-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] domctl: fix IRQ permission
	granting/revocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0f5a611cb586d5109bf7a3ecee9a71202c93126d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:22:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:22:32 2015 +0100

    domctl: fix IRQ permission granting/revocation
    
    Commit 545607eb3c ("x86: fix various issues with handling guest IRQs")
    wasn't really consistent in one respect: The granting of access to an
    IRQ shouldn't assume the pIRQ->IRQ translation to be the same in both
    domains. In fact it is wrong to assume that a translation is already/
    still in place at the time access is being granted/revoked.
    
    What is wanted is to translate the incoming pIRQ to an IRQ for
    the invoking domain (as the pIRQ is the only notion the invoking
    domain has of the IRQ), and grant the subject domain access to
    the resulting IRQ.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 6fb3a07bc0ad656b5f76eb9fc961bcd1d3cace58
    master date: 2015-01-05 10:20:24 -0500
---
 xen/common/domctl.c     |   14 +++++++++-----
 xen/include/xen/iocap.h |   17 +++--------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 9988293..bc8e9d8 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -768,17 +768,21 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_irq_permission:
     {
-        unsigned int pirq = op->u.irq_permission.pirq;
+        unsigned int pirq = op->u.irq_permission.pirq, irq;
         int allow = op->u.irq_permission.allow_access;
 
-        if ( pirq >= d->nr_pirqs )
+        if ( pirq >= current->domain->nr_pirqs )
+        {
             ret = -EINVAL;
-        else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
+            break;
+        }
+        irq = pirq_access_permitted(current->domain, pirq);
+        if ( !irq || xsm_irq_permission(XSM_HOOK, d, irq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = pirq_permit_access(d, pirq);
+            ret = irq_permit_access(d, irq);
         else
-            ret = pirq_deny_access(d, pirq);
+            ret = irq_deny_access(d, irq);
     }
     break;
 
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index b755ecb..1ca3858 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,22 +28,11 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
-#define pirq_permit_access(d, i) ({                     \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
-#define pirq_deny_access(d, i) ({                       \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
 #define pirq_access_permitted(d, i) ({                  \
     struct domain *d__ = (d);                           \
-    rangeset_contains_singleton(d__->irq_caps,          \
-                                domain_pirq_to_irq(d__, i));\
+    int irq__ = domain_pirq_to_irq(d__, i);             \
+    irq__ > 0 && irq_access_permitted(d__, irq__)       \
+    ? irq__ : 0;                                        \
 })
 
 #endif /* __XEN_IOCAP_H__ */
--
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 Feb 06 15:11:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkYm-0001PV-K8; Fri, 06 Feb 2015 15:11:08 +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 1YJkYk-0001PH-Vv
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:07 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	6F/0C-03168-A89D4D45; Fri, 06 Feb 2015 15:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1423235464!11840905!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4411 invoked from network); 6 Feb 2015 15:11:05 -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;
	6 Feb 2015 15: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 1YJkYi-0007bn-6V
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkYi-00045P-3X
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:04 +0000
Date: Fri, 06 Feb 2015 15:11:04 +0000
Message-Id: <E1YJkYi-00045P-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] domctl: fix IRQ permission
	granting/revocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0f5a611cb586d5109bf7a3ecee9a71202c93126d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:22:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:22:32 2015 +0100

    domctl: fix IRQ permission granting/revocation
    
    Commit 545607eb3c ("x86: fix various issues with handling guest IRQs")
    wasn't really consistent in one respect: The granting of access to an
    IRQ shouldn't assume the pIRQ->IRQ translation to be the same in both
    domains. In fact it is wrong to assume that a translation is already/
    still in place at the time access is being granted/revoked.
    
    What is wanted is to translate the incoming pIRQ to an IRQ for
    the invoking domain (as the pIRQ is the only notion the invoking
    domain has of the IRQ), and grant the subject domain access to
    the resulting IRQ.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    master commit: 6fb3a07bc0ad656b5f76eb9fc961bcd1d3cace58
    master date: 2015-01-05 10:20:24 -0500
---
 xen/common/domctl.c     |   14 +++++++++-----
 xen/include/xen/iocap.h |   17 +++--------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 9988293..bc8e9d8 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -768,17 +768,21 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_irq_permission:
     {
-        unsigned int pirq = op->u.irq_permission.pirq;
+        unsigned int pirq = op->u.irq_permission.pirq, irq;
         int allow = op->u.irq_permission.allow_access;
 
-        if ( pirq >= d->nr_pirqs )
+        if ( pirq >= current->domain->nr_pirqs )
+        {
             ret = -EINVAL;
-        else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
+            break;
+        }
+        irq = pirq_access_permitted(current->domain, pirq);
+        if ( !irq || xsm_irq_permission(XSM_HOOK, d, irq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = pirq_permit_access(d, pirq);
+            ret = irq_permit_access(d, irq);
         else
-            ret = pirq_deny_access(d, pirq);
+            ret = irq_deny_access(d, irq);
     }
     break;
 
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index b755ecb..1ca3858 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,22 +28,11 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
-#define pirq_permit_access(d, i) ({                     \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
-#define pirq_deny_access(d, i) ({                       \
-    struct domain *d__ = (d);                           \
-    int i__ = domain_pirq_to_irq(d__, i);               \
-    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
-            : -EINVAL;                                  \
-})
 #define pirq_access_permitted(d, i) ({                  \
     struct domain *d__ = (d);                           \
-    rangeset_contains_singleton(d__->irq_caps,          \
-                                domain_pirq_to_irq(d__, i));\
+    int irq__ = domain_pirq_to_irq(d__, i);             \
+    irq__ > 0 && irq_access_permitted(d__, irq__)       \
+    ? irq__ : 0;                                        \
 })
 
 #endif /* __XEN_IOCAP_H__ */
--
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 Feb 06 15:11:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15:11: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 1YJkYw-0001Re-N2; Fri, 06 Feb 2015 15:11: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 1YJkYv-0001QU-6l
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:17 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	AE/FA-02601-499D4D45; Fri, 06 Feb 2015 15:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1423235474!11843678!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4750 invoked from network); 6 Feb 2015 15:11:15 -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;
	6 Feb 2015 15: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 1YJkYs-0007bq-Ic
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkYs-00046W-As
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:14 +0000
Date: Fri, 06 Feb 2015 15:11:14 +0000
Message-Id: <E1YJkYs-00046W-As@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/VPMU: Clear last_vcpu when
	destroying VPMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 34effcd03d682e3a264ead2fe7a2a67cb4fe6a35
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 15:23:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:23:38 2015 +0100

    x86/VPMU: Clear last_vcpu when destroying VPMU
    
    We need to make sure that last_vcpu is not pointing to VCPU whose
    VPMU is being destroyed. Otherwise we may try to dereference it in
    the future, when VCPU is gone.
    
    We have to do this via IPI since otherwise there is a (somewheat
    theoretical) chance that between test and subsequent clearing
    of last_vcpu the remote processor (i.e. vpmu->last_pcpu) might do
    both vpmu_load() and then vpmu_save() for another VCPU. The former
    will clear last_vcpu and the latter will set it to something else.
    
    Performing this operation via IPI will guarantee that nothing can
    happen on the remote processor between testing and clearing of
    last_vcpu.
    
    We should also check for VPMU_CONTEXT_ALLOCATED in vpmu_destroy() to
    avoid unnecessary percpu tests and arch-specific destroy ops. Thus
    checks in AMD and Intel routines are no longer needed.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: ed8017155607db1bbe1f6ca41eac696b7ef8082b
    master date: 2015-01-07 11:12:27 +0100
---
 xen/arch/x86/hvm/svm/vpmu.c       |    3 ---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    2 --
 xen/arch/x86/hvm/vpmu.c           |   20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 66a3815..d7ab815 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -398,9 +398,6 @@ static void amd_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
-
     if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 4b8dc55..388bc64 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -783,8 +783,6 @@ static void core2_vpmu_destroy(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
     xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
     if ( cpu_has_vmx_msr_bitmap )
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 21fbaba..27441e2 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -247,10 +247,30 @@ void vpmu_initialise(struct vcpu *v)
     }
 }
 
+static void vpmu_clear_last(void *arg)
+{
+    if ( this_cpu(last_vcpu) == arg )
+        this_cpu(last_vcpu) = NULL;
+}
+
 void vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+        return;
+
+    /*
+     * Need to clear last_vcpu in case it points to v.
+     * We can check here non-atomically whether it is 'v' since
+     * last_vcpu can never become 'v' again at this point.
+     * We will test it again in vpmu_clear_last() with interrupts
+     * disabled to make sure we don't clear someone else.
+     */
+    if ( per_cpu(last_vcpu, vpmu->last_pcpu) == v )
+        on_selected_cpus(cpumask_of(vpmu->last_pcpu),
+                         vpmu_clear_last, v, 1);
+
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_destroy )
         vpmu->arch_vpmu_ops->arch_vpmu_destroy(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 Fri Feb 06 15:11:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15:11: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 1YJkYw-0001Re-N2; Fri, 06 Feb 2015 15:11: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 1YJkYv-0001QU-6l
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:17 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	AE/FA-02601-499D4D45; Fri, 06 Feb 2015 15:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1423235474!11843678!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4750 invoked from network); 6 Feb 2015 15:11:15 -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;
	6 Feb 2015 15: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 1YJkYs-0007bq-Ic
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkYs-00046W-As
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:14 +0000
Date: Fri, 06 Feb 2015 15:11:14 +0000
Message-Id: <E1YJkYs-00046W-As@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/VPMU: Clear last_vcpu when
	destroying VPMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 34effcd03d682e3a264ead2fe7a2a67cb4fe6a35
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 15:23:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:23:38 2015 +0100

    x86/VPMU: Clear last_vcpu when destroying VPMU
    
    We need to make sure that last_vcpu is not pointing to VCPU whose
    VPMU is being destroyed. Otherwise we may try to dereference it in
    the future, when VCPU is gone.
    
    We have to do this via IPI since otherwise there is a (somewheat
    theoretical) chance that between test and subsequent clearing
    of last_vcpu the remote processor (i.e. vpmu->last_pcpu) might do
    both vpmu_load() and then vpmu_save() for another VCPU. The former
    will clear last_vcpu and the latter will set it to something else.
    
    Performing this operation via IPI will guarantee that nothing can
    happen on the remote processor between testing and clearing of
    last_vcpu.
    
    We should also check for VPMU_CONTEXT_ALLOCATED in vpmu_destroy() to
    avoid unnecessary percpu tests and arch-specific destroy ops. Thus
    checks in AMD and Intel routines are no longer needed.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: ed8017155607db1bbe1f6ca41eac696b7ef8082b
    master date: 2015-01-07 11:12:27 +0100
---
 xen/arch/x86/hvm/svm/vpmu.c       |    3 ---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    2 --
 xen/arch/x86/hvm/vpmu.c           |   20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 66a3815..d7ab815 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -398,9 +398,6 @@ static void amd_vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
-
     if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 4b8dc55..388bc64 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -783,8 +783,6 @@ static void core2_vpmu_destroy(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
     xfree(core2_vpmu_cxt->pmu_enable);
     xfree(vpmu->context);
     if ( cpu_has_vmx_msr_bitmap )
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 21fbaba..27441e2 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -247,10 +247,30 @@ void vpmu_initialise(struct vcpu *v)
     }
 }
 
+static void vpmu_clear_last(void *arg)
+{
+    if ( this_cpu(last_vcpu) == arg )
+        this_cpu(last_vcpu) = NULL;
+}
+
 void vpmu_destroy(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+        return;
+
+    /*
+     * Need to clear last_vcpu in case it points to v.
+     * We can check here non-atomically whether it is 'v' since
+     * last_vcpu can never become 'v' again at this point.
+     * We will test it again in vpmu_clear_last() with interrupts
+     * disabled to make sure we don't clear someone else.
+     */
+    if ( per_cpu(last_vcpu, vpmu->last_pcpu) == v )
+        on_selected_cpus(cpumask_of(vpmu->last_pcpu),
+                         vpmu_clear_last, v, 1);
+
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_destroy )
         vpmu->arch_vpmu_ops->arch_vpmu_destroy(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 Fri Feb 06 15:11:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15:11: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 1YJkZ5-0001XU-Qn; Fri, 06 Feb 2015 15:11:27 +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 1YJkZ5-0001XN-4w
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:27 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DF/C7-02754-E99D4D45; Fri, 06 Feb 2015 15:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1423235485!12231659!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26422 invoked from network); 6 Feb 2015 15:11:25 -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;
	6 Feb 2015 15: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 1YJkZ2-0007bz-PJ
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZ2-00046s-M6
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:24 +0000
Date: Fri, 06 Feb 2015 15:11:24 +0000
Message-Id: <E1YJkZ2-00046s-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: don't crash when PTE bits 52
	and up are non-zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4de472720da0fc56e2a073e2ac94132455c7a1cb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:24:45 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:24:45 2015 +0100

    VT-d: don't crash when PTE bits 52 and up are non-zero
    
    This can (and will) be legitimately the case when sharing page tables
    with EPT (more of a problem before p2m_access_rwx became zero, but
    still possible even now when other than that is the default for a
    guest), leading to an unconditional crash (in print_vtd_entries())
    when a DMA remapping fault occurs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 46e0baf59105200d43612cf0c59de216958b008d
    master date: 2015-01-07 11:13:58 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |   26 ++++++++------------------
 xen/drivers/passthrough/vtd/iommu.h |    2 +-
 xen/drivers/passthrough/vtd/utils.c |    6 +++---
 3 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 4533554..005eb47 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -259,8 +259,7 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
     struct dma_pte *parent, *pte = NULL;
     int level = agaw_to_level(hd->agaw);
     int offset;
-    u64 pte_maddr = 0, maddr;
-    u64 *vaddr = NULL;
+    u64 pte_maddr = 0;
 
     addr &= (((u64)1) << addr_width) - 1;
     ASSERT(spin_is_locked(&hd->mapping_lock));
@@ -282,19 +281,19 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
         offset = address_level_offset(addr, level);
         pte = &parent[offset];
 
-        if ( dma_pte_addr(*pte) == 0 )
+        pte_maddr = dma_pte_addr(*pte);
+        if ( !pte_maddr )
         {
             if ( !alloc )
                 break;
 
             pdev = pci_get_pdev_by_domain(domain, -1, -1, -1);
             drhd = acpi_find_matched_drhd_unit(pdev);
-            maddr = alloc_pgtable_maddr(drhd, 1);
-            if ( !maddr )
+            pte_maddr = alloc_pgtable_maddr(drhd, 1);
+            if ( !pte_maddr )
                 break;
 
-            dma_set_pte_addr(*pte, maddr);
-            vaddr = map_vtd_domain_page(maddr);
+            dma_set_pte_addr(*pte, pte_maddr);
 
             /*
              * high level table always sets r/w, last level
@@ -304,21 +303,12 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
             dma_set_pte_writable(*pte);
             iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
         }
-        else
-        {
-            vaddr = map_vtd_domain_page(pte->val);
-        }
 
         if ( level == 2 )
-        {
-            pte_maddr = pte->val & PAGE_MASK_4K;
-            unmap_vtd_domain_page(vaddr);
             break;
-        }
 
         unmap_vtd_domain_page(parent);
-        parent = (struct dma_pte *)vaddr;
-        vaddr = NULL;
+        parent = map_vtd_domain_page(pte_maddr);
         level--;
     }
 
@@ -2430,7 +2420,7 @@ static void vtd_dump_p2m_table_level(paddr_t pt_maddr, int level, paddr_t gpa,
             printk("%*sgfn: %08lx mfn: %08lx\n",
                    indent, "",
                    (unsigned long)(address >> PAGE_SHIFT_4K),
-                   (unsigned long)(pte->val >> PAGE_SHIFT_4K));
+                   (unsigned long)(dma_pte_addr(*pte) >> PAGE_SHIFT_4K));
     }
 
     unmap_vtd_domain_page(pt_vaddr);
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 1a1f20a..a90f81a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -276,7 +276,7 @@ struct dma_pte {
 #define dma_set_pte_snp(p)  do {(p).val |= DMA_PTE_SNP;} while(0)
 #define dma_set_pte_prot(p, prot) \
             do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
-#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K)
+#define dma_pte_addr(p) ((p).val & PADDR_MASK & PAGE_MASK_4K)
 #define dma_set_pte_addr(p, addr) do {\
             (p).val |= ((addr) & PAGE_MASK_4K); } while (0)
 #define dma_pte_present(p) (((p).val & 3) != 0)
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index a33564b..db4c326 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -170,16 +170,16 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
         l_index = get_level_index(gmfn, level);
         printk("    l%d_index = %x\n", level, l_index);
 
-        pte.val = val = l[l_index];
+        pte.val = l[l_index];
         unmap_vtd_domain_page(l);
-        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, val);
+        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, pte.val);
 
-        pte.val = val;
         if ( !dma_pte_present(pte) )
         {
             printk("    l%d[%x] not present\n", level, l_index);
             break;
         }
+        val = dma_pte_addr(pte);
     } while ( --level );
 }
 
--
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 Feb 06 15:11:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15:11: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 1YJkZ5-0001XU-Qn; Fri, 06 Feb 2015 15:11:27 +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 1YJkZ5-0001XN-4w
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:27 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DF/C7-02754-E99D4D45; Fri, 06 Feb 2015 15:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1423235485!12231659!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26422 invoked from network); 6 Feb 2015 15:11:25 -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;
	6 Feb 2015 15: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 1YJkZ2-0007bz-PJ
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZ2-00046s-M6
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:24 +0000
Date: Fri, 06 Feb 2015 15:11:24 +0000
Message-Id: <E1YJkZ2-00046s-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: don't crash when PTE bits 52
	and up are non-zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4de472720da0fc56e2a073e2ac94132455c7a1cb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:24:45 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:24:45 2015 +0100

    VT-d: don't crash when PTE bits 52 and up are non-zero
    
    This can (and will) be legitimately the case when sharing page tables
    with EPT (more of a problem before p2m_access_rwx became zero, but
    still possible even now when other than that is the default for a
    guest), leading to an unconditional crash (in print_vtd_entries())
    when a DMA remapping fault occurs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 46e0baf59105200d43612cf0c59de216958b008d
    master date: 2015-01-07 11:13:58 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |   26 ++++++++------------------
 xen/drivers/passthrough/vtd/iommu.h |    2 +-
 xen/drivers/passthrough/vtd/utils.c |    6 +++---
 3 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 4533554..005eb47 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -259,8 +259,7 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
     struct dma_pte *parent, *pte = NULL;
     int level = agaw_to_level(hd->agaw);
     int offset;
-    u64 pte_maddr = 0, maddr;
-    u64 *vaddr = NULL;
+    u64 pte_maddr = 0;
 
     addr &= (((u64)1) << addr_width) - 1;
     ASSERT(spin_is_locked(&hd->mapping_lock));
@@ -282,19 +281,19 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
         offset = address_level_offset(addr, level);
         pte = &parent[offset];
 
-        if ( dma_pte_addr(*pte) == 0 )
+        pte_maddr = dma_pte_addr(*pte);
+        if ( !pte_maddr )
         {
             if ( !alloc )
                 break;
 
             pdev = pci_get_pdev_by_domain(domain, -1, -1, -1);
             drhd = acpi_find_matched_drhd_unit(pdev);
-            maddr = alloc_pgtable_maddr(drhd, 1);
-            if ( !maddr )
+            pte_maddr = alloc_pgtable_maddr(drhd, 1);
+            if ( !pte_maddr )
                 break;
 
-            dma_set_pte_addr(*pte, maddr);
-            vaddr = map_vtd_domain_page(maddr);
+            dma_set_pte_addr(*pte, pte_maddr);
 
             /*
              * high level table always sets r/w, last level
@@ -304,21 +303,12 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
             dma_set_pte_writable(*pte);
             iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
         }
-        else
-        {
-            vaddr = map_vtd_domain_page(pte->val);
-        }
 
         if ( level == 2 )
-        {
-            pte_maddr = pte->val & PAGE_MASK_4K;
-            unmap_vtd_domain_page(vaddr);
             break;
-        }
 
         unmap_vtd_domain_page(parent);
-        parent = (struct dma_pte *)vaddr;
-        vaddr = NULL;
+        parent = map_vtd_domain_page(pte_maddr);
         level--;
     }
 
@@ -2430,7 +2420,7 @@ static void vtd_dump_p2m_table_level(paddr_t pt_maddr, int level, paddr_t gpa,
             printk("%*sgfn: %08lx mfn: %08lx\n",
                    indent, "",
                    (unsigned long)(address >> PAGE_SHIFT_4K),
-                   (unsigned long)(pte->val >> PAGE_SHIFT_4K));
+                   (unsigned long)(dma_pte_addr(*pte) >> PAGE_SHIFT_4K));
     }
 
     unmap_vtd_domain_page(pt_vaddr);
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 1a1f20a..a90f81a 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -276,7 +276,7 @@ struct dma_pte {
 #define dma_set_pte_snp(p)  do {(p).val |= DMA_PTE_SNP;} while(0)
 #define dma_set_pte_prot(p, prot) \
             do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
-#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K)
+#define dma_pte_addr(p) ((p).val & PADDR_MASK & PAGE_MASK_4K)
 #define dma_set_pte_addr(p, addr) do {\
             (p).val |= ((addr) & PAGE_MASK_4K); } while (0)
 #define dma_pte_present(p) (((p).val & 3) != 0)
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index a33564b..db4c326 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -170,16 +170,16 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
         l_index = get_level_index(gmfn, level);
         printk("    l%d_index = %x\n", level, l_index);
 
-        pte.val = val = l[l_index];
+        pte.val = l[l_index];
         unmap_vtd_domain_page(l);
-        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, val);
+        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, pte.val);
 
-        pte.val = val;
         if ( !dma_pte_present(pte) )
         {
             printk("    l%d[%x] not present\n", level, l_index);
             break;
         }
+        val = dma_pte_addr(pte);
     } while ( --level );
 }
 
--
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 Feb 06 15:11:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15:11: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 1YJkZF-0001ZH-U0; Fri, 06 Feb 2015 15:11: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 1YJkZF-0001Z5-A0
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:37 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	E1/DD-02749-8A9D4D45; Fri, 06 Feb 2015 15:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1423235495!4905189!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1261 invoked from network); 6 Feb 2015 15:11:36 -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;
	6 Feb 2015 15: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 1YJkZC-0007c7-Uy
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZC-00047O-U5
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:34 +0000
Date: Fri, 06 Feb 2015 15:11:34 +0000
Message-Id: <E1YJkZC-00047O-U5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86emul: tighten CLFLUSH emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5bea1d935e48097c1725bc4162e72fb4f313adf8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:26:16 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:26:16 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 1e1e388..2b6a509 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4319,7 +4319,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
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 Feb 06 15:11:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15:11: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 1YJkZF-0001ZH-U0; Fri, 06 Feb 2015 15:11: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 1YJkZF-0001Z5-A0
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:37 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	E1/DD-02749-8A9D4D45; Fri, 06 Feb 2015 15:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1423235495!4905189!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1261 invoked from network); 6 Feb 2015 15:11:36 -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;
	6 Feb 2015 15: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 1YJkZC-0007c7-Uy
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZC-00047O-U5
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:34 +0000
Date: Fri, 06 Feb 2015 15:11:34 +0000
Message-Id: <E1YJkZC-00047O-U5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86emul: tighten CLFLUSH emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5bea1d935e48097c1725bc4162e72fb4f313adf8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:26:16 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:26:16 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 1e1e388..2b6a509 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4319,7 +4319,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
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 Feb 06 15:11:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZQ-0001eU-0J; Fri, 06 Feb 2015 15:11: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 1YJkZP-0001eF-Gr
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:47 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	CB/91-02755-2B9D4D45; Fri, 06 Feb 2015 15:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1423235505!11810288!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12673 invoked from network); 6 Feb 2015 15:11:46 -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;
	6 Feb 2015 15: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 1YJkZN-0007cD-6f
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZN-00047q-2C
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:45 +0000
Date: Fri, 06 Feb 2015 15:11:45 +0000
Message-Id: <E1YJkZN-00047q-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] common/memory: fix an XSM error
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dd971e41820dc33e1da1c429dfc3c7ee32b4795e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:26:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:26:48 2015 +0100

    common/memory: fix an XSM error path
    
    XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
    return the extent at which failure was detected, not error indicators.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 76d4ff26d9647088353acaf4a56388a354a5d6e9
    master date: 2015-01-19 11:59:05 +0100
---
 xen/common/memory.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 78b0c6c..d2623d4 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -600,11 +600,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
--
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 Feb 06 15:11:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZQ-0001eU-0J; Fri, 06 Feb 2015 15:11: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 1YJkZP-0001eF-Gr
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:47 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	CB/91-02755-2B9D4D45; Fri, 06 Feb 2015 15:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1423235505!11810288!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12673 invoked from network); 6 Feb 2015 15:11:46 -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;
	6 Feb 2015 15: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 1YJkZN-0007cD-6f
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZN-00047q-2C
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:45 +0000
Date: Fri, 06 Feb 2015 15:11:45 +0000
Message-Id: <E1YJkZN-00047q-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] common/memory: fix an XSM error
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dd971e41820dc33e1da1c429dfc3c7ee32b4795e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:26:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:26:48 2015 +0100

    common/memory: fix an XSM error path
    
    XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
    return the extent at which failure was detected, not error indicators.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 76d4ff26d9647088353acaf4a56388a354a5d6e9
    master date: 2015-01-19 11:59:05 +0100
---
 xen/common/memory.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 78b0c6c..d2623d4 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -600,11 +600,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
--
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 Feb 06 15:11:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZb-0001ib-32; Fri, 06 Feb 2015 15:11:59 +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 1YJkZa-0001hX-1D
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:58 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	9D/CB-03164-DB9D4D45; Fri, 06 Feb 2015 15:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1423235515!11205435!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8397 invoked from network); 6 Feb 2015 15:11:56 -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;
	6 Feb 2015 15:11: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 1YJkZX-0007cM-Bi
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZX-00048C-Aq
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:55 +0000
Date: Fri, 06 Feb 2015 15:11:55 +0000
Message-Id: <E1YJkZX-00048C-Aq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xsm/evtchn: never pretend to have
	successfully created a Xen event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 461a8d3916a77695b4137c6b27e7c434e03035ff
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 15:27:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:27:18 2015 +0100

    xsm/evtchn: never pretend to have successfully created a Xen event channel
    
    Xen event channels are not internal resources.  They still have one end in a
    domain, and are created at the request of privileged domains.  This logic
    which "successfully" creates a Xen event channel opens up undesirable failure
    cases with ill-specified XSM policies.
    
    If a domain is permitted to create ioreq servers or memevent listeners, but
    not to create event channels, the ioreq/memevent creation will succeed but
    attempting to bind the returned event channel will fail without any indication
    of a permission error.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 09aa4759faa29c1fe735266de4c79f17329bd67b
    master date: 2015-01-20 10:42:26 +0100
---
 xen/common/event_channel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 64c976b..ba7b85f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1098,21 +1098,25 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&d->event_lock);
 
-    if ( (port = get_free_port(d)) < 0 )
+    rc = get_free_port(d);
+    if ( rc < 0 )
         goto out;
+    port = rc;
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    if ( rc )
+        goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
+    chn->u.unbound.remote_domid = remote_domid;
 
  out:
     spin_unlock(&d->event_lock);
 
-    return port;
+    return rc < 0 ? rc : port;
 }
 
 
--
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 Feb 06 15:11:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZb-0001ib-32; Fri, 06 Feb 2015 15:11:59 +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 1YJkZa-0001hX-1D
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:58 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	9D/CB-03164-DB9D4D45; Fri, 06 Feb 2015 15:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1423235515!11205435!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8397 invoked from network); 6 Feb 2015 15:11:56 -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;
	6 Feb 2015 15:11: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 1YJkZX-0007cM-Bi
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZX-00048C-Aq
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:11:55 +0000
Date: Fri, 06 Feb 2015 15:11:55 +0000
Message-Id: <E1YJkZX-00048C-Aq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xsm/evtchn: never pretend to have
	successfully created a Xen event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 461a8d3916a77695b4137c6b27e7c434e03035ff
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 15:27:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:27:18 2015 +0100

    xsm/evtchn: never pretend to have successfully created a Xen event channel
    
    Xen event channels are not internal resources.  They still have one end in a
    domain, and are created at the request of privileged domains.  This logic
    which "successfully" creates a Xen event channel opens up undesirable failure
    cases with ill-specified XSM policies.
    
    If a domain is permitted to create ioreq servers or memevent listeners, but
    not to create event channels, the ioreq/memevent creation will succeed but
    attempting to bind the returned event channel will fail without any indication
    of a permission error.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 09aa4759faa29c1fe735266de4c79f17329bd67b
    master date: 2015-01-20 10:42:26 +0100
---
 xen/common/event_channel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 64c976b..ba7b85f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1098,21 +1098,25 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&d->event_lock);
 
-    if ( (port = get_free_port(d)) < 0 )
+    rc = get_free_port(d);
+    if ( rc < 0 )
         goto out;
+    port = rc;
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    if ( rc )
+        goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
+    chn->u.unbound.remote_domid = remote_domid;
 
  out:
     spin_unlock(&d->event_lock);
 
-    return port;
+    return rc < 0 ? rc : port;
 }
 
 
--
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 Feb 06 15:12:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZl-0001lz-82; Fri, 06 Feb 2015 15: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 1YJkZk-0001lh-1A
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:08 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	D5/6C-02601-7C9D4D45; Fri, 06 Feb 2015 15:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1423235525!11841215!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13619 invoked from network); 6 Feb 2015 15:12: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;
	6 Feb 2015 15: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 1YJkZh-0007cu-JB
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZh-00048i-Hp
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:05 +0000
Date: Fri, 06 Feb 2015 15:12:05 +0000
Message-Id: <E1YJkZh-00048i-Hp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't expose XSAVES
	capability to PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 28f44faed97a3c935cfaf3737828deb5f9c1dad1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:27:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:27:56 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
    master date: 2015-01-22 12:47:56 +0100
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1f4b327..1c2cf17 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -754,7 +754,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -772,7 +772,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -840,9 +840,19 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 1cc3e37..8a2a51d 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -295,12 +298,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 unsigned int xstate_ctxt_size(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 89f1570..c8ed2a2 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -15,6 +15,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -34,6 +37,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct xsave_struct
--
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 Feb 06 15:12:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZl-0001lz-82; Fri, 06 Feb 2015 15: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 1YJkZk-0001lh-1A
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:08 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	D5/6C-02601-7C9D4D45; Fri, 06 Feb 2015 15:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1423235525!11841215!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13619 invoked from network); 6 Feb 2015 15:12: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;
	6 Feb 2015 15: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 1YJkZh-0007cu-JB
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZh-00048i-Hp
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:05 +0000
Date: Fri, 06 Feb 2015 15:12:05 +0000
Message-Id: <E1YJkZh-00048i-Hp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't expose XSAVES
	capability to PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 28f44faed97a3c935cfaf3737828deb5f9c1dad1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:27:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:27:56 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
    master date: 2015-01-22 12:47:56 +0100
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1f4b327..1c2cf17 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -754,7 +754,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -772,7 +772,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -840,9 +840,19 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 1cc3e37..8a2a51d 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -295,12 +298,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 unsigned int xstate_ctxt_size(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 89f1570..c8ed2a2 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -15,6 +15,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -34,6 +37,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct xsave_struct
--
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 Feb 06 15:12:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZv-0001rD-B4; Fri, 06 Feb 2015 15:12:19 +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 1YJkZu-0001qu-AR
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:18 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	F5/95-02991-1D9D4D45; Fri, 06 Feb 2015 15:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1423235535!11578865!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13874 invoked from network); 6 Feb 2015 15:12:16 -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;
	6 Feb 2015 15:12: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 1YJkZr-0007d1-OD
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZr-00049c-NE
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:15 +0000
Date: Fri, 06 Feb 2015 15:12:15 +0000
Message-Id: <E1YJkZr-00049c-NE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: correctly check for sub-leaf
	zero of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c81b665b5bb7b57abeeea0e004fdc2c80c97608
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:28:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:28:29 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
    master date: 2015-01-22 12:48:40 +0100
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1c2cf17..35f2c59 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -794,7 +794,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_PSE36, &d);
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -827,7 +827,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
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 Feb 06 15:12:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkZv-0001rD-B4; Fri, 06 Feb 2015 15:12:19 +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 1YJkZu-0001qu-AR
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:18 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	F5/95-02991-1D9D4D45; Fri, 06 Feb 2015 15:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1423235535!11578865!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13874 invoked from network); 6 Feb 2015 15:12:16 -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;
	6 Feb 2015 15:12: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 1YJkZr-0007d1-OD
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkZr-00049c-NE
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:15 +0000
Date: Fri, 06 Feb 2015 15:12:15 +0000
Message-Id: <E1YJkZr-00049c-NE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: correctly check for sub-leaf
	zero of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c81b665b5bb7b57abeeea0e004fdc2c80c97608
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:28:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:28:29 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
    master date: 2015-01-22 12:48:40 +0100
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1c2cf17..35f2c59 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -794,7 +794,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_PSE36, &d);
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -827,7 +827,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
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 Feb 06 15:12:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJka6-0001ss-F2; Fri, 06 Feb 2015 15:12: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 1YJka4-0001sY-Nk
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:28 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	F6/8C-03185-CD9D4D45; Fri, 06 Feb 2015 15:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1423235546!11188269!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32766 invoked from network); 6 Feb 2015 15:12:27 -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;
	6 Feb 2015 15: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 1YJka1-0007d9-UO
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJka1-00049z-SA
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:25 +0000
Date: Fri, 06 Feb 2015 15:12:25 +0000
Message-Id: <E1YJka1-00049z-SA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: vcpu_destroy_pagetables()
	must not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22d7558fbd22d68221234f0d03c2a042e554ed28
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Feb 3 15:28:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:28:58 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: de4f284b3d7b47d3b9807f354552ecf3e0fff56b
    master date: 2015-01-26 12:51:09 +0100
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ab9359f..275d71b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2693,7 +2693,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
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 Feb 06 15:12:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJka6-0001ss-F2; Fri, 06 Feb 2015 15:12: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 1YJka4-0001sY-Nk
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:28 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	F6/8C-03185-CD9D4D45; Fri, 06 Feb 2015 15:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1423235546!11188269!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32766 invoked from network); 6 Feb 2015 15:12:27 -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;
	6 Feb 2015 15: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 1YJka1-0007d9-UO
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJka1-00049z-SA
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:25 +0000
Date: Fri, 06 Feb 2015 15:12:25 +0000
Message-Id: <E1YJka1-00049z-SA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: vcpu_destroy_pagetables()
	must not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22d7558fbd22d68221234f0d03c2a042e554ed28
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Feb 3 15:28:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:28:58 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: de4f284b3d7b47d3b9807f354552ecf3e0fff56b
    master date: 2015-01-26 12:51:09 +0100
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ab9359f..275d71b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2693,7 +2693,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
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 Feb 06 15:12:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkaG-0001uK-I2; Fri, 06 Feb 2015 15:12:40 +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 1YJkaF-0001u6-LW
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:39 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	5A/7D-03164-6E9D4D45; Fri, 06 Feb 2015 15:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1423235556!11188324!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2279 invoked from network); 6 Feb 2015 15:12:38 -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;
	6 Feb 2015 15:12: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 1YJkaC-0007dJ-2Y
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkaC-0004AP-1d
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:36 +0000
Date: Fri, 06 Feb 2015 15:12:36 +0000
Message-Id: <E1YJkaC-0004AP-1d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] docs/commandline: correct
	information for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 47266d66b35572b7d2f7b7a5f53d6eab05604cd2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 15:29:41 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:29:41 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
    master date: 2015-01-28 16:31:07 +0100
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 757e46f..aa121fb 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1011,9 +1011,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
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 Feb 06 15:12:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkaG-0001uK-I2; Fri, 06 Feb 2015 15:12:40 +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 1YJkaF-0001u6-LW
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:39 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	5A/7D-03164-6E9D4D45; Fri, 06 Feb 2015 15:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1423235556!11188324!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2279 invoked from network); 6 Feb 2015 15:12:38 -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;
	6 Feb 2015 15:12: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 1YJkaC-0007dJ-2Y
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkaC-0004AP-1d
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:36 +0000
Date: Fri, 06 Feb 2015 15:12:36 +0000
Message-Id: <E1YJkaC-0004AP-1d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] docs/commandline: correct
	information for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 47266d66b35572b7d2f7b7a5f53d6eab05604cd2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 15:29:41 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:29:41 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
    master date: 2015-01-28 16:31:07 +0100
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 757e46f..aa121fb 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1011,9 +1011,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
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 Feb 06 15:12:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkaQ-0001vv-L1; Fri, 06 Feb 2015 15:12: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 1YJkaP-0001vc-Jf
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:49 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	A0/7F-02995-0F9D4D45; Fri, 06 Feb 2015 15:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1423235566!11181354!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22306 invoked from network); 6 Feb 2015 15:12:47 -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 Feb 2015 15: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 1YJkaM-0007dP-6g
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkaM-0004BE-5H
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:46 +0000
Date: Fri, 06 Feb 2015 15:12:46 +0000
Message-Id: <E1YJkaM-0004BE-5H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] bunzip2: off by one in
	get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef73de2a84a3042c3481c9a521e8e0c756b793f2
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue Feb 3 15:30:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:30:13 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 39798e95a954eec660a3f5f21489c30ef78daf6d
    master date: 2015-01-28 16:50:08 +0100
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
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 Feb 06 15:12:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2015 15: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 1YJkaQ-0001vv-L1; Fri, 06 Feb 2015 15:12: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 1YJkaP-0001vc-Jf
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:49 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	A0/7F-02995-0F9D4D45; Fri, 06 Feb 2015 15:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1423235566!11181354!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22306 invoked from network); 6 Feb 2015 15:12:47 -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 Feb 2015 15: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 1YJkaM-0007dP-6g
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJkaM-0004BE-5H
	for xen-changelog@lists.xensource.com; Fri, 06 Feb 2015 15:12:46 +0000
Date: Fri, 06 Feb 2015 15:12:46 +0000
Message-Id: <E1YJkaM-0004BE-5H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] bunzip2: off by one in
	get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef73de2a84a3042c3481c9a521e8e0c756b793f2
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue Feb 3 15:30:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:30:13 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 39798e95a954eec660a3f5f21489c30ef78daf6d
    master date: 2015-01-28 16:50:08 +0100
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
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 Sat Feb 07 02:33:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvCn-0003HP-WA; Sat, 07 Feb 2015 02:33: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 1YJvCm-0003HI-Ba
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:08 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	E9/A1-03164-36975D45; Sat, 07 Feb 2015 02:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1423276385!6239467!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23020 invoked from network); 7 Feb 2015 02:33: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;
	7 Feb 2015 02: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 1YJvCh-0006Sn-Po
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvCh-0002wL-EW
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:03 +0000
Date: Sat, 07 Feb 2015 02:33:03 +0000
Message-Id: <E1YJvCh-0002wL-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86emul: tighten CLFLUSH emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ad83ad993d1a42c61f4edd97eb5d6396a589ad48
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:15:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:15:03 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index fef97ea..8d01e41 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4400,7 +4400,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvCn-0003HP-WA; Sat, 07 Feb 2015 02:33: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 1YJvCm-0003HI-Ba
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:08 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	E9/A1-03164-36975D45; Sat, 07 Feb 2015 02:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1423276385!6239467!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23020 invoked from network); 7 Feb 2015 02:33: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;
	7 Feb 2015 02: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 1YJvCh-0006Sn-Po
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvCh-0002wL-EW
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:03 +0000
Date: Sat, 07 Feb 2015 02:33:03 +0000
Message-Id: <E1YJvCh-0002wL-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86emul: tighten CLFLUSH emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ad83ad993d1a42c61f4edd97eb5d6396a589ad48
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:15:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:15:03 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index fef97ea..8d01e41 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4400,7 +4400,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvCy-0003IP-3y; Sat, 07 Feb 2015 02:33: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 1YJvCw-0003I7-71
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:18 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A5/21-02749-D6975D45; Sat, 07 Feb 2015 02:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1423276396!12254122!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3835 invoked from network); 7 Feb 2015 02:33:17 -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;
	7 Feb 2015 02:33: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 1YJvCu-0006Sq-02
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvCt-0002wk-MU
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:15 +0000
Date: Sat, 07 Feb 2015 02:33:15 +0000
Message-Id: <E1YJvCt-0002wk-MU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] common/memory: fix an XSM error
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2fdd521e4801bfb45ba0e88ca820a8606aa5e1b7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:15:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:15:58 2015 +0100

    common/memory: fix an XSM error path
    
    XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
    return the extent at which failure was detected, not error indicators.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 76d4ff26d9647088353acaf4a56388a354a5d6e9
    master date: 2015-01-19 11:59:05 +0100
---
 xen/common/memory.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 234dae6..e84ace9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvCy-0003IP-3y; Sat, 07 Feb 2015 02:33: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 1YJvCw-0003I7-71
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:18 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A5/21-02749-D6975D45; Sat, 07 Feb 2015 02:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1423276396!12254122!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3835 invoked from network); 7 Feb 2015 02:33:17 -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;
	7 Feb 2015 02:33: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 1YJvCu-0006Sq-02
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvCt-0002wk-MU
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:15 +0000
Date: Sat, 07 Feb 2015 02:33:15 +0000
Message-Id: <E1YJvCt-0002wk-MU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] common/memory: fix an XSM error
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2fdd521e4801bfb45ba0e88ca820a8606aa5e1b7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:15:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:15:58 2015 +0100

    common/memory: fix an XSM error path
    
    XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
    return the extent at which failure was detected, not error indicators.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 76d4ff26d9647088353acaf4a56388a354a5d6e9
    master date: 2015-01-19 11:59:05 +0100
---
 xen/common/memory.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 234dae6..e84ace9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvD8-0003Jv-6c; Sat, 07 Feb 2015 02:33: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 1YJvD6-0003Ji-B7
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:28 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DB/5C-02754-77975D45; Sat, 07 Feb 2015 02:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1423276406!12303389!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10073 invoked from network); 7 Feb 2015 02:33:27 -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;
	7 Feb 2015 02: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 1YJvD4-0006T3-5X
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvD4-0002x7-4W
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:26 +0000
Date: Sat, 07 Feb 2015 02:33:26 +0000
Message-Id: <E1YJvD4-0002x7-4W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xsm/evtchn: never pretend to have
	successfully created a Xen event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4cfc54b1b81fb1a91080072b3250801c020a3134
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:16:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:16:30 2015 +0100

    xsm/evtchn: never pretend to have successfully created a Xen event channel
    
    Xen event channels are not internal resources.  They still have one end in a
    domain, and are created at the request of privileged domains.  This logic
    which "successfully" creates a Xen event channel opens up undesirable failure
    cases with ill-specified XSM policies.
    
    If a domain is permitted to create ioreq servers or memevent listeners, but
    not to create event channels, the ioreq/memevent creation will succeed but
    attempting to bind the returned event channel will fail without any indication
    of a permission error.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 09aa4759faa29c1fe735266de4c79f17329bd67b
    master date: 2015-01-20 10:42:26 +0100
---
 xen/common/event_channel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 7d6de54..eece46b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1155,21 +1155,25 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&d->event_lock);
 
-    if ( (port = get_free_port(d)) < 0 )
+    rc = get_free_port(d);
+    if ( rc < 0 )
         goto out;
+    port = rc;
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    if ( rc )
+        goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
+    chn->u.unbound.remote_domid = remote_domid;
 
  out:
     spin_unlock(&d->event_lock);
 
-    return port;
+    return rc < 0 ? rc : port;
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvD8-0003Jv-6c; Sat, 07 Feb 2015 02:33: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 1YJvD6-0003Ji-B7
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:28 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	DB/5C-02754-77975D45; Sat, 07 Feb 2015 02:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1423276406!12303389!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10073 invoked from network); 7 Feb 2015 02:33:27 -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;
	7 Feb 2015 02: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 1YJvD4-0006T3-5X
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvD4-0002x7-4W
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:26 +0000
Date: Sat, 07 Feb 2015 02:33:26 +0000
Message-Id: <E1YJvD4-0002x7-4W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xsm/evtchn: never pretend to have
	successfully created a Xen event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4cfc54b1b81fb1a91080072b3250801c020a3134
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:16:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:16:30 2015 +0100

    xsm/evtchn: never pretend to have successfully created a Xen event channel
    
    Xen event channels are not internal resources.  They still have one end in a
    domain, and are created at the request of privileged domains.  This logic
    which "successfully" creates a Xen event channel opens up undesirable failure
    cases with ill-specified XSM policies.
    
    If a domain is permitted to create ioreq servers or memevent listeners, but
    not to create event channels, the ioreq/memevent creation will succeed but
    attempting to bind the returned event channel will fail without any indication
    of a permission error.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 09aa4759faa29c1fe735266de4c79f17329bd67b
    master date: 2015-01-20 10:42:26 +0100
---
 xen/common/event_channel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 7d6de54..eece46b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1155,21 +1155,25 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&d->event_lock);
 
-    if ( (port = get_free_port(d)) < 0 )
+    rc = get_free_port(d);
+    if ( rc < 0 )
         goto out;
+    port = rc;
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    if ( rc )
+        goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
+    chn->u.unbound.remote_domid = remote_domid;
 
  out:
     spin_unlock(&d->event_lock);
 
-    return port;
+    return rc < 0 ? rc : port;
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvDI-0003M0-Bk; Sat, 07 Feb 2015 02:33: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 1YJvDH-0003Lk-7k
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:39 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	71/D1-03164-28975D45; Sat, 07 Feb 2015 02:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1423276416!11631185!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18637 invoked from network); 7 Feb 2015 02:33: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;
	7 Feb 2015 02: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 1YJvDE-0006TB-EC
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDE-0002xX-9l
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:36 +0000
Date: Sat, 07 Feb 2015 02:33:36 +0000
Message-Id: <E1YJvDE-0002xX-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: don't expose XSAVES
	capability to PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7788cbb0a59b932c2bc36823d23d52b65099c80a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:17:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:17:26 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
    master date: 2015-01-22 12:47:56 +0100
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 3cd8746..60eac8a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -772,7 +772,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -790,7 +790,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -866,9 +866,19 @@ void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 5f3b161..d5f5e3b 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -320,12 +323,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 8d21349..4c690db 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -16,6 +16,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -40,6 +43,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct __packed __attribute__((aligned (64))) xsave_struct
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:33: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 1YJvDI-0003M0-Bk; Sat, 07 Feb 2015 02:33: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 1YJvDH-0003Lk-7k
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:39 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	71/D1-03164-28975D45; Sat, 07 Feb 2015 02:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1423276416!11631185!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18637 invoked from network); 7 Feb 2015 02:33: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;
	7 Feb 2015 02: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 1YJvDE-0006TB-EC
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDE-0002xX-9l
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:36 +0000
Date: Sat, 07 Feb 2015 02:33:36 +0000
Message-Id: <E1YJvDE-0002xX-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: don't expose XSAVES
	capability to PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7788cbb0a59b932c2bc36823d23d52b65099c80a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:17:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:17:26 2015 +0100

    x86: don't expose XSAVES capability to PV guests
    
    As done by the recent Linux commit b65d6e17fe ("kvm: x86: mask out
    XSAVES") for KVM, we should also mask out XSAVES from what PV guests
    get to see as long as we don't emulate accesses to MSR_IA32_XSS.
    
    Actually, go beyond that: Just like for leaf 7, switch from
    blacklisting to whitelisting, i.e. only allow XSAVEOPT and XSAVEC for
    the time being. And do these overrides consistently for both Dom0 and
    DomU-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8d050ed1097ce5f4bf6a1d6806fb1e3471976adb
    master date: 2015-01-22 12:47:56 +0100
---
 xen/arch/x86/traps.c         |   16 +++++++++++++---
 xen/arch/x86/xstate.c        |   17 +++++++++++++++--
 xen/include/asm-x86/xstate.h |    4 ++++
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 3cd8746..60eac8a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -772,7 +772,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
         switch ( cpuid_leaf )
         {
-        case 0xd:
+        case XSTATE_CPUID:
         {
             unsigned int _eax, _ebx, _ecx, _edx;
             /* EBX value of main leaf 0 depends on enabled xsave features */
@@ -790,7 +790,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
                         b = _eax + _ebx;
                 }
             }
-        break;
+            goto xstate;
         }
         }
         goto out;
@@ -866,9 +866,19 @@ void pv_cpuid(struct cpu_user_regs *regs)
         a = c = d = 0;
         break;
 
-    case 0x0000000d: /* XSAVE */
+    case XSTATE_CPUID:
+    xstate:
         if ( !cpu_has_xsave )
             goto unsupported;
+        if ( regs->_ecx == 1 )
+        {
+            a &= XSTATE_FEATURE_XSAVEOPT |
+                 XSTATE_FEATURE_XSAVEC |
+                 (cpu_has_xgetbv1 ? XSTATE_FEATURE_XGETBV1 : 0) |
+                 (cpu_has_xsaves ? XSTATE_FEATURE_XSAVES : 0);
+            if ( !cpu_has_xsaves )
+                b = c = d = 0;
+        }
         break;
 
     case 0x80000001:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 5f3b161..d5f5e3b 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -14,7 +14,10 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsaveopt;
+static bool_t __read_mostly cpu_has_xsavec;
+bool_t __read_mostly cpu_has_xgetbv1;
+bool_t __read_mostly cpu_has_xsaves;
 
 /*
  * Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
@@ -320,12 +323,22 @@ void xstate_init(bool_t bsp)
         BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
-    /* Check XSAVEOPT feature. */
+    /* Check extended XSAVE features. */
     cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
     if ( bsp )
+    {
         cpu_has_xsaveopt = !!(eax & XSTATE_FEATURE_XSAVEOPT);
+        cpu_has_xsavec = !!(eax & XSTATE_FEATURE_XSAVEC);
+        /* XXX cpu_has_xgetbv1 = !!(eax & XSTATE_FEATURE_XGETBV1); */
+        /* XXX cpu_has_xsaves = !!(eax & XSTATE_FEATURE_XSAVES); */
+    }
     else
+    {
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
+        BUG_ON(!cpu_has_xsavec != !(eax & XSTATE_FEATURE_XSAVEC));
+        /* XXX BUG_ON(!cpu_has_xgetbv1 != !(eax & XSTATE_FEATURE_XGETBV1)); */
+        /* XXX BUG_ON(!cpu_has_xsaves != !(eax & XSTATE_FEATURE_XSAVES)); */
+    }
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 8d21349..4c690db 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -16,6 +16,9 @@
 
 #define XSTATE_CPUID              0x0000000d
 #define XSTATE_FEATURE_XSAVEOPT   (1 << 0)    /* sub-leaf 1, eax[bit 0] */
+#define XSTATE_FEATURE_XSAVEC     (1 << 1)    /* sub-leaf 1, eax[bit 1] */
+#define XSTATE_FEATURE_XGETBV1    (1 << 2)    /* sub-leaf 1, eax[bit 2] */
+#define XSTATE_FEATURE_XSAVES     (1 << 3)    /* sub-leaf 1, eax[bit 3] */
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
@@ -40,6 +43,7 @@
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
 
 extern u64 xfeature_mask;
+extern bool_t cpu_has_xsaves, cpu_has_xgetbv1;
 
 /* extended state save area */
 struct __packed __attribute__((aligned (64))) xsave_struct
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02: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 1YJvDR-0003NY-EP; Sat, 07 Feb 2015 02:33:49 +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 1YJvDR-0003NP-0U
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:49 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	0D/C9-02777-C8975D45; Sat, 07 Feb 2015 02:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1423276426!11916919!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10045 invoked from network); 7 Feb 2015 02:33:47 -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;
	7 Feb 2015 02:33: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 1YJvDO-0006TH-J6
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDO-0002xx-I2
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:46 +0000
Date: Sat, 07 Feb 2015 02:33:46 +0000
Message-Id: <E1YJvDO-0002xx-I2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: correctly check for sub-leaf
	zero of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4eec09f613778ef813bcc2d653b9930aeaf3755f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:17:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:17:59 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
    master date: 2015-01-22 12:48:40 +0100
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 60eac8a..61316ba 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -816,7 +816,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         }
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -851,7 +851,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:33:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02: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 1YJvDR-0003NY-EP; Sat, 07 Feb 2015 02:33:49 +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 1YJvDR-0003NP-0U
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:49 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	0D/C9-02777-C8975D45; Sat, 07 Feb 2015 02:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1423276426!11916919!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10045 invoked from network); 7 Feb 2015 02:33:47 -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;
	7 Feb 2015 02:33: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 1YJvDO-0006TH-J6
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDO-0002xx-I2
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:46 +0000
Date: Sat, 07 Feb 2015 02:33:46 +0000
Message-Id: <E1YJvDO-0002xx-I2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: correctly check for sub-leaf
	zero of leaf 7 in pv_cpuid()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4eec09f613778ef813bcc2d653b9930aeaf3755f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 12:17:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:17:59 2015 +0100

    x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
    
    Only the low 32 bits are relevant.
    
    For consistency also change a cast on regs->eax to regs->_eax.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2
    master date: 2015-01-22 12:48:40 +0100
---
 xen/arch/x86/traps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 60eac8a..61316ba 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -816,7 +816,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         }
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -851,7 +851,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvDc-0003PB-H9; Sat, 07 Feb 2015 02:34:00 +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 1YJvDb-0003Oz-HV
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:59 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	3A/7C-02754-69975D45; Sat, 07 Feb 2015 02:33:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1423276437!12273370!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26961 invoked from network); 7 Feb 2015 02:33:57 -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;
	7 Feb 2015 02:33: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 1YJvDY-0006TQ-SH
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDY-0002z2-Mo
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:56 +0000
Date: Sat, 07 Feb 2015 02:33:56 +0000
Message-Id: <E1YJvDY-0002z2-Mo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] handle XENMEM_get_vnumainfo in
	compat_memory_op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1acb3b6f12821597eac1aa8ce33578f3e26bc272
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Feb 3 12:18:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:18:36 2015 +0100

    handle XENMEM_get_vnumainfo in compat_memory_op
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5f6ec28f2c3c3ba17a0b7f2a1d98324665420f46
    master date: 2015-01-23 15:06:26 +0100
---
 xen/common/compat/memory.c |   48 ++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xlat.lst       |    2 +
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 06c90be..b258138 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -15,6 +15,7 @@ CHECK_TYPE(domid);
 #undef xen_domid_t
 
 CHECK_mem_access_op;
+CHECK_vmemrange;
 
 int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
@@ -32,12 +33,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             struct xen_add_to_physmap *atp;
             struct xen_add_to_physmap_batch *atpb;
             struct xen_remove_from_physmap *xrfp;
+            struct xen_vnuma_topology_info *vnuma;
         } nat;
         union {
             struct compat_memory_reservation rsrv;
             struct compat_memory_exchange xchg;
             struct compat_add_to_physmap atp;
             struct compat_add_to_physmap_batch atpb;
+            struct compat_vnuma_topology_info vnuma;
         } cmp;
 
         set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
@@ -273,13 +276,50 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+        case XENMEM_get_vnumainfo:
+        {
+            enum XLAT_vnuma_topology_info_vdistance vdistance =
+                XLAT_vnuma_topology_info_vdistance_h;
+            enum XLAT_vnuma_topology_info_vcpu_to_vnode vcpu_to_vnode =
+                XLAT_vnuma_topology_info_vcpu_to_vnode_h;
+            enum XLAT_vnuma_topology_info_vmemrange vmemrange =
+                XLAT_vnuma_topology_info_vmemrange_h;
+
+            if ( copy_from_guest(&cmp.vnuma, compat, 1) )
+                return -EFAULT;
+
+#define XLAT_vnuma_topology_info_HNDL_vdistance_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vdistance.h, (_s_)->vdistance.h)
+#define XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vcpu_to_vnode.h, (_s_)->vcpu_to_vnode.h)
+#define XLAT_vnuma_topology_info_HNDL_vmemrange_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vmemrange.h, (_s_)->vmemrange.h)
+
+            XLAT_vnuma_topology_info(nat.vnuma, &cmp.vnuma);
+
+#undef XLAT_vnuma_topology_info_HNDL_vdistance_h
+#undef XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h
+#undef XLAT_vnuma_topology_info_HNDL_vmemrange_h
+            break;
+        }
+
         default:
             return compat_arch_memory_op(cmd, compat);
         }
 
         rc = do_memory_op(cmd, nat.hnd);
         if ( rc < 0 )
+        {
+            if ( rc == -ENOBUFS && op == XENMEM_get_vnumainfo )
+            {
+                cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+                cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+                cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+                if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                    rc = -EFAULT;
+            }
             break;
+        }
 
         cmd = 0;
         if ( hypercall_xlat_continuation(&cmd, 2, 0x02, nat.hnd, compat) )
@@ -398,6 +438,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_remove_from_physmap:
             break;
 
+        case XENMEM_get_vnumainfo:
+            cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+            cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+            cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+            if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                rc = -EFAULT;
+            break;
+
         default:
             domain_crash(current->domain);
             split = 0;
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 41b3e35..9c9fd9a 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -64,6 +64,8 @@
 ?	mem_access_op		memory.h
 !	pod_target			memory.h
 !	remove_from_physmap		memory.h
+?	vmemrange			memory.h
+!	vnuma_topology_info		memory.h
 ?	physdev_eoi			physdev.h
 ?	physdev_get_free_pirq		physdev.h
 ?	physdev_irq			physdev.h
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvDc-0003PB-H9; Sat, 07 Feb 2015 02:34:00 +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 1YJvDb-0003Oz-HV
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:59 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	3A/7C-02754-69975D45; Sat, 07 Feb 2015 02:33:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1423276437!12273370!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26961 invoked from network); 7 Feb 2015 02:33:57 -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;
	7 Feb 2015 02:33: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 1YJvDY-0006TQ-SH
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDY-0002z2-Mo
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:33:56 +0000
Date: Sat, 07 Feb 2015 02:33:56 +0000
Message-Id: <E1YJvDY-0002z2-Mo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] handle XENMEM_get_vnumainfo in
	compat_memory_op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1acb3b6f12821597eac1aa8ce33578f3e26bc272
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Feb 3 12:18:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:18:36 2015 +0100

    handle XENMEM_get_vnumainfo in compat_memory_op
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5f6ec28f2c3c3ba17a0b7f2a1d98324665420f46
    master date: 2015-01-23 15:06:26 +0100
---
 xen/common/compat/memory.c |   48 ++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xlat.lst       |    2 +
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 06c90be..b258138 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -15,6 +15,7 @@ CHECK_TYPE(domid);
 #undef xen_domid_t
 
 CHECK_mem_access_op;
+CHECK_vmemrange;
 
 int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
@@ -32,12 +33,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             struct xen_add_to_physmap *atp;
             struct xen_add_to_physmap_batch *atpb;
             struct xen_remove_from_physmap *xrfp;
+            struct xen_vnuma_topology_info *vnuma;
         } nat;
         union {
             struct compat_memory_reservation rsrv;
             struct compat_memory_exchange xchg;
             struct compat_add_to_physmap atp;
             struct compat_add_to_physmap_batch atpb;
+            struct compat_vnuma_topology_info vnuma;
         } cmp;
 
         set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
@@ -273,13 +276,50 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+        case XENMEM_get_vnumainfo:
+        {
+            enum XLAT_vnuma_topology_info_vdistance vdistance =
+                XLAT_vnuma_topology_info_vdistance_h;
+            enum XLAT_vnuma_topology_info_vcpu_to_vnode vcpu_to_vnode =
+                XLAT_vnuma_topology_info_vcpu_to_vnode_h;
+            enum XLAT_vnuma_topology_info_vmemrange vmemrange =
+                XLAT_vnuma_topology_info_vmemrange_h;
+
+            if ( copy_from_guest(&cmp.vnuma, compat, 1) )
+                return -EFAULT;
+
+#define XLAT_vnuma_topology_info_HNDL_vdistance_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vdistance.h, (_s_)->vdistance.h)
+#define XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vcpu_to_vnode.h, (_s_)->vcpu_to_vnode.h)
+#define XLAT_vnuma_topology_info_HNDL_vmemrange_h(_d_, _s_)		\
+            guest_from_compat_handle((_d_)->vmemrange.h, (_s_)->vmemrange.h)
+
+            XLAT_vnuma_topology_info(nat.vnuma, &cmp.vnuma);
+
+#undef XLAT_vnuma_topology_info_HNDL_vdistance_h
+#undef XLAT_vnuma_topology_info_HNDL_vcpu_to_vnode_h
+#undef XLAT_vnuma_topology_info_HNDL_vmemrange_h
+            break;
+        }
+
         default:
             return compat_arch_memory_op(cmd, compat);
         }
 
         rc = do_memory_op(cmd, nat.hnd);
         if ( rc < 0 )
+        {
+            if ( rc == -ENOBUFS && op == XENMEM_get_vnumainfo )
+            {
+                cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+                cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+                cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+                if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                    rc = -EFAULT;
+            }
             break;
+        }
 
         cmd = 0;
         if ( hypercall_xlat_continuation(&cmd, 2, 0x02, nat.hnd, compat) )
@@ -398,6 +438,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_remove_from_physmap:
             break;
 
+        case XENMEM_get_vnumainfo:
+            cmp.vnuma.nr_vnodes = nat.vnuma->nr_vnodes;
+            cmp.vnuma.nr_vcpus = nat.vnuma->nr_vcpus;
+            cmp.vnuma.nr_vmemranges = nat.vnuma->nr_vmemranges;
+            if ( __copy_to_guest(compat, &cmp.vnuma, 1) )
+                rc = -EFAULT;
+            break;
+
         default:
             domain_crash(current->domain);
             split = 0;
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 41b3e35..9c9fd9a 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -64,6 +64,8 @@
 ?	mem_access_op		memory.h
 !	pod_target			memory.h
 !	remove_from_physmap		memory.h
+?	vmemrange			memory.h
+!	vnuma_topology_info		memory.h
 ?	physdev_eoi			physdev.h
 ?	physdev_get_free_pirq		physdev.h
 ?	physdev_irq			physdev.h
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvDm-0003Ql-Jm; Sat, 07 Feb 2015 02:34: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 1YJvDl-0003QX-TR
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:10 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	9C/7A-02745-1A975D45; Sat, 07 Feb 2015 02:34:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1423276447!11248463!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4534 invoked from network); 7 Feb 2015 02:34:08 -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;
	7 Feb 2015 02:34: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 1YJvDj-0006Tz-1a
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDj-0002zY-0d
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:07 +0000
Date: Sat, 07 Feb 2015 02:34:07 +0000
Message-Id: <E1YJvDj-0002zY-0d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: vcpu_destroy_pagetables()
	must not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a777bedcbf4f273846ae33b01dd9c619e890f2d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Feb 3 12:20:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:20:44 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: de4f284b3d7b47d3b9807f354552ecf3e0fff56b
    master date: 2015-01-26 12:51:09 +0100
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6e9c2c0..d4965da 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2677,7 +2677,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvDm-0003Ql-Jm; Sat, 07 Feb 2015 02:34: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 1YJvDl-0003QX-TR
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:10 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	9C/7A-02745-1A975D45; Sat, 07 Feb 2015 02:34:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1423276447!11248463!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4534 invoked from network); 7 Feb 2015 02:34:08 -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;
	7 Feb 2015 02:34: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 1YJvDj-0006Tz-1a
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDj-0002zY-0d
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:07 +0000
Date: Sat, 07 Feb 2015 02:34:07 +0000
Message-Id: <E1YJvDj-0002zY-0d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: vcpu_destroy_pagetables()
	must not return -EINTR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a777bedcbf4f273846ae33b01dd9c619e890f2d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Feb 3 12:20:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:20:44 2015 +0100

    x86: vcpu_destroy_pagetables() must not return -EINTR
    
    .. otherwise it has the side effect that: domain_relinquish_resources
    will stop and will return to user-space with -EINTR which it is not
    equipped to deal with that error code; or vcpu_reset - which will
    ignore it and convert the error to -ENOMEM..
    
    The preemption mechanism we have for domain destruction is to return
    -EAGAIN (and then user-space calls the hypercall again) and as such we need
    to catch the case of:
    
    domain_relinquish_resources
      ->vcpu_destroy_pagetables
        -> put_page_and_type_preemptible
           -> __put_page_type
               returns -EINTR
    
    and convert it to the proper type. For:
    
    XEN_DOMCTL_setvcpucontext
     -> vcpu_reset
       -> vcpu_destroy_pagetables
    
    we need to return -ERESTART otherwise we end up returning -ENOMEM.
    
    There are also other callers of vcpu_destroy_pagetables: arch_vcpu_reset
    (vcpu_reset) are:
     - hvm_s3_suspend (asserts on any return code),
     - vlapic_init_sipi_one (asserts on any return code),
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: de4f284b3d7b47d3b9807f354552ecf3e0fff56b
    master date: 2015-01-26 12:51:09 +0100
---
 xen/arch/x86/mm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6e9c2c0..d4965da 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2677,7 +2677,11 @@ int vcpu_destroy_pagetables(struct vcpu *v)
 
     v->arch.cr3 = 0;
 
-    return rc;
+    /*
+     * put_page_and_type_preemptible() is liable to return -EINTR. The
+     * callers of us expect -ERESTART so convert it over.
+     */
+    return rc != -EINTR ? rc : -ERESTART;
 }
 
 int new_guest_cr3(unsigned long mfn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvDw-0003SE-MM; Sat, 07 Feb 2015 02:34: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 1YJvDv-0003S1-Ru
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:19 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	57/60-02757-BA975D45; Sat, 07 Feb 2015 02:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1423276457!7527396!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5254 invoked from network); 7 Feb 2015 02:34:18 -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;
	7 Feb 2015 02:34: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 1YJvDt-0006U8-CM
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDt-0002zx-6A
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:17 +0000
Date: Sat, 07 Feb 2015 02:34:17 +0000
Message-Id: <E1YJvDt-0002zx-6A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] docs/commandline: correct
	information for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a855b35ddf9edb69afd23d02908bb1d4bdf9a14
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:21:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:21:38 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
    master date: 2015-01-28 16:31:07 +0100
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 17cf563..53070c0 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1362,9 +1362,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvDw-0003SE-MM; Sat, 07 Feb 2015 02:34: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 1YJvDv-0003S1-Ru
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:19 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	57/60-02757-BA975D45; Sat, 07 Feb 2015 02:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1423276457!7527396!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5254 invoked from network); 7 Feb 2015 02:34:18 -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;
	7 Feb 2015 02:34: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 1YJvDt-0006U8-CM
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvDt-0002zx-6A
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:17 +0000
Date: Sat, 07 Feb 2015 02:34:17 +0000
Message-Id: <E1YJvDt-0002zx-6A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] docs/commandline: correct
	information for 'x2apic_phys' parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a855b35ddf9edb69afd23d02908bb1d4bdf9a14
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 12:21:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:21:38 2015 +0100

    docs/commandline: correct information for 'x2apic_phys' parameter
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 89c381c30b46ec714f2d5bef4b0cb6d759abc7e4
    master date: 2015-01-28 16:31:07 +0100
---
 docs/misc/xen-command-line.markdown |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 17cf563..53070c0 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1362,9 +1362,11 @@ Permit use of x2apic setup for SMP environments.
 ### x2apic\_phys
 > `= <boolean>`
 
-> Default: `true`
+> Default: `true` if **FADT** mandates physical mode, `false` otherwise.
 
-Use the x2apic physical apic driver.  The alternative is the x2apic cluster driver.
+In the case that x2apic is in use, this option switches between physical and
+clustered mode.  The default, given no hint from the **FADT**, is cluster
+mode.
 
 ### xsave
 > `= <boolean>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvE7-0003Tq-P1; Sat, 07 Feb 2015 02:34: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 1YJvE6-0003Tb-Ms
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:30 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	27/9A-02745-5B975D45; Sat, 07 Feb 2015 02:34:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1423276467!11293271!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13699 invoked from network); 7 Feb 2015 02:34:28 -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;
	7 Feb 2015 02:34: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 1YJvE3-0006UE-Hw
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvE3-00030P-G5
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:27 +0000
Date: Sat, 07 Feb 2015 02:34:27 +0000
Message-Id: <E1YJvE3-00030P-G5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] bunzip2: off by one in
	get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8e78d691d9b4bcc945d8f0b0ed2b48713931c4d
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue Feb 3 12:22:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:22:01 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 39798e95a954eec660a3f5f21489c30ef78daf6d
    master date: 2015-01-28 16:50:08 +0100
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 07 02:34:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Feb 2015 02:34: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 1YJvE7-0003Tq-P1; Sat, 07 Feb 2015 02:34: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 1YJvE6-0003Tb-Ms
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:30 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	27/9A-02745-5B975D45; Sat, 07 Feb 2015 02:34:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1423276467!11293271!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13699 invoked from network); 7 Feb 2015 02:34:28 -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;
	7 Feb 2015 02:34: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 1YJvE3-0006UE-Hw
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YJvE3-00030P-G5
	for xen-changelog@lists.xensource.com; Sat, 07 Feb 2015 02:34:27 +0000
Date: Sat, 07 Feb 2015 02:34:27 +0000
Message-Id: <E1YJvE3-00030P-G5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] bunzip2: off by one in
	get_next_block()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8e78d691d9b4bcc945d8f0b0ed2b48713931c4d
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue Feb 3 12:22:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 12:22:01 2015 +0100

    bunzip2: off by one in get_next_block()
    
    "origPtr" is used as an offset into the bd->dbuf[] array.  That array is
    allocated in start_bunzip() and has "bd->dbufSize" number of elements so
    the test here should be >= instead of >.
    
    Later we check "origPtr" again before using it as an offset so I don't
    know if this bug can be triggered in real life.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    
    Trivial adjustments to make the respective Linux commit
    b5c8afe5be51078a979d86ae5ae78c4ac948063d apply to Xen.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 39798e95a954eec660a3f5f21489c30ef78daf6d
    master date: 2015-01-28 16:50:08 +0100
---
 xen/common/bunzip2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/bunzip2.c b/xen/common/bunzip2.c
index 2eb70ab..6d6e8b1 100644
--- a/xen/common/bunzip2.c
+++ b/xen/common/bunzip2.c
@@ -174,7 +174,7 @@ static int INIT get_next_block(struct bunzip_data *bd)
 	if (get_bits(bd, 1))
 		return RETVAL_OBSOLETE_INPUT;
 	origPtr = get_bits(bd, 24);
-	if (origPtr > dbufSize)
+	if (origPtr >= dbufSize)
 		return RETVAL_DATA_ERROR;
 	/* mapping table: if some byte values are never used (encoding things
 	   like ascii text), the compression code removes the gaps to have fewer
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Feb 10 07:11:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4yY-0005B7-7l; Tue, 10 Feb 2015 07:11:14 +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 1YL4yV-0005B2-Vo
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:12 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	F6/16-02754-F0FA9D45; Tue, 10 Feb 2015 07:11:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1423552268!12788557!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25499 invoked from network); 10 Feb 2015 07:11:09 -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;
	10 Feb 2015 07:11: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 1YL4yS-0005uS-K6
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yS-0004tF-9Q
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:08 +0000
Date: Tue, 10 Feb 2015 07:11:08 +0000
Message-Id: <E1YL4yS-0004tF-9Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] time: widen wallclock seconds to 64
	bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1890c4261d62ad4ddca23dc2305ae636b3b4c14
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:25:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:25:47 2015 +0100

    time: widen wallclock seconds to 64 bits
    
    Linux is in the process of converting their seconds representation to
    64 bits, so in order to support it consistently we should follow suit
    (which at some point in quite a few years we'd have to do anyway). To
    represent this in struct shared_info we leverage a 32-bit hole in
    x86-64's and arm's variant of the structure; for x86-32 guests the only
    (reasonable) choice we have is to put the extension in struct
    arch_shared_info.
    
    A note on the conditional suppressing the xen_wc_sec_hi helper macro
    definition in the ix86 case for hypervisor and tools: Neither of the
    two actually need this, and its presence causes the tools to fail to
    build (due to the inclusion of both the x86-64 and x86-32 variants of
    the header).
    
    As a secondary change, x86's do_platform_op() gets a pointless
    initializer as well as a pointless assignment of that same variable
    dropped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/include/xen-foreign/Makefile       |    2 +-
 tools/include/xen-foreign/reference.size |    4 ++--
 xen/arch/arm/time.c                      |    2 +-
 xen/arch/x86/platform_hypercall.c        |   24 +++++++++++++++---------
 xen/arch/x86/time.c                      |   25 +++++++++++++++++++------
 xen/include/public/arch-arm.h            |    1 +
 xen/include/public/arch-x86/xen-x86_32.h |    1 +
 xen/include/public/arch-x86/xen.h        |    4 ++++
 xen/include/public/domctl.h              |    4 ++--
 xen/include/public/platform.h            |   21 +++++++++++++++++++--
 xen/include/public/xen.h                 |    9 +++++++++
 xen/include/xen/sched.h                  |    2 +-
 xen/include/xen/time.h                   |    4 ++--
 xen/xsm/flask/hooks.c                    |    3 ++-
 xen/xsm/flask/policy/access_vectors      |    3 ++-
 15 files changed, 81 insertions(+), 28 deletions(-)

diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index ef8fc12..80a446a 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -17,7 +17,7 @@ clean:
 distclean: clean
 
 checker: checker.c $(headers)
-	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+	$(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -o $@ $<
 
 check-headers: checker
 	./checker > tmp.size
diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index ffe319e..a0409db 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -9,6 +9,6 @@ vcpu_guest_context        |     344     344    2800    5168
 arch_vcpu_info            |       0       0      24      16
 vcpu_time_info            |      32      32      32      32
 vcpu_info                 |      48      48      64      64
-arch_shared_info          |       0       0      24      48
-shared_info               |    1088    1088    2340    3136
+arch_shared_info          |       0       0      28      48
+shared_info               |    1088    1088    2344    3136
 
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 37b85cd..418748d 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -239,7 +239,7 @@ void update_vcpu_system_time(struct vcpu *v)
     /* XXX update shared_info->wc_* */
 }
 
-void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
 {
     d->time_offset_seconds = time_offset_seconds;
     /* XXX update guest visible wallclock time */
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a8dd434..b427852 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -187,7 +187,7 @@ static void resource_access(void *info)
 
 ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
-    ret_t ret = 0;
+    ret_t ret;
     struct xen_platform_op curop, *op = &curop;
 
     if ( copy_from_guest(op, u_xenpf_op, 1) )
@@ -212,14 +212,20 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     switch ( op->cmd )
     {
-    case XENPF_settime:
-    {
-        do_settime(op->u.settime.secs, 
-                   op->u.settime.nsecs, 
-                   op->u.settime.system_time);
-        ret = 0;
-    }
-    break;
+    case XENPF_settime32:
+        do_settime(op->u.settime32.secs,
+                   op->u.settime32.nsecs,
+                   op->u.settime32.system_time);
+        break;
+
+    case XENPF_settime64:
+        if ( likely(!op->u.settime64.mbz) )
+            do_settime(op->u.settime64.secs,
+                       op->u.settime64.nsecs,
+                       op->u.settime64.system_time);
+        else
+            ret = -EINVAL;
+        break;
 
     case XENPF_add_memtype:
     {
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 74c01e3..5aca202 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -47,7 +47,8 @@ string_param("clocksource", opt_clocksource);
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 DEFINE_SPINLOCK(rtc_lock);
 unsigned long pit0_ticks;
-static u32 wc_sec, wc_nsec; /* UTC time at last 'time update'. */
+static unsigned long wc_sec; /* UTC time at last 'time update'. */
+static unsigned int wc_nsec;
 static DEFINE_SPINLOCK(wc_lock);
 
 struct cpu_time {
@@ -902,6 +903,7 @@ void force_update_vcpu_system_time(struct vcpu *v)
 void update_domain_wallclock_time(struct domain *d)
 {
     uint32_t *wc_version;
+    unsigned long sec;
 
     spin_lock(&wc_lock);
 
@@ -909,8 +911,19 @@ void update_domain_wallclock_time(struct domain *d)
     *wc_version = version_update_begin(*wc_version);
     wmb();
 
-    shared_info(d, wc_sec)  = wc_sec + d->time_offset_seconds;
-    shared_info(d, wc_nsec) = wc_nsec;
+    sec = wc_sec + d->time_offset_seconds;
+    if ( likely(!has_32bit_shinfo(d)) )
+    {
+        d->shared_info->native.wc_sec    = sec;
+        d->shared_info->native.wc_nsec   = wc_nsec;
+        d->shared_info->native.wc_sec_hi = sec >> 32;
+    }
+    else
+    {
+        d->shared_info->compat.wc_sec         = sec;
+        d->shared_info->compat.wc_nsec        = wc_nsec;
+        d->shared_info->compat.arch.wc_sec_hi = sec >> 32;
+    }
 
     wmb();
     *wc_version = version_update_end(*wc_version);
@@ -931,7 +944,7 @@ static void update_domain_rtc(void)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
 {
     d->time_offset_seconds = time_offset_seconds;
     if ( is_hvm_domain(d) )
@@ -976,13 +989,13 @@ int cpu_frequency_change(u64 freq)
 }
 
 /* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
-void do_settime(unsigned long secs, unsigned long nsecs, u64 system_time_base)
+void do_settime(unsigned long secs, unsigned int nsecs, u64 system_time_base)
 {
     u64 x;
     u32 y;
     struct domain *d;
 
-    x = SECONDS(secs) + (u64)nsecs - system_time_base;
+    x = SECONDS(secs) + nsecs - system_time_base;
     y = do_div(x, 1000000000);
 
     spin_lock(&wc_lock);
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 124fc90..c2dcb66 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -165,6 +165,7 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
diff --git a/xen/include/public/arch-x86/xen-x86_32.h b/xen/include/public/arch-x86/xen-x86_32.h
index 1504191..be9a6c6 100644
--- a/xen/include/public/arch-x86/xen-x86_32.h
+++ b/xen/include/public/arch-x86/xen-x86_32.h
@@ -104,6 +104,7 @@
     do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0;   \
          (hnd).p = val;                                     \
     } while ( 0 )
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 #define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index c5e880b..232d4a5 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -255,6 +255,10 @@ struct arch_shared_info {
     unsigned long p2m_cr3;         /* cr3 value of the p2m address space */
     unsigned long p2m_vaddr;       /* virtual address of the p2m list */
     unsigned long p2m_generation;  /* generation count of p2m mapping */
+#ifdef __i386__
+    /* There's no room for this field in the generic structure. */
+    uint32_t wc_sec_hi;
+#endif
 };
 typedef struct arch_shared_info arch_shared_info_t;
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 57e2ed7..b3413a2 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -37,7 +37,7 @@
 #include "hvm/save.h"
 #include "memory.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000a
+#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000b
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -449,7 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
 
 /* XEN_DOMCTL_settimeoffset */
 struct xen_domctl_settimeoffset {
-    int32_t  time_offset_seconds; /* applied to domain wallclock time */
+    int64_aligned_t time_offset_seconds; /* applied to domain wallclock time */
 };
 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index 3e340b4..e4cf65f 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -35,13 +35,28 @@
  * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
  * 1 January, 1970 if the current system time was <system_time>.
  */
-#define XENPF_settime             17
-struct xenpf_settime {
+#define XENPF_settime32           17
+struct xenpf_settime32 {
     /* IN variables. */
     uint32_t secs;
     uint32_t nsecs;
     uint64_t system_time;
 };
+#define XENPF_settime64           62
+struct xenpf_settime64 {
+    /* IN variables. */
+    uint64_t secs;
+    uint32_t nsecs;
+    uint32_t mbz;
+    uint64_t system_time;
+};
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
+#define XENPF_settime XENPF_settime32
+#define xenpf_settime xenpf_settime32
+#else
+#define XENPF_settime XENPF_settime64
+#define xenpf_settime xenpf_settime64
+#endif
 typedef struct xenpf_settime xenpf_settime_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
 
@@ -579,6 +594,8 @@ struct xen_platform_op {
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
     union {
         struct xenpf_settime           settime;
+        struct xenpf_settime32         settime32;
+        struct xenpf_settime64         settime64;
         struct xenpf_add_memtype       add_memtype;
         struct xenpf_del_memtype       del_memtype;
         struct xenpf_read_memtype      read_memtype;
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index a6a2092..3703c39 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -682,6 +682,12 @@ struct shared_info {
     uint32_t wc_version;      /* Version counter: see vcpu_time_info_t. */
     uint32_t wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
     uint32_t wc_nsec;         /* Nsecs 00:00:00 UTC, Jan 1, 1970.  */
+#if !defined(__i386__)
+    uint32_t wc_sec_hi;
+# define xen_wc_sec_hi wc_sec_hi
+#elif !defined(__XEN__) && !defined(__XEN_TOOLS__)
+# define xen_wc_sec_hi arch.wc_sec_hi
+#endif
 
     struct arch_shared_info arch;
 
@@ -870,6 +876,9 @@ __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t);
 /* Default definitions for macros used by domctl/sysctl. */
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 
+#ifndef int64_aligned_t
+#define int64_aligned_t int64_t
+#endif
 #ifndef uint64_aligned_t
 #define uint64_aligned_t uint64_t
 #endif
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 814e087..ccd7ed8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -359,7 +359,7 @@ struct domain
     /* Domain is paused by controller software? */
     int              controller_pause_count;
 
-    int32_t          time_offset_seconds;
+    int64_t          time_offset_seconds;
 
 #ifdef HAS_PASSTHROUGH
     /* Does this guest need iommu mappings (-1 meaning "being set up")? */
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index bb6259d..bb19511 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -65,11 +65,11 @@ extern void update_vcpu_system_time(struct vcpu *v);
 extern void update_domain_wallclock_time(struct domain *d);
 
 extern void do_settime(
-    unsigned long secs, unsigned long nsecs, u64 system_time_base);
+    unsigned long secs, unsigned int nsecs, u64 system_time_base);
 
 extern void send_timer_event(struct vcpu *v);
 
-void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds);
+void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds);
 
 #include <asm/time.h>
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d48463f..65094bb 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1365,7 +1365,8 @@ static int flask_platform_op(uint32_t op)
         return 0;
 #endif
 
-    case XENPF_settime:
+    case XENPF_settime32:
+    case XENPF_settime64:
         return domain_has_xen(current->domain, XEN__SETTIME);
 
     case XENPF_add_memtype:
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 1da9f63..8f44b9d 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -8,7 +8,8 @@
 # executing the hypercall, and the target is the xen initial sid (type xen_t).
 class xen
 {
-# XENPF_settime
+# XENPF_settime32
+# XENPF_settime64
     settime
 # XEN_SYSCTL_tbuf_op
     tbufcontrol
--
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 Tue Feb 10 07:11:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4yY-0005B7-7l; Tue, 10 Feb 2015 07:11:14 +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 1YL4yV-0005B2-Vo
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:12 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	F6/16-02754-F0FA9D45; Tue, 10 Feb 2015 07:11:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1423552268!12788557!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25499 invoked from network); 10 Feb 2015 07:11:09 -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;
	10 Feb 2015 07:11: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 1YL4yS-0005uS-K6
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yS-0004tF-9Q
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:08 +0000
Date: Tue, 10 Feb 2015 07:11:08 +0000
Message-Id: <E1YL4yS-0004tF-9Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] time: widen wallclock seconds to 64
	bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1890c4261d62ad4ddca23dc2305ae636b3b4c14
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:25:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:25:47 2015 +0100

    time: widen wallclock seconds to 64 bits
    
    Linux is in the process of converting their seconds representation to
    64 bits, so in order to support it consistently we should follow suit
    (which at some point in quite a few years we'd have to do anyway). To
    represent this in struct shared_info we leverage a 32-bit hole in
    x86-64's and arm's variant of the structure; for x86-32 guests the only
    (reasonable) choice we have is to put the extension in struct
    arch_shared_info.
    
    A note on the conditional suppressing the xen_wc_sec_hi helper macro
    definition in the ix86 case for hypervisor and tools: Neither of the
    two actually need this, and its presence causes the tools to fail to
    build (due to the inclusion of both the x86-64 and x86-32 variants of
    the header).
    
    As a secondary change, x86's do_platform_op() gets a pointless
    initializer as well as a pointless assignment of that same variable
    dropped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/include/xen-foreign/Makefile       |    2 +-
 tools/include/xen-foreign/reference.size |    4 ++--
 xen/arch/arm/time.c                      |    2 +-
 xen/arch/x86/platform_hypercall.c        |   24 +++++++++++++++---------
 xen/arch/x86/time.c                      |   25 +++++++++++++++++++------
 xen/include/public/arch-arm.h            |    1 +
 xen/include/public/arch-x86/xen-x86_32.h |    1 +
 xen/include/public/arch-x86/xen.h        |    4 ++++
 xen/include/public/domctl.h              |    4 ++--
 xen/include/public/platform.h            |   21 +++++++++++++++++++--
 xen/include/public/xen.h                 |    9 +++++++++
 xen/include/xen/sched.h                  |    2 +-
 xen/include/xen/time.h                   |    4 ++--
 xen/xsm/flask/hooks.c                    |    3 ++-
 xen/xsm/flask/policy/access_vectors      |    3 ++-
 15 files changed, 81 insertions(+), 28 deletions(-)

diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index ef8fc12..80a446a 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -17,7 +17,7 @@ clean:
 distclean: clean
 
 checker: checker.c $(headers)
-	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+	$(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -o $@ $<
 
 check-headers: checker
 	./checker > tmp.size
diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index ffe319e..a0409db 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -9,6 +9,6 @@ vcpu_guest_context        |     344     344    2800    5168
 arch_vcpu_info            |       0       0      24      16
 vcpu_time_info            |      32      32      32      32
 vcpu_info                 |      48      48      64      64
-arch_shared_info          |       0       0      24      48
-shared_info               |    1088    1088    2340    3136
+arch_shared_info          |       0       0      28      48
+shared_info               |    1088    1088    2344    3136
 
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 37b85cd..418748d 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -239,7 +239,7 @@ void update_vcpu_system_time(struct vcpu *v)
     /* XXX update shared_info->wc_* */
 }
 
-void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
 {
     d->time_offset_seconds = time_offset_seconds;
     /* XXX update guest visible wallclock time */
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a8dd434..b427852 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -187,7 +187,7 @@ static void resource_access(void *info)
 
 ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
-    ret_t ret = 0;
+    ret_t ret;
     struct xen_platform_op curop, *op = &curop;
 
     if ( copy_from_guest(op, u_xenpf_op, 1) )
@@ -212,14 +212,20 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     switch ( op->cmd )
     {
-    case XENPF_settime:
-    {
-        do_settime(op->u.settime.secs, 
-                   op->u.settime.nsecs, 
-                   op->u.settime.system_time);
-        ret = 0;
-    }
-    break;
+    case XENPF_settime32:
+        do_settime(op->u.settime32.secs,
+                   op->u.settime32.nsecs,
+                   op->u.settime32.system_time);
+        break;
+
+    case XENPF_settime64:
+        if ( likely(!op->u.settime64.mbz) )
+            do_settime(op->u.settime64.secs,
+                       op->u.settime64.nsecs,
+                       op->u.settime64.system_time);
+        else
+            ret = -EINVAL;
+        break;
 
     case XENPF_add_memtype:
     {
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 74c01e3..5aca202 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -47,7 +47,8 @@ string_param("clocksource", opt_clocksource);
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 DEFINE_SPINLOCK(rtc_lock);
 unsigned long pit0_ticks;
-static u32 wc_sec, wc_nsec; /* UTC time at last 'time update'. */
+static unsigned long wc_sec; /* UTC time at last 'time update'. */
+static unsigned int wc_nsec;
 static DEFINE_SPINLOCK(wc_lock);
 
 struct cpu_time {
@@ -902,6 +903,7 @@ void force_update_vcpu_system_time(struct vcpu *v)
 void update_domain_wallclock_time(struct domain *d)
 {
     uint32_t *wc_version;
+    unsigned long sec;
 
     spin_lock(&wc_lock);
 
@@ -909,8 +911,19 @@ void update_domain_wallclock_time(struct domain *d)
     *wc_version = version_update_begin(*wc_version);
     wmb();
 
-    shared_info(d, wc_sec)  = wc_sec + d->time_offset_seconds;
-    shared_info(d, wc_nsec) = wc_nsec;
+    sec = wc_sec + d->time_offset_seconds;
+    if ( likely(!has_32bit_shinfo(d)) )
+    {
+        d->shared_info->native.wc_sec    = sec;
+        d->shared_info->native.wc_nsec   = wc_nsec;
+        d->shared_info->native.wc_sec_hi = sec >> 32;
+    }
+    else
+    {
+        d->shared_info->compat.wc_sec         = sec;
+        d->shared_info->compat.wc_nsec        = wc_nsec;
+        d->shared_info->compat.arch.wc_sec_hi = sec >> 32;
+    }
 
     wmb();
     *wc_version = version_update_end(*wc_version);
@@ -931,7 +944,7 @@ static void update_domain_rtc(void)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
 {
     d->time_offset_seconds = time_offset_seconds;
     if ( is_hvm_domain(d) )
@@ -976,13 +989,13 @@ int cpu_frequency_change(u64 freq)
 }
 
 /* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
-void do_settime(unsigned long secs, unsigned long nsecs, u64 system_time_base)
+void do_settime(unsigned long secs, unsigned int nsecs, u64 system_time_base)
 {
     u64 x;
     u32 y;
     struct domain *d;
 
-    x = SECONDS(secs) + (u64)nsecs - system_time_base;
+    x = SECONDS(secs) + nsecs - system_time_base;
     y = do_div(x, 1000000000);
 
     spin_lock(&wc_lock);
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 124fc90..c2dcb66 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -165,6 +165,7 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
diff --git a/xen/include/public/arch-x86/xen-x86_32.h b/xen/include/public/arch-x86/xen-x86_32.h
index 1504191..be9a6c6 100644
--- a/xen/include/public/arch-x86/xen-x86_32.h
+++ b/xen/include/public/arch-x86/xen-x86_32.h
@@ -104,6 +104,7 @@
     do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0;   \
          (hnd).p = val;                                     \
     } while ( 0 )
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 #define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index c5e880b..232d4a5 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -255,6 +255,10 @@ struct arch_shared_info {
     unsigned long p2m_cr3;         /* cr3 value of the p2m address space */
     unsigned long p2m_vaddr;       /* virtual address of the p2m list */
     unsigned long p2m_generation;  /* generation count of p2m mapping */
+#ifdef __i386__
+    /* There's no room for this field in the generic structure. */
+    uint32_t wc_sec_hi;
+#endif
 };
 typedef struct arch_shared_info arch_shared_info_t;
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 57e2ed7..b3413a2 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -37,7 +37,7 @@
 #include "hvm/save.h"
 #include "memory.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000a
+#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000b
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -449,7 +449,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
 
 /* XEN_DOMCTL_settimeoffset */
 struct xen_domctl_settimeoffset {
-    int32_t  time_offset_seconds; /* applied to domain wallclock time */
+    int64_aligned_t time_offset_seconds; /* applied to domain wallclock time */
 };
 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index 3e340b4..e4cf65f 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -35,13 +35,28 @@
  * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
  * 1 January, 1970 if the current system time was <system_time>.
  */
-#define XENPF_settime             17
-struct xenpf_settime {
+#define XENPF_settime32           17
+struct xenpf_settime32 {
     /* IN variables. */
     uint32_t secs;
     uint32_t nsecs;
     uint64_t system_time;
 };
+#define XENPF_settime64           62
+struct xenpf_settime64 {
+    /* IN variables. */
+    uint64_t secs;
+    uint32_t nsecs;
+    uint32_t mbz;
+    uint64_t system_time;
+};
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
+#define XENPF_settime XENPF_settime32
+#define xenpf_settime xenpf_settime32
+#else
+#define XENPF_settime XENPF_settime64
+#define xenpf_settime xenpf_settime64
+#endif
 typedef struct xenpf_settime xenpf_settime_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
 
@@ -579,6 +594,8 @@ struct xen_platform_op {
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
     union {
         struct xenpf_settime           settime;
+        struct xenpf_settime32         settime32;
+        struct xenpf_settime64         settime64;
         struct xenpf_add_memtype       add_memtype;
         struct xenpf_del_memtype       del_memtype;
         struct xenpf_read_memtype      read_memtype;
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index a6a2092..3703c39 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -682,6 +682,12 @@ struct shared_info {
     uint32_t wc_version;      /* Version counter: see vcpu_time_info_t. */
     uint32_t wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
     uint32_t wc_nsec;         /* Nsecs 00:00:00 UTC, Jan 1, 1970.  */
+#if !defined(__i386__)
+    uint32_t wc_sec_hi;
+# define xen_wc_sec_hi wc_sec_hi
+#elif !defined(__XEN__) && !defined(__XEN_TOOLS__)
+# define xen_wc_sec_hi arch.wc_sec_hi
+#endif
 
     struct arch_shared_info arch;
 
@@ -870,6 +876,9 @@ __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t);
 /* Default definitions for macros used by domctl/sysctl. */
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 
+#ifndef int64_aligned_t
+#define int64_aligned_t int64_t
+#endif
 #ifndef uint64_aligned_t
 #define uint64_aligned_t uint64_t
 #endif
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 814e087..ccd7ed8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -359,7 +359,7 @@ struct domain
     /* Domain is paused by controller software? */
     int              controller_pause_count;
 
-    int32_t          time_offset_seconds;
+    int64_t          time_offset_seconds;
 
 #ifdef HAS_PASSTHROUGH
     /* Does this guest need iommu mappings (-1 meaning "being set up")? */
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index bb6259d..bb19511 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -65,11 +65,11 @@ extern void update_vcpu_system_time(struct vcpu *v);
 extern void update_domain_wallclock_time(struct domain *d);
 
 extern void do_settime(
-    unsigned long secs, unsigned long nsecs, u64 system_time_base);
+    unsigned long secs, unsigned int nsecs, u64 system_time_base);
 
 extern void send_timer_event(struct vcpu *v);
 
-void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds);
+void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds);
 
 #include <asm/time.h>
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d48463f..65094bb 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1365,7 +1365,8 @@ static int flask_platform_op(uint32_t op)
         return 0;
 #endif
 
-    case XENPF_settime:
+    case XENPF_settime32:
+    case XENPF_settime64:
         return domain_has_xen(current->domain, XEN__SETTIME);
 
     case XENPF_add_memtype:
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 1da9f63..8f44b9d 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -8,7 +8,8 @@
 # executing the hypercall, and the target is the xen initial sid (type xen_t).
 class xen
 {
-# XENPF_settime
+# XENPF_settime32
+# XENPF_settime64
     settime
 # XEN_SYSCTL_tbuf_op
     tbufcontrol
--
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 Tue Feb 10 07:11:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4yi-0005MW-Ae; Tue, 10 Feb 2015 07:11:24 +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 1YL4yg-0005Hi-17
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:22 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	74/1D-02749-91FA9D45; Tue, 10 Feb 2015 07:11:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1423552279!12854795!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5370 invoked from network); 10 Feb 2015 07:11:20 -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;
	10 Feb 2015 07:11: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 1YL4yd-0005uV-LM
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yd-0004ua-Cu
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:19 +0000
Date: Tue, 10 Feb 2015 07:11:19 +0000
Message-Id: <E1YL4yd-0004ua-Cu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: introduce a p2m class
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8fe99c468d977ee077ef064618973e0aca578117
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Tue Feb 3 11:27:46 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:27:46 2015 +0100

    x86/mm: introduce a p2m class
    
    Use the class to differentiate between host and nested p2m's, and
    potentially other classes in the future.
    
    Fix p2m class checks that implicitly assume nested and host are
    the only two classes that will ever exist.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c           |    2 +-
 xen/arch/x86/mm/guest_walk.c     |    2 +-
 xen/arch/x86/mm/hap/guest_walk.c |    4 ++--
 xen/arch/x86/mm/p2m-ept.c        |    4 ++--
 xen/arch/x86/mm/p2m.c            |   10 ++++++----
 xen/include/asm-x86/p2m.h        |   17 ++++++++++++++++-
 6 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index fd2314e..9e26342 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2914,7 +2914,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     /* Mem sharing: unshare the page and try again */
     if ( npfec.write_access && (p2mt == p2m_ram_shared) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         sharing_enomem = 
             (mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0);
         rc = 1;
diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index 1b26175..d8f5a35 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -99,7 +99,7 @@ void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
                                  q);
     if ( p2m_is_paging(*p2mt) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         if ( page )
             put_page(page);
         p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
diff --git a/xen/arch/x86/mm/hap/guest_walk.c b/xen/arch/x86/mm/hap/guest_walk.c
index 25d9792..381a196 100644
--- a/xen/arch/x86/mm/hap/guest_walk.c
+++ b/xen/arch/x86/mm/hap/guest_walk.c
@@ -64,7 +64,7 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
                                      &p2mt, NULL, P2M_ALLOC | P2M_UNSHARE);
     if ( p2m_is_paging(p2mt) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         pfec[0] = PFEC_page_paged;
         if ( top_page )
             put_page(top_page);
@@ -106,7 +106,7 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
             put_page(page);
         if ( p2m_is_paging(p2mt) )
         {
-            ASSERT(!p2m_is_nestedp2m(p2m));
+            ASSERT(p2m_is_hostp2m(p2m));
             pfec[0] = PFEC_page_paged;
             p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
             return INVALID_GFN;
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index e21a92d..c2d7720 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -769,8 +769,8 @@ out:
     if ( needs_sync != sync_off )
         ept_sync_domain(p2m);
 
-    /* For non-nested p2m, may need to change VT-d page table.*/
-    if ( rc == 0 && !p2m_is_nestedp2m(p2m) && need_iommu(d) &&
+    /* For host p2m, may need to change VT-d page table.*/
+    if ( rc == 0 && p2m_is_hostp2m(p2m) && need_iommu(d) &&
          need_modify_vtd_table )
     {
         if ( iommu_hap_pt_share )
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index c1b7545..6a06e9f 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -71,6 +71,7 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->domain = d;
     p2m->default_access = p2m_access_rwx;
+    p2m->p2m_class = p2m_host;
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
@@ -158,6 +159,7 @@ static int p2m_init_nestedp2m(struct domain *d)
             p2m_teardown_nestedp2m(d);
             return -ENOMEM;
         }
+        p2m->p2m_class = p2m_nested;
         p2m->write_p2m_entry = nestedp2m_write_p2m_entry;
         list_add(&p2m->np2m_list, &p2m_get_hostp2m(d)->np2m_list);
     }
@@ -202,7 +204,7 @@ int p2m_init(struct domain *d)
 int p2m_is_logdirty_range(struct p2m_domain *p2m, unsigned long start,
                           unsigned long end)
 {
-    ASSERT(!p2m_is_nestedp2m(p2m));
+    ASSERT(p2m_is_hostp2m(p2m));
     if ( p2m->global_logdirty ||
          rangeset_contains_range(p2m->logdirty_ranges, start, end) )
         return 1;
@@ -263,7 +265,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, unsigned long gfn,
 
     if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         /* Try to unshare. If we fail, communicate ENOMEM without
          * sleeping. */
         if ( mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0 )
@@ -431,7 +433,7 @@ int p2m_alloc_table(struct p2m_domain *p2m)
 
     p2m_lock(p2m);
 
-    if ( !p2m_is_nestedp2m(p2m)
+    if ( p2m_is_hostp2m(p2m)
          && !page_list_empty(&d->page_list) )
     {
         P2M_ERROR("dom %d already has memory allocated\n", d->domain_id);
@@ -1710,7 +1712,7 @@ p2m_flush_table(struct p2m_domain *p2m)
 
     /* "Host" p2m tables can have shared entries &c that need a bit more 
      * care when discarding them */
-    ASSERT(p2m_is_nestedp2m(p2m));
+    ASSERT(!p2m_is_hostp2m(p2m));
     /* Nested p2m's do not do pod, hence the asserts (and no pod lock)*/
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index e86e26f..e93c551 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -172,6 +172,11 @@ typedef unsigned int p2m_query_t;
                              (P2M_RAM_TYPES | P2M_GRANT_TYPES |  \
                               p2m_to_mask(p2m_map_foreign)))
 
+typedef enum {
+    p2m_host,
+    p2m_nested,
+} p2m_class_t;
+
 /* Per-p2m-table state */
 struct p2m_domain {
     /* Lock that protects updates to the p2m */
@@ -188,6 +193,8 @@ struct p2m_domain {
 
     struct domain     *domain;   /* back pointer to domain */
 
+    p2m_class_t       p2m_class; /* host/nested/? */
+
     /* Nested p2ms only: nested p2m base value that this p2m shadows.
      * This can be cleared to P2M_BASE_EADDR under the per-p2m lock but
      * needs both the per-p2m lock and the per-domain nestedp2m lock
@@ -297,7 +304,15 @@ struct p2m_domain *p2m_get_nestedp2m(struct vcpu *v, uint64_t np2m_base);
  */
 struct p2m_domain *p2m_get_p2m(struct vcpu *v);
 
-#define p2m_is_nestedp2m(p2m)   ((p2m) != p2m_get_hostp2m((p2m->domain)))
+static inline bool_t p2m_is_hostp2m(const struct p2m_domain *p2m)
+{
+    return p2m->p2m_class == p2m_host;
+}
+
+static inline bool_t p2m_is_nestedp2m(const struct p2m_domain *p2m)
+{
+    return p2m->p2m_class == p2m_nested;
+}
 
 #define p2m_get_pagetable(p2m)  ((p2m)->phys_table)
 
--
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 Tue Feb 10 07:11:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4yi-0005MW-Ae; Tue, 10 Feb 2015 07:11:24 +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 1YL4yg-0005Hi-17
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:22 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	74/1D-02749-91FA9D45; Tue, 10 Feb 2015 07:11:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1423552279!12854795!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5370 invoked from network); 10 Feb 2015 07:11:20 -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;
	10 Feb 2015 07:11: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 1YL4yd-0005uV-LM
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yd-0004ua-Cu
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:19 +0000
Date: Tue, 10 Feb 2015 07:11:19 +0000
Message-Id: <E1YL4yd-0004ua-Cu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: introduce a p2m class
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8fe99c468d977ee077ef064618973e0aca578117
Author:     Ed White <edmund.h.white@intel.com>
AuthorDate: Tue Feb 3 11:27:46 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:27:46 2015 +0100

    x86/mm: introduce a p2m class
    
    Use the class to differentiate between host and nested p2m's, and
    potentially other classes in the future.
    
    Fix p2m class checks that implicitly assume nested and host are
    the only two classes that will ever exist.
    
    Signed-off-by: Ed White <edmund.h.white@intel.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c           |    2 +-
 xen/arch/x86/mm/guest_walk.c     |    2 +-
 xen/arch/x86/mm/hap/guest_walk.c |    4 ++--
 xen/arch/x86/mm/p2m-ept.c        |    4 ++--
 xen/arch/x86/mm/p2m.c            |   10 ++++++----
 xen/include/asm-x86/p2m.h        |   17 ++++++++++++++++-
 6 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index fd2314e..9e26342 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2914,7 +2914,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     /* Mem sharing: unshare the page and try again */
     if ( npfec.write_access && (p2mt == p2m_ram_shared) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         sharing_enomem = 
             (mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0);
         rc = 1;
diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index 1b26175..d8f5a35 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -99,7 +99,7 @@ void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
                                  q);
     if ( p2m_is_paging(*p2mt) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         if ( page )
             put_page(page);
         p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
diff --git a/xen/arch/x86/mm/hap/guest_walk.c b/xen/arch/x86/mm/hap/guest_walk.c
index 25d9792..381a196 100644
--- a/xen/arch/x86/mm/hap/guest_walk.c
+++ b/xen/arch/x86/mm/hap/guest_walk.c
@@ -64,7 +64,7 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
                                      &p2mt, NULL, P2M_ALLOC | P2M_UNSHARE);
     if ( p2m_is_paging(p2mt) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         pfec[0] = PFEC_page_paged;
         if ( top_page )
             put_page(top_page);
@@ -106,7 +106,7 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
             put_page(page);
         if ( p2m_is_paging(p2mt) )
         {
-            ASSERT(!p2m_is_nestedp2m(p2m));
+            ASSERT(p2m_is_hostp2m(p2m));
             pfec[0] = PFEC_page_paged;
             p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
             return INVALID_GFN;
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index e21a92d..c2d7720 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -769,8 +769,8 @@ out:
     if ( needs_sync != sync_off )
         ept_sync_domain(p2m);
 
-    /* For non-nested p2m, may need to change VT-d page table.*/
-    if ( rc == 0 && !p2m_is_nestedp2m(p2m) && need_iommu(d) &&
+    /* For host p2m, may need to change VT-d page table.*/
+    if ( rc == 0 && p2m_is_hostp2m(p2m) && need_iommu(d) &&
          need_modify_vtd_table )
     {
         if ( iommu_hap_pt_share )
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index c1b7545..6a06e9f 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -71,6 +71,7 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->domain = d;
     p2m->default_access = p2m_access_rwx;
+    p2m->p2m_class = p2m_host;
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
@@ -158,6 +159,7 @@ static int p2m_init_nestedp2m(struct domain *d)
             p2m_teardown_nestedp2m(d);
             return -ENOMEM;
         }
+        p2m->p2m_class = p2m_nested;
         p2m->write_p2m_entry = nestedp2m_write_p2m_entry;
         list_add(&p2m->np2m_list, &p2m_get_hostp2m(d)->np2m_list);
     }
@@ -202,7 +204,7 @@ int p2m_init(struct domain *d)
 int p2m_is_logdirty_range(struct p2m_domain *p2m, unsigned long start,
                           unsigned long end)
 {
-    ASSERT(!p2m_is_nestedp2m(p2m));
+    ASSERT(p2m_is_hostp2m(p2m));
     if ( p2m->global_logdirty ||
          rangeset_contains_range(p2m->logdirty_ranges, start, end) )
         return 1;
@@ -263,7 +265,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, unsigned long gfn,
 
     if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
-        ASSERT(!p2m_is_nestedp2m(p2m));
+        ASSERT(p2m_is_hostp2m(p2m));
         /* Try to unshare. If we fail, communicate ENOMEM without
          * sleeping. */
         if ( mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0 )
@@ -431,7 +433,7 @@ int p2m_alloc_table(struct p2m_domain *p2m)
 
     p2m_lock(p2m);
 
-    if ( !p2m_is_nestedp2m(p2m)
+    if ( p2m_is_hostp2m(p2m)
          && !page_list_empty(&d->page_list) )
     {
         P2M_ERROR("dom %d already has memory allocated\n", d->domain_id);
@@ -1710,7 +1712,7 @@ p2m_flush_table(struct p2m_domain *p2m)
 
     /* "Host" p2m tables can have shared entries &c that need a bit more 
      * care when discarding them */
-    ASSERT(p2m_is_nestedp2m(p2m));
+    ASSERT(!p2m_is_hostp2m(p2m));
     /* Nested p2m's do not do pod, hence the asserts (and no pod lock)*/
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index e86e26f..e93c551 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -172,6 +172,11 @@ typedef unsigned int p2m_query_t;
                              (P2M_RAM_TYPES | P2M_GRANT_TYPES |  \
                               p2m_to_mask(p2m_map_foreign)))
 
+typedef enum {
+    p2m_host,
+    p2m_nested,
+} p2m_class_t;
+
 /* Per-p2m-table state */
 struct p2m_domain {
     /* Lock that protects updates to the p2m */
@@ -188,6 +193,8 @@ struct p2m_domain {
 
     struct domain     *domain;   /* back pointer to domain */
 
+    p2m_class_t       p2m_class; /* host/nested/? */
+
     /* Nested p2ms only: nested p2m base value that this p2m shadows.
      * This can be cleared to P2M_BASE_EADDR under the per-p2m lock but
      * needs both the per-p2m lock and the per-domain nestedp2m lock
@@ -297,7 +304,15 @@ struct p2m_domain *p2m_get_nestedp2m(struct vcpu *v, uint64_t np2m_base);
  */
 struct p2m_domain *p2m_get_p2m(struct vcpu *v);
 
-#define p2m_is_nestedp2m(p2m)   ((p2m) != p2m_get_hostp2m((p2m->domain)))
+static inline bool_t p2m_is_hostp2m(const struct p2m_domain *p2m)
+{
+    return p2m->p2m_class == p2m_host;
+}
+
+static inline bool_t p2m_is_nestedp2m(const struct p2m_domain *p2m)
+{
+    return p2m->p2m_class == p2m_nested;
+}
 
 #define p2m_get_pagetable(p2m)  ((p2m)->phys_table)
 
--
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 Tue Feb 10 07:11:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4yu-0005jX-Ea; Tue, 10 Feb 2015 07:11:36 +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 1YL4yt-0005aK-Tn
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:36 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	7B/C5-25903-42FA9D45; Tue, 10 Feb 2015 07:11:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1423552290!11005113!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28068 invoked from network); 10 Feb 2015 07:11:31 -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;
	10 Feb 2015 07:11: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 1YL4yo-0005ug-Ip
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yo-0004ux-1X
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:30 +0000
Date: Tue, 10 Feb 2015 07:11:30 +0000
Message-Id: <E1YL4yo-0004ux-1X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: cleanup usage of nmi_watchdog
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c2fbca65a78cbdf05c36a7acd8b201549074458
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 11:29:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:29:28 2015 +0100

    x86: cleanup usage of nmi_watchdog
    
    Use NMI_NONE when testing whether NMI watchdog is off.
    
    Remove unused NMI_INVALID macro.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/nmi.c         |    4 ++--
 xen/arch/x86/traps.c       |    3 ++-
 xen/include/asm-x86/apic.h |    1 -
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 98c1e15..2ab97a0 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -148,7 +148,7 @@ int __init check_nmi_watchdog (void)
     int cpu;
     bool_t ok = 1;
 
-    if ( !nmi_watchdog )
+    if ( nmi_watchdog == NMI_NONE )
         return 0;
 
     printk("Testing NMI watchdog on all CPUs:");
@@ -361,7 +361,7 @@ static int __pminit setup_p4_watchdog(void)
 
 void __pminit setup_apic_nmi_watchdog(void)
 {
-    if (!nmi_watchdog)
+    if ( nmi_watchdog == NMI_NONE )
         return;
 
     switch (boot_cpu_data.x86_vendor) {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index ec324b0..f5516dc 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3385,7 +3385,8 @@ void do_nmi(const struct cpu_user_regs *regs)
     if ( nmi_callback(regs, cpu) )
         return;
 
-    if ( !nmi_watchdog || (!nmi_watchdog_tick(regs) && watchdog_force) )
+    if ( (nmi_watchdog == NMI_NONE) ||
+         (!nmi_watchdog_tick(regs) && watchdog_force) )
         handle_unknown = 1;
 
     /* Only the BSP gets external NMIs from the system. */
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 6697245..be9a535 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -221,7 +221,6 @@ extern unsigned int nmi_watchdog;
 #define NMI_NONE	0
 #define NMI_IO_APIC	1
 #define NMI_LOCAL_APIC	2
-#define NMI_INVALID	3
 
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline int lapic_suspend(void) {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 Tue Feb 10 07:11:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4yu-0005jX-Ea; Tue, 10 Feb 2015 07:11:36 +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 1YL4yt-0005aK-Tn
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:36 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	7B/C5-25903-42FA9D45; Tue, 10 Feb 2015 07:11:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1423552290!11005113!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28068 invoked from network); 10 Feb 2015 07:11:31 -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;
	10 Feb 2015 07:11: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 1YL4yo-0005ug-Ip
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yo-0004ux-1X
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:30 +0000
Date: Tue, 10 Feb 2015 07:11:30 +0000
Message-Id: <E1YL4yo-0004ux-1X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: cleanup usage of nmi_watchdog
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c2fbca65a78cbdf05c36a7acd8b201549074458
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 11:29:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:29:28 2015 +0100

    x86: cleanup usage of nmi_watchdog
    
    Use NMI_NONE when testing whether NMI watchdog is off.
    
    Remove unused NMI_INVALID macro.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/nmi.c         |    4 ++--
 xen/arch/x86/traps.c       |    3 ++-
 xen/include/asm-x86/apic.h |    1 -
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 98c1e15..2ab97a0 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -148,7 +148,7 @@ int __init check_nmi_watchdog (void)
     int cpu;
     bool_t ok = 1;
 
-    if ( !nmi_watchdog )
+    if ( nmi_watchdog == NMI_NONE )
         return 0;
 
     printk("Testing NMI watchdog on all CPUs:");
@@ -361,7 +361,7 @@ static int __pminit setup_p4_watchdog(void)
 
 void __pminit setup_apic_nmi_watchdog(void)
 {
-    if (!nmi_watchdog)
+    if ( nmi_watchdog == NMI_NONE )
         return;
 
     switch (boot_cpu_data.x86_vendor) {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index ec324b0..f5516dc 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3385,7 +3385,8 @@ void do_nmi(const struct cpu_user_regs *regs)
     if ( nmi_callback(regs, cpu) )
         return;
 
-    if ( !nmi_watchdog || (!nmi_watchdog_tick(regs) && watchdog_force) )
+    if ( (nmi_watchdog == NMI_NONE) ||
+         (!nmi_watchdog_tick(regs) && watchdog_force) )
         handle_unknown = 1;
 
     /* Only the BSP gets external NMIs from the system. */
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 6697245..be9a535 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -221,7 +221,6 @@ extern unsigned int nmi_watchdog;
 #define NMI_NONE	0
 #define NMI_IO_APIC	1
 #define NMI_LOCAL_APIC	2
-#define NMI_INVALID	3
 
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline int lapic_suspend(void) {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 Tue Feb 10 07:11:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4z2-0005mO-I0; Tue, 10 Feb 2015 07:11: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 1YL4z1-0005m4-O4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:43 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	7B/22-31919-F2FA9D45; Tue, 10 Feb 2015 07:11:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1423552301!6995543!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17886 invoked from network); 10 Feb 2015 07:11:42 -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;
	10 Feb 2015 07:11: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 1YL4yz-0005um-A4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yz-0004vf-0H
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:41 +0000
Date: Tue, 10 Feb 2015 07:11:41 +0000
Message-Id: <E1YL4yz-0004vf-0H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: disable when NMI watchdog is
	on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5e09b5c46444b0ab8450c6d6ee8316d4016ac18
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 11:30:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:30:09 2015 +0100

    x86/VPMU: disable when NMI watchdog is on
    
    NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
    overflow occurs. This may be overwritten by VPMU code later, effectively
    turning off the watchdog.
    
    We should disable VPMU when NMI watchdog is running.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    2 ++
 xen/arch/x86/hvm/vpmu.c             |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 2274e74..bc316be 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1346,6 +1346,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 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!
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 63b2158..b2e8e65 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -288,3 +289,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);
--
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 Tue Feb 10 07:11:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11: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 1YL4z2-0005mO-I0; Tue, 10 Feb 2015 07:11: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 1YL4z1-0005m4-O4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:43 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	7B/22-31919-F2FA9D45; Tue, 10 Feb 2015 07:11:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1423552301!6995543!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17886 invoked from network); 10 Feb 2015 07:11:42 -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;
	10 Feb 2015 07:11: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 1YL4yz-0005um-A4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4yz-0004vf-0H
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:41 +0000
Date: Tue, 10 Feb 2015 07:11:41 +0000
Message-Id: <E1YL4yz-0004vf-0H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: disable when NMI watchdog is
	on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5e09b5c46444b0ab8450c6d6ee8316d4016ac18
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 11:30:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:30:09 2015 +0100

    x86/VPMU: disable when NMI watchdog is on
    
    NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
    overflow occurs. This may be overwritten by VPMU code later, effectively
    turning off the watchdog.
    
    We should disable VPMU when NMI watchdog is running.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    2 ++
 xen/arch/x86/hvm/vpmu.c             |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 2274e74..bc316be 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1346,6 +1346,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 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!
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 63b2158..b2e8e65 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -288,3 +289,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);
--
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 Tue Feb 10 07:11:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YL4zC-0005oI-Mo; Tue, 10 Feb 2015 07:11:54 +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 1YL4zC-0005o7-4K
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:54 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	46/D6-02754-93FA9D45; Tue, 10 Feb 2015 07:11:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1423552311!12836152!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20203 invoked from network); 10 Feb 2015 07:11:52 -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;
	10 Feb 2015 07:11:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4z9-0005us-PY
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4z9-0004w3-Km
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:51 +0000
Date: Tue, 10 Feb 2015 07:11:51 +0000
Message-Id: <E1YL4z9-0004w3-Km@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: handle APIC_LVTPC accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 24fdc89e48b737d5131863621df56cb76914ffba
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 11:30:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:30:40 2015 +0100

    x86/VPMU: handle APIC_LVTPC accesses
    
    Don't have the hypervisor update APIC_LVTPC when _it_ thinks the vector
    should be updated. Instead, handle guest's APIC_LVTPC accesses and write what
    the guest explicitly wanted (but only when VPMU is enabled).
    
    This is updated version of commit 8097616fbdda that was reverted by
    cc3404093c85. Unlike the previous version, we don't update APIC_LVTPC
    when VPMU is disabled to avoid interfering with NMI watchdog (which
    runs only when VPMU is off).
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |    4 ----
 xen/arch/x86/hvm/vlapic.c         |    3 +++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   17 -----------------
 xen/arch/x86/hvm/vpmu.c           |   13 +++++++++++++
 xen/include/asm-x86/hvm/vpmu.h    |    1 +
 5 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 19777e3..64dc167 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -302,8 +302,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( has_hvm_container_vcpu(v) &&
              !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
@@ -314,8 +312,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) &&
              ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 8062f31..5da6d8f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -38,6 +38,7 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/vpmu.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -777,6 +778,8 @@ static int vlapic_reg_write(struct vcpu *v,
         }
         if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) )
             pt_may_unmask_irq(NULL, &vlapic->pt);
+        if ( offset == APIC_LVTPC )
+            vpmu_lvtpc_update(val);
         break;
 
     case APIC_TMICT:
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 4d0e9a8..7793145 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -519,19 +519,6 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
 
-    /* Setup LVTPC in local apic */
-    if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
-         is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
-    }
-    else
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
-    }
-
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -697,10 +684,6 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
-    /* HW sets the MASK bit when performance counter interrupt occurs*/
-    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
-    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
-
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index b2e8e65..0e6b6c0 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -65,6 +65,19 @@ static void __init parse_vpmu_param(char *s)
     }
 }
 
+void vpmu_lvtpc_update(uint32_t val)
+{
+    struct vpmu_struct *vpmu;
+
+    if ( !opt_vpmu_enabled )
+        return;
+
+    vpmu = vcpu_vpmu(current);
+
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
+    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+}
+
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(current);
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index ddc2748..9c4e65a 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -104,6 +104,7 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
     return !!((vpmu->flags & mask) == mask);
 }
 
+void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 void vpmu_do_interrupt(struct cpu_user_regs *regs);
--
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 Tue Feb 10 07:11:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YL4zC-0005oI-Mo; Tue, 10 Feb 2015 07:11:54 +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 1YL4zC-0005o7-4K
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:54 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	46/D6-02754-93FA9D45; Tue, 10 Feb 2015 07:11:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1423552311!12836152!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20203 invoked from network); 10 Feb 2015 07:11:52 -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;
	10 Feb 2015 07:11:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4z9-0005us-PY
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4z9-0004w3-Km
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:11:51 +0000
Date: Tue, 10 Feb 2015 07:11:51 +0000
Message-Id: <E1YL4z9-0004w3-Km@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: handle APIC_LVTPC accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 24fdc89e48b737d5131863621df56cb76914ffba
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Feb 3 11:30:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:30:40 2015 +0100

    x86/VPMU: handle APIC_LVTPC accesses
    
    Don't have the hypervisor update APIC_LVTPC when _it_ thinks the vector
    should be updated. Instead, handle guest's APIC_LVTPC accesses and write what
    the guest explicitly wanted (but only when VPMU is enabled).
    
    This is updated version of commit 8097616fbdda that was reverted by
    cc3404093c85. Unlike the previous version, we don't update APIC_LVTPC
    when VPMU is disabled to avoid interfering with NMI watchdog (which
    runs only when VPMU is off).
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |    4 ----
 xen/arch/x86/hvm/vlapic.c         |    3 +++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   17 -----------------
 xen/arch/x86/hvm/vpmu.c           |   13 +++++++++++++
 xen/include/asm-x86/hvm/vpmu.h    |    1 +
 5 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 19777e3..64dc167 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -302,8 +302,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( has_hvm_container_vcpu(v) &&
              !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
@@ -314,8 +312,6 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     if ( (get_pmu_reg_type(msr) == MSR_TYPE_CTRL) &&
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
-        apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) &&
              ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 8062f31..5da6d8f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -38,6 +38,7 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/vpmu.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
@@ -777,6 +778,8 @@ static int vlapic_reg_write(struct vcpu *v,
         }
         if ( (offset == APIC_LVTT) && !(val & APIC_LVT_MASKED) )
             pt_may_unmask_irq(NULL, &vlapic->pt);
+        if ( offset == APIC_LVTPC )
+            vpmu_lvtpc_update(val);
         break;
 
     case APIC_TMICT:
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 4d0e9a8..7793145 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -519,19 +519,6 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
     else
         vpmu_reset(vpmu, VPMU_RUNNING);
 
-    /* Setup LVTPC in local apic */
-    if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
-         is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
-    }
-    else
-    {
-        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
-    }
-
     if ( type != MSR_TYPE_GLOBAL )
     {
         u64 mask;
@@ -697,10 +684,6 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
-    /* HW sets the MASK bit when performance counter interrupt occurs*/
-    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
-    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
-
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index b2e8e65..0e6b6c0 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -65,6 +65,19 @@ static void __init parse_vpmu_param(char *s)
     }
 }
 
+void vpmu_lvtpc_update(uint32_t val)
+{
+    struct vpmu_struct *vpmu;
+
+    if ( !opt_vpmu_enabled )
+        return;
+
+    vpmu = vcpu_vpmu(current);
+
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
+    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+}
+
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(current);
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index ddc2748..9c4e65a 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -104,6 +104,7 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu,
     return !!((vpmu->flags & mask) == mask);
 }
 
+void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 void vpmu_do_interrupt(struct cpu_user_regs *regs);
--
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 Tue Feb 10 07:12:07 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YL4zP-0005q5-PU; Tue, 10 Feb 2015 07:12: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 1YL4zO-0005px-PM
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:06 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	38/49-03168-64FA9D45; Tue, 10 Feb 2015 07:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1423552324!12418758!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14548 invoked from network); 10 Feb 2015 07:12:05 -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;
	10 Feb 2015 07:12: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 1YL4zK-0005vU-17
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zJ-0004wb-Ux
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:01 +0000
Date: Tue, 10 Feb 2015 07:12:01 +0000
Message-Id: <E1YL4zJ-0004wb-Ux@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot/reloc: mask out MBI_BOOTDEV
	from mbi flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1663bdbe1a3e5fe41c898a67c6ac4d30730d8394
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Feb 3 11:31:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:31:27 2015 +0100

    x86/boot/reloc: mask out MBI_BOOTDEV from mbi flags
    
    ..because it is ignored by Xen.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index f971920..63045c0 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -90,7 +90,6 @@ multiboot_info_t *reloc(multiboot_info_t *mbi_old)
 
     /* Mask features we don't understand or don't relocate. */
     mbi->flags &= (MBI_MEMLIMITS |
-                   MBI_BOOTDEV |
                    MBI_CMDLINE |
                    MBI_MODULES |
                    MBI_MEMMAP |
--
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 Tue Feb 10 07:12:07 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YL4zP-0005q5-PU; Tue, 10 Feb 2015 07:12: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 1YL4zO-0005px-PM
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:06 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	38/49-03168-64FA9D45; Tue, 10 Feb 2015 07:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1423552324!12418758!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14548 invoked from network); 10 Feb 2015 07:12:05 -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;
	10 Feb 2015 07:12: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 1YL4zK-0005vU-17
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zJ-0004wb-Ux
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:01 +0000
Date: Tue, 10 Feb 2015 07:12:01 +0000
Message-Id: <E1YL4zJ-0004wb-Ux@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot/reloc: mask out MBI_BOOTDEV
	from mbi flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1663bdbe1a3e5fe41c898a67c6ac4d30730d8394
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Feb 3 11:31:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:31:27 2015 +0100

    x86/boot/reloc: mask out MBI_BOOTDEV from mbi flags
    
    ..because it is ignored by Xen.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index f971920..63045c0 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -90,7 +90,6 @@ multiboot_info_t *reloc(multiboot_info_t *mbi_old)
 
     /* Mask features we don't understand or don't relocate. */
     mbi->flags &= (MBI_MEMLIMITS |
-                   MBI_BOOTDEV |
                    MBI_CMDLINE |
                    MBI_MODULES |
                    MBI_MEMMAP |
--
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 Tue Feb 10 07:12:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL4zb-0005rf-SR; Tue, 10 Feb 2015 07: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 1YL4za-0005rX-Jz
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:18 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	7C/11-02896-15FA9D45; Tue, 10 Feb 2015 07:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1423552335!7403688!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21850 invoked from network); 10 Feb 2015 07:12:16 -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;
	10 Feb 2015 07:12: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 1YL4zW-0005va-Qz
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zW-0004xV-PQ
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:14 +0000
Date: Tue, 10 Feb 2015 07:12:14 +0000
Message-Id: <E1YL4zW-0004xV-PQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: tidy up fragmentary page
	lists in multi-page shadows
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c04822de14328cbfbce0305b938b81690f79d74c
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Feb 3 11:34:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:34:12 2015 +0100

    x86/shadow: tidy up fragmentary page lists in multi-page shadows
    
    Multi-page shadows are linked together using the 'list' field.  When
    those shadows are in the pinned list, the list fragments are spliced
    into the pinned list; otherwise they have no associated list head.
    
    Rework the code that handles these fragments to use the page_list
    interface rather than manipulating the fields directly.  This makes
    the code cleaner, and allows the 'list' field to be either the
    compact pdx form or a normal list_entry.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Introduce sh_terminate_list() and make it use LIST_POISON*.
    
    Move helper array of shadow_size() into common.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |   57 +++++++---------
 xen/arch/x86/mm/shadow/multi.c   |   14 ++--
 xen/arch/x86/mm/shadow/private.h |  139 ++++++++++++++++++++-----------------
 xen/include/xen/mm.h             |    9 +++
 4 files changed, 117 insertions(+), 102 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index e6bcdcd..56d14e4 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1196,6 +1196,26 @@ int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
  * the free pool.
  */
 
+const u8 sh_type_to_size[] = {
+    1, /* SH_type_none           */
+    2, /* SH_type_l1_32_shadow   */
+    2, /* SH_type_fl1_32_shadow  */
+    4, /* SH_type_l2_32_shadow   */
+    1, /* SH_type_l1_pae_shadow  */
+    1, /* SH_type_fl1_pae_shadow */
+    1, /* SH_type_l2_pae_shadow  */
+    1, /* SH_type_l2h_pae_shadow */
+    1, /* SH_type_l1_64_shadow   */
+    1, /* SH_type_fl1_64_shadow  */
+    1, /* SH_type_l2_64_shadow   */
+    1, /* SH_type_l2h_64_shadow  */
+    1, /* SH_type_l3_64_shadow   */
+    1, /* SH_type_l4_64_shadow   */
+    1, /* SH_type_p2m_table      */
+    1, /* SH_type_monitor_table  */
+    1  /* SH_type_oos_snapshot   */
+};
+
 /* Figure out the least acceptable quantity of shadow memory.
  * The minimum memory requirement for always being able to free up a
  * chunk of memory is very small -- only three max-order chunks per
@@ -1218,33 +1238,6 @@ static unsigned int shadow_min_acceptable_pages(struct domain *d)
     return (vcpu_count * 128);
 } 
 
-/* Figure out the size (in pages) of a given shadow type */
-static inline u32
-shadow_size(unsigned int shadow_type) 
-{
-    static const u32 type_to_size[SH_type_unused] = {
-        1, /* SH_type_none           */
-        2, /* SH_type_l1_32_shadow   */
-        2, /* SH_type_fl1_32_shadow  */
-        4, /* SH_type_l2_32_shadow   */
-        1, /* SH_type_l1_pae_shadow  */
-        1, /* SH_type_fl1_pae_shadow */
-        1, /* SH_type_l2_pae_shadow  */
-        1, /* SH_type_l2h_pae_shadow */
-        1, /* SH_type_l1_64_shadow   */
-        1, /* SH_type_fl1_64_shadow  */
-        1, /* SH_type_l2_64_shadow   */
-        1, /* SH_type_l2h_64_shadow  */
-        1, /* SH_type_l3_64_shadow   */
-        1, /* SH_type_l4_64_shadow   */
-        1, /* SH_type_p2m_table      */
-        1, /* SH_type_monitor_table  */
-        1  /* SH_type_oos_snapshot   */
-        };
-    ASSERT(shadow_type < SH_type_unused);
-    return type_to_size[shadow_type];
-}
-
 /* Dispatcher function: call the per-mode function that will unhook the
  * non-Xen mappings in this top-level shadow mfn.  With user_only == 1,
  * unhooks only the user-mode mappings. */
@@ -1487,9 +1480,6 @@ mfn_t shadow_alloc(struct domain *d,
         break;
     }
 
-    /* Page lists don't have pointers back to the head structure, so
-     * it's safe to use a head structure on the stack to link the pages
-     * together. */
     INIT_PAGE_LIST_HEAD(&tmp_list);
 
     /* Init page info fields and clear the pages */
@@ -1523,6 +1513,9 @@ mfn_t shadow_alloc(struct domain *d,
     if ( shadow_type >= SH_type_min_shadow 
          && shadow_type <= SH_type_max_shadow )
         sp->u.sh.head = 1;
+
+    sh_terminate_list(&tmp_list);
+
     return page_to_mfn(sp);
 }
 
@@ -1531,6 +1524,7 @@ mfn_t shadow_alloc(struct domain *d,
 void shadow_free(struct domain *d, mfn_t smfn)
 {
     struct page_info *next = NULL, *sp = mfn_to_page(smfn); 
+    struct page_list_head *pin_list;
     unsigned int pages;
     u32 shadow_type;
     int i;
@@ -1542,6 +1536,7 @@ void shadow_free(struct domain *d, mfn_t smfn)
     ASSERT(shadow_type != SH_type_none);
     ASSERT(sp->u.sh.head || (shadow_type > SH_type_max_shadow));
     pages = shadow_size(shadow_type);
+    pin_list = &d->arch.paging.shadow.pinned_shadows;
 
     for ( i = 0; i < pages; i++ ) 
     {
@@ -1562,7 +1557,7 @@ void shadow_free(struct domain *d, mfn_t smfn)
 #endif
         /* Get the next page before we overwrite the list header */
         if ( i < pages - 1 )
-            next = pdx_to_page(sp->list.next);
+            next = page_list_next(sp, pin_list);
         /* Strip out the type: this is now a free shadow page */
         sp->u.sh.type = sp->u.sh.head = 0;
         /* Remember the TLB timestamp so we will know whether to flush 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 65815bb..5fc10c9 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -428,20 +428,20 @@ sh_guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
 /* From one page of a multi-page shadow, find the next one */
 static inline mfn_t sh_next_page(mfn_t smfn)
 {
-    mfn_t next;
-    struct page_info *pg = mfn_to_page(smfn);
+    struct page_info *pg = mfn_to_page(smfn), *next;
+    struct page_list_head h = PAGE_LIST_HEAD_INIT(h);
 
     ASSERT(pg->u.sh.type == SH_type_l1_32_shadow
            || pg->u.sh.type == SH_type_fl1_32_shadow
            || pg->u.sh.type == SH_type_l2_32_shadow);
     ASSERT(pg->u.sh.type == SH_type_l2_32_shadow || pg->u.sh.head);
-    ASSERT(pg->list.next != PAGE_LIST_NULL);
 
-    next = _mfn(pdx_to_pfn(pg->list.next));
+    next = page_list_next(pg, &h);
 
-    ASSERT(mfn_to_page(next)->u.sh.type == pg->u.sh.type);
-    ASSERT(!mfn_to_page(next)->u.sh.head);
-    return next;
+    ASSERT(next);
+    ASSERT(next->u.sh.type == pg->u.sh.type);
+    ASSERT(!next->u.sh.head);
+    return page_to_mfn(next);
 }
 
 static inline u32
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index b778fcf..82c22e8 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -231,6 +231,17 @@ static inline int sh_type_has_up_pointer(struct vcpu *v, unsigned int t)
     return !sh_type_is_pinnable(v, t);
 }
 
+static inline void sh_terminate_list(struct page_list_head *tmp_list)
+{
+#ifndef PAGE_LIST_NULL
+    /* The temporary list-head is on our stack.  Invalidate the
+     * pointers to it in the shadows, just to get a clean failure if
+     * we accidentally follow them. */
+    tmp_list->prev->next = LIST_POISON1;
+    tmp_list->next->prev = LIST_POISON2;
+#endif
+}
+
 /*
  * Definitions for the shadow_flags field in page_info.
  * These flags are stored on *guest* pages...
@@ -318,6 +329,15 @@ static inline int mfn_oos_may_write(mfn_t gmfn)
 }
 #endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
 
+/* Figure out the size (in pages) of a given shadow type */
+extern const u8 sh_type_to_size[SH_type_unused];
+static inline unsigned int
+shadow_size(unsigned int shadow_type)
+{
+    ASSERT(shadow_type < ARRAY_SIZE(sh_type_to_size));
+    return sh_type_to_size[shadow_type];
+}
+
 /******************************************************************************
  * Various function declarations 
  */
@@ -586,22 +606,25 @@ prev_pinned_shadow(const struct page_info *page,
                    const struct domain *d)
 {
     struct page_info *p;
+    const struct page_list_head *pin_list;
+
+    pin_list = &d->arch.paging.shadow.pinned_shadows;
 
-    if ( page == d->arch.paging.shadow.pinned_shadows.next ) 
+    if ( page_list_empty(pin_list) || page == page_list_first(pin_list) )
         return NULL;
-    
+
     if ( page == NULL ) /* If no current place, start at the tail */
-        p = d->arch.paging.shadow.pinned_shadows.tail;
+        p = page_list_last(pin_list);
     else
-        p = pdx_to_page(page->list.prev);
+        p = page_list_prev(page, pin_list);
     /* Skip over the non-tail parts of multi-page shadows */
     if ( p && p->u.sh.type == SH_type_l2_32_shadow )
     {
-        p = pdx_to_page(p->list.prev);
+        p = page_list_prev(p, pin_list);
         ASSERT(p && p->u.sh.type == SH_type_l2_32_shadow);
-        p = pdx_to_page(p->list.prev);
+        p = page_list_prev(p, pin_list);
         ASSERT(p && p->u.sh.type == SH_type_l2_32_shadow);
-        p = pdx_to_page(p->list.prev);
+        p = page_list_prev(p, pin_list);
         ASSERT(p && p->u.sh.type == SH_type_l2_32_shadow);
     }
     ASSERT(!p || p->u.sh.head);
@@ -618,49 +641,48 @@ prev_pinned_shadow(const struct page_info *page,
  * Returns 0 for failure, 1 for success. */
 static inline int sh_pin(struct vcpu *v, mfn_t smfn)
 {
-    struct page_info *sp;
-    struct page_list_head h, *pin_list;
-    
+    struct page_info *sp[4];
+    struct page_list_head *pin_list;
+    unsigned int i, pages;
+    bool_t already_pinned;
+
     ASSERT(mfn_valid(smfn));
-    sp = mfn_to_page(smfn);
-    ASSERT(sh_type_is_pinnable(v, sp->u.sh.type));
-    ASSERT(sp->u.sh.head);
+    sp[0] = mfn_to_page(smfn);
+    pages = shadow_size(sp[0]->u.sh.type);
+    already_pinned = sp[0]->u.sh.pinned;
+    ASSERT(sh_type_is_pinnable(v, sp[0]->u.sh.type));
+    ASSERT(sp[0]->u.sh.head);
+
+    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
+    if ( already_pinned && sp[0] == page_list_first(pin_list) )
+        return 1;
 
     /* Treat the up-to-four pages of the shadow as a unit in the list ops */
-    h.next = h.tail = sp; 
-    if ( sp->u.sh.type == SH_type_l2_32_shadow ) 
+    for ( i = 1; i < pages; i++ )
     {
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        ASSERT(h.tail->u.sh.type == SH_type_l2_32_shadow); 
+        sp[i] = page_list_next(sp[i - 1], pin_list);
+        ASSERT(sp[i]->u.sh.type == sp[0]->u.sh.type);
+        ASSERT(!sp[i]->u.sh.head);
     }
-    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
 
-    if ( sp->u.sh.pinned )
+    if ( already_pinned )
     {
-        /* Already pinned: take it out of the pinned-list so it can go 
-         * at the front */
-        if ( pin_list->next == h.next )
-            return 1;
-        page_list_prev(h.next, pin_list)->list.next = h.tail->list.next;
-        if ( pin_list->tail == h.tail )
-            pin_list->tail = page_list_prev(h.next, pin_list);
-        else
-            page_list_next(h.tail, pin_list)->list.prev = h.next->list.prev;
-        h.tail->list.next = h.next->list.prev = PAGE_LIST_NULL;
+        /* Take it out of the pinned-list so it can go at the front */
+        for ( i = 0; i < pages; i++ )
+            page_list_del(sp[i], pin_list);
     }
     else
     {
         /* Not pinned: pin it! */
         if ( !sh_get_ref(v, smfn, 0) )
             return 0;
-        sp->u.sh.pinned = 1;
-        ASSERT(h.next->list.prev == PAGE_LIST_NULL);
-        ASSERT(h.tail->list.next == PAGE_LIST_NULL);
+        sp[0]->u.sh.pinned = 1;
     }
+
     /* Put it at the head of the list of pinned shadows */
-    page_list_splice(&h, pin_list);
+    for ( i = pages; i > 0; i-- )
+        page_list_add(sp[i - 1], pin_list);
+
     return 1;
 }
 
@@ -668,46 +690,35 @@ static inline int sh_pin(struct vcpu *v, mfn_t smfn)
  * of pinned shadows, and release the extra ref. */
 static inline void sh_unpin(struct vcpu *v, mfn_t smfn)
 {
-    struct page_list_head h, *pin_list;
-    struct page_info *sp;
-    
+    struct page_list_head tmp_list, *pin_list;
+    struct page_info *sp, *next;
+    unsigned int i, head_type;
+
     ASSERT(mfn_valid(smfn));
     sp = mfn_to_page(smfn);
+    head_type = sp->u.sh.type;
     ASSERT(sh_type_is_pinnable(v, sp->u.sh.type));
     ASSERT(sp->u.sh.head);
 
-    /* Treat the up-to-four pages of the shadow as a unit in the list ops */
-    h.next = h.tail = sp; 
-    if ( sp->u.sh.type == SH_type_l2_32_shadow ) 
-    {
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        ASSERT(h.tail->u.sh.type == SH_type_l2_32_shadow); 
-    }
-    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
-
     if ( !sp->u.sh.pinned )
         return;
-
     sp->u.sh.pinned = 0;
 
-    /* Cut the sub-list out of the list of pinned shadows */
-    if ( pin_list->next == h.next && pin_list->tail == h.tail )
-        pin_list->next = pin_list->tail = NULL;
-    else 
+    /* Cut the sub-list out of the list of pinned shadows,
+     * stitching it back into a list fragment of its own. */
+    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
+    INIT_PAGE_LIST_HEAD(&tmp_list);
+    for ( i = 0; i < shadow_size(head_type); i++ )
     {
-        if ( pin_list->next == h.next )
-            pin_list->next = page_list_next(h.tail, pin_list);
-        else
-            page_list_prev(h.next, pin_list)->list.next = h.tail->list.next;
-        if ( pin_list->tail == h.tail )
-            pin_list->tail = page_list_prev(h.next, pin_list);
-        else
-            page_list_next(h.tail, pin_list)->list.prev = h.next->list.prev;
+        ASSERT(sp->u.sh.type == head_type);
+        ASSERT(!i || !sp->u.sh.head);
+        next = page_list_next(sp, pin_list);
+        page_list_del(sp, pin_list);
+        page_list_add_tail(sp, &tmp_list);
+        sp = next;
     }
-    h.tail->list.next = h.next->list.prev = PAGE_LIST_NULL;
-    
+    sh_terminate_list(&tmp_list);
+
     sh_put_ref(v, smfn, 0);
 }
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 74a65a6..a62ee1e 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -172,6 +172,11 @@ page_list_first(const struct page_list_head *head)
     return head->next;
 }
 static inline struct page_info *
+page_list_last(const struct page_list_head *head)
+{
+    return head->tail;
+}
+static inline struct page_info *
 page_list_next(const struct page_info *page,
                const struct page_list_head *head)
 {
@@ -331,8 +336,12 @@ page_list_splice(struct page_list_head *list, struct page_list_head *head)
 # define page_list_empty                 list_empty
 # define page_list_first(hd)             list_entry((hd)->next, \
                                                     struct page_info, list)
+# define page_list_last(hd)              list_entry((hd)->prev, \
+                                                    struct page_info, list)
 # define page_list_next(pg, hd)          list_entry((pg)->list.next, \
                                                     struct page_info, list)
+# define page_list_prev(pg, hd)          list_entry((pg)->list.prev, \
+                                                    struct page_info, list)
 # define page_list_add(pg, hd)           list_add(&(pg)->list, hd)
 # define page_list_add_tail(pg, hd)      list_add_tail(&(pg)->list, hd)
 # define page_list_del(pg, hd)           list_del(&(pg)->list)
--
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 Tue Feb 10 07:12:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL4zb-0005rf-SR; Tue, 10 Feb 2015 07: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 1YL4za-0005rX-Jz
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:18 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	7C/11-02896-15FA9D45; Tue, 10 Feb 2015 07:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1423552335!7403688!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21850 invoked from network); 10 Feb 2015 07:12:16 -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;
	10 Feb 2015 07:12: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 1YL4zW-0005va-Qz
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zW-0004xV-PQ
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:14 +0000
Date: Tue, 10 Feb 2015 07:12:14 +0000
Message-Id: <E1YL4zW-0004xV-PQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: tidy up fragmentary page
	lists in multi-page shadows
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c04822de14328cbfbce0305b938b81690f79d74c
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Feb 3 11:34:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:34:12 2015 +0100

    x86/shadow: tidy up fragmentary page lists in multi-page shadows
    
    Multi-page shadows are linked together using the 'list' field.  When
    those shadows are in the pinned list, the list fragments are spliced
    into the pinned list; otherwise they have no associated list head.
    
    Rework the code that handles these fragments to use the page_list
    interface rather than manipulating the fields directly.  This makes
    the code cleaner, and allows the 'list' field to be either the
    compact pdx form or a normal list_entry.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Introduce sh_terminate_list() and make it use LIST_POISON*.
    
    Move helper array of shadow_size() into common.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |   57 +++++++---------
 xen/arch/x86/mm/shadow/multi.c   |   14 ++--
 xen/arch/x86/mm/shadow/private.h |  139 ++++++++++++++++++++-----------------
 xen/include/xen/mm.h             |    9 +++
 4 files changed, 117 insertions(+), 102 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index e6bcdcd..56d14e4 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1196,6 +1196,26 @@ int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
  * the free pool.
  */
 
+const u8 sh_type_to_size[] = {
+    1, /* SH_type_none           */
+    2, /* SH_type_l1_32_shadow   */
+    2, /* SH_type_fl1_32_shadow  */
+    4, /* SH_type_l2_32_shadow   */
+    1, /* SH_type_l1_pae_shadow  */
+    1, /* SH_type_fl1_pae_shadow */
+    1, /* SH_type_l2_pae_shadow  */
+    1, /* SH_type_l2h_pae_shadow */
+    1, /* SH_type_l1_64_shadow   */
+    1, /* SH_type_fl1_64_shadow  */
+    1, /* SH_type_l2_64_shadow   */
+    1, /* SH_type_l2h_64_shadow  */
+    1, /* SH_type_l3_64_shadow   */
+    1, /* SH_type_l4_64_shadow   */
+    1, /* SH_type_p2m_table      */
+    1, /* SH_type_monitor_table  */
+    1  /* SH_type_oos_snapshot   */
+};
+
 /* Figure out the least acceptable quantity of shadow memory.
  * The minimum memory requirement for always being able to free up a
  * chunk of memory is very small -- only three max-order chunks per
@@ -1218,33 +1238,6 @@ static unsigned int shadow_min_acceptable_pages(struct domain *d)
     return (vcpu_count * 128);
 } 
 
-/* Figure out the size (in pages) of a given shadow type */
-static inline u32
-shadow_size(unsigned int shadow_type) 
-{
-    static const u32 type_to_size[SH_type_unused] = {
-        1, /* SH_type_none           */
-        2, /* SH_type_l1_32_shadow   */
-        2, /* SH_type_fl1_32_shadow  */
-        4, /* SH_type_l2_32_shadow   */
-        1, /* SH_type_l1_pae_shadow  */
-        1, /* SH_type_fl1_pae_shadow */
-        1, /* SH_type_l2_pae_shadow  */
-        1, /* SH_type_l2h_pae_shadow */
-        1, /* SH_type_l1_64_shadow   */
-        1, /* SH_type_fl1_64_shadow  */
-        1, /* SH_type_l2_64_shadow   */
-        1, /* SH_type_l2h_64_shadow  */
-        1, /* SH_type_l3_64_shadow   */
-        1, /* SH_type_l4_64_shadow   */
-        1, /* SH_type_p2m_table      */
-        1, /* SH_type_monitor_table  */
-        1  /* SH_type_oos_snapshot   */
-        };
-    ASSERT(shadow_type < SH_type_unused);
-    return type_to_size[shadow_type];
-}
-
 /* Dispatcher function: call the per-mode function that will unhook the
  * non-Xen mappings in this top-level shadow mfn.  With user_only == 1,
  * unhooks only the user-mode mappings. */
@@ -1487,9 +1480,6 @@ mfn_t shadow_alloc(struct domain *d,
         break;
     }
 
-    /* Page lists don't have pointers back to the head structure, so
-     * it's safe to use a head structure on the stack to link the pages
-     * together. */
     INIT_PAGE_LIST_HEAD(&tmp_list);
 
     /* Init page info fields and clear the pages */
@@ -1523,6 +1513,9 @@ mfn_t shadow_alloc(struct domain *d,
     if ( shadow_type >= SH_type_min_shadow 
          && shadow_type <= SH_type_max_shadow )
         sp->u.sh.head = 1;
+
+    sh_terminate_list(&tmp_list);
+
     return page_to_mfn(sp);
 }
 
@@ -1531,6 +1524,7 @@ mfn_t shadow_alloc(struct domain *d,
 void shadow_free(struct domain *d, mfn_t smfn)
 {
     struct page_info *next = NULL, *sp = mfn_to_page(smfn); 
+    struct page_list_head *pin_list;
     unsigned int pages;
     u32 shadow_type;
     int i;
@@ -1542,6 +1536,7 @@ void shadow_free(struct domain *d, mfn_t smfn)
     ASSERT(shadow_type != SH_type_none);
     ASSERT(sp->u.sh.head || (shadow_type > SH_type_max_shadow));
     pages = shadow_size(shadow_type);
+    pin_list = &d->arch.paging.shadow.pinned_shadows;
 
     for ( i = 0; i < pages; i++ ) 
     {
@@ -1562,7 +1557,7 @@ void shadow_free(struct domain *d, mfn_t smfn)
 #endif
         /* Get the next page before we overwrite the list header */
         if ( i < pages - 1 )
-            next = pdx_to_page(sp->list.next);
+            next = page_list_next(sp, pin_list);
         /* Strip out the type: this is now a free shadow page */
         sp->u.sh.type = sp->u.sh.head = 0;
         /* Remember the TLB timestamp so we will know whether to flush 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 65815bb..5fc10c9 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -428,20 +428,20 @@ sh_guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
 /* From one page of a multi-page shadow, find the next one */
 static inline mfn_t sh_next_page(mfn_t smfn)
 {
-    mfn_t next;
-    struct page_info *pg = mfn_to_page(smfn);
+    struct page_info *pg = mfn_to_page(smfn), *next;
+    struct page_list_head h = PAGE_LIST_HEAD_INIT(h);
 
     ASSERT(pg->u.sh.type == SH_type_l1_32_shadow
            || pg->u.sh.type == SH_type_fl1_32_shadow
            || pg->u.sh.type == SH_type_l2_32_shadow);
     ASSERT(pg->u.sh.type == SH_type_l2_32_shadow || pg->u.sh.head);
-    ASSERT(pg->list.next != PAGE_LIST_NULL);
 
-    next = _mfn(pdx_to_pfn(pg->list.next));
+    next = page_list_next(pg, &h);
 
-    ASSERT(mfn_to_page(next)->u.sh.type == pg->u.sh.type);
-    ASSERT(!mfn_to_page(next)->u.sh.head);
-    return next;
+    ASSERT(next);
+    ASSERT(next->u.sh.type == pg->u.sh.type);
+    ASSERT(!next->u.sh.head);
+    return page_to_mfn(next);
 }
 
 static inline u32
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index b778fcf..82c22e8 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -231,6 +231,17 @@ static inline int sh_type_has_up_pointer(struct vcpu *v, unsigned int t)
     return !sh_type_is_pinnable(v, t);
 }
 
+static inline void sh_terminate_list(struct page_list_head *tmp_list)
+{
+#ifndef PAGE_LIST_NULL
+    /* The temporary list-head is on our stack.  Invalidate the
+     * pointers to it in the shadows, just to get a clean failure if
+     * we accidentally follow them. */
+    tmp_list->prev->next = LIST_POISON1;
+    tmp_list->next->prev = LIST_POISON2;
+#endif
+}
+
 /*
  * Definitions for the shadow_flags field in page_info.
  * These flags are stored on *guest* pages...
@@ -318,6 +329,15 @@ static inline int mfn_oos_may_write(mfn_t gmfn)
 }
 #endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
 
+/* Figure out the size (in pages) of a given shadow type */
+extern const u8 sh_type_to_size[SH_type_unused];
+static inline unsigned int
+shadow_size(unsigned int shadow_type)
+{
+    ASSERT(shadow_type < ARRAY_SIZE(sh_type_to_size));
+    return sh_type_to_size[shadow_type];
+}
+
 /******************************************************************************
  * Various function declarations 
  */
@@ -586,22 +606,25 @@ prev_pinned_shadow(const struct page_info *page,
                    const struct domain *d)
 {
     struct page_info *p;
+    const struct page_list_head *pin_list;
+
+    pin_list = &d->arch.paging.shadow.pinned_shadows;
 
-    if ( page == d->arch.paging.shadow.pinned_shadows.next ) 
+    if ( page_list_empty(pin_list) || page == page_list_first(pin_list) )
         return NULL;
-    
+
     if ( page == NULL ) /* If no current place, start at the tail */
-        p = d->arch.paging.shadow.pinned_shadows.tail;
+        p = page_list_last(pin_list);
     else
-        p = pdx_to_page(page->list.prev);
+        p = page_list_prev(page, pin_list);
     /* Skip over the non-tail parts of multi-page shadows */
     if ( p && p->u.sh.type == SH_type_l2_32_shadow )
     {
-        p = pdx_to_page(p->list.prev);
+        p = page_list_prev(p, pin_list);
         ASSERT(p && p->u.sh.type == SH_type_l2_32_shadow);
-        p = pdx_to_page(p->list.prev);
+        p = page_list_prev(p, pin_list);
         ASSERT(p && p->u.sh.type == SH_type_l2_32_shadow);
-        p = pdx_to_page(p->list.prev);
+        p = page_list_prev(p, pin_list);
         ASSERT(p && p->u.sh.type == SH_type_l2_32_shadow);
     }
     ASSERT(!p || p->u.sh.head);
@@ -618,49 +641,48 @@ prev_pinned_shadow(const struct page_info *page,
  * Returns 0 for failure, 1 for success. */
 static inline int sh_pin(struct vcpu *v, mfn_t smfn)
 {
-    struct page_info *sp;
-    struct page_list_head h, *pin_list;
-    
+    struct page_info *sp[4];
+    struct page_list_head *pin_list;
+    unsigned int i, pages;
+    bool_t already_pinned;
+
     ASSERT(mfn_valid(smfn));
-    sp = mfn_to_page(smfn);
-    ASSERT(sh_type_is_pinnable(v, sp->u.sh.type));
-    ASSERT(sp->u.sh.head);
+    sp[0] = mfn_to_page(smfn);
+    pages = shadow_size(sp[0]->u.sh.type);
+    already_pinned = sp[0]->u.sh.pinned;
+    ASSERT(sh_type_is_pinnable(v, sp[0]->u.sh.type));
+    ASSERT(sp[0]->u.sh.head);
+
+    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
+    if ( already_pinned && sp[0] == page_list_first(pin_list) )
+        return 1;
 
     /* Treat the up-to-four pages of the shadow as a unit in the list ops */
-    h.next = h.tail = sp; 
-    if ( sp->u.sh.type == SH_type_l2_32_shadow ) 
+    for ( i = 1; i < pages; i++ )
     {
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        ASSERT(h.tail->u.sh.type == SH_type_l2_32_shadow); 
+        sp[i] = page_list_next(sp[i - 1], pin_list);
+        ASSERT(sp[i]->u.sh.type == sp[0]->u.sh.type);
+        ASSERT(!sp[i]->u.sh.head);
     }
-    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
 
-    if ( sp->u.sh.pinned )
+    if ( already_pinned )
     {
-        /* Already pinned: take it out of the pinned-list so it can go 
-         * at the front */
-        if ( pin_list->next == h.next )
-            return 1;
-        page_list_prev(h.next, pin_list)->list.next = h.tail->list.next;
-        if ( pin_list->tail == h.tail )
-            pin_list->tail = page_list_prev(h.next, pin_list);
-        else
-            page_list_next(h.tail, pin_list)->list.prev = h.next->list.prev;
-        h.tail->list.next = h.next->list.prev = PAGE_LIST_NULL;
+        /* Take it out of the pinned-list so it can go at the front */
+        for ( i = 0; i < pages; i++ )
+            page_list_del(sp[i], pin_list);
     }
     else
     {
         /* Not pinned: pin it! */
         if ( !sh_get_ref(v, smfn, 0) )
             return 0;
-        sp->u.sh.pinned = 1;
-        ASSERT(h.next->list.prev == PAGE_LIST_NULL);
-        ASSERT(h.tail->list.next == PAGE_LIST_NULL);
+        sp[0]->u.sh.pinned = 1;
     }
+
     /* Put it at the head of the list of pinned shadows */
-    page_list_splice(&h, pin_list);
+    for ( i = pages; i > 0; i-- )
+        page_list_add(sp[i - 1], pin_list);
+
     return 1;
 }
 
@@ -668,46 +690,35 @@ static inline int sh_pin(struct vcpu *v, mfn_t smfn)
  * of pinned shadows, and release the extra ref. */
 static inline void sh_unpin(struct vcpu *v, mfn_t smfn)
 {
-    struct page_list_head h, *pin_list;
-    struct page_info *sp;
-    
+    struct page_list_head tmp_list, *pin_list;
+    struct page_info *sp, *next;
+    unsigned int i, head_type;
+
     ASSERT(mfn_valid(smfn));
     sp = mfn_to_page(smfn);
+    head_type = sp->u.sh.type;
     ASSERT(sh_type_is_pinnable(v, sp->u.sh.type));
     ASSERT(sp->u.sh.head);
 
-    /* Treat the up-to-four pages of the shadow as a unit in the list ops */
-    h.next = h.tail = sp; 
-    if ( sp->u.sh.type == SH_type_l2_32_shadow ) 
-    {
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        h.tail = pdx_to_page(h.tail->list.next);
-        ASSERT(h.tail->u.sh.type == SH_type_l2_32_shadow); 
-    }
-    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
-
     if ( !sp->u.sh.pinned )
         return;
-
     sp->u.sh.pinned = 0;
 
-    /* Cut the sub-list out of the list of pinned shadows */
-    if ( pin_list->next == h.next && pin_list->tail == h.tail )
-        pin_list->next = pin_list->tail = NULL;
-    else 
+    /* Cut the sub-list out of the list of pinned shadows,
+     * stitching it back into a list fragment of its own. */
+    pin_list = &v->domain->arch.paging.shadow.pinned_shadows;
+    INIT_PAGE_LIST_HEAD(&tmp_list);
+    for ( i = 0; i < shadow_size(head_type); i++ )
     {
-        if ( pin_list->next == h.next )
-            pin_list->next = page_list_next(h.tail, pin_list);
-        else
-            page_list_prev(h.next, pin_list)->list.next = h.tail->list.next;
-        if ( pin_list->tail == h.tail )
-            pin_list->tail = page_list_prev(h.next, pin_list);
-        else
-            page_list_next(h.tail, pin_list)->list.prev = h.next->list.prev;
+        ASSERT(sp->u.sh.type == head_type);
+        ASSERT(!i || !sp->u.sh.head);
+        next = page_list_next(sp, pin_list);
+        page_list_del(sp, pin_list);
+        page_list_add_tail(sp, &tmp_list);
+        sp = next;
     }
-    h.tail->list.next = h.next->list.prev = PAGE_LIST_NULL;
-    
+    sh_terminate_list(&tmp_list);
+
     sh_put_ref(v, smfn, 0);
 }
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 74a65a6..a62ee1e 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -172,6 +172,11 @@ page_list_first(const struct page_list_head *head)
     return head->next;
 }
 static inline struct page_info *
+page_list_last(const struct page_list_head *head)
+{
+    return head->tail;
+}
+static inline struct page_info *
 page_list_next(const struct page_info *page,
                const struct page_list_head *head)
 {
@@ -331,8 +336,12 @@ page_list_splice(struct page_list_head *list, struct page_list_head *head)
 # define page_list_empty                 list_empty
 # define page_list_first(hd)             list_entry((hd)->next, \
                                                     struct page_info, list)
+# define page_list_last(hd)              list_entry((hd)->prev, \
+                                                    struct page_info, list)
 # define page_list_next(pg, hd)          list_entry((pg)->list.next, \
                                                     struct page_info, list)
+# define page_list_prev(pg, hd)          list_entry((pg)->list.prev, \
+                                                    struct page_info, list)
 # define page_list_add(pg, hd)           list_add(&(pg)->list, hd)
 # define page_list_add_tail(pg, hd)      list_add_tail(&(pg)->list, hd)
 # define page_list_del(pg, hd)           list_del(&(pg)->list)
--
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 Tue Feb 10 07:12:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:12: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 1YL4zk-0005sv-V6; Tue, 10 Feb 2015 07:12: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 1YL4zj-0005si-HG
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:27 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	BB/46-02804-A5FA9D45; Tue, 10 Feb 2015 07:12:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1423552345!5716126!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18710 invoked from network); 10 Feb 2015 07:12:26 -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;
	10 Feb 2015 07:12: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 1YL4zh-0005vg-6C
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zh-0004xr-2U
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:25 +0000
Date: Tue, 10 Feb 2015 07:12:25 +0000
Message-Id: <E1YL4zh-0004xr-2U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: don't needlessly expose
	internal 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 4b3a4238d6babe93a8620405a8785c50aa988f23
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:35:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:35:01 2015 +0100

    x86/shadow: don't needlessly expose internal functions
    
    ... and drop an unused one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |    2 +-
 xen/arch/x86/mm/shadow/private.h |    5 +++++
 xen/include/asm-x86/shadow.h     |   17 -----------------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 56d14e4..005cbe2 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2383,7 +2383,7 @@ int sh_remove_write_access_from_sl1p(struct vcpu *v, mfn_t gmfn,
 /* Remove all mappings of a guest frame from the shadow tables.
  * Returns non-zero if we need to flush TLBs. */
 
-int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
+static int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
 {
     struct page_info *page = mfn_to_page(gmfn);
 
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 82c22e8..72518fd 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -387,6 +387,11 @@ int shadow_write_guest_entry(struct vcpu *v, intpte_t *p,
 int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
                                intpte_t *old, intpte_t new, mfn_t gmfn);
 
+/* Update all the things that are derived from the guest's CR0/CR3/CR4.
+ * Called to initialize paging structures if the paging mode
+ * has changed, and when bringing up a VCPU for the first time. */
+void shadow_update_paging_modes(struct vcpu *v);
+
 /* Unhook the non-Xen mappings in this top-level shadow mfn.
  * With user_only == 1, unhooks only the user-mode mappings. */
 void shadow_unhook_mappings(struct vcpu *v, mfn_t smfn, int user_only);
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index f2ce352..308ce80 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -77,23 +77,6 @@ void shadow_teardown(struct domain *d);
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
 
-/* Update all the things that are derived from the guest's CR0/CR3/CR4.
- * Called to initialize paging structures if the paging mode
- * has changed, and when bringing up a VCPU for the first time. */
-void shadow_update_paging_modes(struct vcpu *v);
-
-
-/* Remove all mappings of the guest page from the shadows. 
- * This is called from common code.  It does not flush TLBs. */
-int sh_remove_all_mappings(struct vcpu *v, mfn_t target_mfn);
-static inline void 
-shadow_drop_references(struct domain *d, struct page_info *p)
-{
-    if ( unlikely(shadow_mode_enabled(d)) )
-        /* See the comment about locking in sh_remove_all_mappings */
-        sh_remove_all_mappings(d->vcpu[0], _mfn(page_to_mfn(p)));
-}
-
 /* Remove all shadows of the guest mfn. */
 void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all);
 static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn)
--
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 Tue Feb 10 07:12:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:12: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 1YL4zk-0005sv-V6; Tue, 10 Feb 2015 07:12: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 1YL4zj-0005si-HG
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:27 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	BB/46-02804-A5FA9D45; Tue, 10 Feb 2015 07:12:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1423552345!5716126!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18710 invoked from network); 10 Feb 2015 07:12:26 -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;
	10 Feb 2015 07:12: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 1YL4zh-0005vg-6C
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zh-0004xr-2U
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:25 +0000
Date: Tue, 10 Feb 2015 07:12:25 +0000
Message-Id: <E1YL4zh-0004xr-2U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: don't needlessly expose
	internal 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 4b3a4238d6babe93a8620405a8785c50aa988f23
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:35:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:35:01 2015 +0100

    x86/shadow: don't needlessly expose internal functions
    
    ... and drop an unused one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |    2 +-
 xen/arch/x86/mm/shadow/private.h |    5 +++++
 xen/include/asm-x86/shadow.h     |   17 -----------------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 56d14e4..005cbe2 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2383,7 +2383,7 @@ int sh_remove_write_access_from_sl1p(struct vcpu *v, mfn_t gmfn,
 /* Remove all mappings of a guest frame from the shadow tables.
  * Returns non-zero if we need to flush TLBs. */
 
-int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
+static int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
 {
     struct page_info *page = mfn_to_page(gmfn);
 
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 82c22e8..72518fd 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -387,6 +387,11 @@ int shadow_write_guest_entry(struct vcpu *v, intpte_t *p,
 int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
                                intpte_t *old, intpte_t new, mfn_t gmfn);
 
+/* Update all the things that are derived from the guest's CR0/CR3/CR4.
+ * Called to initialize paging structures if the paging mode
+ * has changed, and when bringing up a VCPU for the first time. */
+void shadow_update_paging_modes(struct vcpu *v);
+
 /* Unhook the non-Xen mappings in this top-level shadow mfn.
  * With user_only == 1, unhooks only the user-mode mappings. */
 void shadow_unhook_mappings(struct vcpu *v, mfn_t smfn, int user_only);
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index f2ce352..308ce80 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -77,23 +77,6 @@ void shadow_teardown(struct domain *d);
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
 
-/* Update all the things that are derived from the guest's CR0/CR3/CR4.
- * Called to initialize paging structures if the paging mode
- * has changed, and when bringing up a VCPU for the first time. */
-void shadow_update_paging_modes(struct vcpu *v);
-
-
-/* Remove all mappings of the guest page from the shadows. 
- * This is called from common code.  It does not flush TLBs. */
-int sh_remove_all_mappings(struct vcpu *v, mfn_t target_mfn);
-static inline void 
-shadow_drop_references(struct domain *d, struct page_info *p)
-{
-    if ( unlikely(shadow_mode_enabled(d)) )
-        /* See the comment about locking in sh_remove_all_mappings */
-        sh_remove_all_mappings(d->vcpu[0], _mfn(page_to_mfn(p)));
-}
-
 /* Remove all shadows of the guest mfn. */
 void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all);
 static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn)
--
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 Tue Feb 10 07:12:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL4zw-0005ux-GX; Tue, 10 Feb 2015 07:12:40 +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 1YL4zu-0005uV-LN
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:38 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	FC/71-02896-56FA9D45; Tue, 10 Feb 2015 07:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1423552355!11889821!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18013 invoked from network); 10 Feb 2015 07:12:36 -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;
	10 Feb 2015 07:12: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 1YL4zr-0005vo-L6
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zr-0004yI-HB
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:35 +0000
Date: Tue, 10 Feb 2015 07:12:35 +0000
Message-Id: <E1YL4zr-0004yI-HB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: allow for building without
	shadow mode 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 8f1ddea9f0d757d4c685689c12db8765ae800b1e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:36:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:36:39 2015 +0100

    x86/mm: allow for building without shadow mode support
    
    Considering the complexity of the code, it seems to be a reasonable
    thing to allow people to disable that code entirely even outside the
    immediate need for this by the next patch.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/Rules.mk           |    4 ++
 xen/arch/x86/domain_build.c     |    4 ++
 xen/arch/x86/mm/paging.c        |   18 +++++---
 xen/arch/x86/mm/shadow/Makefile |    6 ++-
 xen/arch/x86/mm/shadow/common.c |    4 +-
 xen/arch/x86/mm/shadow/none.c   |   78 +++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/domain.h    |    4 ++
 xen/include/asm-x86/paging.h    |    6 +++
 xen/include/asm-x86/shadow.h    |   35 +++++++++++++++--
 xen/include/xen/paging.h        |    2 +-
 10 files changed, 146 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index ef8c222..e0ca4b9 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -32,9 +32,13 @@ x86 := y
 x86_32 := n
 x86_64 := y
 
+shadow-paging ?= y
+
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
+
+CFLAGS-$(shadow-paging) += -DCONFIG_SHADOW_PAGING
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index a561d7c..4380b57 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -129,8 +129,10 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
     return alloc_vcpu(dom0, 0, 0);
 }
 
+#ifdef CONFIG_SHADOW_PAGING
 static bool_t __initdata opt_dom0_shadow;
 boolean_param("dom0_shadow", opt_dom0_shadow);
+#endif
 
 static char __initdata opt_dom0_ioports_disable[200] = "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
@@ -1418,6 +1420,7 @@ int __init construct_dom0(
     regs->esi = vstartinfo_start;
     regs->eflags = X86_EFLAGS_IF;
 
+#ifdef CONFIG_SHADOW_PAGING
     if ( opt_dom0_shadow )
     {
         if ( is_pvh_domain(d) )
@@ -1428,6 +1431,7 @@ int __init construct_dom0(
         if ( paging_enable(d, PG_SH_enable) == 0 ) 
             paging_update_paging_modes(v);
     }
+#endif
 
     /*
      * PVH Fixme: XENFEAT_supervisor_mode_kernel has been reused in PVH with a
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 6b788f7..b54d76a 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -635,16 +635,16 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags)
      * don't want to leak any active log-dirty bitmaps */
     d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 
-    /* The order of the *_init calls below is important, as the later
-     * ones may rewrite some common fields.  Shadow pagetables are the
-     * default... */
-    shadow_domain_init(d, domcr_flags);
-
-    /* ... but we will use hardware assistance if it's available. */
+    /*
+     * Shadow pagetables are the default, but we will use
+     * hardware assistance if it's available and enabled.
+     */
     if ( hap_enabled(d) )
         hap_domain_init(d);
+    else
+        rc = shadow_domain_init(d, domcr_flags);
 
-    return 0;
+    return rc;
 }
 
 /* vcpu paging struct initialization goes here */
@@ -822,12 +822,16 @@ int paging_enable(struct domain *d, u32 mode)
  * and therefore its pagetables will soon be discarded */
 void pagetable_dying(struct domain *d, paddr_t gpa)
 {
+#ifdef CONFIG_SHADOW_PAGING
     struct vcpu *v;
 
     ASSERT(paging_mode_shadow(d));
 
     v = d->vcpu[0];
     v->arch.paging.mode->shadow.pagetable_dying(v, gpa);
+#else
+    BUG();
+#endif
 }
 
 /* Print paging-assistance info to the console */
diff --git a/xen/arch/x86/mm/shadow/Makefile b/xen/arch/x86/mm/shadow/Makefile
index b3b0cde..a07bc0c 100644
--- a/xen/arch/x86/mm/shadow/Makefile
+++ b/xen/arch/x86/mm/shadow/Makefile
@@ -1,4 +1,8 @@
-obj-$(x86_64) += common.o guest_2.o guest_3.o guest_4.o
+ifeq ($(shadow-paging),y)
+obj-y += common.o guest_2.o guest_3.o guest_4.o
+else
+obj-y += none.o
+endif
 
 guest_%.o: multi.c Makefile
 	$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 005cbe2..3630ae0 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -47,7 +47,7 @@ static void sh_clean_dirty_bitmap(struct domain *);
 
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called for every domain from arch_domain_create() */
-void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
 {
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.freelist);
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.pinned_shadows);
@@ -61,6 +61,8 @@ void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
     d->arch.paging.shadow.oos_off = (domcr_flags & DOMCRF_oos_off) ?  1 : 0;
 #endif
     d->arch.paging.shadow.pagetable_dying_op = 0;
+
+    return 0;
 }
 
 /* Setup the shadow-specfic parts of a vcpu struct. Note: The most important
diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c
new file mode 100644
index 0000000..809f81c
--- /dev/null
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -0,0 +1,78 @@
+#include <xen/mm.h>
+#include <asm/shadow.h>
+
+static int _enable_log_dirty(struct domain *d, bool_t log_global)
+{
+    ASSERT(is_pv_domain(d));
+    return -EOPNOTSUPP;
+}
+
+static int _disable_log_dirty(struct domain *d)
+{
+    ASSERT(is_pv_domain(d));
+    return -EOPNOTSUPP;
+}
+
+static void _clean_dirty_bitmap(struct domain *d)
+{
+    ASSERT(is_pv_domain(d));
+}
+
+int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+{
+    paging_log_dirty_init(d, _enable_log_dirty,
+                          _disable_log_dirty, _clean_dirty_bitmap);
+    return is_pv_domain(d) ? 0 : -EOPNOTSUPP;
+}
+
+static int _page_fault(struct vcpu *v, unsigned long va,
+                       struct cpu_user_regs *regs)
+{
+    ASSERT_UNREACHABLE();
+    return 0;
+}
+
+static int _invlpg(struct vcpu *v, unsigned long va)
+{
+    ASSERT_UNREACHABLE();
+    return -EOPNOTSUPP;
+}
+
+static unsigned long _gva_to_gfn(struct vcpu *v, struct p2m_domain *p2m,
+                                 unsigned long va, uint32_t *pfec)
+{
+    ASSERT_UNREACHABLE();
+    return INVALID_GFN;
+}
+
+static void _update_cr3(struct vcpu *v, int do_locking)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static void _update_paging_modes(struct vcpu *v)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static void _write_p2m_entry(struct domain *d, unsigned long gfn,
+                             l1_pgentry_t *p, l1_pgentry_t new,
+                             unsigned int level)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static const struct paging_mode sh_paging_none = {
+    .page_fault                    = _page_fault,
+    .invlpg                        = _invlpg,
+    .gva_to_gfn                    = _gva_to_gfn,
+    .update_cr3                    = _update_cr3,
+    .update_paging_modes           = _update_paging_modes,
+    .write_p2m_entry               = _write_p2m_entry,
+};
+
+void shadow_vcpu_init(struct vcpu *v)
+{
+    ASSERT(is_pv_domain(v->domain));
+    v->arch.paging.mode = &sh_paging_none;
+}
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index b233fbc..00a8606 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -88,6 +88,7 @@ void hypercall_page_initialise(struct domain *d, void *);
 /*          shadow paging extension             */
 /************************************************/
 struct shadow_domain {
+#ifdef CONFIG_SHADOW_PAGING
     unsigned int      opt_flags;    /* runtime tunable optimizations on/off */
     struct page_list_head pinned_shadows;
 
@@ -117,9 +118,11 @@ struct shadow_domain {
 
     /* Has this domain ever used HVMOP_pagetable_dying? */
     bool_t pagetable_dying_op;
+#endif
 };
 
 struct shadow_vcpu {
+#ifdef CONFIG_SHADOW_PAGING
     /* PAE guests: per-vcpu shadow top-level table */
     l3_pgentry_t l3table[4] __attribute__((__aligned__(32)));
     /* PAE guests: per-vcpu cache of the top-level *guest* entries */
@@ -145,6 +148,7 @@ struct shadow_vcpu {
     } oos_fixup[SHADOW_OOS_PAGES];
 
     bool_t pagetable_dying;
+#endif
 };
 
 /************************************************/
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 5f810f6..53de715 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -39,7 +39,11 @@
 #define PG_SH_shift    20
 #define PG_HAP_shift   21
 /* We're in one of the shadow modes */
+#ifdef CONFIG_SHADOW_PAGING
 #define PG_SH_enable   (1U << PG_SH_shift)
+#else
+#define PG_SH_enable   0
+#endif
 #define PG_HAP_enable  (1U << PG_HAP_shift)
 
 /* common paging mode bits */
@@ -74,6 +78,7 @@
 
 struct sh_emulate_ctxt;
 struct shadow_paging_mode {
+#ifdef CONFIG_SHADOW_PAGING
     void          (*detach_old_tables     )(struct vcpu *v);
     int           (*x86_emulate_write     )(struct vcpu *v, unsigned long va,
                                             void *src, u32 bytes,
@@ -88,6 +93,7 @@ struct shadow_paging_mode {
     int           (*guess_wrmap           )(struct vcpu *v, 
                                             unsigned long vaddr, mfn_t gmfn);
     void          (*pagetable_dying       )(struct vcpu *v, paddr_t gpa);
+#endif
     /* For outsiders to tell what mode we're in */
     unsigned int shadow_levels;
 };
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 308ce80..a4c8776 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -49,12 +49,14 @@
 
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called from paging_domain_init(). */
-void shadow_domain_init(struct domain *d, unsigned int domcr_flags);
+int shadow_domain_init(struct domain *d, unsigned int domcr_flags);
 
 /* Setup the shadow-specific parts of a vcpu struct. It is called by
  * paging_vcpu_init() in paging.c */
 void shadow_vcpu_init(struct vcpu *v);
 
+#ifdef CONFIG_SHADOW_PAGING
+
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
@@ -77,17 +79,40 @@ void shadow_teardown(struct domain *d);
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
 
-/* Remove all shadows of the guest mfn. */
 void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all);
+
+/* Discard _all_ mappings from the domain's shadows. */
+void shadow_blow_tables_per_domain(struct domain *d);
+
+#else /* !CONFIG_SHADOW_PAGING */
+
+#define shadow_teardown(d) ASSERT(is_pv_domain(d))
+#define shadow_final_teardown(d) ASSERT(is_pv_domain(d))
+#define shadow_enable(d, mode) \
+    ({ ASSERT(is_pv_domain(d)); -EOPNOTSUPP; })
+#define shadow_track_dirty_vram(d, begin_pfn, nr, bitmap) \
+    ({ ASSERT_UNREACHABLE(); -EOPNOTSUPP; })
+
+static inline void sh_remove_shadows(struct vcpu *v, mfn_t gmfn,
+                                     bool_t fast, bool_t all) {}
+
+static inline void shadow_blow_tables_per_domain(struct domain *d) {}
+
+static inline int shadow_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
+                                XEN_GUEST_HANDLE_PARAM(void) u_domctl)
+{
+    return -EINVAL;
+}
+
+#endif /* CONFIG_SHADOW_PAGING */
+
+/* Remove all shadows of the guest mfn. */
 static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn)
 {
     /* See the comment about locking in sh_remove_shadows */
     sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */);
 }
 
-/* Discard _all_ mappings from the domain's shadows. */
-void shadow_blow_tables_per_domain(struct domain *d);
-
 #endif /* _XEN_SHADOW_H */
 
 /*
diff --git a/xen/include/xen/paging.h b/xen/include/xen/paging.h
index 123cc58..214bde5 100644
--- a/xen/include/xen/paging.h
+++ b/xen/include/xen/paging.h
@@ -7,7 +7,7 @@
 #include <asm/paging.h>
 #include <asm/p2m.h>
 
-#elif defined CONFIG_SHADOW
+#elif defined CONFIG_SHADOW_PAGING
 
 #include <asm/shadow.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 Tue Feb 10 07:12:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL4zw-0005ux-GX; Tue, 10 Feb 2015 07:12:40 +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 1YL4zu-0005uV-LN
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:38 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	FC/71-02896-56FA9D45; Tue, 10 Feb 2015 07:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1423552355!11889821!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18013 invoked from network); 10 Feb 2015 07:12:36 -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;
	10 Feb 2015 07:12: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 1YL4zr-0005vo-L6
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL4zr-0004yI-HB
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:35 +0000
Date: Tue, 10 Feb 2015 07:12:35 +0000
Message-Id: <E1YL4zr-0004yI-HB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: allow for building without
	shadow mode 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 8f1ddea9f0d757d4c685689c12db8765ae800b1e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:36:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:36:39 2015 +0100

    x86/mm: allow for building without shadow mode support
    
    Considering the complexity of the code, it seems to be a reasonable
    thing to allow people to disable that code entirely even outside the
    immediate need for this by the next patch.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/Rules.mk           |    4 ++
 xen/arch/x86/domain_build.c     |    4 ++
 xen/arch/x86/mm/paging.c        |   18 +++++---
 xen/arch/x86/mm/shadow/Makefile |    6 ++-
 xen/arch/x86/mm/shadow/common.c |    4 +-
 xen/arch/x86/mm/shadow/none.c   |   78 +++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/domain.h    |    4 ++
 xen/include/asm-x86/paging.h    |    6 +++
 xen/include/asm-x86/shadow.h    |   35 +++++++++++++++--
 xen/include/xen/paging.h        |    2 +-
 10 files changed, 146 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index ef8c222..e0ca4b9 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -32,9 +32,13 @@ x86 := y
 x86_32 := n
 x86_64 := y
 
+shadow-paging ?= y
+
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
+
+CFLAGS-$(shadow-paging) += -DCONFIG_SHADOW_PAGING
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index a561d7c..4380b57 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -129,8 +129,10 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
     return alloc_vcpu(dom0, 0, 0);
 }
 
+#ifdef CONFIG_SHADOW_PAGING
 static bool_t __initdata opt_dom0_shadow;
 boolean_param("dom0_shadow", opt_dom0_shadow);
+#endif
 
 static char __initdata opt_dom0_ioports_disable[200] = "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
@@ -1418,6 +1420,7 @@ int __init construct_dom0(
     regs->esi = vstartinfo_start;
     regs->eflags = X86_EFLAGS_IF;
 
+#ifdef CONFIG_SHADOW_PAGING
     if ( opt_dom0_shadow )
     {
         if ( is_pvh_domain(d) )
@@ -1428,6 +1431,7 @@ int __init construct_dom0(
         if ( paging_enable(d, PG_SH_enable) == 0 ) 
             paging_update_paging_modes(v);
     }
+#endif
 
     /*
      * PVH Fixme: XENFEAT_supervisor_mode_kernel has been reused in PVH with a
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 6b788f7..b54d76a 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -635,16 +635,16 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags)
      * don't want to leak any active log-dirty bitmaps */
     d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 
-    /* The order of the *_init calls below is important, as the later
-     * ones may rewrite some common fields.  Shadow pagetables are the
-     * default... */
-    shadow_domain_init(d, domcr_flags);
-
-    /* ... but we will use hardware assistance if it's available. */
+    /*
+     * Shadow pagetables are the default, but we will use
+     * hardware assistance if it's available and enabled.
+     */
     if ( hap_enabled(d) )
         hap_domain_init(d);
+    else
+        rc = shadow_domain_init(d, domcr_flags);
 
-    return 0;
+    return rc;
 }
 
 /* vcpu paging struct initialization goes here */
@@ -822,12 +822,16 @@ int paging_enable(struct domain *d, u32 mode)
  * and therefore its pagetables will soon be discarded */
 void pagetable_dying(struct domain *d, paddr_t gpa)
 {
+#ifdef CONFIG_SHADOW_PAGING
     struct vcpu *v;
 
     ASSERT(paging_mode_shadow(d));
 
     v = d->vcpu[0];
     v->arch.paging.mode->shadow.pagetable_dying(v, gpa);
+#else
+    BUG();
+#endif
 }
 
 /* Print paging-assistance info to the console */
diff --git a/xen/arch/x86/mm/shadow/Makefile b/xen/arch/x86/mm/shadow/Makefile
index b3b0cde..a07bc0c 100644
--- a/xen/arch/x86/mm/shadow/Makefile
+++ b/xen/arch/x86/mm/shadow/Makefile
@@ -1,4 +1,8 @@
-obj-$(x86_64) += common.o guest_2.o guest_3.o guest_4.o
+ifeq ($(shadow-paging),y)
+obj-y += common.o guest_2.o guest_3.o guest_4.o
+else
+obj-y += none.o
+endif
 
 guest_%.o: multi.c Makefile
 	$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 005cbe2..3630ae0 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -47,7 +47,7 @@ static void sh_clean_dirty_bitmap(struct domain *);
 
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called for every domain from arch_domain_create() */
-void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
 {
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.freelist);
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.pinned_shadows);
@@ -61,6 +61,8 @@ void shadow_domain_init(struct domain *d, unsigned int domcr_flags)
     d->arch.paging.shadow.oos_off = (domcr_flags & DOMCRF_oos_off) ?  1 : 0;
 #endif
     d->arch.paging.shadow.pagetable_dying_op = 0;
+
+    return 0;
 }
 
 /* Setup the shadow-specfic parts of a vcpu struct. Note: The most important
diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c
new file mode 100644
index 0000000..809f81c
--- /dev/null
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -0,0 +1,78 @@
+#include <xen/mm.h>
+#include <asm/shadow.h>
+
+static int _enable_log_dirty(struct domain *d, bool_t log_global)
+{
+    ASSERT(is_pv_domain(d));
+    return -EOPNOTSUPP;
+}
+
+static int _disable_log_dirty(struct domain *d)
+{
+    ASSERT(is_pv_domain(d));
+    return -EOPNOTSUPP;
+}
+
+static void _clean_dirty_bitmap(struct domain *d)
+{
+    ASSERT(is_pv_domain(d));
+}
+
+int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+{
+    paging_log_dirty_init(d, _enable_log_dirty,
+                          _disable_log_dirty, _clean_dirty_bitmap);
+    return is_pv_domain(d) ? 0 : -EOPNOTSUPP;
+}
+
+static int _page_fault(struct vcpu *v, unsigned long va,
+                       struct cpu_user_regs *regs)
+{
+    ASSERT_UNREACHABLE();
+    return 0;
+}
+
+static int _invlpg(struct vcpu *v, unsigned long va)
+{
+    ASSERT_UNREACHABLE();
+    return -EOPNOTSUPP;
+}
+
+static unsigned long _gva_to_gfn(struct vcpu *v, struct p2m_domain *p2m,
+                                 unsigned long va, uint32_t *pfec)
+{
+    ASSERT_UNREACHABLE();
+    return INVALID_GFN;
+}
+
+static void _update_cr3(struct vcpu *v, int do_locking)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static void _update_paging_modes(struct vcpu *v)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static void _write_p2m_entry(struct domain *d, unsigned long gfn,
+                             l1_pgentry_t *p, l1_pgentry_t new,
+                             unsigned int level)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static const struct paging_mode sh_paging_none = {
+    .page_fault                    = _page_fault,
+    .invlpg                        = _invlpg,
+    .gva_to_gfn                    = _gva_to_gfn,
+    .update_cr3                    = _update_cr3,
+    .update_paging_modes           = _update_paging_modes,
+    .write_p2m_entry               = _write_p2m_entry,
+};
+
+void shadow_vcpu_init(struct vcpu *v)
+{
+    ASSERT(is_pv_domain(v->domain));
+    v->arch.paging.mode = &sh_paging_none;
+}
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index b233fbc..00a8606 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -88,6 +88,7 @@ void hypercall_page_initialise(struct domain *d, void *);
 /*          shadow paging extension             */
 /************************************************/
 struct shadow_domain {
+#ifdef CONFIG_SHADOW_PAGING
     unsigned int      opt_flags;    /* runtime tunable optimizations on/off */
     struct page_list_head pinned_shadows;
 
@@ -117,9 +118,11 @@ struct shadow_domain {
 
     /* Has this domain ever used HVMOP_pagetable_dying? */
     bool_t pagetable_dying_op;
+#endif
 };
 
 struct shadow_vcpu {
+#ifdef CONFIG_SHADOW_PAGING
     /* PAE guests: per-vcpu shadow top-level table */
     l3_pgentry_t l3table[4] __attribute__((__aligned__(32)));
     /* PAE guests: per-vcpu cache of the top-level *guest* entries */
@@ -145,6 +148,7 @@ struct shadow_vcpu {
     } oos_fixup[SHADOW_OOS_PAGES];
 
     bool_t pagetable_dying;
+#endif
 };
 
 /************************************************/
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 5f810f6..53de715 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -39,7 +39,11 @@
 #define PG_SH_shift    20
 #define PG_HAP_shift   21
 /* We're in one of the shadow modes */
+#ifdef CONFIG_SHADOW_PAGING
 #define PG_SH_enable   (1U << PG_SH_shift)
+#else
+#define PG_SH_enable   0
+#endif
 #define PG_HAP_enable  (1U << PG_HAP_shift)
 
 /* common paging mode bits */
@@ -74,6 +78,7 @@
 
 struct sh_emulate_ctxt;
 struct shadow_paging_mode {
+#ifdef CONFIG_SHADOW_PAGING
     void          (*detach_old_tables     )(struct vcpu *v);
     int           (*x86_emulate_write     )(struct vcpu *v, unsigned long va,
                                             void *src, u32 bytes,
@@ -88,6 +93,7 @@ struct shadow_paging_mode {
     int           (*guess_wrmap           )(struct vcpu *v, 
                                             unsigned long vaddr, mfn_t gmfn);
     void          (*pagetable_dying       )(struct vcpu *v, paddr_t gpa);
+#endif
     /* For outsiders to tell what mode we're in */
     unsigned int shadow_levels;
 };
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 308ce80..a4c8776 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -49,12 +49,14 @@
 
 /* Set up the shadow-specific parts of a domain struct at start of day.
  * Called from paging_domain_init(). */
-void shadow_domain_init(struct domain *d, unsigned int domcr_flags);
+int shadow_domain_init(struct domain *d, unsigned int domcr_flags);
 
 /* Setup the shadow-specific parts of a vcpu struct. It is called by
  * paging_vcpu_init() in paging.c */
 void shadow_vcpu_init(struct vcpu *v);
 
+#ifdef CONFIG_SHADOW_PAGING
+
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
 int shadow_enable(struct domain *d, u32 mode);
 
@@ -77,17 +79,40 @@ void shadow_teardown(struct domain *d);
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
 
-/* Remove all shadows of the guest mfn. */
 void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all);
+
+/* Discard _all_ mappings from the domain's shadows. */
+void shadow_blow_tables_per_domain(struct domain *d);
+
+#else /* !CONFIG_SHADOW_PAGING */
+
+#define shadow_teardown(d) ASSERT(is_pv_domain(d))
+#define shadow_final_teardown(d) ASSERT(is_pv_domain(d))
+#define shadow_enable(d, mode) \
+    ({ ASSERT(is_pv_domain(d)); -EOPNOTSUPP; })
+#define shadow_track_dirty_vram(d, begin_pfn, nr, bitmap) \
+    ({ ASSERT_UNREACHABLE(); -EOPNOTSUPP; })
+
+static inline void sh_remove_shadows(struct vcpu *v, mfn_t gmfn,
+                                     bool_t fast, bool_t all) {}
+
+static inline void shadow_blow_tables_per_domain(struct domain *d) {}
+
+static inline int shadow_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
+                                XEN_GUEST_HANDLE_PARAM(void) u_domctl)
+{
+    return -EINVAL;
+}
+
+#endif /* CONFIG_SHADOW_PAGING */
+
+/* Remove all shadows of the guest mfn. */
 static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn)
 {
     /* See the comment about locking in sh_remove_shadows */
     sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */);
 }
 
-/* Discard _all_ mappings from the domain's shadows. */
-void shadow_blow_tables_per_domain(struct domain *d);
-
 #endif /* _XEN_SHADOW_H */
 
 /*
diff --git a/xen/include/xen/paging.h b/xen/include/xen/paging.h
index 123cc58..214bde5 100644
--- a/xen/include/xen/paging.h
+++ b/xen/include/xen/paging.h
@@ -7,7 +7,7 @@
 #include <asm/paging.h>
 #include <asm/p2m.h>
 
-#elif defined CONFIG_SHADOW
+#elif defined CONFIG_SHADOW_PAGING
 
 #include <asm/shadow.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 Tue Feb 10 07:12:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL505-0005xF-J4; Tue, 10 Feb 2015 07:12: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 1YL504-0005wi-7d
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:48 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	59/52-02994-F6FA9D45; Tue, 10 Feb 2015 07:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1423552366!7655873!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16446 invoked from network); 10 Feb 2015 07:12:46 -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;
	10 Feb 2015 07:12: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 1YL501-0005vu-R0
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL501-0004yu-Q1
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:45 +0000
Date: Tue, 10 Feb 2015 07:12:45 +0000
Message-Id: <E1YL501-0004yu-Q1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU/x86: correct page_list_first()
	use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c3808f4b5249691d9e15ec8d268158d52c6d899
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:38:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:38:22 2015 +0100

    IOMMU/x86: correct page_list_first() use
    
    Comparing its result against NULL is unsafe when page lists use normal
    list entries for linking together - page_list_empty() needs to be used
    instead.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/drivers/passthrough/x86/iommu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index ce0ca5a..52d8948 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -85,8 +85,9 @@ int arch_iommu_populate_page_table(struct domain *d)
          * first few entries.
          */
         page_list_move(&d->page_list, &d->arch.relmem_list);
-        while ( (page = page_list_first(&d->page_list)) != NULL &&
-                (page->count_info & (PGC_state|PGC_broken)) )
+        while ( !page_list_empty(&d->page_list) &&
+                (page = page_list_first(&d->page_list),
+                 (page->count_info & (PGC_state|PGC_broken))) )
         {
             page_list_del(page, &d->page_list);
             page_list_add_tail(page, &d->arch.relmem_list);
--
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 Tue Feb 10 07:12:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL505-0005xF-J4; Tue, 10 Feb 2015 07:12: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 1YL504-0005wi-7d
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:48 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	59/52-02994-F6FA9D45; Tue, 10 Feb 2015 07:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1423552366!7655873!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16446 invoked from network); 10 Feb 2015 07:12:46 -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;
	10 Feb 2015 07:12: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 1YL501-0005vu-R0
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL501-0004yu-Q1
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:45 +0000
Date: Tue, 10 Feb 2015 07:12:45 +0000
Message-Id: <E1YL501-0004yu-Q1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU/x86: correct page_list_first()
	use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c3808f4b5249691d9e15ec8d268158d52c6d899
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:38:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:38:22 2015 +0100

    IOMMU/x86: correct page_list_first() use
    
    Comparing its result against NULL is unsafe when page lists use normal
    list entries for linking together - page_list_empty() needs to be used
    instead.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/drivers/passthrough/x86/iommu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index ce0ca5a..52d8948 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -85,8 +85,9 @@ int arch_iommu_populate_page_table(struct domain *d)
          * first few entries.
          */
         page_list_move(&d->page_list, &d->arch.relmem_list);
-        while ( (page = page_list_first(&d->page_list)) != NULL &&
-                (page->count_info & (PGC_state|PGC_broken)) )
+        while ( !page_list_empty(&d->page_list) &&
+                (page = page_list_first(&d->page_list),
+                 (page->count_info & (PGC_state|PGC_broken))) )
         {
             page_list_del(page, &d->page_list);
             page_list_add_tail(page, &d->arch.relmem_list);
--
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 Tue Feb 10 07:12:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50F-0005zV-Lp; Tue, 10 Feb 2015 07: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 1YL50E-0005zD-ED
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:58 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	87/BE-03000-97FA9D45; Tue, 10 Feb 2015 07:12:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1423552376!12485899!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5746 invoked from network); 10 Feb 2015 07:12:57 -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;
	10 Feb 2015 07: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 1YL50C-0005w3-5U
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50C-0004zP-4O
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:56 +0000
Date: Tue, 10 Feb 2015 07:12:56 +0000
Message-Id: <E1YL50C-0004zP-4O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: provide build time option to
	support up to 123Tb of memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 10dcec844fee36b97a72f85181341a080727e02b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:39:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:39:17 2015 +0100

    x86: provide build time option to support up to 123Tb of memory
    
    As this requires growing struct page_info from 32 to 48 bytes as well
    as shrinking the always accessible direct mapped memory range from 5Tb
    to 3.5Tb, this isn't being introduced as a general or default enabled
    feature.
    
    A side effect of the change to x86's mm.h is that asm/mm.h may no
    longer be included directly. Hence in the few places where this was done,
    xen/mm.h is being substituted (indirectly in the hvm/mtrr.h case).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/Rules.mk        |    2 ++
 xen/arch/x86/hvm/mtrr.c      |    4 +---
 xen/arch/x86/setup.c         |    5 +++++
 xen/include/asm-x86/config.h |   29 +++++++++++++++++++++++++++--
 xen/include/asm-x86/mm.h     |    4 ++++
 xen/include/asm-x86/mtrr.h   |    3 +--
 6 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index e0ca4b9..4a04a8a 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -33,6 +33,7 @@ x86_32 := n
 x86_64 := y
 
 shadow-paging ?= y
+bigmem        ?= n
 
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
@@ -42,3 +43,4 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 CFLAGS-$(shadow-paging) += -DCONFIG_SHADOW_PAGING
+CFLAGS-$(bigmem)        += -DCONFIG_BIGMEM
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index ee18553..76b3c2a 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -18,13 +18,11 @@
  */
 
 #include <public/hvm/e820.h>
-#include <xen/types.h>
+#include <xen/domain_page.h>
 #include <asm/e820.h>
 #include <asm/iocap.h>
-#include <asm/mm.h>
 #include <asm/paging.h>
 #include <asm/p2m.h>
-#include <xen/domain_page.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/cacheattr.h>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c27c49c..d316212 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -386,8 +386,13 @@ static void __init setup_max_pdx(unsigned long top_page)
     if ( max_pdx > FRAMETABLE_NR )
         max_pdx = FRAMETABLE_NR;
 
+    if ( max_pdx > MPT_VIRT_SIZE / sizeof(unsigned long) )
+        max_pdx = MPT_VIRT_SIZE / sizeof(unsigned long);
+
+#ifdef PAGE_LIST_NULL
     if ( max_pdx >= PAGE_LIST_NULL )
         max_pdx = PAGE_LIST_NULL - 1;
+#endif
 
     max_page = pdx_to_pfn(max_pdx - 1) + 1;
 }
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 2fbd68d..270f694 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -158,6 +158,7 @@ extern unsigned char boot_edid_info[128];
  *    High read-only compatibility machine-to-phys translation table.
  *  0xffff82d080000000 - 0xffff82d0bfffffff [1GB,   2^30 bytes, PML4:261]
  *    Xen text, static data, bss.
+#ifndef CONFIG_BIGMEM
  *  0xffff82d0c0000000 - 0xffff82dffbffffff [61GB - 64MB,       PML4:261]
  *    Reserved for future use.
  *  0xffff82dffc000000 - 0xffff82dfffffffff [64MB,  2^26 bytes, PML4:261]
@@ -166,6 +167,16 @@ extern unsigned char boot_edid_info[128];
  *    Page-frame information array.
  *  0xffff830000000000 - 0xffff87ffffffffff [5TB, 5*2^40 bytes, PML4:262-271]
  *    1:1 direct mapping of all physical memory.
+#else
+ *  0xffff82d0c0000000 - 0xffff82ffdfffffff [188.5GB,           PML4:261]
+ *    Reserved for future use.
+ *  0xffff82ffe0000000 - 0xffff82ffffffffff [512MB, 2^29 bytes, PML4:261]
+ *    Super-page information array.
+ *  0xffff830000000000 - 0xffff847fffffffff [1.5TB, 3*2^39 bytes, PML4:262-264]
+ *    Page-frame information array.
+ *  0xffff848000000000 - 0xffff87ffffffffff [3.5TB, 7*2^39 bytes, PML4:265-271]
+ *    1:1 direct mapping of all physical memory.
+#endif
  *  0xffff880000000000 - 0xffffffffffffffff [120TB,             PML4:272-511]
  *    PV: Guest-defined use.
  *  0xffff880000000000 - 0xffffff7fffffffff [119.5TB,           PML4:272-510]
@@ -234,21 +245,35 @@ extern unsigned char boot_edid_info[128];
 /* Slot 261: xen text, static data and bss (1GB). */
 #define XEN_VIRT_START          (HIRO_COMPAT_MPT_VIRT_END)
 #define XEN_VIRT_END            (XEN_VIRT_START + GB(1))
-/* Slot 261: superpage information array (64MB). */
+
+/* Slot 261: superpage information array (64MB or 512MB). */
 #define SPAGETABLE_VIRT_END     FRAMETABLE_VIRT_START
 #define SPAGETABLE_NR           (((FRAMETABLE_NR - 1) >> (SUPERPAGE_SHIFT - \
                                                           PAGE_SHIFT)) + 1)
 #define SPAGETABLE_SIZE         (SPAGETABLE_NR * sizeof(struct spage_info))
 #define SPAGETABLE_VIRT_START   ((SPAGETABLE_VIRT_END - SPAGETABLE_SIZE) & \
                                  (_AC(-1,UL) << SUPERPAGE_SHIFT))
+
+#ifndef CONFIG_BIGMEM
 /* Slot 261: page-frame information array (128GB). */
-#define FRAMETABLE_VIRT_END     DIRECTMAP_VIRT_START
 #define FRAMETABLE_SIZE         GB(128)
+#else
+/* Slot 262-264: page-frame information array (1.5TB). */
+#define FRAMETABLE_SIZE         GB(1536)
+#endif
+#define FRAMETABLE_VIRT_END     DIRECTMAP_VIRT_START
 #define FRAMETABLE_NR           (FRAMETABLE_SIZE / sizeof(*frame_table))
 #define FRAMETABLE_VIRT_START   (FRAMETABLE_VIRT_END - FRAMETABLE_SIZE)
+
+#ifndef CONFIG_BIGMEM
 /* Slot 262-271/510: A direct 1:1 mapping of all of physical memory. */
 #define DIRECTMAP_VIRT_START    (PML4_ADDR(262))
 #define DIRECTMAP_SIZE          (PML4_ENTRY_BYTES * (511 - 262))
+#else
+/* Slot 265-271/510: A direct 1:1 mapping of all of physical memory. */
+#define DIRECTMAP_VIRT_START    (PML4_ADDR(265))
+#define DIRECTMAP_SIZE          (PML4_ENTRY_BYTES * (511 - 265))
+#endif
 #define DIRECTMAP_VIRT_END      (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE)
 
 #ifndef __ASSEMBLY__
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index dca298f..136f1c3 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -17,6 +17,7 @@
  */
 #define PFN_ORDER(_pfn) ((_pfn)->v.free.order)
 
+#ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
  * struct page_list_head), intended to allow easy adjustment once x86-64
@@ -30,6 +31,9 @@ struct page_list_entry
 {
     __pdx_t next, prev;
 };
+#else
+#define __pdx_t unsigned long
+#endif
 
 struct page_sharing_info;
 
diff --git a/xen/include/asm-x86/mtrr.h b/xen/include/asm-x86/mtrr.h
index 328ba04..0569db6 100644
--- a/xen/include/asm-x86/mtrr.h
+++ b/xen/include/asm-x86/mtrr.h
@@ -1,8 +1,7 @@
 #ifndef __ASM_X86_MTRR_H__
 #define __ASM_X86_MTRR_H__
 
-#include <xen/config.h>
-#include <asm/mm.h>
+#include <xen/mm.h>
 
 /* These are the region types. They match the architectural specification. */
 #define MTRR_TYPE_UNCACHABLE 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 Tue Feb 10 07:12:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50F-0005zV-Lp; Tue, 10 Feb 2015 07: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 1YL50E-0005zD-ED
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:58 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	87/BE-03000-97FA9D45; Tue, 10 Feb 2015 07:12:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1423552376!12485899!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5746 invoked from network); 10 Feb 2015 07:12:57 -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;
	10 Feb 2015 07: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 1YL50C-0005w3-5U
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50C-0004zP-4O
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:12:56 +0000
Date: Tue, 10 Feb 2015 07:12:56 +0000
Message-Id: <E1YL50C-0004zP-4O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: provide build time option to
	support up to 123Tb of memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 10dcec844fee36b97a72f85181341a080727e02b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 11:39:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:39:17 2015 +0100

    x86: provide build time option to support up to 123Tb of memory
    
    As this requires growing struct page_info from 32 to 48 bytes as well
    as shrinking the always accessible direct mapped memory range from 5Tb
    to 3.5Tb, this isn't being introduced as a general or default enabled
    feature.
    
    A side effect of the change to x86's mm.h is that asm/mm.h may no
    longer be included directly. Hence in the few places where this was done,
    xen/mm.h is being substituted (indirectly in the hvm/mtrr.h case).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/Rules.mk        |    2 ++
 xen/arch/x86/hvm/mtrr.c      |    4 +---
 xen/arch/x86/setup.c         |    5 +++++
 xen/include/asm-x86/config.h |   29 +++++++++++++++++++++++++++--
 xen/include/asm-x86/mm.h     |    4 ++++
 xen/include/asm-x86/mtrr.h   |    3 +--
 6 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index e0ca4b9..4a04a8a 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -33,6 +33,7 @@ x86_32 := n
 x86_64 := y
 
 shadow-paging ?= y
+bigmem        ?= n
 
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
@@ -42,3 +43,4 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 CFLAGS-$(shadow-paging) += -DCONFIG_SHADOW_PAGING
+CFLAGS-$(bigmem)        += -DCONFIG_BIGMEM
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index ee18553..76b3c2a 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -18,13 +18,11 @@
  */
 
 #include <public/hvm/e820.h>
-#include <xen/types.h>
+#include <xen/domain_page.h>
 #include <asm/e820.h>
 #include <asm/iocap.h>
-#include <asm/mm.h>
 #include <asm/paging.h>
 #include <asm/p2m.h>
-#include <xen/domain_page.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/cacheattr.h>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c27c49c..d316212 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -386,8 +386,13 @@ static void __init setup_max_pdx(unsigned long top_page)
     if ( max_pdx > FRAMETABLE_NR )
         max_pdx = FRAMETABLE_NR;
 
+    if ( max_pdx > MPT_VIRT_SIZE / sizeof(unsigned long) )
+        max_pdx = MPT_VIRT_SIZE / sizeof(unsigned long);
+
+#ifdef PAGE_LIST_NULL
     if ( max_pdx >= PAGE_LIST_NULL )
         max_pdx = PAGE_LIST_NULL - 1;
+#endif
 
     max_page = pdx_to_pfn(max_pdx - 1) + 1;
 }
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 2fbd68d..270f694 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -158,6 +158,7 @@ extern unsigned char boot_edid_info[128];
  *    High read-only compatibility machine-to-phys translation table.
  *  0xffff82d080000000 - 0xffff82d0bfffffff [1GB,   2^30 bytes, PML4:261]
  *    Xen text, static data, bss.
+#ifndef CONFIG_BIGMEM
  *  0xffff82d0c0000000 - 0xffff82dffbffffff [61GB - 64MB,       PML4:261]
  *    Reserved for future use.
  *  0xffff82dffc000000 - 0xffff82dfffffffff [64MB,  2^26 bytes, PML4:261]
@@ -166,6 +167,16 @@ extern unsigned char boot_edid_info[128];
  *    Page-frame information array.
  *  0xffff830000000000 - 0xffff87ffffffffff [5TB, 5*2^40 bytes, PML4:262-271]
  *    1:1 direct mapping of all physical memory.
+#else
+ *  0xffff82d0c0000000 - 0xffff82ffdfffffff [188.5GB,           PML4:261]
+ *    Reserved for future use.
+ *  0xffff82ffe0000000 - 0xffff82ffffffffff [512MB, 2^29 bytes, PML4:261]
+ *    Super-page information array.
+ *  0xffff830000000000 - 0xffff847fffffffff [1.5TB, 3*2^39 bytes, PML4:262-264]
+ *    Page-frame information array.
+ *  0xffff848000000000 - 0xffff87ffffffffff [3.5TB, 7*2^39 bytes, PML4:265-271]
+ *    1:1 direct mapping of all physical memory.
+#endif
  *  0xffff880000000000 - 0xffffffffffffffff [120TB,             PML4:272-511]
  *    PV: Guest-defined use.
  *  0xffff880000000000 - 0xffffff7fffffffff [119.5TB,           PML4:272-510]
@@ -234,21 +245,35 @@ extern unsigned char boot_edid_info[128];
 /* Slot 261: xen text, static data and bss (1GB). */
 #define XEN_VIRT_START          (HIRO_COMPAT_MPT_VIRT_END)
 #define XEN_VIRT_END            (XEN_VIRT_START + GB(1))
-/* Slot 261: superpage information array (64MB). */
+
+/* Slot 261: superpage information array (64MB or 512MB). */
 #define SPAGETABLE_VIRT_END     FRAMETABLE_VIRT_START
 #define SPAGETABLE_NR           (((FRAMETABLE_NR - 1) >> (SUPERPAGE_SHIFT - \
                                                           PAGE_SHIFT)) + 1)
 #define SPAGETABLE_SIZE         (SPAGETABLE_NR * sizeof(struct spage_info))
 #define SPAGETABLE_VIRT_START   ((SPAGETABLE_VIRT_END - SPAGETABLE_SIZE) & \
                                  (_AC(-1,UL) << SUPERPAGE_SHIFT))
+
+#ifndef CONFIG_BIGMEM
 /* Slot 261: page-frame information array (128GB). */
-#define FRAMETABLE_VIRT_END     DIRECTMAP_VIRT_START
 #define FRAMETABLE_SIZE         GB(128)
+#else
+/* Slot 262-264: page-frame information array (1.5TB). */
+#define FRAMETABLE_SIZE         GB(1536)
+#endif
+#define FRAMETABLE_VIRT_END     DIRECTMAP_VIRT_START
 #define FRAMETABLE_NR           (FRAMETABLE_SIZE / sizeof(*frame_table))
 #define FRAMETABLE_VIRT_START   (FRAMETABLE_VIRT_END - FRAMETABLE_SIZE)
+
+#ifndef CONFIG_BIGMEM
 /* Slot 262-271/510: A direct 1:1 mapping of all of physical memory. */
 #define DIRECTMAP_VIRT_START    (PML4_ADDR(262))
 #define DIRECTMAP_SIZE          (PML4_ENTRY_BYTES * (511 - 262))
+#else
+/* Slot 265-271/510: A direct 1:1 mapping of all of physical memory. */
+#define DIRECTMAP_VIRT_START    (PML4_ADDR(265))
+#define DIRECTMAP_SIZE          (PML4_ENTRY_BYTES * (511 - 265))
+#endif
 #define DIRECTMAP_VIRT_END      (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE)
 
 #ifndef __ASSEMBLY__
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index dca298f..136f1c3 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -17,6 +17,7 @@
  */
 #define PFN_ORDER(_pfn) ((_pfn)->v.free.order)
 
+#ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
  * struct page_list_head), intended to allow easy adjustment once x86-64
@@ -30,6 +31,9 @@ struct page_list_entry
 {
     __pdx_t next, prev;
 };
+#else
+#define __pdx_t unsigned long
+#endif
 
 struct page_sharing_info;
 
diff --git a/xen/include/asm-x86/mtrr.h b/xen/include/asm-x86/mtrr.h
index 328ba04..0569db6 100644
--- a/xen/include/asm-x86/mtrr.h
+++ b/xen/include/asm-x86/mtrr.h
@@ -1,8 +1,7 @@
 #ifndef __ASM_X86_MTRR_H__
 #define __ASM_X86_MTRR_H__
 
-#include <xen/config.h>
-#include <asm/mm.h>
+#include <xen/mm.h>
 
 /* These are the region types. They match the architectural specification. */
 #define MTRR_TYPE_UNCACHABLE 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 Tue Feb 10 07:13:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50Q-00061X-Od; Tue, 10 Feb 2015 07:13:10 +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 1YL50O-00061C-O6
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	CD/AE-02749-48FA9D45; Tue, 10 Feb 2015 07:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1423552386!12823755!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11066 invoked from network); 10 Feb 2015 07:13:07 -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;
	10 Feb 2015 07:13: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 1YL50M-0005wc-EY
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50M-0004zv-D7
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:06 +0000
Date: Tue, 10 Feb 2015 07:13:06 +0000
Message-Id: <E1YL50M-0004zv-D7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: alter the alloc/free xen event
	channel functions to take a 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 c58ba78c84eecf4b7ed5e68d744c555112f8ad14
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 11:40:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:40:10 2015 +0100

    evtchn: alter the alloc/free xen event channel functions to take a domain
    
    The resource behind an event channel is domain centric rather than vcpu
    centric.
    
    This change allows mem_event_disable() to avoid arbitrarily referencing
    d->vcpu[0] just to pass the domain.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    A few cosmetic adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c     |   20 +++++++++++---------
 xen/common/event_channel.c |   20 ++++++++------------
 xen/common/mem_event.c     |    5 ++---
 xen/include/xen/event.h    |    5 ++---
 4 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9e26342..b03ee4e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -627,7 +627,8 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
 
     spin_lock(&s->lock);
 
-    rc = alloc_unbound_xen_event_channel(v, s->domid, NULL);
+    rc = alloc_unbound_xen_event_channel(v->domain, v->vcpu_id, s->domid,
+                                         NULL);
     if ( rc < 0 )
         goto fail2;
 
@@ -637,7 +638,7 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
     {
         struct domain *d = s->domain;
 
-        rc = alloc_unbound_xen_event_channel(v, s->domid, NULL);
+        rc = alloc_unbound_xen_event_channel(v->domain, 0, s->domid, NULL);
         if ( rc < 0 )
             goto fail3;
 
@@ -658,7 +659,7 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
     return 0;
 
  fail3:
-    free_xen_event_channel(v, sv->ioreq_evtchn);
+    free_xen_event_channel(v->domain, sv->ioreq_evtchn);
     
  fail2:
     spin_unlock(&s->lock);
@@ -685,9 +686,9 @@ static void hvm_ioreq_server_remove_vcpu(struct hvm_ioreq_server *s,
         list_del(&sv->list_entry);
 
         if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
-            free_xen_event_channel(v, s->bufioreq_evtchn);
+            free_xen_event_channel(v->domain, s->bufioreq_evtchn);
 
-        free_xen_event_channel(v, sv->ioreq_evtchn);
+        free_xen_event_channel(v->domain, sv->ioreq_evtchn);
 
         xfree(sv);
         break;
@@ -712,9 +713,9 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
         list_del(&sv->list_entry);
 
         if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
-            free_xen_event_channel(v, s->bufioreq_evtchn);
+            free_xen_event_channel(v->domain, s->bufioreq_evtchn);
 
-        free_xen_event_channel(v, sv->ioreq_evtchn);
+        free_xen_event_channel(v->domain, sv->ioreq_evtchn);
 
         xfree(sv);
     }
@@ -1338,13 +1339,14 @@ static int hvm_replace_event_channel(struct vcpu *v, domid_t remote_domid,
 {
     int old_port, new_port;
 
-    new_port = alloc_unbound_xen_event_channel(v, remote_domid, NULL);
+    new_port = alloc_unbound_xen_event_channel(v->domain, v->vcpu_id,
+                                               remote_domid, NULL);
     if ( new_port < 0 )
         return new_port;
 
     /* xchg() ensures that only we call free_xen_event_channel(). */
     old_port = xchg(p_port, new_port);
-    free_xen_event_channel(v, old_port);
+    free_xen_event_channel(v->domain, old_port);
     return 0;
 }
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 4a52f69..fae242d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1139,42 +1139,38 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 
 int alloc_unbound_xen_event_channel(
-    struct vcpu *local_vcpu, domid_t remote_domid,
+    struct domain *ld, unsigned int lvcpu, domid_t remote_domid,
     xen_event_channel_notification_t notification_fn)
 {
     struct evtchn *chn;
-    struct domain *d = local_vcpu->domain;
     int            port, rc;
 
-    spin_lock(&d->event_lock);
+    spin_lock(&ld->event_lock);
 
-    rc = get_free_port(d);
+    rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
     port = rc;
-    chn = evtchn_from_port(d, port);
+    chn = evtchn_from_port(ld, port);
 
-    rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
     if ( rc )
         goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
-    chn->notify_vcpu_id = local_vcpu->vcpu_id;
+    chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
  out:
-    spin_unlock(&d->event_lock);
+    spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
 }
 
-
-void free_xen_event_channel(
-    struct vcpu *local_vcpu, int port)
+void free_xen_event_channel(struct domain *d, int port)
 {
     struct evtchn *chn;
-    struct domain *d = local_vcpu->domain;
 
     spin_lock(&d->event_lock);
 
diff --git a/xen/common/mem_event.c b/xen/common/mem_event.c
index 16ebdb5..7cfbe8e 100644
--- a/xen/common/mem_event.c
+++ b/xen/common/mem_event.c
@@ -81,8 +81,7 @@ static int mem_event_enable(
     med->blocked = 0;
 
     /* Allocate event channel */
-    rc = alloc_unbound_xen_event_channel(d->vcpu[0],
-                                         current->domain->domain_id,
+    rc = alloc_unbound_xen_event_channel(d, 0, current->domain->domain_id,
                                          notification_fn);
     if ( rc < 0 )
         goto err;
@@ -221,7 +220,7 @@ static int mem_event_disable(struct domain *d, struct mem_event_domain *med)
         }
 
         /* Free domU's event channel and leave the other one unbound */
-        free_xen_event_channel(d->vcpu[0], med->xen_port);
+        free_xen_event_channel(d, med->xen_port);
 
         /* Unblock all vCPUs */
         for_each_vcpu ( d, v )
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2b63f9a..690f865 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -58,10 +58,9 @@ void evtchn_move_pirqs(struct vcpu *v);
 typedef void (*xen_event_channel_notification_t)(
     struct vcpu *v, unsigned int port);
 int alloc_unbound_xen_event_channel(
-    struct vcpu *local_vcpu, domid_t remote_domid,
+    struct domain *ld, unsigned int lvcpu, domid_t remote_domid,
     xen_event_channel_notification_t notification_fn);
-void free_xen_event_channel(
-    struct vcpu *local_vcpu, int port);
+void free_xen_event_channel(struct domain *d, int port);
 
 /* Query if event channel is in use by the guest */
 int guest_enabled_event(struct vcpu *v, uint32_t virq);
--
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 Tue Feb 10 07:13:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50Q-00061X-Od; Tue, 10 Feb 2015 07:13:10 +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 1YL50O-00061C-O6
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	CD/AE-02749-48FA9D45; Tue, 10 Feb 2015 07:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1423552386!12823755!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11066 invoked from network); 10 Feb 2015 07:13:07 -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;
	10 Feb 2015 07:13: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 1YL50M-0005wc-EY
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50M-0004zv-D7
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:06 +0000
Date: Tue, 10 Feb 2015 07:13:06 +0000
Message-Id: <E1YL50M-0004zv-D7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: alter the alloc/free xen event
	channel functions to take a 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 c58ba78c84eecf4b7ed5e68d744c555112f8ad14
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 3 11:40:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 11:40:10 2015 +0100

    evtchn: alter the alloc/free xen event channel functions to take a domain
    
    The resource behind an event channel is domain centric rather than vcpu
    centric.
    
    This change allows mem_event_disable() to avoid arbitrarily referencing
    d->vcpu[0] just to pass the domain.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    A few cosmetic adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c     |   20 +++++++++++---------
 xen/common/event_channel.c |   20 ++++++++------------
 xen/common/mem_event.c     |    5 ++---
 xen/include/xen/event.h    |    5 ++---
 4 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9e26342..b03ee4e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -627,7 +627,8 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
 
     spin_lock(&s->lock);
 
-    rc = alloc_unbound_xen_event_channel(v, s->domid, NULL);
+    rc = alloc_unbound_xen_event_channel(v->domain, v->vcpu_id, s->domid,
+                                         NULL);
     if ( rc < 0 )
         goto fail2;
 
@@ -637,7 +638,7 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
     {
         struct domain *d = s->domain;
 
-        rc = alloc_unbound_xen_event_channel(v, s->domid, NULL);
+        rc = alloc_unbound_xen_event_channel(v->domain, 0, s->domid, NULL);
         if ( rc < 0 )
             goto fail3;
 
@@ -658,7 +659,7 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
     return 0;
 
  fail3:
-    free_xen_event_channel(v, sv->ioreq_evtchn);
+    free_xen_event_channel(v->domain, sv->ioreq_evtchn);
     
  fail2:
     spin_unlock(&s->lock);
@@ -685,9 +686,9 @@ static void hvm_ioreq_server_remove_vcpu(struct hvm_ioreq_server *s,
         list_del(&sv->list_entry);
 
         if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
-            free_xen_event_channel(v, s->bufioreq_evtchn);
+            free_xen_event_channel(v->domain, s->bufioreq_evtchn);
 
-        free_xen_event_channel(v, sv->ioreq_evtchn);
+        free_xen_event_channel(v->domain, sv->ioreq_evtchn);
 
         xfree(sv);
         break;
@@ -712,9 +713,9 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
         list_del(&sv->list_entry);
 
         if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
-            free_xen_event_channel(v, s->bufioreq_evtchn);
+            free_xen_event_channel(v->domain, s->bufioreq_evtchn);
 
-        free_xen_event_channel(v, sv->ioreq_evtchn);
+        free_xen_event_channel(v->domain, sv->ioreq_evtchn);
 
         xfree(sv);
     }
@@ -1338,13 +1339,14 @@ static int hvm_replace_event_channel(struct vcpu *v, domid_t remote_domid,
 {
     int old_port, new_port;
 
-    new_port = alloc_unbound_xen_event_channel(v, remote_domid, NULL);
+    new_port = alloc_unbound_xen_event_channel(v->domain, v->vcpu_id,
+                                               remote_domid, NULL);
     if ( new_port < 0 )
         return new_port;
 
     /* xchg() ensures that only we call free_xen_event_channel(). */
     old_port = xchg(p_port, new_port);
-    free_xen_event_channel(v, old_port);
+    free_xen_event_channel(v->domain, old_port);
     return 0;
 }
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 4a52f69..fae242d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1139,42 +1139,38 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 
 int alloc_unbound_xen_event_channel(
-    struct vcpu *local_vcpu, domid_t remote_domid,
+    struct domain *ld, unsigned int lvcpu, domid_t remote_domid,
     xen_event_channel_notification_t notification_fn)
 {
     struct evtchn *chn;
-    struct domain *d = local_vcpu->domain;
     int            port, rc;
 
-    spin_lock(&d->event_lock);
+    spin_lock(&ld->event_lock);
 
-    rc = get_free_port(d);
+    rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
     port = rc;
-    chn = evtchn_from_port(d, port);
+    chn = evtchn_from_port(ld, port);
 
-    rc = xsm_evtchn_unbound(XSM_TARGET, d, chn, remote_domid);
+    rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
     if ( rc )
         goto out;
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
-    chn->notify_vcpu_id = local_vcpu->vcpu_id;
+    chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
  out:
-    spin_unlock(&d->event_lock);
+    spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
 }
 
-
-void free_xen_event_channel(
-    struct vcpu *local_vcpu, int port)
+void free_xen_event_channel(struct domain *d, int port)
 {
     struct evtchn *chn;
-    struct domain *d = local_vcpu->domain;
 
     spin_lock(&d->event_lock);
 
diff --git a/xen/common/mem_event.c b/xen/common/mem_event.c
index 16ebdb5..7cfbe8e 100644
--- a/xen/common/mem_event.c
+++ b/xen/common/mem_event.c
@@ -81,8 +81,7 @@ static int mem_event_enable(
     med->blocked = 0;
 
     /* Allocate event channel */
-    rc = alloc_unbound_xen_event_channel(d->vcpu[0],
-                                         current->domain->domain_id,
+    rc = alloc_unbound_xen_event_channel(d, 0, current->domain->domain_id,
                                          notification_fn);
     if ( rc < 0 )
         goto err;
@@ -221,7 +220,7 @@ static int mem_event_disable(struct domain *d, struct mem_event_domain *med)
         }
 
         /* Free domU's event channel and leave the other one unbound */
-        free_xen_event_channel(d->vcpu[0], med->xen_port);
+        free_xen_event_channel(d, med->xen_port);
 
         /* Unblock all vCPUs */
         for_each_vcpu ( d, v )
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2b63f9a..690f865 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -58,10 +58,9 @@ void evtchn_move_pirqs(struct vcpu *v);
 typedef void (*xen_event_channel_notification_t)(
     struct vcpu *v, unsigned int port);
 int alloc_unbound_xen_event_channel(
-    struct vcpu *local_vcpu, domid_t remote_domid,
+    struct domain *ld, unsigned int lvcpu, domid_t remote_domid,
     xen_event_channel_notification_t notification_fn);
-void free_xen_event_channel(
-    struct vcpu *local_vcpu, int port);
+void free_xen_event_channel(struct domain *d, int port);
 
 /* Query if event channel is in use by the guest */
 int guest_enabled_event(struct vcpu *v, uint32_t virq);
--
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 Tue Feb 10 07:13:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50a-00063p-TX; Tue, 10 Feb 2015 07:13:20 +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 1YL50Z-00063I-Kn
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:19 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	82/8F-02745-E8FA9D45; Tue, 10 Feb 2015 07:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1423552397!11889952!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20788 invoked from network); 10 Feb 2015 07:13:18 -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;
	10 Feb 2015 07: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 1YL50W-0005wi-R4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50W-00051C-Lt
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:16 +0000
Date: Tue, 10 Feb 2015 07:13:16 +0000
Message-Id: <E1YL50W-00051C-Lt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] rump kernels: use new platform macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 441256a532dd737905ce335506d2ffcf0ff0db7c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Feb 3 13:47:08 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Feb 4 16:49:01 2015 +0000

    rump kernels: use new platform macro
    
    Starting from rump kernel changeset 91d5623 ("Renaming platform macros,
    app-tools and autoconf target string"), __RUMPUSER_XEN__ and __RUMPAPP__
    are deleted. We are supposed to use __RUMPRUN__ instead.
    
    We still keep __RUMPUSER_XEN__ for now in order to make xen-unstable
    pass osstest push gate. I will remove __RUMPUSER_XEN__ later.
    
    Related discussion:
    http://thread.gmane.org/gmane.comp.rumpkernel.user/739
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_private.c |    2 +-
 tools/xenstore/xs_lib.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index e2441ad..df6cd9b 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -33,7 +33,7 @@
 
 #define XENCTRL_OSDEP "XENCTRL_OSDEP"
 
-#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) && !defined(__RUMPRUN__)
 #define DO_DYNAMIC_OSDEP
 #endif
 
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index d166497..4795162 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -79,7 +79,7 @@ const char *xs_domain_dev(void)
 	char *s = getenv("XENSTORED_PATH");
 	if (s)
 		return s;
-#if defined(__RUMPUSER_XEN__)
+#if defined(__RUMPUSER_XEN__) || defined(__RUMPRUN__)
 	return "/dev/xen/xenbus";
 #elif defined(__linux__)
 	return "/proc/xen/xenbus";
--
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 Tue Feb 10 07:13:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50a-00063p-TX; Tue, 10 Feb 2015 07:13:20 +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 1YL50Z-00063I-Kn
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:19 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	82/8F-02745-E8FA9D45; Tue, 10 Feb 2015 07:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1423552397!11889952!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20788 invoked from network); 10 Feb 2015 07:13:18 -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;
	10 Feb 2015 07: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 1YL50W-0005wi-R4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50W-00051C-Lt
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:16 +0000
Date: Tue, 10 Feb 2015 07:13:16 +0000
Message-Id: <E1YL50W-00051C-Lt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] rump kernels: use new platform macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 441256a532dd737905ce335506d2ffcf0ff0db7c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Feb 3 13:47:08 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Feb 4 16:49:01 2015 +0000

    rump kernels: use new platform macro
    
    Starting from rump kernel changeset 91d5623 ("Renaming platform macros,
    app-tools and autoconf target string"), __RUMPUSER_XEN__ and __RUMPAPP__
    are deleted. We are supposed to use __RUMPRUN__ instead.
    
    We still keep __RUMPUSER_XEN__ for now in order to make xen-unstable
    pass osstest push gate. I will remove __RUMPUSER_XEN__ later.
    
    Related discussion:
    http://thread.gmane.org/gmane.comp.rumpkernel.user/739
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_private.c |    2 +-
 tools/xenstore/xs_lib.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index e2441ad..df6cd9b 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -33,7 +33,7 @@
 
 #define XENCTRL_OSDEP "XENCTRL_OSDEP"
 
-#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) && !defined(__RUMPRUN__)
 #define DO_DYNAMIC_OSDEP
 #endif
 
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index d166497..4795162 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -79,7 +79,7 @@ const char *xs_domain_dev(void)
 	char *s = getenv("XENSTORED_PATH");
 	if (s)
 		return s;
-#if defined(__RUMPUSER_XEN__)
+#if defined(__RUMPUSER_XEN__) || defined(__RUMPRUN__)
 	return "/dev/xen/xenbus";
 #elif defined(__linux__)
 	return "/proc/xen/xenbus";
--
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 Tue Feb 10 07:13:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50l-00065y-0E; Tue, 10 Feb 2015 07:13:31 +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 1YL50k-00065n-7s
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:30 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C2/0F-02749-99FA9D45; Tue, 10 Feb 2015 07:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1423552407!12485985!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7991 invoked from network); 10 Feb 2015 07:13:28 -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;
	10 Feb 2015 07: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 1YL50h-0005wo-7j
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50h-00051c-3h
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:27 +0000
Date: Tue, 10 Feb 2015 07:13:27 +0000
Message-Id: <E1YL50h-00051c-3h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Wait for ballooning if free
	memory is increasing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2563bca11544361dc2afa5e20b5663e10a0715cb
Author:     Mike Latimer <mlatimer@suse.com>
AuthorDate: Fri Jan 30 14:01:00 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:14:14 2015 +0000

    libxl: Wait for ballooning if free memory is increasing
    
    During domain startup, all required memory ballooning must complete
    within a maximum window of 33 seconds (3 retries, 11 seconds of delay).
    If not, domain creation is aborted with a 'failed to free memory' error.
    
    In order to accommodate large domains or slower hardware (which require
    substantially longer to balloon memory) the free memory process should
    continue retrying if the amount of free memory is increasing on each
    iteration of the loop.
    
    Signed-off-by: Mike Latimer <mlatimer@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index b7eac29..440db78 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2198,8 +2198,9 @@ static int preserve_domain(uint32_t *r_domid, libxl_event *event,
 
 static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
 {
-    int rc, retries = 3;
-    uint32_t need_memkb, free_memkb;
+    int rc, retries;
+    const int MAX_RETRIES = 3;
+    uint32_t need_memkb, free_memkb, free_memkb_prev = 0;
 
     if (!autoballoon)
         return 0;
@@ -2208,6 +2209,7 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
     if (rc < 0)
         return rc;
 
+    retries = MAX_RETRIES;
     do {
         rc = libxl_get_free_memory(ctx, &free_memkb);
         if (rc < 0)
@@ -2232,7 +2234,16 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
         if (rc < 0)
             return rc;
 
-        retries--;
+        /*
+         * If the amount of free mem has increased on this iteration (i.e.
+         * some progress has been made) then reset the retry counter.
+         */
+        if (free_memkb > free_memkb_prev) {
+            retries = MAX_RETRIES;
+            free_memkb_prev = free_memkb;
+        } else {
+            retries--;
+        }
     } while (retries > 0);
 
     return ERROR_NOMEM;
--
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 Tue Feb 10 07:13:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL50l-00065y-0E; Tue, 10 Feb 2015 07:13:31 +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 1YL50k-00065n-7s
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:30 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C2/0F-02749-99FA9D45; Tue, 10 Feb 2015 07:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1423552407!12485985!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7991 invoked from network); 10 Feb 2015 07:13:28 -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;
	10 Feb 2015 07: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 1YL50h-0005wo-7j
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50h-00051c-3h
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:27 +0000
Date: Tue, 10 Feb 2015 07:13:27 +0000
Message-Id: <E1YL50h-00051c-3h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Wait for ballooning if free
	memory is increasing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2563bca11544361dc2afa5e20b5663e10a0715cb
Author:     Mike Latimer <mlatimer@suse.com>
AuthorDate: Fri Jan 30 14:01:00 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:14:14 2015 +0000

    libxl: Wait for ballooning if free memory is increasing
    
    During domain startup, all required memory ballooning must complete
    within a maximum window of 33 seconds (3 retries, 11 seconds of delay).
    If not, domain creation is aborted with a 'failed to free memory' error.
    
    In order to accommodate large domains or slower hardware (which require
    substantially longer to balloon memory) the free memory process should
    continue retrying if the amount of free memory is increasing on each
    iteration of the loop.
    
    Signed-off-by: Mike Latimer <mlatimer@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index b7eac29..440db78 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2198,8 +2198,9 @@ static int preserve_domain(uint32_t *r_domid, libxl_event *event,
 
 static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
 {
-    int rc, retries = 3;
-    uint32_t need_memkb, free_memkb;
+    int rc, retries;
+    const int MAX_RETRIES = 3;
+    uint32_t need_memkb, free_memkb, free_memkb_prev = 0;
 
     if (!autoballoon)
         return 0;
@@ -2208,6 +2209,7 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
     if (rc < 0)
         return rc;
 
+    retries = MAX_RETRIES;
     do {
         rc = libxl_get_free_memory(ctx, &free_memkb);
         if (rc < 0)
@@ -2232,7 +2234,16 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
         if (rc < 0)
             return rc;
 
-        retries--;
+        /*
+         * If the amount of free mem has increased on this iteration (i.e.
+         * some progress has been made) then reset the retry counter.
+         */
+        if (free_memkb > free_memkb_prev) {
+            retries = MAX_RETRIES;
+            free_memkb_prev = free_memkb;
+        } else {
+            retries--;
+        }
     } while (retries > 0);
 
     return ERROR_NOMEM;
--
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 Tue Feb 10 07:13:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:13: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 1YL50v-00067t-36; Tue, 10 Feb 2015 07:13:41 +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 1YL50u-00067b-0Q
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:40 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	7A/A8-02754-3AFA9D45; Tue, 10 Feb 2015 07:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1423552417!5525399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16173 invoked from network); 10 Feb 2015 07:13:38 -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;
	10 Feb 2015 07: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 1YL50r-0005ww-G4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50r-00052D-Et
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:37 +0000
Date: Tue, 10 Feb 2015 07:13:37 +0000
Message-Id: <E1YL50r-00052D-Et@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add SCIF UART support for
	early printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57617cf072f30d8da3fb336228db432d34ac2570
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Wed Feb 4 15:05:22 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:20:04 2015 +0000

    xen/arm: Add SCIF UART support for early printk
    
    Add support for the "Lager" development board based on R-Car H2 SoC
    which has SCIF compatible UART.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt    |    1 +
 xen/arch/arm/Rules.mk             |    4 ++
 xen/arch/arm/arm32/debug-scif.inc |   49 +++++++++++++++++
 xen/include/asm-arm/scif-uart.h   |  107 +++++++++++++++++++++++++++++++++++++
 4 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 71a0247..1ca2a55 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -19,6 +19,7 @@ where mach is the name of the machine:
   - brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors.
   - hip04-d01: printk with 8250 on HiSilicon Hip-04 D01
   - seattle: printk with pl011 for AMD Seattle processor
+  - lager: printk with SCIF0 on Renesas R-Car H2 processors
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 4ee51a9..c7bd227 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -109,6 +109,10 @@ ifeq ($(CONFIG_EARLY_PRINTK), seattle)
 EARLY_PRINTK_INC := pl011
 EARLY_UART_BASE_ADDRESS := 0xe1010000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), lager)
+EARLY_PRINTK_INC := scif
+EARLY_UART_BASE_ADDRESS := 0xe6e60000
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm32/debug-scif.inc b/xen/arch/arm/arm32/debug-scif.inc
new file mode 100644
index 0000000..ce85752
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-scif.inc
@@ -0,0 +1,49 @@
+/*
+ * xen/arch/arm/arm32/debug-scif.inc
+ *
+ * SCIF specific debug code
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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/scif-uart.h>
+
+/* SCIF UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register
+ */
+.macro early_uart_ready rb rc
+1:
+        ldrh   \rc, [\rb, #SCIF_SCFSR]   /* <- SCFSR (status register) */
+        tst    \rc, #SCFSR_TDFE          /* Check TDFE bit */
+        beq    1b                        /* Wait for the UART to be ready */
+.endm
+
+/* SCIF UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit
+ */
+.macro early_uart_transmit rb rt
+        strb   \rt, [\rb, #SCIF_SCFTDR]                  /* -> SCFTDR (data register) */
+        ldrh   \rt, [\rb, #SCIF_SCFSR]                   /* <- SCFSR (status register) */
+        and    \rt, \rt, #(~(SCFSR_TEND | SCFSR_TDFE))   /* Clear TEND and TDFE bits */
+        strh   \rt, [\rb, #SCIF_SCFSR]                   /* -> SCFSR (status register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/scif-uart.h b/xen/include/asm-arm/scif-uart.h
new file mode 100644
index 0000000..7a9f639
--- /dev/null
+++ b/xen/include/asm-arm/scif-uart.h
@@ -0,0 +1,107 @@
+/*
+ * xen/include/asm-arm/scif-uart.h
+ *
+ * Common constant definition between early printk and the UART driver
+ * for the SCIF compatible UART.
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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.
+ */
+
+#ifndef __ASM_ARM_SCIF_UART_H
+#define __ASM_ARM_SCIF_UART_H
+
+#define SCIF_FIFO_MAX_SIZE    16
+#define SCIF_CLK_FREQ         14745600
+
+/* Register offsets */
+#define SCIF_SCSMR     (0x00)    /* Serial mode register           */
+#define SCIF_SCBRR     (0x04)    /* Bit rate register              */
+#define SCIF_SCSCR     (0x08)    /* Serial control register        */
+#define SCIF_SCFTDR    (0x0C)    /* Transmit FIFO data register    */
+#define SCIF_SCFSR     (0x10)    /* Serial status register         */
+#define SCIF_SCFRDR    (0x14)    /* Receive FIFO data register     */
+#define SCIF_SCFCR     (0x18)    /* FIFO control register          */
+#define SCIF_SCFDR     (0x1C)    /* FIFO data count register       */
+#define SCIF_SCSPTR    (0x20)    /* Serial port register           */
+#define SCIF_SCLSR     (0x24)    /* Line status register           */
+#define SCIF_DL        (0x30)    /* Frequency division register    */
+#define SCIF_CKS       (0x34)    /* Clock Select register          */
+
+/* Serial Control Register (SCSCR) */
+#define SCSCR_TIE     (1 << 7)    /* Transmit Interrupt Enable */
+#define SCSCR_RIE     (1 << 6)    /* Receive Interrupt Enable */
+#define SCSCR_TE      (1 << 5)    /* Transmit Enable */
+#define SCSCR_RE      (1 << 4)    /* Receive Enable */
+#define SCSCR_REIE    (1 << 3)    /* Receive Error Interrupt Enable */
+#define SCSCR_TOIE    (1 << 2)    /* Timeout Interrupt Enable */
+#define SCSCR_CKE1    (1 << 1)    /* Clock Enable 1 */
+#define SCSCR_CKE0    (1 << 0)    /* Clock Enable 0 */
+
+#define SCSCR_CKE00    (0)
+#define SCSCR_CKE01    (SCSCR_CKE0)
+#define SCSCR_CKE10    (SCSCR_CKE1)
+#define SCSCR_CKE11    (SCSCR_CKE1 | SCSCR_CKE0)
+
+/* Serial Mode Register (SCSMR) */
+#define SCSMR_CHR     (1 << 6)    /* 7-bit Character Length */
+#define SCSMR_PE      (1 << 5)    /* Parity Enable */
+#define SCSMR_ODD     (1 << 4)    /* Odd Parity */
+#define SCSMR_STOP    (1 << 3)    /* Stop Bit Length */
+
+/* Serial Status Register (SCFSR) */
+#define SCFSR_ER      (1 << 7)    /* Receive Error */
+#define SCFSR_TEND    (1 << 6)    /* Transmission End */
+#define SCFSR_TDFE    (1 << 5)    /* Transmit FIFO Data Empty */
+#define SCFSR_BRK     (1 << 4)    /* Break Detect */
+#define SCFSR_FER     (1 << 3)    /* Framing Error */
+#define SCFSR_PER     (1 << 2)    /* Parity Error */
+#define SCFSR_RDF     (1 << 1)    /* Receive FIFO Data Full */
+#define SCFSR_DR      (1 << 0)    /* Receive Data Ready */
+
+#define SCIF_ERRORS    (SCFSR_PER | SCFSR_FER | SCFSR_ER | SCFSR_BRK)
+
+/* Line Status Register (SCLSR) */
+#define SCLSR_TO      (1 << 2)    /* Timeout */
+#define SCLSR_ORER    (1 << 0)    /* Overrun Error */
+
+/* FIFO Control Register (SCFCR) */
+#define SCFCR_RTRG1    (1 << 7)    /* Receive FIFO Data Count Trigger 1 */
+#define SCFCR_RTRG0    (1 << 6)    /* Receive FIFO Data Count Trigger 0 */
+#define SCFCR_TTRG1    (1 << 5)    /* Transmit FIFO Data Count Trigger 1 */
+#define SCFCR_TTRG0    (1 << 4)    /* Transmit FIFO Data Count Trigger 0 */
+#define SCFCR_MCE      (1 << 3)    /* Modem Control Enable */
+#define SCFCR_TFRST    (1 << 2)    /* Transmit FIFO Data Register Reset */
+#define SCFCR_RFRST    (1 << 1)    /* Receive FIFO Data Register Reset */
+#define SCFCR_LOOP     (1 << 0)    /* Loopback Test */
+
+#define SCFCR_RTRG00    (0)
+#define SCFCR_RTRG01    (SCFCR_RTRG0)
+#define SCFCR_RTRG10    (SCFCR_RTRG1)
+#define SCFCR_RTRG11    (SCFCR_RTRG1 | SCFCR_RTRG0)
+
+#define SCFCR_TTRG00    (0)
+#define SCFCR_TTRG01    (SCFCR_TTRG0)
+#define SCFCR_TTRG10    (SCFCR_TTRG1)
+#define SCFCR_TTRG11    (SCFCR_TTRG1 | SCFCR_TTRG0)
+
+#endif /* __ASM_ARM_SCIF_UART_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * 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 Tue Feb 10 07:13:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:13: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 1YL50v-00067t-36; Tue, 10 Feb 2015 07:13:41 +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 1YL50u-00067b-0Q
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:40 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	7A/A8-02754-3AFA9D45; Tue, 10 Feb 2015 07:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1423552417!5525399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16173 invoked from network); 10 Feb 2015 07:13:38 -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;
	10 Feb 2015 07: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 1YL50r-0005ww-G4
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL50r-00052D-Et
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:37 +0000
Date: Tue, 10 Feb 2015 07:13:37 +0000
Message-Id: <E1YL50r-00052D-Et@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add SCIF UART support for
	early printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57617cf072f30d8da3fb336228db432d34ac2570
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Wed Feb 4 15:05:22 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:20:04 2015 +0000

    xen/arm: Add SCIF UART support for early printk
    
    Add support for the "Lager" development board based on R-Car H2 SoC
    which has SCIF compatible UART.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt    |    1 +
 xen/arch/arm/Rules.mk             |    4 ++
 xen/arch/arm/arm32/debug-scif.inc |   49 +++++++++++++++++
 xen/include/asm-arm/scif-uart.h   |  107 +++++++++++++++++++++++++++++++++++++
 4 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 71a0247..1ca2a55 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -19,6 +19,7 @@ where mach is the name of the machine:
   - brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors.
   - hip04-d01: printk with 8250 on HiSilicon Hip-04 D01
   - seattle: printk with pl011 for AMD Seattle processor
+  - lager: printk with SCIF0 on Renesas R-Car H2 processors
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 4ee51a9..c7bd227 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -109,6 +109,10 @@ ifeq ($(CONFIG_EARLY_PRINTK), seattle)
 EARLY_PRINTK_INC := pl011
 EARLY_UART_BASE_ADDRESS := 0xe1010000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), lager)
+EARLY_PRINTK_INC := scif
+EARLY_UART_BASE_ADDRESS := 0xe6e60000
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm32/debug-scif.inc b/xen/arch/arm/arm32/debug-scif.inc
new file mode 100644
index 0000000..ce85752
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-scif.inc
@@ -0,0 +1,49 @@
+/*
+ * xen/arch/arm/arm32/debug-scif.inc
+ *
+ * SCIF specific debug code
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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/scif-uart.h>
+
+/* SCIF UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register
+ */
+.macro early_uart_ready rb rc
+1:
+        ldrh   \rc, [\rb, #SCIF_SCFSR]   /* <- SCFSR (status register) */
+        tst    \rc, #SCFSR_TDFE          /* Check TDFE bit */
+        beq    1b                        /* Wait for the UART to be ready */
+.endm
+
+/* SCIF UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit
+ */
+.macro early_uart_transmit rb rt
+        strb   \rt, [\rb, #SCIF_SCFTDR]                  /* -> SCFTDR (data register) */
+        ldrh   \rt, [\rb, #SCIF_SCFSR]                   /* <- SCFSR (status register) */
+        and    \rt, \rt, #(~(SCFSR_TEND | SCFSR_TDFE))   /* Clear TEND and TDFE bits */
+        strh   \rt, [\rb, #SCIF_SCFSR]                   /* -> SCFSR (status register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/scif-uart.h b/xen/include/asm-arm/scif-uart.h
new file mode 100644
index 0000000..7a9f639
--- /dev/null
+++ b/xen/include/asm-arm/scif-uart.h
@@ -0,0 +1,107 @@
+/*
+ * xen/include/asm-arm/scif-uart.h
+ *
+ * Common constant definition between early printk and the UART driver
+ * for the SCIF compatible UART.
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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.
+ */
+
+#ifndef __ASM_ARM_SCIF_UART_H
+#define __ASM_ARM_SCIF_UART_H
+
+#define SCIF_FIFO_MAX_SIZE    16
+#define SCIF_CLK_FREQ         14745600
+
+/* Register offsets */
+#define SCIF_SCSMR     (0x00)    /* Serial mode register           */
+#define SCIF_SCBRR     (0x04)    /* Bit rate register              */
+#define SCIF_SCSCR     (0x08)    /* Serial control register        */
+#define SCIF_SCFTDR    (0x0C)    /* Transmit FIFO data register    */
+#define SCIF_SCFSR     (0x10)    /* Serial status register         */
+#define SCIF_SCFRDR    (0x14)    /* Receive FIFO data register     */
+#define SCIF_SCFCR     (0x18)    /* FIFO control register          */
+#define SCIF_SCFDR     (0x1C)    /* FIFO data count register       */
+#define SCIF_SCSPTR    (0x20)    /* Serial port register           */
+#define SCIF_SCLSR     (0x24)    /* Line status register           */
+#define SCIF_DL        (0x30)    /* Frequency division register    */
+#define SCIF_CKS       (0x34)    /* Clock Select register          */
+
+/* Serial Control Register (SCSCR) */
+#define SCSCR_TIE     (1 << 7)    /* Transmit Interrupt Enable */
+#define SCSCR_RIE     (1 << 6)    /* Receive Interrupt Enable */
+#define SCSCR_TE      (1 << 5)    /* Transmit Enable */
+#define SCSCR_RE      (1 << 4)    /* Receive Enable */
+#define SCSCR_REIE    (1 << 3)    /* Receive Error Interrupt Enable */
+#define SCSCR_TOIE    (1 << 2)    /* Timeout Interrupt Enable */
+#define SCSCR_CKE1    (1 << 1)    /* Clock Enable 1 */
+#define SCSCR_CKE0    (1 << 0)    /* Clock Enable 0 */
+
+#define SCSCR_CKE00    (0)
+#define SCSCR_CKE01    (SCSCR_CKE0)
+#define SCSCR_CKE10    (SCSCR_CKE1)
+#define SCSCR_CKE11    (SCSCR_CKE1 | SCSCR_CKE0)
+
+/* Serial Mode Register (SCSMR) */
+#define SCSMR_CHR     (1 << 6)    /* 7-bit Character Length */
+#define SCSMR_PE      (1 << 5)    /* Parity Enable */
+#define SCSMR_ODD     (1 << 4)    /* Odd Parity */
+#define SCSMR_STOP    (1 << 3)    /* Stop Bit Length */
+
+/* Serial Status Register (SCFSR) */
+#define SCFSR_ER      (1 << 7)    /* Receive Error */
+#define SCFSR_TEND    (1 << 6)    /* Transmission End */
+#define SCFSR_TDFE    (1 << 5)    /* Transmit FIFO Data Empty */
+#define SCFSR_BRK     (1 << 4)    /* Break Detect */
+#define SCFSR_FER     (1 << 3)    /* Framing Error */
+#define SCFSR_PER     (1 << 2)    /* Parity Error */
+#define SCFSR_RDF     (1 << 1)    /* Receive FIFO Data Full */
+#define SCFSR_DR      (1 << 0)    /* Receive Data Ready */
+
+#define SCIF_ERRORS    (SCFSR_PER | SCFSR_FER | SCFSR_ER | SCFSR_BRK)
+
+/* Line Status Register (SCLSR) */
+#define SCLSR_TO      (1 << 2)    /* Timeout */
+#define SCLSR_ORER    (1 << 0)    /* Overrun Error */
+
+/* FIFO Control Register (SCFCR) */
+#define SCFCR_RTRG1    (1 << 7)    /* Receive FIFO Data Count Trigger 1 */
+#define SCFCR_RTRG0    (1 << 6)    /* Receive FIFO Data Count Trigger 0 */
+#define SCFCR_TTRG1    (1 << 5)    /* Transmit FIFO Data Count Trigger 1 */
+#define SCFCR_TTRG0    (1 << 4)    /* Transmit FIFO Data Count Trigger 0 */
+#define SCFCR_MCE      (1 << 3)    /* Modem Control Enable */
+#define SCFCR_TFRST    (1 << 2)    /* Transmit FIFO Data Register Reset */
+#define SCFCR_RFRST    (1 << 1)    /* Receive FIFO Data Register Reset */
+#define SCFCR_LOOP     (1 << 0)    /* Loopback Test */
+
+#define SCFCR_RTRG00    (0)
+#define SCFCR_RTRG01    (SCFCR_RTRG0)
+#define SCFCR_RTRG10    (SCFCR_RTRG1)
+#define SCFCR_RTRG11    (SCFCR_RTRG1 | SCFCR_RTRG0)
+
+#define SCFCR_TTRG00    (0)
+#define SCFCR_TTRG01    (SCFCR_TTRG0)
+#define SCFCR_TTRG10    (SCFCR_TTRG1)
+#define SCFCR_TTRG11    (SCFCR_TTRG1 | SCFCR_TTRG0)
+
+#endif /* __ASM_ARM_SCIF_UART_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * 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 Tue Feb 10 07:13:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:13: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 1YL516-00069k-5q; Tue, 10 Feb 2015 07:13:52 +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 1YL515-00069S-0y
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:51 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	5D/6A-02898-EAFA9D45; Tue, 10 Feb 2015 07:13:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1423552427!11781984!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29738 invoked from network); 10 Feb 2015 07:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Feb 2015 07: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 1YL511-0005x2-NB
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL511-00052Z-L7
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:47 +0000
Date: Tue, 10 Feb 2015 07:13:47 +0000
Message-Id: <E1YL511-00052Z-L7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add new driver for SCIF UART
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b29ff3b6b3e0274309255dafa198af6141dd691
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Wed Feb 4 15:05:23 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:20:04 2015 +0000

    xen/arm: Add new driver for SCIF UART
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/arm32.mk              |    1 +
 xen/drivers/char/Makefile    |    1 +
 xen/drivers/char/scif-uart.c |  367 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 369 insertions(+), 0 deletions(-)

diff --git a/config/arm32.mk b/config/arm32.mk
index 4f83a63..268ca9c 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -12,6 +12,7 @@ CFLAGS += -marm
 HAS_PL011 := y
 HAS_EXYNOS4210 := y
 HAS_OMAP := y
+HAS_SCIF := y
 HAS_NS16550 := y
 
 # Use only if calling $(LD) directly.
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 911b788..9e94195 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -3,6 +3,7 @@ obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
 obj-$(HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(HAS_OMAP) += omap-uart.o
+obj-$(HAS_SCIF) += scif-uart.o
 obj-$(HAS_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += dt-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
new file mode 100644
index 0000000..1a1c496
--- /dev/null
+++ b/xen/drivers/char/scif-uart.c
@@ -0,0 +1,367 @@
+/*
+ * xen/drivers/char/scif-uart.c
+ *
+ * Driver for SCIF (Serial communication interface with FIFO)
+ * compatible UART.
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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 <xen/config.h>
+#include <xen/console.h>
+#include <xen/errno.h>
+#include <xen/serial.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <xen/delay.h>
+#include <asm/device.h>
+#include <asm/scif-uart.h>
+#include <asm/io.h>
+
+#define PARITY_NONE    0
+#define PARITY_EVEN    1
+#define PARITY_ODD     2
+
+#define scif_readb(uart, off)          readb((uart)->regs + (off))
+#define scif_writeb(uart, off, val)    writeb((val), (uart)->regs + (off))
+
+#define scif_readw(uart, off)          readw((uart)->regs + (off))
+#define scif_writew(uart, off, val)    writew((val), (uart)->regs + (off))
+
+static struct scif_uart {
+    unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+    unsigned int irq;
+    char __iomem *regs;
+    struct irqaction irqaction;
+    struct vuart_info vuart;
+} scif_com = {0};
+
+static void scif_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs)
+{
+    struct serial_port *port = data;
+    struct scif_uart *uart = port->uart;
+    uint16_t status, ctrl;
+
+    ctrl = scif_readw(uart, SCIF_SCSCR);
+    status = scif_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
+    /* Ignore next flag if TX Interrupt is disabled */
+    if ( !(ctrl & SCSCR_TIE) )
+        status &= ~SCFSR_TDFE;
+
+    while ( status != 0 )
+    {
+        /* TX Interrupt */
+        if ( status & SCFSR_TDFE )
+            serial_tx_interrupt(port, regs);
+
+        /* RX Interrupt */
+        if ( status & (SCFSR_RDF | SCFSR_DR) )
+            serial_rx_interrupt(port, regs);
+
+        /* Error Interrupt */
+        if ( status & SCIF_ERRORS )
+            scif_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
+        if ( scif_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
+            scif_writew(uart, SCIF_SCLSR, 0);
+
+        ctrl = scif_readw(uart, SCIF_SCSCR);
+        status = scif_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
+        /* Ignore next flag if TX Interrupt is disabled */
+        if ( !(ctrl & SCSCR_TIE) )
+            status &= ~SCFSR_TDFE;
+    }
+}
+
+static void __init scif_uart_init_preirq(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+    unsigned int divisor;
+    uint16_t val;
+
+    /*
+     * Wait until last bit has been transmitted. This is needed for a smooth
+     * transition when we come from early printk
+     */
+    while ( !(scif_readw(uart, SCIF_SCFSR) & SCFSR_TEND) );
+
+    /* Disable TX/RX parts and all interrupts */
+    scif_writew(uart, SCIF_SCSCR, 0);
+
+    /* Reset TX/RX FIFOs */
+    scif_writew(uart, SCIF_SCFCR, SCFCR_RFRST | SCFCR_TFRST);
+
+    /* Clear all errors and flags */
+    scif_readw(uart, SCIF_SCFSR);
+    scif_writew(uart, SCIF_SCFSR, 0);
+    scif_readw(uart, SCIF_SCLSR);
+    scif_writew(uart, SCIF_SCLSR, 0);
+
+    /* Select Baud rate generator output as a clock source */
+    scif_writew(uart, SCIF_SCSCR, SCSCR_CKE10);
+
+    /* Setup protocol format and Baud rate, select Asynchronous mode */
+    val = 0;
+    ASSERT( uart->data_bits >= 7 && uart->data_bits <= 8 );
+    if ( uart->data_bits == 7 )
+        val |= SCSMR_CHR;
+    else
+        val &= ~SCSMR_CHR;
+
+    ASSERT( uart->stop_bits >= 1 && uart->stop_bits <= 2 );
+    if ( uart->stop_bits == 2 )
+        val |= SCSMR_STOP;
+    else
+        val &= ~SCSMR_STOP;
+
+    ASSERT( uart->parity >= PARITY_NONE && uart->parity <= PARITY_ODD );
+    switch ( uart->parity )
+    {
+    case PARITY_NONE:
+        val &= ~SCSMR_PE;
+        break;
+
+    case PARITY_EVEN:
+        val |= SCSMR_PE;
+        break;
+
+    case PARITY_ODD:
+        val |= SCSMR_PE | SCSMR_ODD;
+        break;
+    }
+    scif_writew(uart, SCIF_SCSMR, val);
+
+    ASSERT( uart->clock_hz > 0 );
+    if ( uart->baud != BAUD_AUTO )
+    {
+        /* Setup desired Baud rate */
+        divisor = uart->clock_hz / (uart->baud << 4);
+        ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
+        scif_writew(uart, SCIF_DL, (uint16_t)divisor);
+        /* Selects the frequency divided clock (SC_CLK external input) */
+        scif_writew(uart, SCIF_CKS, 0);
+        udelay(1000000 / uart->baud + 1);
+    }
+    else
+    {
+        /* Read current Baud rate */
+        divisor = scif_readw(uart, SCIF_DL);
+        ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
+        uart->baud = uart->clock_hz / (divisor << 4);
+    }
+
+    /* Setup trigger level for TX/RX FIFOs */
+    scif_writew(uart, SCIF_SCFCR, SCFCR_RTRG11 | SCFCR_TTRG11);
+
+    /* Enable TX/RX parts */
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) |
+                 SCSCR_TE | SCSCR_RE);
+}
+
+static void __init scif_uart_init_postirq(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+    int rc;
+
+    uart->irqaction.handler = scif_uart_interrupt;
+    uart->irqaction.name    = "scif_uart";
+    uart->irqaction.dev_id  = port;
+
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+        dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %d\n",
+                uart->irq);
+
+    /* Clear all errors */
+    if ( scif_readw(uart, SCIF_SCFSR) & SCIF_ERRORS )
+        scif_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
+    if ( scif_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
+        scif_writew(uart, SCIF_SCLSR, 0);
+
+    /* Enable TX/RX and Error Interrupts  */
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) |
+                 SCSCR_TIE | SCSCR_RIE | SCSCR_REIE);
+}
+
+static void scif_uart_suspend(struct serial_port *port)
+{
+    BUG();
+}
+
+static void scif_uart_resume(struct serial_port *port)
+{
+    BUG();
+}
+
+static int scif_uart_tx_ready(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+    uint16_t cnt;
+
+    /* Check for empty space in TX FIFO */
+    if ( !(scif_readw(uart, SCIF_SCFSR) & SCFSR_TDFE) )
+        return 0;
+
+     /* Check number of data bytes stored in TX FIFO */
+    cnt = scif_readw(uart, SCIF_SCFDR) >> 8;
+    ASSERT( cnt >= 0 && cnt <= SCIF_FIFO_MAX_SIZE );
+
+    return (SCIF_FIFO_MAX_SIZE - cnt);
+}
+
+static void scif_uart_putc(struct serial_port *port, char c)
+{
+    struct scif_uart *uart = port->uart;
+
+    scif_writeb(uart, SCIF_SCFTDR, c);
+    /* Clear required TX flags */
+    scif_writew(uart, SCIF_SCFSR, scif_readw(uart, SCIF_SCFSR) &
+                 ~(SCFSR_TEND | SCFSR_TDFE));
+}
+
+static int scif_uart_getc(struct serial_port *port, char *pc)
+{
+    struct scif_uart *uart = port->uart;
+
+    /* Check for available data bytes in RX FIFO */
+    if ( !(scif_readw(uart, SCIF_SCFSR) & (SCFSR_RDF | SCFSR_DR)) )
+        return 0;
+
+    *pc = scif_readb(uart, SCIF_SCFRDR);
+
+    /* dummy read */
+    scif_readw(uart, SCIF_SCFSR);
+    /* Clear required RX flags */
+    scif_writew(uart, SCIF_SCFSR, ~(SCFSR_RDF | SCFSR_DR));
+
+    return 1;
+}
+
+static int __init scif_uart_irq(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    return ((uart->irq > 0) ? uart->irq : -1);
+}
+
+static const struct vuart_info *scif_vuart_info(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    return &uart->vuart;
+}
+
+static void scif_uart_start_tx(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) | SCSCR_TIE);
+}
+
+static void scif_uart_stop_tx(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) & ~SCSCR_TIE);
+}
+
+static struct uart_driver __read_mostly scif_uart_driver = {
+    .init_preirq  = scif_uart_init_preirq,
+    .init_postirq = scif_uart_init_postirq,
+    .endboot      = NULL,
+    .suspend      = scif_uart_suspend,
+    .resume       = scif_uart_resume,
+    .tx_ready     = scif_uart_tx_ready,
+    .putc         = scif_uart_putc,
+    .getc         = scif_uart_getc,
+    .irq          = scif_uart_irq,
+    .start_tx     = scif_uart_start_tx,
+    .stop_tx      = scif_uart_stop_tx,
+    .vuart_info   = scif_vuart_info,
+};
+
+static int __init scif_uart_init(struct dt_device_node *dev,
+                                 const void *data)
+{
+    const char *config = data;
+    struct scif_uart *uart;
+    int res;
+    u64 addr, size;
+
+    if ( strcmp(config, "") )
+        printk("WARNING: UART configuration is not supported\n");
+
+    uart = &scif_com;
+
+    uart->clock_hz  = SCIF_CLK_FREQ;
+    uart->baud      = BAUD_AUTO;
+    uart->data_bits = 8;
+    uart->parity    = PARITY_NONE;
+    uart->stop_bits = 1;
+
+    res = dt_device_get_address(dev, 0, &addr, &size);
+    if ( res )
+    {
+        printk("scif-uart: Unable to retrieve the base"
+                     " address of the UART\n");
+        return res;
+    }
+
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
+    {
+        printk("scif-uart: Unable to retrieve the IRQ\n");
+        return res;
+    }
+    uart->irq = res;
+
+    uart->regs = ioremap_nocache(addr, size);
+    if ( !uart->regs )
+    {
+        printk("scif-uart: Unable to map the UART memory\n");
+        return -ENOMEM;
+    }
+
+    uart->vuart.base_addr  = addr;
+    uart->vuart.size       = size;
+    uart->vuart.data_off   = SCIF_SCFTDR;
+    uart->vuart.status_off = SCIF_SCFSR;
+    uart->vuart.status     = SCFSR_TDFE;
+
+    /* Register with generic serial driver */
+    serial_register_uart(SERHND_DTUART, &scif_uart_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
+}
+
+static const char * const scif_uart_dt_compat[] __initconst =
+{
+    "renesas,scif",
+    NULL
+};
+
+DT_DEVICE_START(scif_uart, "SCIF UART", DEVICE_SERIAL)
+    .compatible = scif_uart_dt_compat,
+    .init = scif_uart_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * 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 Tue Feb 10 07:13:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:13: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 1YL516-00069k-5q; Tue, 10 Feb 2015 07:13:52 +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 1YL515-00069S-0y
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:51 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	5D/6A-02898-EAFA9D45; Tue, 10 Feb 2015 07:13:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1423552427!11781984!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29738 invoked from network); 10 Feb 2015 07:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Feb 2015 07: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 1YL511-0005x2-NB
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL511-00052Z-L7
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:47 +0000
Date: Tue, 10 Feb 2015 07:13:47 +0000
Message-Id: <E1YL511-00052Z-L7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add new driver for SCIF UART
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b29ff3b6b3e0274309255dafa198af6141dd691
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Wed Feb 4 15:05:23 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:20:04 2015 +0000

    xen/arm: Add new driver for SCIF UART
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/arm32.mk              |    1 +
 xen/drivers/char/Makefile    |    1 +
 xen/drivers/char/scif-uart.c |  367 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 369 insertions(+), 0 deletions(-)

diff --git a/config/arm32.mk b/config/arm32.mk
index 4f83a63..268ca9c 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -12,6 +12,7 @@ CFLAGS += -marm
 HAS_PL011 := y
 HAS_EXYNOS4210 := y
 HAS_OMAP := y
+HAS_SCIF := y
 HAS_NS16550 := y
 
 # Use only if calling $(LD) directly.
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 911b788..9e94195 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -3,6 +3,7 @@ obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
 obj-$(HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(HAS_OMAP) += omap-uart.o
+obj-$(HAS_SCIF) += scif-uart.o
 obj-$(HAS_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += dt-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
new file mode 100644
index 0000000..1a1c496
--- /dev/null
+++ b/xen/drivers/char/scif-uart.c
@@ -0,0 +1,367 @@
+/*
+ * xen/drivers/char/scif-uart.c
+ *
+ * Driver for SCIF (Serial communication interface with FIFO)
+ * compatible UART.
+ *
+ * Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
+ * Copyright (C) 2014, Globallogic.
+ *
+ * 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 <xen/config.h>
+#include <xen/console.h>
+#include <xen/errno.h>
+#include <xen/serial.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <xen/delay.h>
+#include <asm/device.h>
+#include <asm/scif-uart.h>
+#include <asm/io.h>
+
+#define PARITY_NONE    0
+#define PARITY_EVEN    1
+#define PARITY_ODD     2
+
+#define scif_readb(uart, off)          readb((uart)->regs + (off))
+#define scif_writeb(uart, off, val)    writeb((val), (uart)->regs + (off))
+
+#define scif_readw(uart, off)          readw((uart)->regs + (off))
+#define scif_writew(uart, off, val)    writew((val), (uart)->regs + (off))
+
+static struct scif_uart {
+    unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+    unsigned int irq;
+    char __iomem *regs;
+    struct irqaction irqaction;
+    struct vuart_info vuart;
+} scif_com = {0};
+
+static void scif_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs)
+{
+    struct serial_port *port = data;
+    struct scif_uart *uart = port->uart;
+    uint16_t status, ctrl;
+
+    ctrl = scif_readw(uart, SCIF_SCSCR);
+    status = scif_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
+    /* Ignore next flag if TX Interrupt is disabled */
+    if ( !(ctrl & SCSCR_TIE) )
+        status &= ~SCFSR_TDFE;
+
+    while ( status != 0 )
+    {
+        /* TX Interrupt */
+        if ( status & SCFSR_TDFE )
+            serial_tx_interrupt(port, regs);
+
+        /* RX Interrupt */
+        if ( status & (SCFSR_RDF | SCFSR_DR) )
+            serial_rx_interrupt(port, regs);
+
+        /* Error Interrupt */
+        if ( status & SCIF_ERRORS )
+            scif_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
+        if ( scif_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
+            scif_writew(uart, SCIF_SCLSR, 0);
+
+        ctrl = scif_readw(uart, SCIF_SCSCR);
+        status = scif_readw(uart, SCIF_SCFSR) & ~SCFSR_TEND;
+        /* Ignore next flag if TX Interrupt is disabled */
+        if ( !(ctrl & SCSCR_TIE) )
+            status &= ~SCFSR_TDFE;
+    }
+}
+
+static void __init scif_uart_init_preirq(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+    unsigned int divisor;
+    uint16_t val;
+
+    /*
+     * Wait until last bit has been transmitted. This is needed for a smooth
+     * transition when we come from early printk
+     */
+    while ( !(scif_readw(uart, SCIF_SCFSR) & SCFSR_TEND) );
+
+    /* Disable TX/RX parts and all interrupts */
+    scif_writew(uart, SCIF_SCSCR, 0);
+
+    /* Reset TX/RX FIFOs */
+    scif_writew(uart, SCIF_SCFCR, SCFCR_RFRST | SCFCR_TFRST);
+
+    /* Clear all errors and flags */
+    scif_readw(uart, SCIF_SCFSR);
+    scif_writew(uart, SCIF_SCFSR, 0);
+    scif_readw(uart, SCIF_SCLSR);
+    scif_writew(uart, SCIF_SCLSR, 0);
+
+    /* Select Baud rate generator output as a clock source */
+    scif_writew(uart, SCIF_SCSCR, SCSCR_CKE10);
+
+    /* Setup protocol format and Baud rate, select Asynchronous mode */
+    val = 0;
+    ASSERT( uart->data_bits >= 7 && uart->data_bits <= 8 );
+    if ( uart->data_bits == 7 )
+        val |= SCSMR_CHR;
+    else
+        val &= ~SCSMR_CHR;
+
+    ASSERT( uart->stop_bits >= 1 && uart->stop_bits <= 2 );
+    if ( uart->stop_bits == 2 )
+        val |= SCSMR_STOP;
+    else
+        val &= ~SCSMR_STOP;
+
+    ASSERT( uart->parity >= PARITY_NONE && uart->parity <= PARITY_ODD );
+    switch ( uart->parity )
+    {
+    case PARITY_NONE:
+        val &= ~SCSMR_PE;
+        break;
+
+    case PARITY_EVEN:
+        val |= SCSMR_PE;
+        break;
+
+    case PARITY_ODD:
+        val |= SCSMR_PE | SCSMR_ODD;
+        break;
+    }
+    scif_writew(uart, SCIF_SCSMR, val);
+
+    ASSERT( uart->clock_hz > 0 );
+    if ( uart->baud != BAUD_AUTO )
+    {
+        /* Setup desired Baud rate */
+        divisor = uart->clock_hz / (uart->baud << 4);
+        ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
+        scif_writew(uart, SCIF_DL, (uint16_t)divisor);
+        /* Selects the frequency divided clock (SC_CLK external input) */
+        scif_writew(uart, SCIF_CKS, 0);
+        udelay(1000000 / uart->baud + 1);
+    }
+    else
+    {
+        /* Read current Baud rate */
+        divisor = scif_readw(uart, SCIF_DL);
+        ASSERT( divisor >= 1 && divisor <= (uint16_t)UINT_MAX );
+        uart->baud = uart->clock_hz / (divisor << 4);
+    }
+
+    /* Setup trigger level for TX/RX FIFOs */
+    scif_writew(uart, SCIF_SCFCR, SCFCR_RTRG11 | SCFCR_TTRG11);
+
+    /* Enable TX/RX parts */
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) |
+                 SCSCR_TE | SCSCR_RE);
+}
+
+static void __init scif_uart_init_postirq(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+    int rc;
+
+    uart->irqaction.handler = scif_uart_interrupt;
+    uart->irqaction.name    = "scif_uart";
+    uart->irqaction.dev_id  = port;
+
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+        dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %d\n",
+                uart->irq);
+
+    /* Clear all errors */
+    if ( scif_readw(uart, SCIF_SCFSR) & SCIF_ERRORS )
+        scif_writew(uart, SCIF_SCFSR, ~SCIF_ERRORS);
+    if ( scif_readw(uart, SCIF_SCLSR) & SCLSR_ORER )
+        scif_writew(uart, SCIF_SCLSR, 0);
+
+    /* Enable TX/RX and Error Interrupts  */
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) |
+                 SCSCR_TIE | SCSCR_RIE | SCSCR_REIE);
+}
+
+static void scif_uart_suspend(struct serial_port *port)
+{
+    BUG();
+}
+
+static void scif_uart_resume(struct serial_port *port)
+{
+    BUG();
+}
+
+static int scif_uart_tx_ready(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+    uint16_t cnt;
+
+    /* Check for empty space in TX FIFO */
+    if ( !(scif_readw(uart, SCIF_SCFSR) & SCFSR_TDFE) )
+        return 0;
+
+     /* Check number of data bytes stored in TX FIFO */
+    cnt = scif_readw(uart, SCIF_SCFDR) >> 8;
+    ASSERT( cnt >= 0 && cnt <= SCIF_FIFO_MAX_SIZE );
+
+    return (SCIF_FIFO_MAX_SIZE - cnt);
+}
+
+static void scif_uart_putc(struct serial_port *port, char c)
+{
+    struct scif_uart *uart = port->uart;
+
+    scif_writeb(uart, SCIF_SCFTDR, c);
+    /* Clear required TX flags */
+    scif_writew(uart, SCIF_SCFSR, scif_readw(uart, SCIF_SCFSR) &
+                 ~(SCFSR_TEND | SCFSR_TDFE));
+}
+
+static int scif_uart_getc(struct serial_port *port, char *pc)
+{
+    struct scif_uart *uart = port->uart;
+
+    /* Check for available data bytes in RX FIFO */
+    if ( !(scif_readw(uart, SCIF_SCFSR) & (SCFSR_RDF | SCFSR_DR)) )
+        return 0;
+
+    *pc = scif_readb(uart, SCIF_SCFRDR);
+
+    /* dummy read */
+    scif_readw(uart, SCIF_SCFSR);
+    /* Clear required RX flags */
+    scif_writew(uart, SCIF_SCFSR, ~(SCFSR_RDF | SCFSR_DR));
+
+    return 1;
+}
+
+static int __init scif_uart_irq(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    return ((uart->irq > 0) ? uart->irq : -1);
+}
+
+static const struct vuart_info *scif_vuart_info(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    return &uart->vuart;
+}
+
+static void scif_uart_start_tx(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) | SCSCR_TIE);
+}
+
+static void scif_uart_stop_tx(struct serial_port *port)
+{
+    struct scif_uart *uart = port->uart;
+
+    scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) & ~SCSCR_TIE);
+}
+
+static struct uart_driver __read_mostly scif_uart_driver = {
+    .init_preirq  = scif_uart_init_preirq,
+    .init_postirq = scif_uart_init_postirq,
+    .endboot      = NULL,
+    .suspend      = scif_uart_suspend,
+    .resume       = scif_uart_resume,
+    .tx_ready     = scif_uart_tx_ready,
+    .putc         = scif_uart_putc,
+    .getc         = scif_uart_getc,
+    .irq          = scif_uart_irq,
+    .start_tx     = scif_uart_start_tx,
+    .stop_tx      = scif_uart_stop_tx,
+    .vuart_info   = scif_vuart_info,
+};
+
+static int __init scif_uart_init(struct dt_device_node *dev,
+                                 const void *data)
+{
+    const char *config = data;
+    struct scif_uart *uart;
+    int res;
+    u64 addr, size;
+
+    if ( strcmp(config, "") )
+        printk("WARNING: UART configuration is not supported\n");
+
+    uart = &scif_com;
+
+    uart->clock_hz  = SCIF_CLK_FREQ;
+    uart->baud      = BAUD_AUTO;
+    uart->data_bits = 8;
+    uart->parity    = PARITY_NONE;
+    uart->stop_bits = 1;
+
+    res = dt_device_get_address(dev, 0, &addr, &size);
+    if ( res )
+    {
+        printk("scif-uart: Unable to retrieve the base"
+                     " address of the UART\n");
+        return res;
+    }
+
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
+    {
+        printk("scif-uart: Unable to retrieve the IRQ\n");
+        return res;
+    }
+    uart->irq = res;
+
+    uart->regs = ioremap_nocache(addr, size);
+    if ( !uart->regs )
+    {
+        printk("scif-uart: Unable to map the UART memory\n");
+        return -ENOMEM;
+    }
+
+    uart->vuart.base_addr  = addr;
+    uart->vuart.size       = size;
+    uart->vuart.data_off   = SCIF_SCFTDR;
+    uart->vuart.status_off = SCIF_SCFSR;
+    uart->vuart.status     = SCFSR_TDFE;
+
+    /* Register with generic serial driver */
+    serial_register_uart(SERHND_DTUART, &scif_uart_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
+}
+
+static const char * const scif_uart_dt_compat[] __initconst =
+{
+    "renesas,scif",
+    NULL
+};
+
+DT_DEVICE_START(scif_uart, "SCIF UART", DEVICE_SERIAL)
+    .compatible = scif_uart_dt_compat,
+    .init = scif_uart_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * 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 Tue Feb 10 07:14:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL51F-0006Bd-AL; Tue, 10 Feb 2015 07:14:01 +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 1YL51E-0006BI-Am
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:00 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	55/DA-02753-7BFA9D45; Tue, 10 Feb 2015 07:13:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1423552438!12423040!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14746 invoked from network); 10 Feb 2015 07:13:59 -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;
	10 Feb 2015 07: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 1YL51B-0005xB-V1
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51B-00052w-TZ
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:57 +0000
Date: Tue, 10 Feb 2015 07:13:57 +0000
Message-Id: <E1YL51B-00052w-TZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce support for Renesas
	R-Car Gen2 platform
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d12f430d1ddb4f18f047c73ad96141b75af6983f
Author:     Iurii Konovalenko <iurii.konovalenko@globallogic.com>
AuthorDate: Wed Feb 4 15:05:24 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:20:04 2015 +0000

    xen/arm: Introduce support for Renesas R-Car Gen2 platform
    
    Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/Makefile |    1 +
 xen/arch/arm/platforms/rcar2.c  |   71 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 8f47c16..e173fec 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_32) += rcar2.o
 obj-$(CONFIG_ARM_64) += seattle.o
 obj-$(CONFIG_ARM_64) += xgene-storm.o
diff --git a/xen/arch/arm/platforms/rcar2.c b/xen/arch/arm/platforms/rcar2.c
new file mode 100644
index 0000000..aef544c
--- /dev/null
+++ b/xen/arch/arm/platforms/rcar2.c
@@ -0,0 +1,71 @@
+/*
+ * xen/arch/arm/platforms/rcar2.c
+ *
+ * Renesas R-Car Gen2 specific settings
+ *
+ * Iurii Konovalenko <iurii.konovalenko@globallogic.com>
+ *
+ * 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 <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/platform.h>
+#include <asm/io.h>
+
+#define RCAR2_RAM_ADDR                         0xE63C0000
+#define RCAR2_RAM_SIZE                         0x1000
+#define RCAR2_SMP_START_OFFSET                 0xFFC
+
+static int __init rcar2_smp_init(void)
+{
+    void __iomem *pram;
+
+    /* map ICRAM */
+    pram = ioremap_nocache(RCAR2_RAM_ADDR, RCAR2_RAM_SIZE);
+    if( !pram )
+    {
+        dprintk( XENLOG_ERR, "Unable to map RCAR2 ICRAM\n");
+        return -ENOMEM;
+    }
+
+    /* setup reset vectors */
+    writel(__pa(init_secondary), pram + RCAR2_SMP_START_OFFSET);
+    iounmap(pram);
+
+    sev();
+
+    return 0;
+}
+
+static const char const *rcar2_dt_compat[] __initdata =
+{
+    "renesas,lager",
+    NULL
+};
+
+PLATFORM_START(rcar2, "Renesas R-Car Gen2")
+    .compatible = rcar2_dt_compat,
+    .cpu_up = cpu_up_send_sgi,
+    .smp_init = rcar2_smp_init,
+
+    .dom0_gnttab_start = 0xc0000000,
+    .dom0_gnttab_size = 0x20000,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * 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 Tue Feb 10 07:14:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL51F-0006Bd-AL; Tue, 10 Feb 2015 07:14:01 +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 1YL51E-0006BI-Am
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:00 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	55/DA-02753-7BFA9D45; Tue, 10 Feb 2015 07:13:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1423552438!12423040!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14746 invoked from network); 10 Feb 2015 07:13:59 -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;
	10 Feb 2015 07: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 1YL51B-0005xB-V1
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51B-00052w-TZ
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:13:57 +0000
Date: Tue, 10 Feb 2015 07:13:57 +0000
Message-Id: <E1YL51B-00052w-TZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce support for Renesas
	R-Car Gen2 platform
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d12f430d1ddb4f18f047c73ad96141b75af6983f
Author:     Iurii Konovalenko <iurii.konovalenko@globallogic.com>
AuthorDate: Wed Feb 4 15:05:24 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:20:04 2015 +0000

    xen/arm: Introduce support for Renesas R-Car Gen2 platform
    
    Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/Makefile |    1 +
 xen/arch/arm/platforms/rcar2.c  |   71 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 8f47c16..e173fec 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_32) += rcar2.o
 obj-$(CONFIG_ARM_64) += seattle.o
 obj-$(CONFIG_ARM_64) += xgene-storm.o
diff --git a/xen/arch/arm/platforms/rcar2.c b/xen/arch/arm/platforms/rcar2.c
new file mode 100644
index 0000000..aef544c
--- /dev/null
+++ b/xen/arch/arm/platforms/rcar2.c
@@ -0,0 +1,71 @@
+/*
+ * xen/arch/arm/platforms/rcar2.c
+ *
+ * Renesas R-Car Gen2 specific settings
+ *
+ * Iurii Konovalenko <iurii.konovalenko@globallogic.com>
+ *
+ * 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 <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/platform.h>
+#include <asm/io.h>
+
+#define RCAR2_RAM_ADDR                         0xE63C0000
+#define RCAR2_RAM_SIZE                         0x1000
+#define RCAR2_SMP_START_OFFSET                 0xFFC
+
+static int __init rcar2_smp_init(void)
+{
+    void __iomem *pram;
+
+    /* map ICRAM */
+    pram = ioremap_nocache(RCAR2_RAM_ADDR, RCAR2_RAM_SIZE);
+    if( !pram )
+    {
+        dprintk( XENLOG_ERR, "Unable to map RCAR2 ICRAM\n");
+        return -ENOMEM;
+    }
+
+    /* setup reset vectors */
+    writel(__pa(init_secondary), pram + RCAR2_SMP_START_OFFSET);
+    iounmap(pram);
+
+    sev();
+
+    return 0;
+}
+
+static const char const *rcar2_dt_compat[] __initdata =
+{
+    "renesas,lager",
+    NULL
+};
+
+PLATFORM_START(rcar2, "Renesas R-Car Gen2")
+    .compatible = rcar2_dt_compat,
+    .cpu_up = cpu_up_send_sgi,
+    .smp_init = rcar2_smp_init,
+
+    .dom0_gnttab_start = 0xc0000000,
+    .dom0_gnttab_size = 0x20000,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * 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 Tue Feb 10 07:14:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL51P-0006DI-D5; Tue, 10 Feb 2015 07:14: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 1YL51O-0006D6-Fm
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:10 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	7F/81-03132-1CFA9D45; Tue, 10 Feb 2015 07:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1423552448!3424812!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26317 invoked from network); 10 Feb 2015 07:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Feb 2015 07: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 1YL51M-0005xk-6E
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51M-00053S-4d
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:08 +0000
Date: Tue, 10 Feb 2015 07:14:08 +0000
Message-Id: <E1YL51M-00053S-4d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libvchan: address compiler warnings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b541d3fe1d438e152c755b2fba6e5905e27041ca
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Feb 4 16:07:48 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:21:48 2015 +0000

    libvchan: address compiler warnings
    
    Both vchan_wr() and stdout_wr() should be defined with a non-empty
    argument list (i.e. void). Additionally both of them as well as usage()
    should be static to make clear that no other code is referencing them.
    
    Further, statements should follow declarations.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libvchan/node-select.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/tools/libvchan/node-select.c b/tools/libvchan/node-select.c
index 13c5822..6712df0 100644
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -39,7 +39,7 @@
 
 #include <libxenvchan.h>
 
-void usage(char** argv)
+static void usage(char** argv)
 {
 	fprintf(stderr, "usage:\n"
 		"\t%s [client|server] domainid nodepath [rbufsiz wbufsiz]\n",
@@ -54,10 +54,12 @@ int insiz = 0;
 int outsiz = 0;
 struct libxenvchan *ctrl = 0;
 
-void vchan_wr() {
+static void vchan_wr(void) {
+	int ret;
+
 	if (!insiz)
 		return;
-	int ret = libxenvchan_write(ctrl, inbuf, insiz);
+	ret = libxenvchan_write(ctrl, inbuf, insiz);
 	if (ret < 0) {
 		fprintf(stderr, "vchan write failed\n");
 		exit(1);
@@ -68,10 +70,12 @@ void vchan_wr() {
 	}
 }
 
-void stdout_wr() {
+static void stdout_wr(void) {
+	int ret;
+
 	if (!outsiz)
 		return;
-	int ret = write(1, outbuf, outsiz);
+	ret = write(1, outbuf, outsiz);
 	if (ret < 0 && errno != EAGAIN)
 		exit(1);
 	if (ret > 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 Tue Feb 10 07:14:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL51P-0006DI-D5; Tue, 10 Feb 2015 07:14: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 1YL51O-0006D6-Fm
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:10 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	7F/81-03132-1CFA9D45; Tue, 10 Feb 2015 07:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1423552448!3424812!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26317 invoked from network); 10 Feb 2015 07:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Feb 2015 07: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 1YL51M-0005xk-6E
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51M-00053S-4d
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:08 +0000
Date: Tue, 10 Feb 2015 07:14:08 +0000
Message-Id: <E1YL51M-00053S-4d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libvchan: address compiler warnings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b541d3fe1d438e152c755b2fba6e5905e27041ca
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Feb 4 16:07:48 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:21:48 2015 +0000

    libvchan: address compiler warnings
    
    Both vchan_wr() and stdout_wr() should be defined with a non-empty
    argument list (i.e. void). Additionally both of them as well as usage()
    should be static to make clear that no other code is referencing them.
    
    Further, statements should follow declarations.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libvchan/node-select.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/tools/libvchan/node-select.c b/tools/libvchan/node-select.c
index 13c5822..6712df0 100644
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -39,7 +39,7 @@
 
 #include <libxenvchan.h>
 
-void usage(char** argv)
+static void usage(char** argv)
 {
 	fprintf(stderr, "usage:\n"
 		"\t%s [client|server] domainid nodepath [rbufsiz wbufsiz]\n",
@@ -54,10 +54,12 @@ int insiz = 0;
 int outsiz = 0;
 struct libxenvchan *ctrl = 0;
 
-void vchan_wr() {
+static void vchan_wr(void) {
+	int ret;
+
 	if (!insiz)
 		return;
-	int ret = libxenvchan_write(ctrl, inbuf, insiz);
+	ret = libxenvchan_write(ctrl, inbuf, insiz);
 	if (ret < 0) {
 		fprintf(stderr, "vchan write failed\n");
 		exit(1);
@@ -68,10 +70,12 @@ void vchan_wr() {
 	}
 }
 
-void stdout_wr() {
+static void stdout_wr(void) {
+	int ret;
+
 	if (!outsiz)
 		return;
-	int ret = write(1, outbuf, outsiz);
+	ret = write(1, outbuf, outsiz);
 	if (ret < 0 && errno != EAGAIN)
 		exit(1);
 	if (ret > 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 Tue Feb 10 07:14:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL51Z-0006F3-Fj; Tue, 10 Feb 2015 07:14:21 +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 1YL51Y-0006Ep-QY
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:20 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	6E/BC-03710-CCFA9D45; Tue, 10 Feb 2015 07:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1423552458!11713166!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23547 invoked from network); 10 Feb 2015 07:14:19 -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;
	10 Feb 2015 07: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 1YL51W-0005xq-Bs
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51W-00054M-AU
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:18 +0000
Date: Tue, 10 Feb 2015 07:14:18 +0000
Message-Id: <E1YL51W-00054M-AU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Call context_saved() with
	interrupts enabled during context switch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8bb583bec290a4f903cf065814af33ce49d4d0b
Author:     denys drozdov <denys.drozdov@globallogic.com>
AuthorDate: Wed Feb 4 19:13:05 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:22:33 2015 +0000

    xen/arm: Call context_saved() with interrupts enabled during context switch
    
    This is a requirement of the scheduler interface, violating this
    causes for example with the RT scheduler:
    
    (XEN) Assertion 'local_irq_is_enabled()' failed at spinlock.c:137
    (XEN) ----[ Xen-4.5.0  arm32  debug=y  Not tainted ]----
    (XEN) CPU:    0
    (XEN) PC:     0022a074 _spin_lock_irq+0x18/0x94
    
    (XEN) Xen call trace:
    (XEN)    [<0022a074>] _spin_lock_irq+0x18/0x94 (PC)
    (XEN)    [<002256b8>] rt_context_saved+0x3c/0x144 (LR)
    (XEN)    [<002256b8>] rt_context_saved+0x3c/0x144
    (XEN)    [<00228ed8>] context_saved+0x4c/0x80
    (XEN)    [<002524b4>] schedule_tail+0x148/0x2f0
    (XEN)    [<00252668>] continue_new_vcpu+0xc/0x70
    (XEN)    [<00252a18>] context_switch+0x74/0x7c
    
    Signed-off-by: denys drozdov <denys.drozdov@globallogic.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index cfc7ab4..3e3fe92 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -64,7 +64,7 @@ static void ctxt_switch_from(struct vcpu *p)
      * mode. Therefore we don't need to save the context of an idle VCPU.
      */
     if ( is_idle_vcpu(p) )
-        goto end_context;
+        return;
 
     p2m_save_state(p);
 
@@ -138,9 +138,6 @@ static void ctxt_switch_from(struct vcpu *p)
     gic_save_state(p);
 
     isb();
-
-end_context:
-    context_saved(p);
 }
 
 static void ctxt_switch_to(struct vcpu *n)
@@ -246,6 +243,8 @@ static void schedule_tail(struct vcpu *prev)
 
     local_irq_enable();
 
+    context_saved(prev);
+
     if ( prev != current )
         update_runstate_area(current);
 
--
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 Tue Feb 10 07:14:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL51Z-0006F3-Fj; Tue, 10 Feb 2015 07:14:21 +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 1YL51Y-0006Ep-QY
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:20 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	6E/BC-03710-CCFA9D45; Tue, 10 Feb 2015 07:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1423552458!11713166!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23547 invoked from network); 10 Feb 2015 07:14:19 -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;
	10 Feb 2015 07: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 1YL51W-0005xq-Bs
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51W-00054M-AU
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:18 +0000
Date: Tue, 10 Feb 2015 07:14:18 +0000
Message-Id: <E1YL51W-00054M-AU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Call context_saved() with
	interrupts enabled during context switch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8bb583bec290a4f903cf065814af33ce49d4d0b
Author:     denys drozdov <denys.drozdov@globallogic.com>
AuthorDate: Wed Feb 4 19:13:05 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Feb 5 12:22:33 2015 +0000

    xen/arm: Call context_saved() with interrupts enabled during context switch
    
    This is a requirement of the scheduler interface, violating this
    causes for example with the RT scheduler:
    
    (XEN) Assertion 'local_irq_is_enabled()' failed at spinlock.c:137
    (XEN) ----[ Xen-4.5.0  arm32  debug=y  Not tainted ]----
    (XEN) CPU:    0
    (XEN) PC:     0022a074 _spin_lock_irq+0x18/0x94
    
    (XEN) Xen call trace:
    (XEN)    [<0022a074>] _spin_lock_irq+0x18/0x94 (PC)
    (XEN)    [<002256b8>] rt_context_saved+0x3c/0x144 (LR)
    (XEN)    [<002256b8>] rt_context_saved+0x3c/0x144
    (XEN)    [<00228ed8>] context_saved+0x4c/0x80
    (XEN)    [<002524b4>] schedule_tail+0x148/0x2f0
    (XEN)    [<00252668>] continue_new_vcpu+0xc/0x70
    (XEN)    [<00252a18>] context_switch+0x74/0x7c
    
    Signed-off-by: denys drozdov <denys.drozdov@globallogic.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index cfc7ab4..3e3fe92 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -64,7 +64,7 @@ static void ctxt_switch_from(struct vcpu *p)
      * mode. Therefore we don't need to save the context of an idle VCPU.
      */
     if ( is_idle_vcpu(p) )
-        goto end_context;
+        return;
 
     p2m_save_state(p);
 
@@ -138,9 +138,6 @@ static void ctxt_switch_from(struct vcpu *p)
     gic_save_state(p);
 
     isb();
-
-end_context:
-    context_saved(p);
 }
 
 static void ctxt_switch_to(struct vcpu *n)
@@ -246,6 +243,8 @@ static void schedule_tail(struct vcpu *prev)
 
     local_irq_enable();
 
+    context_saved(prev);
+
     if ( prev != current )
         update_runstate_area(current);
 
--
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 Tue Feb 10 07:14:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL51j-0006Gq-IT; Tue, 10 Feb 2015 07:14:31 +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 1YL51i-0006Gd-Nz
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:30 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	0E/89-02754-6DFA9D45; Tue, 10 Feb 2015 07:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1423552468!12486184!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14203 invoked from network); 10 Feb 2015 07:14:29 -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;
	10 Feb 2015 07:14: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 1YL51g-0005xy-MB
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51g-00054i-Hs
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:28 +0000
Date: Tue, 10 Feb 2015 07:14:28 +0000
Message-Id: <E1YL51g-00054i-Hs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: avoid needless EPT table
	ajustment and 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 06ed8cc2cc9be465719ac8f8def03a43e34064da
Author:     Liang Li <liang.z.li@intel.com>
AuthorDate: Thu Feb 5 13:59:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 13:59:48 2015 +0100

    x86: avoid needless EPT table ajustment and cache flush
    
    When a guest change it's MTRR MSRs, ajusting EPT table and flushing
    cache are needed only when guest has IOMMU device, using need_iommu(d)
    can minimize the impact to guest with device assigned, since a guest
    may be hot plugged with a device thus there may be dirty cache lines
    before need_iommu(d) becoming true, force the p2m_memory_type_changed
    and flush_all when the first device is assigned to guest to amend this
    issue.
    
    Signed-off-by: Liang Li <liang.z.li@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/mtrr.c       |    2 +-
 xen/drivers/passthrough/pci.c |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index 76b3c2a..a69ee62 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -789,7 +789,7 @@ HVM_REGISTER_SAVE_RESTORE(MTRR, hvm_save_mtrr_msr, hvm_load_mtrr_msr,
 
 void memory_type_changed(struct domain *d)
 {
-    if ( iommu_enabled && d->vcpu && d->vcpu[0] )
+    if ( need_iommu(d) && d->vcpu && d->vcpu[0] )
     {
         p2m_memory_type_changed(d);
         flush_all(FLUSH_CACHE);
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 78c6977..b93e7d8 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1365,6 +1365,13 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
             }
         }
         d->need_iommu = 1;
+        /*
+         * There may be dirty cache lines when a device is assigned
+         * and before need_iommu(d) becoming true, this will cause
+         * memory_type_changed lose effect if memory type changes.
+         * Call memory_type_changed here to amend this.
+         */
+        memory_type_changed(d);
     }
 
     pdev = pci_get_pdev_by_domain(hardware_domain, seg, bus, devfn);
--
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 Tue Feb 10 07:14:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL51j-0006Gq-IT; Tue, 10 Feb 2015 07:14:31 +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 1YL51i-0006Gd-Nz
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:30 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	0E/89-02754-6DFA9D45; Tue, 10 Feb 2015 07:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1423552468!12486184!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14203 invoked from network); 10 Feb 2015 07:14:29 -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;
	10 Feb 2015 07:14: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 1YL51g-0005xy-MB
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51g-00054i-Hs
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:28 +0000
Date: Tue, 10 Feb 2015 07:14:28 +0000
Message-Id: <E1YL51g-00054i-Hs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: avoid needless EPT table
	ajustment and 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 06ed8cc2cc9be465719ac8f8def03a43e34064da
Author:     Liang Li <liang.z.li@intel.com>
AuthorDate: Thu Feb 5 13:59:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 13:59:48 2015 +0100

    x86: avoid needless EPT table ajustment and cache flush
    
    When a guest change it's MTRR MSRs, ajusting EPT table and flushing
    cache are needed only when guest has IOMMU device, using need_iommu(d)
    can minimize the impact to guest with device assigned, since a guest
    may be hot plugged with a device thus there may be dirty cache lines
    before need_iommu(d) becoming true, force the p2m_memory_type_changed
    and flush_all when the first device is assigned to guest to amend this
    issue.
    
    Signed-off-by: Liang Li <liang.z.li@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/mtrr.c       |    2 +-
 xen/drivers/passthrough/pci.c |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index 76b3c2a..a69ee62 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -789,7 +789,7 @@ HVM_REGISTER_SAVE_RESTORE(MTRR, hvm_save_mtrr_msr, hvm_load_mtrr_msr,
 
 void memory_type_changed(struct domain *d)
 {
-    if ( iommu_enabled && d->vcpu && d->vcpu[0] )
+    if ( need_iommu(d) && d->vcpu && d->vcpu[0] )
     {
         p2m_memory_type_changed(d);
         flush_all(FLUSH_CACHE);
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 78c6977..b93e7d8 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1365,6 +1365,13 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
             }
         }
         d->need_iommu = 1;
+        /*
+         * There may be dirty cache lines when a device is assigned
+         * and before need_iommu(d) becoming true, this will cause
+         * memory_type_changed lose effect if memory type changes.
+         * Call memory_type_changed here to amend this.
+         */
+        memory_type_changed(d);
     }
 
     pdev = pci_get_pdev_by_domain(hardware_domain, seg, bus, devfn);
--
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 Tue Feb 10 07:14:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL51u-0006Ii-L7; Tue, 10 Feb 2015 07:14: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 1YL51t-0006IU-9I
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:41 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	64/43-02991-0EFA9D45; Tue, 10 Feb 2015 07:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1423552479!11782182!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3207 invoked from network); 10 Feb 2015 07:14:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Feb 2015 07:14: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 1YL51q-0005y4-RA
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51q-00055E-QN
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:38 +0000
Date: Tue, 10 Feb 2015 07:14:38 +0000
Message-Id: <E1YL51q-00055E-QN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/xz: add comments for the
	intentionally missing break statements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 58c030d5f8048a95c485ebf6296066c45bde1cd4
Author:     Lasse Collin <lasse.collin@tukaani.org>
AuthorDate: Thu Feb 5 14:01:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 14:01:09 2015 +0100

    common/xz: add comments for the intentionally missing break statements
    
    Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
    [Linux commit 84d517f3e56f7d0d305c14a701cee8f7372ebe1e]
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: IAn Campbell <ian.campbell@citrix.com>
---
 xen/common/xz/dec_lzma2.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/common/xz/dec_lzma2.c b/xen/common/xz/dec_lzma2.c
index 779221d..44fe79b 100644
--- a/xen/common/xz/dec_lzma2.c
+++ b/xen/common/xz/dec_lzma2.c
@@ -1043,6 +1043,8 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
 
 			s->lzma2.sequence = SEQ_LZMA_PREPARE;
 
+		/* Fall through */
+
 		case SEQ_LZMA_PREPARE:
 			if (s->lzma2.compressed < RC_INIT_BYTES)
 				return XZ_DATA_ERROR;
@@ -1053,6 +1055,8 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
 			s->lzma2.compressed -= RC_INIT_BYTES;
 			s->lzma2.sequence = SEQ_LZMA_RUN;
 
+		/* Fall through */
+
 		case SEQ_LZMA_RUN:
 			/*
 			 * Set dictionary limit to indicate how much we want
--
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 Tue Feb 10 07:14:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07: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 1YL51u-0006Ii-L7; Tue, 10 Feb 2015 07:14: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 1YL51t-0006IU-9I
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:41 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	64/43-02991-0EFA9D45; Tue, 10 Feb 2015 07:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1423552479!11782182!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3207 invoked from network); 10 Feb 2015 07:14:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Feb 2015 07:14: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 1YL51q-0005y4-RA
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL51q-00055E-QN
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:38 +0000
Date: Tue, 10 Feb 2015 07:14:38 +0000
Message-Id: <E1YL51q-00055E-QN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/xz: add comments for the
	intentionally missing break statements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 58c030d5f8048a95c485ebf6296066c45bde1cd4
Author:     Lasse Collin <lasse.collin@tukaani.org>
AuthorDate: Thu Feb 5 14:01:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 14:01:09 2015 +0100

    common/xz: add comments for the intentionally missing break statements
    
    Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
    [Linux commit 84d517f3e56f7d0d305c14a701cee8f7372ebe1e]
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: IAn Campbell <ian.campbell@citrix.com>
---
 xen/common/xz/dec_lzma2.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/common/xz/dec_lzma2.c b/xen/common/xz/dec_lzma2.c
index 779221d..44fe79b 100644
--- a/xen/common/xz/dec_lzma2.c
+++ b/xen/common/xz/dec_lzma2.c
@@ -1043,6 +1043,8 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
 
 			s->lzma2.sequence = SEQ_LZMA_PREPARE;
 
+		/* Fall through */
+
 		case SEQ_LZMA_PREPARE:
 			if (s->lzma2.compressed < RC_INIT_BYTES)
 				return XZ_DATA_ERROR;
@@ -1053,6 +1055,8 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
 			s->lzma2.compressed -= RC_INIT_BYTES;
 			s->lzma2.sequence = SEQ_LZMA_RUN;
 
+		/* Fall through */
+
 		case SEQ_LZMA_RUN:
 			/*
 			 * Set dictionary limit to indicate how much we want
--
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 Tue Feb 10 07:14:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL524-0006Kc-Nj; Tue, 10 Feb 2015 07:14:52 +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 1YL523-0006KM-QA
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:52 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	6F/44-02756-BEFA9D45; Tue, 10 Feb 2015 07:14:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1423552489!5716500!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26888 invoked from network); 10 Feb 2015 07:14:50 -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;
	10 Feb 2015 07:14:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL521-0005yA-6c
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL521-00055a-5o
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:49 +0000
Date: Tue, 10 Feb 2015 07:14:49 +0000
Message-Id: <E1YL521-00055a-5o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: work around collision of -O0
	and -D_FORTIFY_SOURCE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 001324547356af86875fad5003f679571a6b8f1c
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 5 16:28:56 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Feb 6 17:26:30 2015 +0000

    tools: work around collision of -O0 and -D_FORTIFY_SOURCE
    
    Some systems have python-config include -D_FORTIFY_SOURCE in the
    CFLAGS.  But -D_FORTIFY_SOURCE does not (currently) work with -O0, and
    -O0 is enabled in debug builds (since 1166ecf781).  As a result, on
    those systems, debug builds fail.
    
    Work around this problem as follows:
     * In configure, detect -D_FORTIFY_SOURCE in $(python-config --cflags)
     * If detected, set the new autoconf substitution and make variable
       PY_NOOPT_CFLAGS to -O1.
     * In tools/Rules.mk, where we add -O0, also add PY_NOOPT_CFLAGS
       (which will override the -O0 with -O1 if required).
    
    Overriding the -O0 is better than disabling Fortify because the
    latter might have an adverse security impact.  A user who wants to
    disable optimisation completely even for Python and also disable
    Fortify can set the environment variable
        EXTRA_CFLAGS_XEN_TOOLS='-U_FORTIFY_SOURCE -O0'
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reported-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Euan Harris <euan.harris@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Tested-by: Don Slutz <dslutz@verizon.com>
---
 config/Tools.mk.in         |    1 +
 m4/python_fortify_noopt.m4 |   31 +++++++++++++++++++++++++++++++
 tools/Rules.mk             |    2 ++
 tools/configure            |   39 +++++++++++++++++++++++++++++++++++++++
 tools/configure.ac         |    2 ++
 tools/pygrub/Makefile      |    6 ++++--
 tools/python/Makefile      |    6 ++++--
 7 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 30267fa..e7da99d 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -13,6 +13,7 @@ BISON               := @BISON@
 FLEX                := @FLEX@
 PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
+PY_NOOPT_CFLAGS     := @PY_NOOPT_CFLAGS@
 PERL                := @PERL@
 CURL_CONFIG         := @CURL@
 XML2_CONFIG         := @XML@
diff --git a/m4/python_fortify_noopt.m4 b/m4/python_fortify_noopt.m4
new file mode 100644
index 0000000..f9cb52b
--- /dev/null
+++ b/m4/python_fortify_noopt.m4
@@ -0,0 +1,31 @@
+dnl Defines PY_NOOPT_CFLAGS to either '' or -O1
+dnl
+
+dnl This is necessary because on some systems setup.py includes
+dnl -D_FORTIFY_SOURCE but have a -D_FORTIFY_SOURCE which breaks
+dnl with -O0.  On those systems we arrange to use -O1 for debug
+dnl builds instead.
+
+AC_DEFUN([AX_CHECK_PYTHON_FORTIFY_NOOPT], [
+    AC_CACHE_CHECK([whether Python setup.py brokenly enables -D_FORTIFY_SOURCE],
+                   [ax_cv_python_fortify],[
+        ax_cv_python_fortify=no
+        for arg in $($PYTHON-config --cflags); do
+            case "$arg" in
+            -D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            -Wp,-D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -Wp,-D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            *) ;;
+            esac
+        done
+    ])
+
+    AS_IF([test x$ax_cv_python_fortify = xyes],[
+        PY_NOOPT_CFLAGS=-O1
+    ], [
+        PY_NOOPT_CFLAGS=''
+    ])
+
+    AC_SUBST(PY_NOOPT_CFLAGS)
+])
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 74cf37e..3c29d07 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -57,6 +57,8 @@ SHLIB_libxenvchan  = -Wl,-rpath-link=$(XEN_LIBVCHAN)
 ifeq ($(debug),y)
 # Disable optimizations and enable debugging information for macros
 CFLAGS += -O0 -g3
+# But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=<n>.
+PY_CFLAGS += $(PY_NOOPT_CFLAGS)
 endif
 
 LIBXL_BLKTAP ?= $(CONFIG_BLKTAP2)
diff --git a/tools/configure b/tools/configure
index ab04e8c..e7dac75 100755
--- a/tools/configure
+++ b/tools/configure
@@ -652,6 +652,7 @@ PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
 CURSES_LIBS
+PY_NOOPT_CFLAGS
 EGREP
 GREP
 CPP
@@ -3453,6 +3454,10 @@ esac
 
 
 
+
+
+
+
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -7043,6 +7048,40 @@ CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Python setup.py brokenly enables -D_FORTIFY_SOURCE" >&5
+$as_echo_n "checking whether Python setup.py brokenly enables -D_FORTIFY_SOURCE... " >&6; }
+if ${ax_cv_python_fortify+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        ax_cv_python_fortify=no
+        for arg in $($PYTHON-config --cflags); do
+            case "$arg" in
+            -D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            -Wp,-D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -Wp,-D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            *) ;;
+            esac
+        done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_python_fortify" >&5
+$as_echo "$ax_cv_python_fortify" >&6; }
+
+    if test x$ax_cv_python_fortify = xyes; then :
+
+        PY_NOOPT_CFLAGS=-O1
+
+else
+
+        PY_NOOPT_CFLAGS=''
+
+fi
+
+
+
+
 fi
 
 if ! $rump; then
diff --git a/tools/configure.ac b/tools/configure.ac
index d9cbf1f..03dadd7 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -58,6 +58,7 @@ m4_include([../m4/checkpolicy.m4])
 m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/python_version.m4])
 m4_include([../m4/python_devel.m4])
+m4_include([../m4/python_fortify_noopt.m4])
 m4_include([../m4/ocaml.m4])
 m4_include([../m4/uuid.m4])
 m4_include([../m4/pkg.m4])
@@ -295,6 +296,7 @@ AX_CHECK_PYTHON_VERSION([2], [3])
 
 AS_IF([test "$cross_compiling" != yes], [
     AX_CHECK_PYTHON_DEVEL()
+    AX_CHECK_PYTHON_FORTIFY_NOOPT()
 ])
 
 if ! $rump; then
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 6fd194c..00e654a 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -2,15 +2,17 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS) $(APPEND_LDFLAGS)
+
 .PHONY: all
 all: build
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install: all
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
 		--install-scripts=$(LIBEXEC_BIN) --force
 	set -e; if [ $(BINDIR) != $(LIBEXEC_BIN) -a \
diff --git a/tools/python/Makefile b/tools/python/Makefile
index af95119..e933be8 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 .PHONY: all
 all: build
 
+PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)
+
 .PHONY: build
 build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/idl.py
@@ -11,11 +13,11 @@ build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		xen/lowlevel/xl/_pyxl_types.h \
 		xen/lowlevel/xl/_pyxl_types.c
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install:
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
 
 .PHONY: test
--
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 Tue Feb 10 07:14:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2015 07:14: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 1YL524-0006Kc-Nj; Tue, 10 Feb 2015 07:14:52 +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 1YL523-0006KM-QA
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:52 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	6F/44-02756-BEFA9D45; Tue, 10 Feb 2015 07:14:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1423552489!5716500!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26888 invoked from network); 10 Feb 2015 07:14:50 -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;
	10 Feb 2015 07:14:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL521-0005yA-6c
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YL521-00055a-5o
	for xen-changelog@lists.xensource.com; Tue, 10 Feb 2015 07:14:49 +0000
Date: Tue, 10 Feb 2015 07:14:49 +0000
Message-Id: <E1YL521-00055a-5o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: work around collision of -O0
	and -D_FORTIFY_SOURCE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 001324547356af86875fad5003f679571a6b8f1c
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 5 16:28:56 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Feb 6 17:26:30 2015 +0000

    tools: work around collision of -O0 and -D_FORTIFY_SOURCE
    
    Some systems have python-config include -D_FORTIFY_SOURCE in the
    CFLAGS.  But -D_FORTIFY_SOURCE does not (currently) work with -O0, and
    -O0 is enabled in debug builds (since 1166ecf781).  As a result, on
    those systems, debug builds fail.
    
    Work around this problem as follows:
     * In configure, detect -D_FORTIFY_SOURCE in $(python-config --cflags)
     * If detected, set the new autoconf substitution and make variable
       PY_NOOPT_CFLAGS to -O1.
     * In tools/Rules.mk, where we add -O0, also add PY_NOOPT_CFLAGS
       (which will override the -O0 with -O1 if required).
    
    Overriding the -O0 is better than disabling Fortify because the
    latter might have an adverse security impact.  A user who wants to
    disable optimisation completely even for Python and also disable
    Fortify can set the environment variable
        EXTRA_CFLAGS_XEN_TOOLS='-U_FORTIFY_SOURCE -O0'
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reported-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Euan Harris <euan.harris@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Tested-by: Don Slutz <dslutz@verizon.com>
---
 config/Tools.mk.in         |    1 +
 m4/python_fortify_noopt.m4 |   31 +++++++++++++++++++++++++++++++
 tools/Rules.mk             |    2 ++
 tools/configure            |   39 +++++++++++++++++++++++++++++++++++++++
 tools/configure.ac         |    2 ++
 tools/pygrub/Makefile      |    6 ++++--
 tools/python/Makefile      |    6 ++++--
 7 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 30267fa..e7da99d 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -13,6 +13,7 @@ BISON               := @BISON@
 FLEX                := @FLEX@
 PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
+PY_NOOPT_CFLAGS     := @PY_NOOPT_CFLAGS@
 PERL                := @PERL@
 CURL_CONFIG         := @CURL@
 XML2_CONFIG         := @XML@
diff --git a/m4/python_fortify_noopt.m4 b/m4/python_fortify_noopt.m4
new file mode 100644
index 0000000..f9cb52b
--- /dev/null
+++ b/m4/python_fortify_noopt.m4
@@ -0,0 +1,31 @@
+dnl Defines PY_NOOPT_CFLAGS to either '' or -O1
+dnl
+
+dnl This is necessary because on some systems setup.py includes
+dnl -D_FORTIFY_SOURCE but have a -D_FORTIFY_SOURCE which breaks
+dnl with -O0.  On those systems we arrange to use -O1 for debug
+dnl builds instead.
+
+AC_DEFUN([AX_CHECK_PYTHON_FORTIFY_NOOPT], [
+    AC_CACHE_CHECK([whether Python setup.py brokenly enables -D_FORTIFY_SOURCE],
+                   [ax_cv_python_fortify],[
+        ax_cv_python_fortify=no
+        for arg in $($PYTHON-config --cflags); do
+            case "$arg" in
+            -D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            -Wp,-D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -Wp,-D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            *) ;;
+            esac
+        done
+    ])
+
+    AS_IF([test x$ax_cv_python_fortify = xyes],[
+        PY_NOOPT_CFLAGS=-O1
+    ], [
+        PY_NOOPT_CFLAGS=''
+    ])
+
+    AC_SUBST(PY_NOOPT_CFLAGS)
+])
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 74cf37e..3c29d07 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -57,6 +57,8 @@ SHLIB_libxenvchan  = -Wl,-rpath-link=$(XEN_LIBVCHAN)
 ifeq ($(debug),y)
 # Disable optimizations and enable debugging information for macros
 CFLAGS += -O0 -g3
+# But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=<n>.
+PY_CFLAGS += $(PY_NOOPT_CFLAGS)
 endif
 
 LIBXL_BLKTAP ?= $(CONFIG_BLKTAP2)
diff --git a/tools/configure b/tools/configure
index ab04e8c..e7dac75 100755
--- a/tools/configure
+++ b/tools/configure
@@ -652,6 +652,7 @@ PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
 CURSES_LIBS
+PY_NOOPT_CFLAGS
 EGREP
 GREP
 CPP
@@ -3453,6 +3454,10 @@ esac
 
 
 
+
+
+
+
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -7043,6 +7048,40 @@ CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Python setup.py brokenly enables -D_FORTIFY_SOURCE" >&5
+$as_echo_n "checking whether Python setup.py brokenly enables -D_FORTIFY_SOURCE... " >&6; }
+if ${ax_cv_python_fortify+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        ax_cv_python_fortify=no
+        for arg in $($PYTHON-config --cflags); do
+            case "$arg" in
+            -D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            -Wp,-D_FORTIFY_SOURCE=0) ax_cv_python_fortify=no ;;
+            -Wp,-D_FORTIFY_SOURCE=*) ax_cv_python_fortify=yes ;;
+            *) ;;
+            esac
+        done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_python_fortify" >&5
+$as_echo "$ax_cv_python_fortify" >&6; }
+
+    if test x$ax_cv_python_fortify = xyes; then :
+
+        PY_NOOPT_CFLAGS=-O1
+
+else
+
+        PY_NOOPT_CFLAGS=''
+
+fi
+
+
+
+
 fi
 
 if ! $rump; then
diff --git a/tools/configure.ac b/tools/configure.ac
index d9cbf1f..03dadd7 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -58,6 +58,7 @@ m4_include([../m4/checkpolicy.m4])
 m4_include([../m4/set_cflags_ldflags.m4])
 m4_include([../m4/python_version.m4])
 m4_include([../m4/python_devel.m4])
+m4_include([../m4/python_fortify_noopt.m4])
 m4_include([../m4/ocaml.m4])
 m4_include([../m4/uuid.m4])
 m4_include([../m4/pkg.m4])
@@ -295,6 +296,7 @@ AX_CHECK_PYTHON_VERSION([2], [3])
 
 AS_IF([test "$cross_compiling" != yes], [
     AX_CHECK_PYTHON_DEVEL()
+    AX_CHECK_PYTHON_FORTIFY_NOOPT()
 ])
 
 if ! $rump; then
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 6fd194c..00e654a 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -2,15 +2,17 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS) $(APPEND_LDFLAGS)
+
 .PHONY: all
 all: build
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install: all
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
 		--install-scripts=$(LIBEXEC_BIN) --force
 	set -e; if [ $(BINDIR) != $(LIBEXEC_BIN) -a \
diff --git a/tools/python/Makefile b/tools/python/Makefile
index af95119..e933be8 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 .PHONY: all
 all: build
 
+PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)
+
 .PHONY: build
 build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/idl.py
@@ -11,11 +13,11 @@ build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		xen/lowlevel/xl/_pyxl_types.h \
 		xen/lowlevel/xl/_pyxl_types.c
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install:
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
 
 .PHONY: test
--
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 Mon Feb 16 10:55:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJKa-0001b2-CT; Mon, 16 Feb 2015 10:55:12 +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 1YNJKZ-0001at-EI
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:11 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	8B/EB-03219-E8CC1E45; Mon, 16 Feb 2015 10:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1424084108!11940571!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23029 invoked from network); 16 Feb 2015 10:55:10 -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;
	16 Feb 2015 10: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 1YNJKW-00083L-F5
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJKR-0005PV-81
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:03 +0000
Date: Mon, 16 Feb 2015 10:55:03 +0000
Message-Id: <E1YNJKR-0005PV-81@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: event handling: Add an assert
	to egc_run_callbacks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b5a5bba1a8025040947f39f1c80012373f35efe
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:10:11 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:17 2015 +0000

    libxl: event handling: Add an assert to egc_run_callbacks
    
    Check that the ao is still live when we are about to running some of
    its callbacks.
    
    This reveals an existing bug in libxl which is exercised by libvirt,
    converting
       libvirtd: libxl_event.c:1792: libxl__ao_complete_check_progress_reports: Assertion `ao->in_initiator' failed.
    into
       libvirtd: libxl_event.c:1338: egc_run_callbacks: Assertion `aop->ao->magic == 0xA0FACE00ul' failed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 0d874d9..ae73728 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1335,6 +1335,7 @@ static void egc_run_callbacks(libxl__egc *egc)
         aop->how->callback(CTX, aop->ev, aop->how->for_callback);
 
         CTX_LOCK;
+        assert(aop->ao->magic == LIBXL__AO_MAGIC);
         aop->ao->progress_reports_outstanding--;
         libxl__ao_complete_check_progress_reports(egc, aop->ao);
         CTX_UNLOCK;
--
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 Mon Feb 16 10:55:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJKa-0001b2-CT; Mon, 16 Feb 2015 10:55:12 +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 1YNJKZ-0001at-EI
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:11 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	8B/EB-03219-E8CC1E45; Mon, 16 Feb 2015 10:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1424084108!11940571!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23029 invoked from network); 16 Feb 2015 10:55:10 -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;
	16 Feb 2015 10: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 1YNJKW-00083L-F5
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJKR-0005PV-81
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:03 +0000
Date: Mon, 16 Feb 2015 10:55:03 +0000
Message-Id: <E1YNJKR-0005PV-81@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: event handling: Add an assert
	to egc_run_callbacks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b5a5bba1a8025040947f39f1c80012373f35efe
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:10:11 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:17 2015 +0000

    libxl: event handling: Add an assert to egc_run_callbacks
    
    Check that the ao is still live when we are about to running some of
    its callbacks.
    
    This reveals an existing bug in libxl which is exercised by libvirt,
    converting
       libvirtd: libxl_event.c:1792: libxl__ao_complete_check_progress_reports: Assertion `ao->in_initiator' failed.
    into
       libvirtd: libxl_event.c:1338: egc_run_callbacks: Assertion `aop->ao->magic == 0xA0FACE00ul' failed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 0d874d9..ae73728 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1335,6 +1335,7 @@ static void egc_run_callbacks(libxl__egc *egc)
         aop->how->callback(CTX, aop->ev, aop->how->for_callback);
 
         CTX_LOCK;
+        assert(aop->ao->magic == LIBXL__AO_MAGIC);
         aop->ao->progress_reports_outstanding--;
         libxl__ao_complete_check_progress_reports(egc, aop->ao);
         CTX_UNLOCK;
--
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 Mon Feb 16 10:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10: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 1YNJKk-0001cE-FG; Mon, 16 Feb 2015 10:55:22 +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 1YNJKj-0001c0-7U
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:21 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	84/9C-02801-89CC1E45; Mon, 16 Feb 2015 10:55:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1424084118!6732706!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18682 invoked from network); 16 Feb 2015 10:55:19 -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;
	16 Feb 2015 10:55: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 1YNJKg-00083P-LN
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJKg-0005Pt-JU
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:18 +0000
Date: Mon, 16 Feb 2015 10:55:18 +0000
Message-Id: <E1YNJKg-0005Pt-JU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: event handling: Break out
	ao_work_outstanding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93699882d98cce9736d6e871db303275df1138a2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:18:30 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:30 2015 +0000

    libxl: event handling: Break out ao_work_outstanding
    
    Break out the test in libxl__ao_complete_check_progress_reports, into
    ao_work_outstanding, which reports false if either (i) the ao is still
    ongoing or (ii) there is a progress report (perhaps on a different
    thread's callback queue) which has yet to be reported to the
    application.
    
    No functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_event.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index ae73728..89ca6d2 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1773,19 +1773,25 @@ void libxl__ao_complete(libxl__egc *egc, libxl__ao *ao, int rc)
     libxl__ao_complete_check_progress_reports(egc, ao);
 }
 
-void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
+static bool ao_work_outstanding(libxl__ao *ao)
 {
     /*
      * We don't consider an ao complete if it has any outstanding
      * callbacks.  These callbacks might be outstanding on other
      * threads, queued up in the other threads' egc's.  Those threads
      * will, after making the callback, take out the lock again,
-     * decrement progress_reports_outstanding, and call us again.
+     * decrement progress_reports_outstanding, and call
+     * libxl__ao_complete_check_progress_reports.
      */
+    return !ao->complete || ao->progress_reports_outstanding;
+}
+
+void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
+{
     libxl_ctx *ctx = libxl__gc_owner(&egc->gc);
     assert(ao->progress_reports_outstanding >= 0);
 
-    if (!ao->complete || ao->progress_reports_outstanding)
+    if (ao_work_outstanding(ao))
         return;
 
     if (ao->poller) {
--
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 Mon Feb 16 10:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10: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 1YNJKk-0001cE-FG; Mon, 16 Feb 2015 10:55:22 +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 1YNJKj-0001c0-7U
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:21 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	84/9C-02801-89CC1E45; Mon, 16 Feb 2015 10:55:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1424084118!6732706!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18682 invoked from network); 16 Feb 2015 10:55:19 -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;
	16 Feb 2015 10:55: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 1YNJKg-00083P-LN
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJKg-0005Pt-JU
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:18 +0000
Date: Mon, 16 Feb 2015 10:55:18 +0000
Message-Id: <E1YNJKg-0005Pt-JU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: event handling: Break out
	ao_work_outstanding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93699882d98cce9736d6e871db303275df1138a2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:18:30 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:30 2015 +0000

    libxl: event handling: Break out ao_work_outstanding
    
    Break out the test in libxl__ao_complete_check_progress_reports, into
    ao_work_outstanding, which reports false if either (i) the ao is still
    ongoing or (ii) there is a progress report (perhaps on a different
    thread's callback queue) which has yet to be reported to the
    application.
    
    No functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_event.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index ae73728..89ca6d2 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1773,19 +1773,25 @@ void libxl__ao_complete(libxl__egc *egc, libxl__ao *ao, int rc)
     libxl__ao_complete_check_progress_reports(egc, ao);
 }
 
-void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
+static bool ao_work_outstanding(libxl__ao *ao)
 {
     /*
      * We don't consider an ao complete if it has any outstanding
      * callbacks.  These callbacks might be outstanding on other
      * threads, queued up in the other threads' egc's.  Those threads
      * will, after making the callback, take out the lock again,
-     * decrement progress_reports_outstanding, and call us again.
+     * decrement progress_reports_outstanding, and call
+     * libxl__ao_complete_check_progress_reports.
      */
+    return !ao->complete || ao->progress_reports_outstanding;
+}
+
+void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
+{
     libxl_ctx *ctx = libxl__gc_owner(&egc->gc);
     assert(ao->progress_reports_outstanding >= 0);
 
-    if (!ao->complete || ao->progress_reports_outstanding)
+    if (ao_work_outstanding(ao))
         return;
 
     if (ao->poller) {
--
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 Mon Feb 16 10:55:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJKu-0001dr-Ht; Mon, 16 Feb 2015 10:55:32 +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 1YNJKt-0001dZ-Cf
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:31 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	37/39-02810-2ACC1E45; Mon, 16 Feb 2015 10:55:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1424084129!4554319!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14637 invoked from network); 16 Feb 2015 10:55:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Feb 2015 10:55: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 1YNJKq-00083Z-QY
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJKq-0005QF-PV
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:28 +0000
Date: Mon, 16 Feb 2015 10:55:28 +0000
Message-Id: <E1YNJKq-0005QF-PV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: event handling: ao_inprogress
	does waits while reports outstanding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1335f0d7b2402e94e0c6e8a905dc309edaafcfb
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:20:32 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:32 2015 +0000

    libxl: event handling: ao_inprogress does waits while reports outstanding
    
    libxl__ao_inprogress needs to check (like
    libxl__ao_complete_check_progress_reports) that there are no
    oustanding progress callbacks.
    
    Otherwise it might happen that we would destroy the ao while another
    thread has an outstanding callback its egc report queue.  The other
    thread would then, in its egc_run_callbacks, touch the destroyed ao.
    
    Instead, when this happens in libxl__ao_inprogress, simply run round
    the event loop again.  The thread which eventually makes the callback
    will spot our poller in the ao, and notify the poller, waking us up.
    
    This fixes an assertion failure race seen with libvirt:
      libvirtd: libxl_event.c:1792: libxl__ao_complete_check_progress_reports: Assertion `ao->in_initiator' failed.
    or (after "Add an assert to egc_run_callbacks")
      libvirtd: libxl_event.c:1338: egc_run_callbacks: Assertion `aop->ao->magic == 0xA0FACE00ul' failed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 89ca6d2..595da2b 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1878,7 +1878,7 @@ int libxl__ao_inprogress(libxl__ao *ao,
         for (;;) {
             assert(ao->magic == LIBXL__AO_MAGIC);
 
-            if (ao->complete) {
+            if (!ao_work_outstanding(ao)) {
                 rc = ao->rc;
                 ao->notified = 1;
                 break;
--
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 Mon Feb 16 10:55:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJKu-0001dr-Ht; Mon, 16 Feb 2015 10:55:32 +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 1YNJKt-0001dZ-Cf
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:31 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	37/39-02810-2ACC1E45; Mon, 16 Feb 2015 10:55:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1424084129!4554319!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14637 invoked from network); 16 Feb 2015 10:55:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Feb 2015 10:55: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 1YNJKq-00083Z-QY
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJKq-0005QF-PV
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:28 +0000
Date: Mon, 16 Feb 2015 10:55:28 +0000
Message-Id: <E1YNJKq-0005QF-PV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: event handling: ao_inprogress
	does waits while reports outstanding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1335f0d7b2402e94e0c6e8a905dc309edaafcfb
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:20:32 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:32 2015 +0000

    libxl: event handling: ao_inprogress does waits while reports outstanding
    
    libxl__ao_inprogress needs to check (like
    libxl__ao_complete_check_progress_reports) that there are no
    oustanding progress callbacks.
    
    Otherwise it might happen that we would destroy the ao while another
    thread has an outstanding callback its egc report queue.  The other
    thread would then, in its egc_run_callbacks, touch the destroyed ao.
    
    Instead, when this happens in libxl__ao_inprogress, simply run round
    the event loop again.  The thread which eventually makes the callback
    will spot our poller in the ao, and notify the poller, waking us up.
    
    This fixes an assertion failure race seen with libvirt:
      libvirtd: libxl_event.c:1792: libxl__ao_complete_check_progress_reports: Assertion `ao->in_initiator' failed.
    or (after "Add an assert to egc_run_callbacks")
      libvirtd: libxl_event.c:1338: egc_run_callbacks: Assertion `aop->ao->magic == 0xA0FACE00ul' failed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 89ca6d2..595da2b 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1878,7 +1878,7 @@ int libxl__ao_inprogress(libxl__ao *ao,
         for (;;) {
             assert(ao->magic == LIBXL__AO_MAGIC);
 
-            if (ao->complete) {
+            if (!ao_work_outstanding(ao)) {
                 rc = ao->rc;
                 ao->notified = 1;
                 break;
--
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 Mon Feb 16 10:55:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJL4-0001fR-KW; Mon, 16 Feb 2015 10:55: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 1YNJL3-0001fB-HC
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:41 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	E8/A5-02760-CACC1E45; Mon, 16 Feb 2015 10:55:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1424084139!9057038!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22790 invoked from network); 16 Feb 2015 10:55:40 -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;
	16 Feb 2015 10:55: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 1YNJL0-00083f-Vf
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJL0-0005Qh-Tc
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:38 +0000
Date: Mon, 16 Feb 2015 10:55:38 +0000
Message-Id: <E1YNJL0-0005Qh-Tc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: More probably detect reentry of
	destroyed ctx
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8bc64413be51c91b8f5e790b71e0d94727f9f004
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:34:40 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:36 2015 +0000

    libxl: More probably detect reentry of destroyed ctx
    
    In libxl_ctx_free:
    
    1. Move the GC_INIT earlier, so that we can:
    
    2. Take the lock around most of the work.  This is technically
       unnecessary since calling any other libxl entrypoint on a ctx being
       passed to libxl_ctx_free risks undefined behaviour.  But, taking
       the lock allows us to much more usually spot this.
    
    3. Increment osevent_in_hook by 1000.  If we are reentered after
       destroy, this will trip some of our entrypoints' asserts.  It also
       means that if we crash for some other reason relating to reentering
       a destroyed ctx, the cause will be more obviously visible by
       examining ctx->osevent_in_hook (assuming that the memory previously
       used for the ctx hasn't been reused and overwritten).
    
    4. Free the lock again.  (pthread_mutex_destroy requires that the
       mutex be unlocked.)
    
    With this patch, I find that an occasional race previously reported
    as:
      libvirtd: libxl_internal.h:3265: libxl__ctx_unlock: Assertion `!r' failed.
    is now reported as:
      libvirtd: libxl_event.c:1236: libxl_osevent_occurred_fd: Assertion `!libxl__gc_owner(gc)->osevent_in_hook' failed.
    
    Examining the call trace with gdb shows this:
      (gdb) bt
      #0  0xb773f424 in __kernel_vsyscall ()
      #1  0xb7022871 in raise () from /lib/i386-linux-gnu/i686/nosegneg/libc.so.6
      #2  0xb7025d62 in abort () from /lib/i386-linux-gnu/i686/nosegneg/libc.so.6
      #3  0xb701b958 in __assert_fail () from /lib/i386-linux-gnu/i686/nosegneg/libc.so.6
      #4  0xb6f00390 in libxl_osevent_occurred_fd (ctx=0xb84813a8, for_libxl=0xb84d6848, fd=31, events_ign=0, revents_ign=1) at libxl_event.c:1236
      #5  0xb1b70464 in libxlDomainObjFDEventCallback () from /usr/local/lib/libvirt/connection-driver/libvirt_driver_libxl.so
      #6  0xb72163b1 in virEventPollDispatchHandles () from /usr/local/lib/libvirt.so.0
      #7  0xb7216be5 in virEventPollRunOnce () from /usr/local/lib/libvirt.so.0
      #8  0xb7214a7e in virEventRunDefaultImpl () from /usr/local/lib/libvirt.so.0
      #9  0xb77c7b98 in virNetServerRun ()
      #10 0xb7771c63 in main ()
      (gdb) print ctx->osevent_in_hook
      $2 = 1000
      (gdb)
    which IMO demonstrates that libxl_osevent_occurred_fd is being called
    on a destroyed ctx.
    
    This is probably a symptom of the bug in libvirt fixed by these
    patches:
       https://www.redhat.com/archives/libvir-list/2015-February/msg00024.html
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index cd6f42c..b9a1941 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -146,11 +146,13 @@ int libxl_ctx_free(libxl_ctx *ctx)
 {
     if (!ctx) return 0;
 
-    assert(!ctx->osevent_in_hook);
-
     int i;
     GC_INIT(ctx);
 
+    CTX_LOCK;
+    assert(!ctx->osevent_in_hook);
+    CTX->osevent_in_hook += 1000; /* make violations easier to debug */
+
     /* Deregister all libxl__ev_KINDs: */
 
     free_disable_deaths(gc, &CTX->death_list);
@@ -196,6 +198,7 @@ int libxl_ctx_free(libxl_ctx *ctx)
     libxl__sigchld_notneeded(gc);
     libxl__pipe_close(ctx->sigchld_selfpipe);
 
+    CTX_UNLOCK;
     pthread_mutex_destroy(&ctx->lock);
 
     GC_FREE;
--
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 Mon Feb 16 10:55:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJL4-0001fR-KW; Mon, 16 Feb 2015 10:55: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 1YNJL3-0001fB-HC
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:41 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	E8/A5-02760-CACC1E45; Mon, 16 Feb 2015 10:55:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1424084139!9057038!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22790 invoked from network); 16 Feb 2015 10:55:40 -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;
	16 Feb 2015 10:55: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 1YNJL0-00083f-Vf
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJL0-0005Qh-Tc
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:38 +0000
Date: Mon, 16 Feb 2015 10:55:38 +0000
Message-Id: <E1YNJL0-0005Qh-Tc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: More probably detect reentry of
	destroyed ctx
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8bc64413be51c91b8f5e790b71e0d94727f9f004
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 9 15:34:40 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 9 17:41:36 2015 +0000

    libxl: More probably detect reentry of destroyed ctx
    
    In libxl_ctx_free:
    
    1. Move the GC_INIT earlier, so that we can:
    
    2. Take the lock around most of the work.  This is technically
       unnecessary since calling any other libxl entrypoint on a ctx being
       passed to libxl_ctx_free risks undefined behaviour.  But, taking
       the lock allows us to much more usually spot this.
    
    3. Increment osevent_in_hook by 1000.  If we are reentered after
       destroy, this will trip some of our entrypoints' asserts.  It also
       means that if we crash for some other reason relating to reentering
       a destroyed ctx, the cause will be more obviously visible by
       examining ctx->osevent_in_hook (assuming that the memory previously
       used for the ctx hasn't been reused and overwritten).
    
    4. Free the lock again.  (pthread_mutex_destroy requires that the
       mutex be unlocked.)
    
    With this patch, I find that an occasional race previously reported
    as:
      libvirtd: libxl_internal.h:3265: libxl__ctx_unlock: Assertion `!r' failed.
    is now reported as:
      libvirtd: libxl_event.c:1236: libxl_osevent_occurred_fd: Assertion `!libxl__gc_owner(gc)->osevent_in_hook' failed.
    
    Examining the call trace with gdb shows this:
      (gdb) bt
      #0  0xb773f424 in __kernel_vsyscall ()
      #1  0xb7022871 in raise () from /lib/i386-linux-gnu/i686/nosegneg/libc.so.6
      #2  0xb7025d62 in abort () from /lib/i386-linux-gnu/i686/nosegneg/libc.so.6
      #3  0xb701b958 in __assert_fail () from /lib/i386-linux-gnu/i686/nosegneg/libc.so.6
      #4  0xb6f00390 in libxl_osevent_occurred_fd (ctx=0xb84813a8, for_libxl=0xb84d6848, fd=31, events_ign=0, revents_ign=1) at libxl_event.c:1236
      #5  0xb1b70464 in libxlDomainObjFDEventCallback () from /usr/local/lib/libvirt/connection-driver/libvirt_driver_libxl.so
      #6  0xb72163b1 in virEventPollDispatchHandles () from /usr/local/lib/libvirt.so.0
      #7  0xb7216be5 in virEventPollRunOnce () from /usr/local/lib/libvirt.so.0
      #8  0xb7214a7e in virEventRunDefaultImpl () from /usr/local/lib/libvirt.so.0
      #9  0xb77c7b98 in virNetServerRun ()
      #10 0xb7771c63 in main ()
      (gdb) print ctx->osevent_in_hook
      $2 = 1000
      (gdb)
    which IMO demonstrates that libxl_osevent_occurred_fd is being called
    on a destroyed ctx.
    
    This is probably a symptom of the bug in libvirt fixed by these
    patches:
       https://www.redhat.com/archives/libvir-list/2015-February/msg00024.html
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index cd6f42c..b9a1941 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -146,11 +146,13 @@ int libxl_ctx_free(libxl_ctx *ctx)
 {
     if (!ctx) return 0;
 
-    assert(!ctx->osevent_in_hook);
-
     int i;
     GC_INIT(ctx);
 
+    CTX_LOCK;
+    assert(!ctx->osevent_in_hook);
+    CTX->osevent_in_hook += 1000; /* make violations easier to debug */
+
     /* Deregister all libxl__ev_KINDs: */
 
     free_disable_deaths(gc, &CTX->death_list);
@@ -196,6 +198,7 @@ int libxl_ctx_free(libxl_ctx *ctx)
     libxl__sigchld_notneeded(gc);
     libxl__pipe_close(ctx->sigchld_selfpipe);
 
+    CTX_UNLOCK;
     pthread_mutex_destroy(&ctx->lock);
 
     GC_FREE;
--
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 Mon Feb 16 10:55:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJLE-0001hB-Na; Mon, 16 Feb 2015 10:55:52 +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 1YNJLD-0001h3-Pb
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:51 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	EE/3C-25903-7BCC1E45; Mon, 16 Feb 2015 10:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1424084149!4554404!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17923 invoked from network); 16 Feb 2015 10:55:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Feb 2015 10:55:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLB-00083i-4K
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLB-0005S1-2r
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:49 +0000
Date: Mon, 16 Feb 2015 10:55:49 +0000
Message-Id: <E1YNJLB-0005S1-2r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: wait for at least one ioreq
	server to be 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 dd748d128d86996592afafea02e578cc7d4e6d42
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Feb 10 13:28:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:28:40 2015 +0100

    x86/hvm: wait for at least one ioreq server to be enabled
    
    In the case where a stub domain is providing emulation for an HVM
    guest, there is no interlock in the toolstack to make sure that
    the stub domain is up and running before the guest is unpaused.
    
    Prior to the introduction of ioreq servers this was not a problem,
    since there was only ever one emulator so ioreqs were simply
    created anyway and the vcpu remained blocked until the stub domain
    started and picked up the ioreq.
    
    Since ioreq servers allow for multiple emulators for a single guest
    it's not possible to know a priori which emulator will handle a
    particular ioreq, so emulators must attach to a guest before the
    guest runs.
    
    This patch works around the lack of interlock in the toolstack for
    stub domains by keeping the domain paused until at least one ioreq
    server is created and enabled, which in practice means the stub
    domain is indeed up and running.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c           |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/domain.h |    1 +
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b03ee4e..952f965 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -886,6 +886,13 @@ static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
 
   done:
     spin_unlock(&s->lock);
+
+    /* This check is protected by the domain ioreq server lock. */
+    if ( d->arch.hvm_domain.ioreq_server.waiting )
+    {
+        d->arch.hvm_domain.ioreq_server.waiting = 0;
+        domain_unpause(d);
+    }
 }
 
 static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
@@ -1437,6 +1444,20 @@ int hvm_domain_initialise(struct domain *d)
 
     spin_lock_init(&d->arch.hvm_domain.ioreq_server.lock);
     INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
+    
+    /*
+     * In the case where a stub domain is providing emulation for
+     * the guest, there is no interlock in the toolstack to prevent
+     * the guest from running before the stub domain is ready.
+     * Hence the domain must remain paused until at least one ioreq
+     * server is created and enabled.
+     */
+    if ( !is_pvh_domain(d) )
+    {
+        domain_pause(d);
+        d->arch.hvm_domain.ioreq_server.waiting = 1;
+    }
+
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 2757c7f..0702bf5 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -83,6 +83,7 @@ struct hvm_domain {
     struct {
         spinlock_t       lock;
         ioservid_t       id;
+        bool_t           waiting;
         struct list_head list;
     } ioreq_server;
     struct hvm_ioreq_server *default_ioreq_server;
--
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 Mon Feb 16 10:55:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:55: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 1YNJLE-0001hB-Na; Mon, 16 Feb 2015 10:55:52 +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 1YNJLD-0001h3-Pb
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:51 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	EE/3C-25903-7BCC1E45; Mon, 16 Feb 2015 10:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1424084149!4554404!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17923 invoked from network); 16 Feb 2015 10:55:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Feb 2015 10:55:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLB-00083i-4K
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLB-0005S1-2r
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:49 +0000
Date: Mon, 16 Feb 2015 10:55:49 +0000
Message-Id: <E1YNJLB-0005S1-2r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: wait for at least one ioreq
	server to be 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 dd748d128d86996592afafea02e578cc7d4e6d42
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Feb 10 13:28:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:28:40 2015 +0100

    x86/hvm: wait for at least one ioreq server to be enabled
    
    In the case where a stub domain is providing emulation for an HVM
    guest, there is no interlock in the toolstack to make sure that
    the stub domain is up and running before the guest is unpaused.
    
    Prior to the introduction of ioreq servers this was not a problem,
    since there was only ever one emulator so ioreqs were simply
    created anyway and the vcpu remained blocked until the stub domain
    started and picked up the ioreq.
    
    Since ioreq servers allow for multiple emulators for a single guest
    it's not possible to know a priori which emulator will handle a
    particular ioreq, so emulators must attach to a guest before the
    guest runs.
    
    This patch works around the lack of interlock in the toolstack for
    stub domains by keeping the domain paused until at least one ioreq
    server is created and enabled, which in practice means the stub
    domain is indeed up and running.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c           |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/domain.h |    1 +
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b03ee4e..952f965 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -886,6 +886,13 @@ static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
 
   done:
     spin_unlock(&s->lock);
+
+    /* This check is protected by the domain ioreq server lock. */
+    if ( d->arch.hvm_domain.ioreq_server.waiting )
+    {
+        d->arch.hvm_domain.ioreq_server.waiting = 0;
+        domain_unpause(d);
+    }
 }
 
 static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
@@ -1437,6 +1444,20 @@ int hvm_domain_initialise(struct domain *d)
 
     spin_lock_init(&d->arch.hvm_domain.ioreq_server.lock);
     INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
+    
+    /*
+     * In the case where a stub domain is providing emulation for
+     * the guest, there is no interlock in the toolstack to prevent
+     * the guest from running before the stub domain is ready.
+     * Hence the domain must remain paused until at least one ioreq
+     * server is created and enabled.
+     */
+    if ( !is_pvh_domain(d) )
+    {
+        domain_pause(d);
+        d->arch.hvm_domain.ioreq_server.waiting = 1;
+    }
+
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 2757c7f..0702bf5 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -83,6 +83,7 @@ struct hvm_domain {
     struct {
         spinlock_t       lock;
         ioservid_t       id;
+        bool_t           waiting;
         struct list_head list;
     } ioreq_server;
     struct hvm_ioreq_server *default_ioreq_server;
--
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 Mon Feb 16 10:56:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YNJLP-0001ix-QN; Mon, 16 Feb 2015 10:56:03 +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 1YNJLO-0001ij-76
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:02 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	AB/2A-02885-1CCC1E45; Mon, 16 Feb 2015 10:56:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1424084159!9481634!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9061 invoked from network); 16 Feb 2015 10:56:00 -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;
	16 Feb 2015 10:56: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 1YNJLL-00083s-CB
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLL-0005SP-7S
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:59 +0000
Date: Mon, 16 Feb 2015 10:55:59 +0000
Message-Id: <E1YNJLL-0005SP-7S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: explicitly mark ioreq server
	pages dirty
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70f691130081324a8efb97b23c504d8abc5421db
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Feb 10 13:29:51 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:29:51 2015 +0100

    x86/hvm: explicitly mark ioreq server pages dirty
    
    ...when they are added back into the guest physmap, when an ioreq
    server is disabled. If this is not done then the pages are missed
    during migration, causing ioreq server creation to fail on the remote end.
    
    This problem only manifests if the ioreq server is non-default because in
    the default case the pages are never removed from the guest physmap.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 952f965..6368768 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -543,9 +543,16 @@ static void hvm_remove_ioreq_gmfn(
 static int hvm_add_ioreq_gmfn(
     struct domain *d, struct hvm_ioreq_page *iorp)
 {
+    int rc;
+
     clear_page(iorp->va);
-    return guest_physmap_add_page(d, iorp->gmfn,
-                                  page_to_mfn(iorp->page), 0);
+
+    rc = guest_physmap_add_page(d, iorp->gmfn,
+                                page_to_mfn(iorp->page), 0);
+    if ( rc == 0 )
+        paging_mark_dirty(d, page_to_mfn(iorp->page));
+
+    return rc;
 }
 
 static int hvm_print_line(
--
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 Mon Feb 16 10:56:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YNJLP-0001ix-QN; Mon, 16 Feb 2015 10:56:03 +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 1YNJLO-0001ij-76
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:02 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	AB/2A-02885-1CCC1E45; Mon, 16 Feb 2015 10:56:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1424084159!9481634!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9061 invoked from network); 16 Feb 2015 10:56:00 -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;
	16 Feb 2015 10:56: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 1YNJLL-00083s-CB
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLL-0005SP-7S
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:55:59 +0000
Date: Mon, 16 Feb 2015 10:55:59 +0000
Message-Id: <E1YNJLL-0005SP-7S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: explicitly mark ioreq server
	pages dirty
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70f691130081324a8efb97b23c504d8abc5421db
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Feb 10 13:29:51 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:29:51 2015 +0100

    x86/hvm: explicitly mark ioreq server pages dirty
    
    ...when they are added back into the guest physmap, when an ioreq
    server is disabled. If this is not done then the pages are missed
    during migration, causing ioreq server creation to fail on the remote end.
    
    This problem only manifests if the ioreq server is non-default because in
    the default case the pages are never removed from the guest physmap.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 952f965..6368768 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -543,9 +543,16 @@ static void hvm_remove_ioreq_gmfn(
 static int hvm_add_ioreq_gmfn(
     struct domain *d, struct hvm_ioreq_page *iorp)
 {
+    int rc;
+
     clear_page(iorp->va);
-    return guest_physmap_add_page(d, iorp->gmfn,
-                                  page_to_mfn(iorp->page), 0);
+
+    rc = guest_physmap_add_page(d, iorp->gmfn,
+                                page_to_mfn(iorp->page), 0);
+    if ( rc == 0 )
+        paging_mark_dirty(d, page_to_mfn(iorp->page));
+
+    return rc;
 }
 
 static int hvm_print_line(
--
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 Mon Feb 16 10:56:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJLZ-0001kj-V2; Mon, 16 Feb 2015 10:56: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 1YNJLY-0001kJ-4N
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:12 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	77/3E-02801-BCCC1E45; Mon, 16 Feb 2015 10:56:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1424084169!6732901!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27751 invoked from network); 16 Feb 2015 10:56:10 -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;
	16 Feb 2015 10:56: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 1YNJLV-00084T-HM
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLV-0005Sx-GN
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:09 +0000
Date: Mon, 16 Feb 2015 10:56:09 +0000
Message-Id: <E1YNJLV-0005Sx-GN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: also separate kernel/user
	vTSC statistics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afb2f2ffb72e38268bdd0c26ce7f3df90eea76bb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 10 13:31:16 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:31:16 2015 +0100

    x86/HVM: also separate kernel/user vTSC statistics
    
    It is unclear why this got done for PV only originally.
    
    While at it, limit this statistics collection to debug or performance
    counter enabled builds.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c       |   38 +++++++++++++++++++++++++++++++++-----
 xen/arch/x86/time.c          |   10 ++++------
 xen/include/asm-x86/domain.h |    6 ++++--
 3 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6368768..3051e2a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -319,7 +319,6 @@ u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
     {
         tsc = hvm_get_guest_time_fixed(v, at_tsc);
         tsc = gtime_to_gtsc(v->domain, tsc);
-        v->domain->arch.vtsc_kerncount++;
     }
     else if ( at_tsc )
     {
@@ -4396,12 +4395,41 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
     }
 }
 
+static uint64_t _hvm_rdtsc_intercept(void)
+{
+    struct vcpu *curr = current;
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+    struct domain *currd = curr->domain;
+
+    if ( currd->arch.vtsc )
+        switch ( hvm_guest_x86_mode(curr) )
+        {
+            struct segment_register sreg;
+
+        case 8:
+        case 4:
+        case 2:
+            hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+            if ( unlikely(sreg.attr.fields.dpl) )
+            {
+        case 1:
+                currd->arch.vtsc_usercount++;
+                break;
+            }
+            /* fall through */
+        case 0:
+            currd->arch.vtsc_kerncount++;
+            break;
+        }
+#endif
+
+    return hvm_get_guest_tsc(curr);
+}
+
 void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
 {
-    uint64_t tsc;
-    struct vcpu *v = current;
+    uint64_t tsc = _hvm_rdtsc_intercept();
 
-    tsc = hvm_get_guest_tsc(v);
     regs->eax = (uint32_t)tsc;
     regs->edx = (uint32_t)(tsc >> 32);
 
@@ -4429,7 +4457,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         break;
 
     case MSR_IA32_TSC:
-        *msr_content = hvm_get_guest_tsc(v);
+        *msr_content = _hvm_rdtsc_intercept();
         break;
 
     case MSR_IA32_TSC_ADJUST:
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5aca202..b609938 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1777,10 +1777,12 @@ void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp)
 
     spin_lock(&d->arch.vtsc_lock);
 
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
     if ( guest_kernel_mode(v, regs) )
         d->arch.vtsc_kerncount++;
     else
         d->arch.vtsc_usercount++;
+#endif
 
     if ( (int64_t)(now - d->arch.vtsc_last) > 0 )
         d->arch.vtsc_last = now;
@@ -2033,17 +2035,13 @@ static void dump_softtsc(unsigned char key)
             printk(",khz=%"PRIu32, d->arch.tsc_khz);
         if ( d->arch.incarnation )
             printk(",inc=%"PRIu32, d->arch.incarnation);
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
         if ( !(d->arch.vtsc_kerncount | d->arch.vtsc_usercount) )
-        {
             printk("\n");
-            continue;
-        }
-        if ( is_hvm_domain(d) )
-            printk(",vtsc count: %"PRIu64" total\n",
-                   d->arch.vtsc_kerncount);
         else
             printk(",vtsc count: %"PRIu64" kernel, %"PRIu64" user\n",
                    d->arch.vtsc_kerncount, d->arch.vtsc_usercount);
+#endif
         domcnt++;
     }
 
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 00a8606..12a5e81 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -319,8 +319,10 @@ struct arch_domain
     struct time_scale ns_to_vtsc; /* scaling for certain emulated cases */
     uint32_t incarnation;    /* incremented every restore or live migrate
                                 (possibly other cases in the future */
-    uint64_t vtsc_kerncount; /* for hvm, counts all vtsc */
-    uint64_t vtsc_usercount; /* not used for hvm */
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+    uint64_t vtsc_kerncount;
+    uint64_t vtsc_usercount;
+#endif
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
     spinlock_t e820_lock;
--
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 Mon Feb 16 10:56:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJLZ-0001kj-V2; Mon, 16 Feb 2015 10:56: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 1YNJLY-0001kJ-4N
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:12 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	77/3E-02801-BCCC1E45; Mon, 16 Feb 2015 10:56:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1424084169!6732901!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27751 invoked from network); 16 Feb 2015 10:56:10 -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;
	16 Feb 2015 10:56: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 1YNJLV-00084T-HM
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLV-0005Sx-GN
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:09 +0000
Date: Mon, 16 Feb 2015 10:56:09 +0000
Message-Id: <E1YNJLV-0005Sx-GN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: also separate kernel/user
	vTSC statistics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afb2f2ffb72e38268bdd0c26ce7f3df90eea76bb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 10 13:31:16 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:31:16 2015 +0100

    x86/HVM: also separate kernel/user vTSC statistics
    
    It is unclear why this got done for PV only originally.
    
    While at it, limit this statistics collection to debug or performance
    counter enabled builds.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c       |   38 +++++++++++++++++++++++++++++++++-----
 xen/arch/x86/time.c          |   10 ++++------
 xen/include/asm-x86/domain.h |    6 ++++--
 3 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6368768..3051e2a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -319,7 +319,6 @@ u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
     {
         tsc = hvm_get_guest_time_fixed(v, at_tsc);
         tsc = gtime_to_gtsc(v->domain, tsc);
-        v->domain->arch.vtsc_kerncount++;
     }
     else if ( at_tsc )
     {
@@ -4396,12 +4395,41 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
     }
 }
 
+static uint64_t _hvm_rdtsc_intercept(void)
+{
+    struct vcpu *curr = current;
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+    struct domain *currd = curr->domain;
+
+    if ( currd->arch.vtsc )
+        switch ( hvm_guest_x86_mode(curr) )
+        {
+            struct segment_register sreg;
+
+        case 8:
+        case 4:
+        case 2:
+            hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+            if ( unlikely(sreg.attr.fields.dpl) )
+            {
+        case 1:
+                currd->arch.vtsc_usercount++;
+                break;
+            }
+            /* fall through */
+        case 0:
+            currd->arch.vtsc_kerncount++;
+            break;
+        }
+#endif
+
+    return hvm_get_guest_tsc(curr);
+}
+
 void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
 {
-    uint64_t tsc;
-    struct vcpu *v = current;
+    uint64_t tsc = _hvm_rdtsc_intercept();
 
-    tsc = hvm_get_guest_tsc(v);
     regs->eax = (uint32_t)tsc;
     regs->edx = (uint32_t)(tsc >> 32);
 
@@ -4429,7 +4457,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         break;
 
     case MSR_IA32_TSC:
-        *msr_content = hvm_get_guest_tsc(v);
+        *msr_content = _hvm_rdtsc_intercept();
         break;
 
     case MSR_IA32_TSC_ADJUST:
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5aca202..b609938 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1777,10 +1777,12 @@ void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp)
 
     spin_lock(&d->arch.vtsc_lock);
 
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
     if ( guest_kernel_mode(v, regs) )
         d->arch.vtsc_kerncount++;
     else
         d->arch.vtsc_usercount++;
+#endif
 
     if ( (int64_t)(now - d->arch.vtsc_last) > 0 )
         d->arch.vtsc_last = now;
@@ -2033,17 +2035,13 @@ static void dump_softtsc(unsigned char key)
             printk(",khz=%"PRIu32, d->arch.tsc_khz);
         if ( d->arch.incarnation )
             printk(",inc=%"PRIu32, d->arch.incarnation);
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
         if ( !(d->arch.vtsc_kerncount | d->arch.vtsc_usercount) )
-        {
             printk("\n");
-            continue;
-        }
-        if ( is_hvm_domain(d) )
-            printk(",vtsc count: %"PRIu64" total\n",
-                   d->arch.vtsc_kerncount);
         else
             printk(",vtsc count: %"PRIu64" kernel, %"PRIu64" user\n",
                    d->arch.vtsc_kerncount, d->arch.vtsc_usercount);
+#endif
         domcnt++;
     }
 
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 00a8606..12a5e81 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -319,8 +319,10 @@ struct arch_domain
     struct time_scale ns_to_vtsc; /* scaling for certain emulated cases */
     uint32_t incarnation;    /* incremented every restore or live migrate
                                 (possibly other cases in the future */
-    uint64_t vtsc_kerncount; /* for hvm, counts all vtsc */
-    uint64_t vtsc_usercount; /* not used for hvm */
+#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+    uint64_t vtsc_kerncount;
+    uint64_t vtsc_usercount;
+#endif
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
     spinlock_t e820_lock;
--
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 Mon Feb 16 10:56:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJLn-0001nC-4K; Mon, 16 Feb 2015 10:56:27 +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 1YNJLm-0001my-6O
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:26 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	70/2C-02830-9DCC1E45; Mon, 16 Feb 2015 10:56:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1424084179!4095394!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9597 invoked from network); 16 Feb 2015 10:56:24 -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;
	16 Feb 2015 10:56: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 1YNJLf-00084Z-Ml
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLf-0005TJ-LM
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:19 +0000
Date: Mon, 16 Feb 2015 10:56:19 +0000
Message-Id: <E1YNJLf-0005TJ-LM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: re-order struct arch_domain fields
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d40cbb98a3eb447b8055ec4e70e93a6f22850ac5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 10 13:32:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:32:03 2015 +0100

    x86: re-order struct arch_domain fields
    
    ... to reduce padding holes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/domain.h |   45 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 12a5e81..9cdffa8 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -255,13 +255,16 @@ struct arch_domain
 
     unsigned int hv_compat_vstart;
 
-    bool_t s3_integrity;
+    /* Maximum physical-address bitwidth supported by this guest. */
+    unsigned int physaddr_bitsize;
 
     /* I/O-port admin-specified access capabilities. */
     struct rangeset *ioport_caps;
     uint32_t pci_cf8;
     uint8_t cmos_idx;
 
+    bool_t s3_integrity;
+
     struct list_head pdev_list;
 
     union {
@@ -275,6 +278,18 @@ struct arch_domain
      * page_alloc lock */
     int page_alloc_unlock_level;
 
+    /* Continuable domain_relinquish_resources(). */
+    enum {
+        RELMEM_not_started,
+        RELMEM_shared,
+        RELMEM_xen,
+        RELMEM_l4,
+        RELMEM_l3,
+        RELMEM_l2,
+        RELMEM_done,
+    } relmem;
+    struct page_list_head relmem_list;
+
     /* nestedhvm: translate l2 guest physical to host physical */
     struct p2m_domain *nested_p2m[MAX_NESTEDP2M];
     mm_lock_t nested_p2m_lock;
@@ -282,27 +297,16 @@ struct arch_domain
     /* NB. protected by d->event_lock and by irq_desc[irq].lock */
     struct radix_tree_root irq_pirq;
 
-    /* Maximum physical-address bitwidth supported by this guest. */
-    unsigned int physaddr_bitsize;
-
     /* Is a 32-bit PV (non-HVM) guest? */
     bool_t is_32bit_pv;
     /* Is shared-info page in 32-bit format? */
     bool_t has_32bit_shinfo;
+
     /* Domain cannot handle spurious page faults? */
     bool_t suppress_spurious_page_faults;
 
-    /* Continuable domain_relinquish_resources(). */
-    enum {
-        RELMEM_not_started,
-        RELMEM_shared,
-        RELMEM_xen,
-        RELMEM_l4,
-        RELMEM_l3,
-        RELMEM_l2,
-        RELMEM_done,
-    } relmem;
-    struct page_list_head relmem_list;
+    /* Is PHYSDEVOP_eoi to automatically unmask the event channel? */
+    bool_t auto_unmask;
 
     cpuid_input_t *cpuids;
 
@@ -329,15 +333,12 @@ struct arch_domain
     struct e820entry *e820;
     unsigned int nr_e820;
 
-    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
-     * unmask the event channel */
-    bool_t auto_unmask;
+    unsigned int psr_rmid; /* RMID assigned to the domain for CMT */
+
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
-
-    unsigned int psr_rmid; /* RMID assigned to the domain for CMT */
-} __cacheline_aligned;
+};
 
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
 
@@ -493,7 +494,7 @@ struct arch_vcpu
         unsigned long eip;
     } mem_event;
 
-} __cacheline_aligned;
+};
 
 smap_check_policy_t smap_policy_change(struct vcpu *v,
                                        smap_check_policy_t new_policy);
--
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 Mon Feb 16 10:56:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJLn-0001nC-4K; Mon, 16 Feb 2015 10:56:27 +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 1YNJLm-0001my-6O
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:26 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	70/2C-02830-9DCC1E45; Mon, 16 Feb 2015 10:56:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1424084179!4095394!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9597 invoked from network); 16 Feb 2015 10:56:24 -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;
	16 Feb 2015 10:56: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 1YNJLf-00084Z-Ml
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLf-0005TJ-LM
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:19 +0000
Date: Mon, 16 Feb 2015 10:56:19 +0000
Message-Id: <E1YNJLf-0005TJ-LM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: re-order struct arch_domain fields
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d40cbb98a3eb447b8055ec4e70e93a6f22850ac5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 10 13:32:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 13:32:03 2015 +0100

    x86: re-order struct arch_domain fields
    
    ... to reduce padding holes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/domain.h |   45 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 12a5e81..9cdffa8 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -255,13 +255,16 @@ struct arch_domain
 
     unsigned int hv_compat_vstart;
 
-    bool_t s3_integrity;
+    /* Maximum physical-address bitwidth supported by this guest. */
+    unsigned int physaddr_bitsize;
 
     /* I/O-port admin-specified access capabilities. */
     struct rangeset *ioport_caps;
     uint32_t pci_cf8;
     uint8_t cmos_idx;
 
+    bool_t s3_integrity;
+
     struct list_head pdev_list;
 
     union {
@@ -275,6 +278,18 @@ struct arch_domain
      * page_alloc lock */
     int page_alloc_unlock_level;
 
+    /* Continuable domain_relinquish_resources(). */
+    enum {
+        RELMEM_not_started,
+        RELMEM_shared,
+        RELMEM_xen,
+        RELMEM_l4,
+        RELMEM_l3,
+        RELMEM_l2,
+        RELMEM_done,
+    } relmem;
+    struct page_list_head relmem_list;
+
     /* nestedhvm: translate l2 guest physical to host physical */
     struct p2m_domain *nested_p2m[MAX_NESTEDP2M];
     mm_lock_t nested_p2m_lock;
@@ -282,27 +297,16 @@ struct arch_domain
     /* NB. protected by d->event_lock and by irq_desc[irq].lock */
     struct radix_tree_root irq_pirq;
 
-    /* Maximum physical-address bitwidth supported by this guest. */
-    unsigned int physaddr_bitsize;
-
     /* Is a 32-bit PV (non-HVM) guest? */
     bool_t is_32bit_pv;
     /* Is shared-info page in 32-bit format? */
     bool_t has_32bit_shinfo;
+
     /* Domain cannot handle spurious page faults? */
     bool_t suppress_spurious_page_faults;
 
-    /* Continuable domain_relinquish_resources(). */
-    enum {
-        RELMEM_not_started,
-        RELMEM_shared,
-        RELMEM_xen,
-        RELMEM_l4,
-        RELMEM_l3,
-        RELMEM_l2,
-        RELMEM_done,
-    } relmem;
-    struct page_list_head relmem_list;
+    /* Is PHYSDEVOP_eoi to automatically unmask the event channel? */
+    bool_t auto_unmask;
 
     cpuid_input_t *cpuids;
 
@@ -329,15 +333,12 @@ struct arch_domain
     struct e820entry *e820;
     unsigned int nr_e820;
 
-    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
-     * unmask the event channel */
-    bool_t auto_unmask;
+    unsigned int psr_rmid; /* RMID assigned to the domain for CMT */
+
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
-
-    unsigned int psr_rmid; /* RMID assigned to the domain for CMT */
-} __cacheline_aligned;
+};
 
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
 
@@ -493,7 +494,7 @@ struct arch_vcpu
         unsigned long eip;
     } mem_event;
 
-} __cacheline_aligned;
+};
 
 smap_check_policy_t smap_policy_change(struct vcpu *v,
                                        smap_check_policy_t new_policy);
--
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 Mon Feb 16 10:56:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJLu-0001oR-7S; Mon, 16 Feb 2015 10:56:34 +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 1YNJLt-0001oB-2r
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:33 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	70/B8-02884-0ECC1E45; Mon, 16 Feb 2015 10:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1424084190!8208425!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28021 invoked from network); 16 Feb 2015 10:56:31 -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;
	16 Feb 2015 10:56: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 1YNJLp-00084i-Sy
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLp-0005Tg-Qu
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:29 +0000
Date: Mon, 16 Feb 2015 10:56:29 +0000
Message-Id: <E1YNJLp-0005Tg-Qu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: export the
	exception_table[] function pointer table to C
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d3eb16b8a7c06f0d2a2110948a8477a62b541bbf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 11 17:16:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:16:18 2015 +0100

    x86/traps: export the exception_table[] function pointer table to C
    
    and use it in preference to the direct call to do_nmi() in vmx.c
    
    The value 'TRAP_last_reserved' was only used where 'TRAP_nr' would be more
    appropriate, so is replaced.
    
    No functional change
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmx/vmx.c      |    2 +-
 xen/arch/x86/x86_64/entry.S     |    5 +++--
 xen/include/asm-x86/processor.h |    5 ++++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 88b7821..357ef6c 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2701,7 +2701,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
                  (X86_EVENTTYPE_NMI << 8)) )
         {
-            do_nmi(regs);
+            exception_table[TRAP_nmi](regs);
             enable_nmis();
         }
         break;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index b3d6e32..062c690 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -728,9 +728,10 @@ ENTRY(exception_table)
         .quad do_alignment_check
         .quad do_machine_check
         .quad do_simd_coprocessor_error
-        .rept TRAP_last_reserved + 1 - ((. - exception_table) / 8)
+        .rept TRAP_nr - ((. - exception_table) / 8)
         .quad do_reserved_trap /* Architecturally reserved exceptions. */
         .endr
+        .size exception_table, . - exception_table
 
 ENTRY(hypercall_table)
         .quad do_set_trap_table     /*  0 */
@@ -857,7 +858,7 @@ autogen_stubs: /* Automatically generated stubs. */
         entrypoint 1b
 
         /* Reserved exceptions, heading towards do_reserved_trap(). */
-        .elseif vec == TRAP_copro_seg || vec == TRAP_spurious_int || (vec > TRAP_simd_error && vec <= TRAP_last_reserved)
+        .elseif vec == TRAP_copro_seg || vec == TRAP_spurious_int || (vec > TRAP_simd_error && vec < TRAP_nr)
 
 1:      test  $8,%spl        /* 64bit exception frames are 16 byte aligned, but the word */
         jz    2f             /* size is 8 bytes.  Check whether the processor gave us an */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 20eade6..2773ea8 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -114,7 +114,7 @@
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
 #define TRAP_virtualisation   20
-#define TRAP_last_reserved    31
+#define TRAP_nr               32
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */
@@ -492,6 +492,9 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
+/* Dispatch table for exceptions */
+extern void (* const exception_table[TRAP_nr])(struct cpu_user_regs *regs);
+
 #define DECLARE_TRAP_HANDLER(_name)                    \
     void _name(void);                                  \
     void do_ ## _name(struct cpu_user_regs *regs)
--
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 Mon Feb 16 10:56:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJLu-0001oR-7S; Mon, 16 Feb 2015 10:56:34 +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 1YNJLt-0001oB-2r
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:33 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	70/B8-02884-0ECC1E45; Mon, 16 Feb 2015 10:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1424084190!8208425!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28021 invoked from network); 16 Feb 2015 10:56:31 -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;
	16 Feb 2015 10:56: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 1YNJLp-00084i-Sy
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJLp-0005Tg-Qu
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:29 +0000
Date: Mon, 16 Feb 2015 10:56:29 +0000
Message-Id: <E1YNJLp-0005Tg-Qu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: export the
	exception_table[] function pointer table to C
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d3eb16b8a7c06f0d2a2110948a8477a62b541bbf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 11 17:16:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:16:18 2015 +0100

    x86/traps: export the exception_table[] function pointer table to C
    
    and use it in preference to the direct call to do_nmi() in vmx.c
    
    The value 'TRAP_last_reserved' was only used where 'TRAP_nr' would be more
    appropriate, so is replaced.
    
    No functional change
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmx/vmx.c      |    2 +-
 xen/arch/x86/x86_64/entry.S     |    5 +++--
 xen/include/asm-x86/processor.h |    5 ++++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 88b7821..357ef6c 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2701,7 +2701,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
                  (X86_EVENTTYPE_NMI << 8)) )
         {
-            do_nmi(regs);
+            exception_table[TRAP_nmi](regs);
             enable_nmis();
         }
         break;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index b3d6e32..062c690 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -728,9 +728,10 @@ ENTRY(exception_table)
         .quad do_alignment_check
         .quad do_machine_check
         .quad do_simd_coprocessor_error
-        .rept TRAP_last_reserved + 1 - ((. - exception_table) / 8)
+        .rept TRAP_nr - ((. - exception_table) / 8)
         .quad do_reserved_trap /* Architecturally reserved exceptions. */
         .endr
+        .size exception_table, . - exception_table
 
 ENTRY(hypercall_table)
         .quad do_set_trap_table     /*  0 */
@@ -857,7 +858,7 @@ autogen_stubs: /* Automatically generated stubs. */
         entrypoint 1b
 
         /* Reserved exceptions, heading towards do_reserved_trap(). */
-        .elseif vec == TRAP_copro_seg || vec == TRAP_spurious_int || (vec > TRAP_simd_error && vec <= TRAP_last_reserved)
+        .elseif vec == TRAP_copro_seg || vec == TRAP_spurious_int || (vec > TRAP_simd_error && vec < TRAP_nr)
 
 1:      test  $8,%spl        /* 64bit exception frames are 16 byte aligned, but the word */
         jz    2f             /* size is 8 bytes.  Check whether the processor gave us an */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 20eade6..2773ea8 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -114,7 +114,7 @@
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
 #define TRAP_virtualisation   20
-#define TRAP_last_reserved    31
+#define TRAP_nr               32
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */
@@ -492,6 +492,9 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
+/* Dispatch table for exceptions */
+extern void (* const exception_table[TRAP_nr])(struct cpu_user_regs *regs);
+
 #define DECLARE_TRAP_HANDLER(_name)                    \
     void _name(void);                                  \
     void do_ ## _name(struct cpu_user_regs *regs)
--
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 Mon Feb 16 10:56:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJM4-0001q8-A8; Mon, 16 Feb 2015 10:56:44 +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 1YNJM2-0001pv-Od
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:42 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	72/7E-02999-AECC1E45; Mon, 16 Feb 2015 10:56:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1424084200!9481845!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14159 invoked from network); 16 Feb 2015 10:56:41 -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;
	16 Feb 2015 10:56:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJM0-00084r-5G
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJM0-0005Uw-0Z
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:40 +0000
Date: Mon, 16 Feb 2015 10:56:40 +0000
Message-Id: <E1YNJM0-0005Uw-0Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: avoid interleaved writes
	when updating potentially-live descriptors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52956401df7497f3f51e3bd164ce2bb0a5cc2ee1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 11 17:17:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:17:38 2015 +0100

    x86/traps: avoid interleaved writes when updating potentially-live descriptors
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/processor.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 2773ea8..c5c647a 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -444,9 +444,12 @@ struct __packed __cacheline_aligned tss_struct {
  * descriptor table entry. */
 static always_inline void set_ist(idt_entry_t *idt, unsigned long ist)
 {
+    idt_entry_t new = *idt;
+
     /* IST is a 3 bit field, 32 bits into the IDT entry. */
     ASSERT(ist <= IST_MAX);
-    idt->a = (idt->a & ~(7UL << 32)) | (ist << 32);
+    new.a = (idt->a & ~(7UL << 32)) | (ist << 32);
+    _write_gate_lower(idt, &new);
 }
 
 #define IDT_ENTRIES 256
--
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 Mon Feb 16 10:56:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56: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 1YNJM4-0001q8-A8; Mon, 16 Feb 2015 10:56:44 +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 1YNJM2-0001pv-Od
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:42 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	72/7E-02999-AECC1E45; Mon, 16 Feb 2015 10:56:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1424084200!9481845!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14159 invoked from network); 16 Feb 2015 10:56:41 -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;
	16 Feb 2015 10:56:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJM0-00084r-5G
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJM0-0005Uw-0Z
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:40 +0000
Date: Mon, 16 Feb 2015 10:56:40 +0000
Message-Id: <E1YNJM0-0005Uw-0Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: avoid interleaved writes
	when updating potentially-live descriptors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52956401df7497f3f51e3bd164ce2bb0a5cc2ee1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 11 17:17:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:17:38 2015 +0100

    x86/traps: avoid interleaved writes when updating potentially-live descriptors
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/processor.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 2773ea8..c5c647a 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -444,9 +444,12 @@ struct __packed __cacheline_aligned tss_struct {
  * descriptor table entry. */
 static always_inline void set_ist(idt_entry_t *idt, unsigned long ist)
 {
+    idt_entry_t new = *idt;
+
     /* IST is a 3 bit field, 32 bits into the IDT entry. */
     ASSERT(ist <= IST_MAX);
-    idt->a = (idt->a & ~(7UL << 32)) | (ist << 32);
+    new.a = (idt->a & ~(7UL << 32)) | (ist << 32);
+    _write_gate_lower(idt, &new);
 }
 
 #define IDT_ENTRIES 256
--
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 Mon Feb 16 10:56:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YNJME-0001rq-EU; Mon, 16 Feb 2015 10:56:54 +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 1YNJMC-0001ra-WD
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:53 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AD/AD-02809-4FCC1E45; Mon, 16 Feb 2015 10:56:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1424084210!12138237!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2451 invoked from network); 16 Feb 2015 10:56:51 -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;
	16 Feb 2015 10:56: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 1YNJMA-000851-Cq
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMA-0005VJ-8B
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:50 +0000
Date: Mon, 16 Feb 2015 10:56:50 +0000
Message-Id: <E1YNJMA-0005VJ-8B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/nmi: fix shootdown of pcpus
	running in VMX non-root 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 cbeeaa7da01bfa37c1fcdfe79e8f4f1400262ccb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 11 17:18:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:18:27 2015 +0100

    x86/nmi: fix shootdown of pcpus running in VMX non-root mode
    
    c/s 7dd3b06ff "vmx: fix handling of NMI VMEXIT" fixed one issue but
    inadvertently introduced a regression when it came to the NMI shootdown.  The
    shootdown code worked by patching vector 2 in each IDT, but the introduced
    direct call to do_nmi() bypassed this.
    
    Instead of patching each IDT, take a different approach by updating the
    existing dispatch table.  This allows for the removal of the remote IDT
    patching and the removal of the nmi_crash() entry point.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/crash.c            |   59 ++++++++++++++++-----------------------
 xen/arch/x86/x86_64/entry.S     |    9 ------
 xen/include/asm-x86/processor.h |    1 -
 3 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index c0b83df..eb7be9c 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -36,9 +36,11 @@ static unsigned int crashing_cpu;
 static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 
 /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
-void do_nmi_crash(struct cpu_user_regs *regs)
+static void noreturn do_nmi_crash(const struct cpu_user_regs *regs)
 {
-    int cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
+
+    stac();
 
     /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
     ASSERT(cpu != crashing_cpu);
@@ -113,11 +115,10 @@ void do_nmi_crash(struct cpu_user_regs *regs)
         halt();
 }
 
-void nmi_crash(void);
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
-    int i, cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     disable_lapic_nmi_watchdog();
     local_irq_disable();
@@ -127,38 +128,26 @@ static void nmi_shootdown_cpus(void)
 
     cpumask_andnot(&waiting_to_crash, &cpu_online_map, cpumask_of(cpu));
 
-    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
-     * invokes do_nmi_crash (above), which cause them to write state and
-     * fall into a loop.  The crashing pcpu gets the nop handler to
-     * cause it to return to this function ASAP.
+    /*
+     * Disable IST for MCEs to avoid stack corruption race conditions, and
+     * change the NMI handler to a nop to avoid deviation from this codepath.
      */
-    for ( i = 0; i < nr_cpu_ids; i++ )
-    {
-        if ( idt_tables[i] == NULL )
-            continue;
-
-        if ( i == cpu )
-        {
-            /*
-             * Disable the interrupt stack tables for this cpu's MCE and NMI 
-             * handlers, and alter the NMI handler to have no operation.  
-             * Disabling the stack tables prevents stack corruption race 
-             * conditions, while changing the handler helps prevent cascading 
-             * faults; we are certainly going to crash by this point.
-             *
-             * This update is safe from a security point of view, as this pcpu 
-             * is never going to try to sysret back to a PV vcpu.
-             */
-            _set_gate_lower(&idt_tables[i][TRAP_nmi],
-                            SYS_DESC_irq_gate, 0, &trap_nop);
-            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
-        }
-        else
-        {
-            /* Do not update stack table for other pcpus. */
-            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
-        }
-    }
+    _set_gate_lower(&idt_tables[cpu][TRAP_nmi],
+                    SYS_DESC_irq_gate, 0, &trap_nop);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+    /*
+     * Ideally would be:
+     *   exception_table[TRAP_nmi] = &do_nmi_crash;
+     *
+     * but the exception_table is read only.  Borrow an unused fixmap entry
+     * to construct a writable mapping.
+     */
+    set_fixmap(FIX_TBOOT_MAP_ADDRESS, __pa(&exception_table[TRAP_nmi]));
+    write_atomic((unsigned long *)
+                 (fix_to_virt(FIX_TBOOT_MAP_ADDRESS) +
+                  ((unsigned long)&exception_table[TRAP_nmi] & ~PAGE_MASK)),
+                 (unsigned long)&do_nmi_crash);
 
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 062c690..2d25d57 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -669,15 +669,6 @@ handle_ist_exception:
         je    restore_all_guest
         jmp   compat_restore_all_guest
 
-ENTRY(nmi_crash)
-        pushq $0
-        movl $TRAP_nmi,4(%rsp)
-        /* Set AC to reduce chance of further SMAP faults */
-        SAVE_ALL STAC
-        movq %rsp,%rdi
-        callq do_nmi_crash /* Does not return */
-        ud2
-
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index c5c647a..87d80ff 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -530,7 +530,6 @@ DECLARE_TRAP_HANDLER(alignment_check);
 
 void trap_nop(void);
 void enable_nmis(void);
-void noreturn do_nmi_crash(struct cpu_user_regs *regs);
 void do_reserved_trap(struct cpu_user_regs *regs);
 
 void syscall_enter(void);
--
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 Mon Feb 16 10:56:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YNJME-0001rq-EU; Mon, 16 Feb 2015 10:56:54 +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 1YNJMC-0001ra-WD
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:53 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AD/AD-02809-4FCC1E45; Mon, 16 Feb 2015 10:56:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1424084210!12138237!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2451 invoked from network); 16 Feb 2015 10:56:51 -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;
	16 Feb 2015 10:56: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 1YNJMA-000851-Cq
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMA-0005VJ-8B
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:56:50 +0000
Date: Mon, 16 Feb 2015 10:56:50 +0000
Message-Id: <E1YNJMA-0005VJ-8B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/nmi: fix shootdown of pcpus
	running in VMX non-root 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 cbeeaa7da01bfa37c1fcdfe79e8f4f1400262ccb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 11 17:18:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:18:27 2015 +0100

    x86/nmi: fix shootdown of pcpus running in VMX non-root mode
    
    c/s 7dd3b06ff "vmx: fix handling of NMI VMEXIT" fixed one issue but
    inadvertently introduced a regression when it came to the NMI shootdown.  The
    shootdown code worked by patching vector 2 in each IDT, but the introduced
    direct call to do_nmi() bypassed this.
    
    Instead of patching each IDT, take a different approach by updating the
    existing dispatch table.  This allows for the removal of the remote IDT
    patching and the removal of the nmi_crash() entry point.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/crash.c            |   59 ++++++++++++++++-----------------------
 xen/arch/x86/x86_64/entry.S     |    9 ------
 xen/include/asm-x86/processor.h |    1 -
 3 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index c0b83df..eb7be9c 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -36,9 +36,11 @@ static unsigned int crashing_cpu;
 static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 
 /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
-void do_nmi_crash(struct cpu_user_regs *regs)
+static void noreturn do_nmi_crash(const struct cpu_user_regs *regs)
 {
-    int cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
+
+    stac();
 
     /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
     ASSERT(cpu != crashing_cpu);
@@ -113,11 +115,10 @@ void do_nmi_crash(struct cpu_user_regs *regs)
         halt();
 }
 
-void nmi_crash(void);
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
-    int i, cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     disable_lapic_nmi_watchdog();
     local_irq_disable();
@@ -127,38 +128,26 @@ static void nmi_shootdown_cpus(void)
 
     cpumask_andnot(&waiting_to_crash, &cpu_online_map, cpumask_of(cpu));
 
-    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
-     * invokes do_nmi_crash (above), which cause them to write state and
-     * fall into a loop.  The crashing pcpu gets the nop handler to
-     * cause it to return to this function ASAP.
+    /*
+     * Disable IST for MCEs to avoid stack corruption race conditions, and
+     * change the NMI handler to a nop to avoid deviation from this codepath.
      */
-    for ( i = 0; i < nr_cpu_ids; i++ )
-    {
-        if ( idt_tables[i] == NULL )
-            continue;
-
-        if ( i == cpu )
-        {
-            /*
-             * Disable the interrupt stack tables for this cpu's MCE and NMI 
-             * handlers, and alter the NMI handler to have no operation.  
-             * Disabling the stack tables prevents stack corruption race 
-             * conditions, while changing the handler helps prevent cascading 
-             * faults; we are certainly going to crash by this point.
-             *
-             * This update is safe from a security point of view, as this pcpu 
-             * is never going to try to sysret back to a PV vcpu.
-             */
-            _set_gate_lower(&idt_tables[i][TRAP_nmi],
-                            SYS_DESC_irq_gate, 0, &trap_nop);
-            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
-        }
-        else
-        {
-            /* Do not update stack table for other pcpus. */
-            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
-        }
-    }
+    _set_gate_lower(&idt_tables[cpu][TRAP_nmi],
+                    SYS_DESC_irq_gate, 0, &trap_nop);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+    /*
+     * Ideally would be:
+     *   exception_table[TRAP_nmi] = &do_nmi_crash;
+     *
+     * but the exception_table is read only.  Borrow an unused fixmap entry
+     * to construct a writable mapping.
+     */
+    set_fixmap(FIX_TBOOT_MAP_ADDRESS, __pa(&exception_table[TRAP_nmi]));
+    write_atomic((unsigned long *)
+                 (fix_to_virt(FIX_TBOOT_MAP_ADDRESS) +
+                  ((unsigned long)&exception_table[TRAP_nmi] & ~PAGE_MASK)),
+                 (unsigned long)&do_nmi_crash);
 
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 062c690..2d25d57 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -669,15 +669,6 @@ handle_ist_exception:
         je    restore_all_guest
         jmp   compat_restore_all_guest
 
-ENTRY(nmi_crash)
-        pushq $0
-        movl $TRAP_nmi,4(%rsp)
-        /* Set AC to reduce chance of further SMAP faults */
-        SAVE_ALL STAC
-        movq %rsp,%rdi
-        callq do_nmi_crash /* Does not return */
-        ud2
-
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index c5c647a..87d80ff 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -530,7 +530,6 @@ DECLARE_TRAP_HANDLER(alignment_check);
 
 void trap_nop(void);
 void enable_nmis(void);
-void noreturn do_nmi_crash(struct cpu_user_regs *regs);
 void do_reserved_trap(struct cpu_user_regs *regs);
 
 void syscall_enter(void);
--
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 Mon Feb 16 10:57:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:57: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 1YNJMV-0001tk-HJ; Mon, 16 Feb 2015 10:57:11 +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 1YNJMT-0001tb-QK
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:09 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	A1/94-29399-50DC1E45; Mon, 16 Feb 2015 10:57:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1424084220!12105236!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23236 invoked from network); 16 Feb 2015 10:57:06 -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;
	16 Feb 2015 10:57: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 1YNJMK-00085A-Hh
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMK-0005Vj-Gj
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:00 +0000
Date: Mon, 16 Feb 2015 10:57:00 +0000
Message-Id: <E1YNJMK-0005Vj-Gj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xentrace: adjust IOPORT & MMIO format
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49b3925ea38196910b1dbf9c434aba35a60d35ce
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Wed Feb 11 17:19:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:19:26 2015 +0100

    xentrace: adjust IOPORT & MMIO format
    
    The 1st item is not data, but the port (address).
    The 2nd item is the data.
    
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/xentrace/formats |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index da658bf..5d7b72a 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -68,10 +68,10 @@
 0x00082014  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  INVLPG      [ is invlpga? = %(1)d, virt = 0x%(2)08x ]
 0x00082114  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  INVLPG      [ is invlpga? = %(1)d, virt = 0x%(3)08x%(2)08x ]
 0x00082015  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MCE
-0x00082016  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_READ [ data = 0x%(1)04x ]
-0x00082216  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_WRITE [ data = 0x%(1)04x ]
-0x00082017  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_READ   [ data = 0x%(1)04x ]
-0x00082217  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_WRITE  [ data = 0x%(1)04x ]
+0x00082016  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_READ [ port = 0x%(1)04x, data = 0x%(2)08x ]
+0x00082216  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_WRITE [ port = 0x%(1)04x, data = 0x%(2)08x ]
+0x00082017  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_READ   [ port = 0x%(1)08x, data = 0x%(2)08x ]
+0x00082217  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_WRITE  [ port = 0x%(1)08x, data = 0x%(2)08x ]
 0x00082018  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  CLTS
 0x00082019  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  LMSW        [ value = 0x%(1)08x ]
 0x00082119  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  LMSW        [ value = 0x%(2)08x%(1)08x ]
--
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 Mon Feb 16 10:57:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:57: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 1YNJMV-0001tk-HJ; Mon, 16 Feb 2015 10:57:11 +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 1YNJMT-0001tb-QK
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:09 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	A1/94-29399-50DC1E45; Mon, 16 Feb 2015 10:57:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1424084220!12105236!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23236 invoked from network); 16 Feb 2015 10:57:06 -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;
	16 Feb 2015 10:57: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 1YNJMK-00085A-Hh
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMK-0005Vj-Gj
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:00 +0000
Date: Mon, 16 Feb 2015 10:57:00 +0000
Message-Id: <E1YNJMK-0005Vj-Gj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xentrace: adjust IOPORT & MMIO format
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49b3925ea38196910b1dbf9c434aba35a60d35ce
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Wed Feb 11 17:19:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:19:26 2015 +0100

    xentrace: adjust IOPORT & MMIO format
    
    The 1st item is not data, but the port (address).
    The 2nd item is the data.
    
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/xentrace/formats |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index da658bf..5d7b72a 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -68,10 +68,10 @@
 0x00082014  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  INVLPG      [ is invlpga? = %(1)d, virt = 0x%(2)08x ]
 0x00082114  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  INVLPG      [ is invlpga? = %(1)d, virt = 0x%(3)08x%(2)08x ]
 0x00082015  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MCE
-0x00082016  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_READ [ data = 0x%(1)04x ]
-0x00082216  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_WRITE [ data = 0x%(1)04x ]
-0x00082017  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_READ   [ data = 0x%(1)04x ]
-0x00082217  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_WRITE  [ data = 0x%(1)04x ]
+0x00082016  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_READ [ port = 0x%(1)04x, data = 0x%(2)08x ]
+0x00082216  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  IOPORT_WRITE [ port = 0x%(1)04x, data = 0x%(2)08x ]
+0x00082017  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_READ   [ port = 0x%(1)08x, data = 0x%(2)08x ]
+0x00082217  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  MMIO_WRITE  [ port = 0x%(1)08x, data = 0x%(2)08x ]
 0x00082018  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  CLTS
 0x00082019  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  LMSW        [ value = 0x%(1)08x ]
 0x00082119  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  LMSW        [ value = 0x%(2)08x%(1)08x ]
--
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 Mon Feb 16 10:57:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:57: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 1YNJMg-0001vD-K8; Mon, 16 Feb 2015 10:57: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 1YNJMf-0001v4-DY
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:21 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	53/E4-29399-01DC1E45; Mon, 16 Feb 2015 10:57:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1424084233!12129780!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4720 invoked from network); 16 Feb 2015 10:57:20 -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;
	16 Feb 2015 10:57: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 1YNJMU-00085g-MR
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMU-0005WG-LV
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:10 +0000
Date: Mon, 16 Feb 2015 10:57:10 +0000
Message-Id: <E1YNJMU-0005WG-LV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: IOREQ_TYPE_PCI_CONFIG
	shouldn't reach hvm_complete_assist_req()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e57ce42b225e0f9b8794ce2ee8ade15baf5992c2
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Wed Feb 11 17:20:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:20:30 2015 +0100

    x86/HVM: IOREQ_TYPE_PCI_CONFIG shouldn't reach hvm_complete_assist_req()
    
    Suggested-by: Paul Durrant <paul.durrant@citrix.com>
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3051e2a..a917fe8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2659,6 +2659,9 @@ static bool_t hvm_complete_assist_req(ioreq_t *p)
 {
     switch ( p->type )
     {
+    case IOREQ_TYPE_PCI_CONFIG:
+        ASSERT_UNREACHABLE();
+        break;
     case IOREQ_TYPE_COPY:
     case IOREQ_TYPE_PIO:
         if ( p->dir == IOREQ_READ )
--
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 Mon Feb 16 10:57:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:57: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 1YNJMg-0001vD-K8; Mon, 16 Feb 2015 10:57: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 1YNJMf-0001v4-DY
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:21 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	53/E4-29399-01DC1E45; Mon, 16 Feb 2015 10:57:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1424084233!12129780!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4720 invoked from network); 16 Feb 2015 10:57:20 -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;
	16 Feb 2015 10:57: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 1YNJMU-00085g-MR
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMU-0005WG-LV
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:10 +0000
Date: Mon, 16 Feb 2015 10:57:10 +0000
Message-Id: <E1YNJMU-0005WG-LV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: IOREQ_TYPE_PCI_CONFIG
	shouldn't reach hvm_complete_assist_req()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e57ce42b225e0f9b8794ce2ee8ade15baf5992c2
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Wed Feb 11 17:20:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:20:30 2015 +0100

    x86/HVM: IOREQ_TYPE_PCI_CONFIG shouldn't reach hvm_complete_assist_req()
    
    Suggested-by: Paul Durrant <paul.durrant@citrix.com>
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3051e2a..a917fe8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2659,6 +2659,9 @@ static bool_t hvm_complete_assist_req(ioreq_t *p)
 {
     switch ( p->type )
     {
+    case IOREQ_TYPE_PCI_CONFIG:
+        ASSERT_UNREACHABLE();
+        break;
     case IOREQ_TYPE_COPY:
     case IOREQ_TYPE_PIO:
         if ( p->dir == IOREQ_READ )
--
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 Mon Feb 16 10:57:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:57: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 1YNJMu-0001we-Mr; Mon, 16 Feb 2015 10:57: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 1YNJMt-0001wW-Bp
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:35 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9E/35-29399-E1DC1E45; Mon, 16 Feb 2015 10:57:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1424084241!11789657!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12395 invoked from network); 16 Feb 2015 10:57:31 -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;
	16 Feb 2015 10:57: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 1YNJMe-00085p-R0
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMe-0005Wc-Q1
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:20 +0000
Date: Mon, 16 Feb 2015 10:57:20 +0000
Message-Id: <E1YNJMe-0005Wc-Q1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: do not retry in
	hvmemul_do_io() if no ioreq server exists for this I/O
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb34a7c8d741aa447d79e1b01d71168a4088a4d7
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Wed Feb 11 17:21:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:21:14 2015 +0100

    x86/HVM: do not retry in hvmemul_do_io() if no ioreq server exists for this I/O
    
    This saves a VMENTRY and a VMEXIT since we no longer retry the
    ioport read on backing DM not handling a given ioreq.
    
    There are 2 case about "no ioreq server exists for this I/O":
    
    1) No ioreq servers (PVH case)
    2) No ioreq servers for this I/O (non PVH case)
    
    The routine hvm_has_dm() used to check for the empty list, the PVH
    case (#1).
    
    By changing from hvm_has_dm() to hvm_select_ioreq_server() both
    cases are considered.  Doing it this way allows
    hvm_send_assist_req() to only have 2 possible return values.
    
    The key part of skipping the retry is to do "rc = X86EMUL_OKAY"
    which is what the error path on the call to hvm_has_dm() does in
    hvmemul_do_io() (the only call on hvm_has_dm()).
    
    Since this case is no longer handled in hvm_send_assist_req(), move
    the call to hvm_complete_assist_req() into hvmemul_do_io().
    
    As part of this change, do the work of hvm_complete_assist_req() in
    the PVH case.  Acting more like real hardware looks to be better.
    
    Adding "rc = X86EMUL_OKAY" in the failing case of
    hvm_send_assist_req() would break what was done in commit
    bac0999325056a3b3a92f7622df7ffbc5388b1c3 and commit
    f20f3c8ece5c10fa7626f253d28f570a43b23208.  We are currently doing
    the succeeding case of hvm_send_assist_req() and retying the I/O.
    
    Since hvm_select_ioreq_server() has already been called, switch to
    using hvm_send_assist_req_to_ioreq_server().
    
    Since there is no longer any calls to hvm_send_assist_req(), drop
    that routine and rename hvm_send_assist_req_to_ioreq_server() to
    hvm_send_assist_req.
    
    Since hvm_send_assist_req() is an extern, add an ASSERT() on s.
    
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c    |   12 +++++++++---
 xen/arch/x86/hvm/hvm.c        |   29 ++++++-----------------------
 xen/include/asm-x86/hvm/hvm.h |    6 ++++--
 3 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 2ed4344..636c909 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -218,21 +218,27 @@ static int hvmemul_do_io(
             vio->io_state = HVMIO_handle_mmio_awaiting_completion;
         break;
     case X86EMUL_UNHANDLEABLE:
-        /* If there is no backing DM, just ignore accesses */
-        if ( !hvm_has_dm(curr->domain) )
+    {
+        struct hvm_ioreq_server *s =
+            hvm_select_ioreq_server(curr->domain, &p);
+
+        /* If there is no suitable backing DM, just ignore accesses */
+        if ( !s )
         {
+            hvm_complete_assist_req(&p);
             rc = X86EMUL_OKAY;
             vio->io_state = HVMIO_none;
         }
         else
         {
             rc = X86EMUL_RETRY;
-            if ( !hvm_send_assist_req(&p) )
+            if ( !hvm_send_assist_req(s, &p) )
                 vio->io_state = HVMIO_none;
             else if ( p_data == NULL )
                 rc = X86EMUL_OKAY;
         }
         break;
+    }
     default:
         BUG();
     }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a917fe8..a52c6e0 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2408,8 +2408,8 @@ void hvm_vcpu_down(struct vcpu *v)
     }
 }
 
-static struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
-                                                        ioreq_t *p)
+struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
+                                                 ioreq_t *p)
 {
 #define CF8_BDF(cf8)     (((cf8) & 0x00ffff00) >> 8)
 #define CF8_ADDR_LO(cf8) ((cf8) & 0x000000fc)
@@ -2591,18 +2591,13 @@ int hvm_buffered_io_send(ioreq_t *p)
     return 1;
 }
 
-bool_t hvm_has_dm(struct domain *d)
-{
-    return !list_empty(&d->arch.hvm_domain.ioreq_server.list);
-}
-
-bool_t hvm_send_assist_req_to_ioreq_server(struct hvm_ioreq_server *s,
-                                           ioreq_t *proto_p)
+bool_t hvm_send_assist_req(struct hvm_ioreq_server *s, ioreq_t *proto_p)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct hvm_ioreq_vcpu *sv;
 
+    ASSERT(s);
     if ( unlikely(!vcpu_start_shutdown_deferral(curr)) )
         return 0; /* implicitly bins the i/o operation */
 
@@ -2655,7 +2650,7 @@ bool_t hvm_send_assist_req_to_ioreq_server(struct hvm_ioreq_server *s,
     return 0;
 }
 
-static bool_t hvm_complete_assist_req(ioreq_t *p)
+void hvm_complete_assist_req(ioreq_t *p)
 {
     switch ( p->type )
     {
@@ -2684,18 +2679,6 @@ static bool_t hvm_complete_assist_req(ioreq_t *p)
         hvm_io_assist(p);
         break;
     }
-
-    return 1;
-}
-
-bool_t hvm_send_assist_req(ioreq_t *p)
-{
-    struct hvm_ioreq_server *s = hvm_select_ioreq_server(current->domain, p);
-
-    if ( !s )
-        return hvm_complete_assist_req(p);
-
-    return hvm_send_assist_req_to_ioreq_server(s, p);
 }
 
 void hvm_broadcast_assist_req(ioreq_t *p)
@@ -2708,7 +2691,7 @@ void hvm_broadcast_assist_req(ioreq_t *p)
     list_for_each_entry ( s,
                           &d->arch.hvm_domain.ioreq_server.list,
                           list_entry )
-        (void) hvm_send_assist_req_to_ioreq_server(s, p);
+        (void) hvm_send_assist_req(s, p);
 }
 
 void hvm_hlt(unsigned long rflags)
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index e3d2d9a..0dc909b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -228,8 +228,11 @@ int hvm_vcpu_cacheattr_init(struct vcpu *v);
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
-bool_t hvm_send_assist_req(ioreq_t *p);
+struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
+                                                 ioreq_t *p);
+bool_t hvm_send_assist_req(struct hvm_ioreq_server *s, ioreq_t *p);
 void hvm_broadcast_assist_req(ioreq_t *p);
+void hvm_complete_assist_req(ioreq_t *p);
 
 void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
 int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
@@ -359,7 +362,6 @@ void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
 void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
                                    unsigned int *ecx, unsigned int *edx);
 void hvm_migrate_timers(struct vcpu *v);
-bool_t hvm_has_dm(struct domain *d);
 bool_t hvm_io_pending(struct vcpu *v);
 void hvm_do_resume(struct vcpu *v);
 void hvm_migrate_pirqs(struct vcpu *v);
--
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 Mon Feb 16 10:57:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 10:57: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 1YNJMu-0001we-Mr; Mon, 16 Feb 2015 10:57: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 1YNJMt-0001wW-Bp
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:35 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9E/35-29399-E1DC1E45; Mon, 16 Feb 2015 10:57:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1424084241!11789657!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12395 invoked from network); 16 Feb 2015 10:57:31 -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;
	16 Feb 2015 10:57: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 1YNJMe-00085p-R0
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNJMe-0005Wc-Q1
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 10:57:20 +0000
Date: Mon, 16 Feb 2015 10:57:20 +0000
Message-Id: <E1YNJMe-0005Wc-Q1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: do not retry in
	hvmemul_do_io() if no ioreq server exists for this I/O
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb34a7c8d741aa447d79e1b01d71168a4088a4d7
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Wed Feb 11 17:21:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 17:21:14 2015 +0100

    x86/HVM: do not retry in hvmemul_do_io() if no ioreq server exists for this I/O
    
    This saves a VMENTRY and a VMEXIT since we no longer retry the
    ioport read on backing DM not handling a given ioreq.
    
    There are 2 case about "no ioreq server exists for this I/O":
    
    1) No ioreq servers (PVH case)
    2) No ioreq servers for this I/O (non PVH case)
    
    The routine hvm_has_dm() used to check for the empty list, the PVH
    case (#1).
    
    By changing from hvm_has_dm() to hvm_select_ioreq_server() both
    cases are considered.  Doing it this way allows
    hvm_send_assist_req() to only have 2 possible return values.
    
    The key part of skipping the retry is to do "rc = X86EMUL_OKAY"
    which is what the error path on the call to hvm_has_dm() does in
    hvmemul_do_io() (the only call on hvm_has_dm()).
    
    Since this case is no longer handled in hvm_send_assist_req(), move
    the call to hvm_complete_assist_req() into hvmemul_do_io().
    
    As part of this change, do the work of hvm_complete_assist_req() in
    the PVH case.  Acting more like real hardware looks to be better.
    
    Adding "rc = X86EMUL_OKAY" in the failing case of
    hvm_send_assist_req() would break what was done in commit
    bac0999325056a3b3a92f7622df7ffbc5388b1c3 and commit
    f20f3c8ece5c10fa7626f253d28f570a43b23208.  We are currently doing
    the succeeding case of hvm_send_assist_req() and retying the I/O.
    
    Since hvm_select_ioreq_server() has already been called, switch to
    using hvm_send_assist_req_to_ioreq_server().
    
    Since there is no longer any calls to hvm_send_assist_req(), drop
    that routine and rename hvm_send_assist_req_to_ioreq_server() to
    hvm_send_assist_req.
    
    Since hvm_send_assist_req() is an extern, add an ASSERT() on s.
    
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c    |   12 +++++++++---
 xen/arch/x86/hvm/hvm.c        |   29 ++++++-----------------------
 xen/include/asm-x86/hvm/hvm.h |    6 ++++--
 3 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 2ed4344..636c909 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -218,21 +218,27 @@ static int hvmemul_do_io(
             vio->io_state = HVMIO_handle_mmio_awaiting_completion;
         break;
     case X86EMUL_UNHANDLEABLE:
-        /* If there is no backing DM, just ignore accesses */
-        if ( !hvm_has_dm(curr->domain) )
+    {
+        struct hvm_ioreq_server *s =
+            hvm_select_ioreq_server(curr->domain, &p);
+
+        /* If there is no suitable backing DM, just ignore accesses */
+        if ( !s )
         {
+            hvm_complete_assist_req(&p);
             rc = X86EMUL_OKAY;
             vio->io_state = HVMIO_none;
         }
         else
         {
             rc = X86EMUL_RETRY;
-            if ( !hvm_send_assist_req(&p) )
+            if ( !hvm_send_assist_req(s, &p) )
                 vio->io_state = HVMIO_none;
             else if ( p_data == NULL )
                 rc = X86EMUL_OKAY;
         }
         break;
+    }
     default:
         BUG();
     }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a917fe8..a52c6e0 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2408,8 +2408,8 @@ void hvm_vcpu_down(struct vcpu *v)
     }
 }
 
-static struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
-                                                        ioreq_t *p)
+struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
+                                                 ioreq_t *p)
 {
 #define CF8_BDF(cf8)     (((cf8) & 0x00ffff00) >> 8)
 #define CF8_ADDR_LO(cf8) ((cf8) & 0x000000fc)
@@ -2591,18 +2591,13 @@ int hvm_buffered_io_send(ioreq_t *p)
     return 1;
 }
 
-bool_t hvm_has_dm(struct domain *d)
-{
-    return !list_empty(&d->arch.hvm_domain.ioreq_server.list);
-}
-
-bool_t hvm_send_assist_req_to_ioreq_server(struct hvm_ioreq_server *s,
-                                           ioreq_t *proto_p)
+bool_t hvm_send_assist_req(struct hvm_ioreq_server *s, ioreq_t *proto_p)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct hvm_ioreq_vcpu *sv;
 
+    ASSERT(s);
     if ( unlikely(!vcpu_start_shutdown_deferral(curr)) )
         return 0; /* implicitly bins the i/o operation */
 
@@ -2655,7 +2650,7 @@ bool_t hvm_send_assist_req_to_ioreq_server(struct hvm_ioreq_server *s,
     return 0;
 }
 
-static bool_t hvm_complete_assist_req(ioreq_t *p)
+void hvm_complete_assist_req(ioreq_t *p)
 {
     switch ( p->type )
     {
@@ -2684,18 +2679,6 @@ static bool_t hvm_complete_assist_req(ioreq_t *p)
         hvm_io_assist(p);
         break;
     }
-
-    return 1;
-}
-
-bool_t hvm_send_assist_req(ioreq_t *p)
-{
-    struct hvm_ioreq_server *s = hvm_select_ioreq_server(current->domain, p);
-
-    if ( !s )
-        return hvm_complete_assist_req(p);
-
-    return hvm_send_assist_req_to_ioreq_server(s, p);
 }
 
 void hvm_broadcast_assist_req(ioreq_t *p)
@@ -2708,7 +2691,7 @@ void hvm_broadcast_assist_req(ioreq_t *p)
     list_for_each_entry ( s,
                           &d->arch.hvm_domain.ioreq_server.list,
                           list_entry )
-        (void) hvm_send_assist_req_to_ioreq_server(s, p);
+        (void) hvm_send_assist_req(s, p);
 }
 
 void hvm_hlt(unsigned long rflags)
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index e3d2d9a..0dc909b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -228,8 +228,11 @@ int hvm_vcpu_cacheattr_init(struct vcpu *v);
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
-bool_t hvm_send_assist_req(ioreq_t *p);
+struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
+                                                 ioreq_t *p);
+bool_t hvm_send_assist_req(struct hvm_ioreq_server *s, ioreq_t *p);
 void hvm_broadcast_assist_req(ioreq_t *p);
+void hvm_complete_assist_req(ioreq_t *p);
 
 void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
 int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
@@ -359,7 +362,6 @@ void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
 void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
                                    unsigned int *ecx, unsigned int *edx);
 void hvm_migrate_timers(struct vcpu *v);
-bool_t hvm_has_dm(struct domain *d);
 bool_t hvm_io_pending(struct vcpu *v);
 void hvm_do_resume(struct vcpu *v);
 void hvm_migrate_pirqs(struct vcpu *v);
--
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 Mon Feb 16 15:00:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 15:00: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 1YNN9d-0004Fg-44; Mon, 16 Feb 2015 15:00: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 1YNN9b-0004FX-Ve
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 15:00:08 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	C1/F2-02810-7F502E45; Mon, 16 Feb 2015 15:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1424098805!8075616!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6845 invoked from network); 16 Feb 2015 15:00:06 -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;
	16 Feb 2015 15:00: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 1YNN9W-0002JH-RY
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 15:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNN9W-0005bk-Lx
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 15:00:02 +0000
Date: Mon, 16 Feb 2015 15:00:02 +0000
Message-Id: <E1YNN9W-0005bk-Lx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.5-testing] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3499745d3a8561cce67f3d4fbc2da60401253ad4
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:51:08 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a4b276b4ce49c8d70dd841ff885b900ec652b994)
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.5-testing.git

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

From xen-changelog-bounces@lists.xen.org Mon Feb 16 15:00:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2015 15:00: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 1YNN9d-0004Fg-44; Mon, 16 Feb 2015 15:00: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 1YNN9b-0004FX-Ve
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 15:00:08 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	C1/F2-02810-7F502E45; Mon, 16 Feb 2015 15:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1424098805!8075616!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6845 invoked from network); 16 Feb 2015 15:00:06 -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;
	16 Feb 2015 15:00: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 1YNN9W-0002JH-RY
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 15:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YNN9W-0005bk-Lx
	for xen-changelog@lists.xensource.com; Mon, 16 Feb 2015 15:00:02 +0000
Date: Mon, 16 Feb 2015 15:00:02 +0000
Message-Id: <E1YNN9W-0005bk-Lx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.5-testing] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3499745d3a8561cce67f3d4fbc2da60401253ad4
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:51:08 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a4b276b4ce49c8d70dd841ff885b900ec652b994)
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.5-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Feb 19 11:33:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Feb 2015 11:33: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 1YOPLy-0001Vn-UD; Thu, 19 Feb 2015 11:33:10 +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 1YOPLx-0001Vd-Nd
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:09 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	DA/99-02750-5F9C5E45; Thu, 19 Feb 2015 11:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1424345585!14317142!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6668 invoked from network); 19 Feb 2015 11:33:06 -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;
	19 Feb 2015 11: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 1YOPLq-0005Qo-Nn
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOPLq-0000V2-I1
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:02 +0000
Date: Thu, 19 Feb 2015 11:33:02 +0000
Message-Id: <E1YOPLq-0000V2-I1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9550be0726b577cf038691c77d8c924c43e7cebd
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:51:25 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a4b276b4ce49c8d70dd841ff885b900ec652b994)
    (cherry picked from commit 3499745d3a8561cce67f3d4fbc2da60401253ad4)
    (cherry picked from commit e052bfcd0f2b0776f1f39f8282446ba8601bde82)
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Feb 19 11:33:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Feb 2015 11:33: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 1YOPLy-0001Vn-UD; Thu, 19 Feb 2015 11:33:10 +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 1YOPLx-0001Vd-Nd
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:09 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	DA/99-02750-5F9C5E45; Thu, 19 Feb 2015 11:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1424345585!14317142!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6668 invoked from network); 19 Feb 2015 11:33:06 -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;
	19 Feb 2015 11: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 1YOPLq-0005Qo-Nn
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOPLq-0000V2-I1
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:02 +0000
Date: Thu, 19 Feb 2015 11:33:02 +0000
Message-Id: <E1YOPLq-0000V2-I1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9550be0726b577cf038691c77d8c924c43e7cebd
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:51:25 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a4b276b4ce49c8d70dd841ff885b900ec652b994)
    (cherry picked from commit 3499745d3a8561cce67f3d4fbc2da60401253ad4)
    (cherry picked from commit e052bfcd0f2b0776f1f39f8282446ba8601bde82)
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Feb 19 11:33:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Feb 2015 11:33: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 1YOPM8-0001X4-0S; Thu, 19 Feb 2015 11:33: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 1YOPM6-0001Wd-0D
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:18 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	A3/97-03164-DF9C5E45; Thu, 19 Feb 2015 11:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1424345595!10777842!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8374 invoked from network); 19 Feb 2015 11:33:16 -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;
	19 Feb 2015 11: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 1YOPM3-0005Qr-GH
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOPM3-0000Vl-Es
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:15 +0000
Date: Thu, 19 Feb 2015 11:33:15 +0000
Message-Id: <E1YOPM3-0000Vl-Es@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.4-testing] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e052bfcd0f2b0776f1f39f8282446ba8601bde82
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:51:17 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a4b276b4ce49c8d70dd841ff885b900ec652b994)
    (cherry picked from commit 3499745d3a8561cce67f3d4fbc2da60401253ad4)
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.4-testing.git

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

From xen-changelog-bounces@lists.xen.org Thu Feb 19 11:33:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Feb 2015 11:33: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 1YOPM8-0001X4-0S; Thu, 19 Feb 2015 11:33: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 1YOPM6-0001Wd-0D
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:18 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	A3/97-03164-DF9C5E45; Thu, 19 Feb 2015 11:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1424345595!10777842!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8374 invoked from network); 19 Feb 2015 11:33:16 -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;
	19 Feb 2015 11: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 1YOPM3-0005Qr-GH
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOPM3-0000Vl-Es
	for xen-changelog@lists.xensource.com; Thu, 19 Feb 2015 11:33:15 +0000
Date: Thu, 19 Feb 2015 11:33:15 +0000
Message-Id: <E1YOPM3-0000Vl-Es@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.4-testing] cirrus: fix an uninitialized
	variable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e052bfcd0f2b0776f1f39f8282446ba8601bde82
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Mon Feb 2 16:49:59 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:51:17 2015 +0000

    cirrus: fix an uninitialized variable
    
    Noticed by paying attention to a compiler warning (reported for the
    only caller of the function modified, vga_ioport_read()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a4b276b4ce49c8d70dd841ff885b900ec652b994)
    (cherry picked from commit 3499745d3a8561cce67f3d4fbc2da60401253ad4)
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 38c829a..a26b051 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1658,8 +1658,8 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
     default:
 #ifdef DEBUG_CIRRUS
 	printf("cirrus: inport cr_index %02x\n", reg_index);
-	*reg_value = 0xff;
 #endif
+	*reg_value = 0xff;
 	break;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.4-testing.git

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjmh-00025G-VT; Fri, 20 Feb 2015 09:22:07 +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 1YOjmg-00025B-Vm
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:07 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	38/82-03219-EBCF6E45; Fri, 20 Feb 2015 09:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1424424124!7256921!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21734 invoked from network); 20 Feb 2015 09:22:05 -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;
	20 Feb 2015 09:22: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 1YOjme-0002Qv-EC
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjme-0003qB-Aa
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:04 +0000
Date: Fri, 20 Feb 2015 09:22:04 +0000
Message-Id: <E1YOjme-0003qB-Aa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Install libxlutil.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 6302c61f4f295b0ef70290ac16cf8d8e89014ad2
Author:     Jim Fehlig <jfehlig@suse.com>
AuthorDate: Thu Jan 8 14:43:28 2015 -0700
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:44:36 2015 +0000

    Install libxlutil.h
    
    libxlutil.{a,so} are installed, but not the corresponding header
    file.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    (cherry picked from commit 8ff079803677b82195addebc0e88f1630cb7354b)
---
 tools/libxl/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index b417372..6a8575b 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -266,7 +266,7 @@ install: all
 	$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)/libxlutil.so.$(XLUMAJOR)
 	$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(LIBDIR)/libxlutil.so
 	$(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
 
 .PHONY: clean
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjmh-00025G-VT; Fri, 20 Feb 2015 09:22:07 +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 1YOjmg-00025B-Vm
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:07 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	38/82-03219-EBCF6E45; Fri, 20 Feb 2015 09:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1424424124!7256921!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21734 invoked from network); 20 Feb 2015 09:22:05 -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;
	20 Feb 2015 09:22: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 1YOjme-0002Qv-EC
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjme-0003qB-Aa
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:04 +0000
Date: Fri, 20 Feb 2015 09:22:04 +0000
Message-Id: <E1YOjme-0003qB-Aa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Install libxlutil.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 6302c61f4f295b0ef70290ac16cf8d8e89014ad2
Author:     Jim Fehlig <jfehlig@suse.com>
AuthorDate: Thu Jan 8 14:43:28 2015 -0700
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:44:36 2015 +0000

    Install libxlutil.h
    
    libxlutil.{a,so} are installed, but not the corresponding header
    file.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    (cherry picked from commit 8ff079803677b82195addebc0e88f1630cb7354b)
---
 tools/libxl/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index b417372..6a8575b 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -266,7 +266,7 @@ install: all
 	$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)/libxlutil.so.$(XLUMAJOR)
 	$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(LIBDIR)/libxlutil.so
 	$(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
 
 .PHONY: clean
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjmt-00026A-2f; Fri, 20 Feb 2015 09:22: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 1YOjmr-000260-R1
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:18 +0000
Content-Length: 6720
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	43/F5-02991-9CCF6E45; Fri, 20 Feb 2015 09:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1424424134!6541892!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11030 invoked from network); 20 Feb 2015 09:22:16 -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;
	20 Feb 2015 09:22: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 1YOjmo-0002Qz-ON
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjmo-0003qa-L6
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:14 +0000
Date: Fri, 20 Feb 2015 09:22:14 +0000
Message-Id: <E1YOjmo-0003qa-L6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxc: introduce a per
	architecture scratch pfn for temporary grant mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2600143458208469748=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2600143458208469748==
Content-Length: 6444
Content-Transfer-Encoding: quoted-printable

commit 84f2484db41edebc0b7622a3585b2384813d75fe
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Jan 21 13:25:44 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:45:56 2015 +0000

    libxc: introduce a per architecture scratch pfn for temporary grant mapping
    
    The code to initialize the grant table in libxc uses
    xc_domain_maximum_gpfn() + 1 to get a guest pfn for mapping the grant
    frame and to initialize it.
    
    This solution has two major issues:
        - The check of the return of xc_domain_maximum_gpfn is buggy because
        xen_pfn_t is unsigned and in case of an error -ERRNO is returned.
        Which is never catch with ( pfn <=3D 0 ).
        - The guest memory layout maybe filled up to the end, i.e
        xc_domain_maximum_gpfn() + 1 gives either 0 or an invalid PFN due to
        hardware limitation.
    
    Futhermore, on ARM, xc_domain_maximum_gpfn() is not implemented and
    return -ENOSYS. This will make libxc to use always the same PFN which
    may colapse with an already mapped region (see xen/include/public/arch-arm.h
    for the layout).
    
    This patch only address the problem for ARM, the x86 version use the same
    behavior (ie xc_domain_maximum_gpfn() + 1), as I'm not familiar with Xen x86.
    
    A new function xc_core_arch_get_scratch_gpfn is introduced to be able to
    choose the gpfn per architecture.
    
    For the ARM version, we use the GUEST_GNTTAB_GUEST which is the base of
    the region by the guest to map the grant table. At the build time,
    nothing is mapped there.
    
    At the same time correctly check the return of xc_domain_maximum_gpfn
    for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Cc: Roger Pau Monn=C3=A9 <roger.pau@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>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 5b5c40c0d10f5ffbd35b7eef6df34a086000442f)
---
 tools/libxc/xc_core.h     |    3 +++
 tools/libxc/xc_core_arm.c |   17 +++++++++++++++++
 tools/libxc/xc_core_x86.c |   17 +++++++++++++++++
 tools/libxc/xc_dom_boot.c |   18 ++++++++++++------
 4 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 10cbfca..5867030 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -148,6 +148,9 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
                                   shared_info_any_t *live_shinfo,
                                   xen_pfn_t **live_p2m, unsigned long *pfnp);
 
+int xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                                  xen_pfn_t *gpfn);
+
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
index 2fbcf3f..16508e7 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -96,6 +96,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    /*
+     * The Grant Table region space is not used until the guest is
+     * booting. Use the first page for the scratch pfn.
+     */
+    XC_BUILD_BUG_ON(GUEST_GNTTAB_SIZE < XC_PAGE_SIZE);
+
+    *gpfn =3D GUEST_GNTTAB_BASE >> XC_PAGE_SHIFT;
+
+    return 0;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index f05060a..fac99ec 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -205,6 +205,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    int rc;
+
+    rc =3D xc_domain_maximum_gpfn(xch, domid);
+
+    if ( rc <=3D 0 )
+        return rc;
+
+    *gpfn =3D rc + 1;
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f0a1c64..a141eb5 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -33,6 +33,7 @@
 
 #include "xg_private.h"
 #include "xc_dom.h"
+#include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
 
@@ -365,7 +366,7 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
                            domid_t xenstore_domid)
 {
     int rc;
-    xen_pfn_t max_gfn;
+    xen_pfn_t scratch_gpfn;
     struct xen_add_to_physmap xatp =3D {
         .domid =3D domid,
         .space =3D XENMAPSPACE_grant_table,
@@ -375,16 +376,21 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
         .domid =3D domid,
     };
 
-    max_gfn =3D xc_domain_maximum_gpfn(xch, domid);
-    if ( max_gfn <=3D 0 ) {
+    rc =3D xc_core_arch_get_scratch_gpfn(xch, domid, &scratch_gpfn);
+    if ( rc < 0 )
+    {
         xc_dom_panic(xch, XC_INTERNAL_ERROR,
-                     "%s: failed to get max gfn "
+                     "%s: failed to get a scratch gfn "
                      "[errno=3D%d]\n",
                      __FUNCTION__, errno);
         return -1;
     }
-    xatp.gpfn =3D max_gfn + 1;
-    xrfp.gpfn =3D max_gfn + 1;
+    xatp.gpfn =3D scratch_gpfn;
+    xrfp.gpfn =3D scratch_gpfn;
+
+    xc_dom_printf(xch, "%s: called, pfn=3D0x%"PRI_xen_pfn, __FUNCTION__,
+                  scratch_gpfn);
+
 
     rc =3D do_memory_op(xch, XENMEM_add_to_physmap, &xatp, sizeof(xatp));
     if ( rc !=3D 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5


--===============2600143458208469748==
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
--===============2600143458208469748==--

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjmt-00026A-2f; Fri, 20 Feb 2015 09:22: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 1YOjmr-000260-R1
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:18 +0000
Content-Length: 6720
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	43/F5-02991-9CCF6E45; Fri, 20 Feb 2015 09:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1424424134!6541892!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11030 invoked from network); 20 Feb 2015 09:22:16 -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;
	20 Feb 2015 09:22: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 1YOjmo-0002Qz-ON
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjmo-0003qa-L6
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:14 +0000
Date: Fri, 20 Feb 2015 09:22:14 +0000
Message-Id: <E1YOjmo-0003qa-L6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxc: introduce a per
	architecture scratch pfn for temporary grant mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2600143458208469748=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2600143458208469748==
Content-Length: 6444
Content-Transfer-Encoding: quoted-printable

commit 84f2484db41edebc0b7622a3585b2384813d75fe
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Jan 21 13:25:44 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:45:56 2015 +0000

    libxc: introduce a per architecture scratch pfn for temporary grant mapping
    
    The code to initialize the grant table in libxc uses
    xc_domain_maximum_gpfn() + 1 to get a guest pfn for mapping the grant
    frame and to initialize it.
    
    This solution has two major issues:
        - The check of the return of xc_domain_maximum_gpfn is buggy because
        xen_pfn_t is unsigned and in case of an error -ERRNO is returned.
        Which is never catch with ( pfn <=3D 0 ).
        - The guest memory layout maybe filled up to the end, i.e
        xc_domain_maximum_gpfn() + 1 gives either 0 or an invalid PFN due to
        hardware limitation.
    
    Futhermore, on ARM, xc_domain_maximum_gpfn() is not implemented and
    return -ENOSYS. This will make libxc to use always the same PFN which
    may colapse with an already mapped region (see xen/include/public/arch-arm.h
    for the layout).
    
    This patch only address the problem for ARM, the x86 version use the same
    behavior (ie xc_domain_maximum_gpfn() + 1), as I'm not familiar with Xen x86.
    
    A new function xc_core_arch_get_scratch_gpfn is introduced to be able to
    choose the gpfn per architecture.
    
    For the ARM version, we use the GUEST_GNTTAB_GUEST which is the base of
    the region by the guest to map the grant table. At the build time,
    nothing is mapped there.
    
    At the same time correctly check the return of xc_domain_maximum_gpfn
    for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Cc: Roger Pau Monn=C3=A9 <roger.pau@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>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 5b5c40c0d10f5ffbd35b7eef6df34a086000442f)
---
 tools/libxc/xc_core.h     |    3 +++
 tools/libxc/xc_core_arm.c |   17 +++++++++++++++++
 tools/libxc/xc_core_x86.c |   17 +++++++++++++++++
 tools/libxc/xc_dom_boot.c |   18 ++++++++++++------
 4 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 10cbfca..5867030 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -148,6 +148,9 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
                                   shared_info_any_t *live_shinfo,
                                   xen_pfn_t **live_p2m, unsigned long *pfnp);
 
+int xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                                  xen_pfn_t *gpfn);
+
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
index 2fbcf3f..16508e7 100644
--- a/tools/libxc/xc_core_arm.c
+++ b/tools/libxc/xc_core_arm.c
@@ -96,6 +96,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    /*
+     * The Grant Table region space is not used until the guest is
+     * booting. Use the first page for the scratch pfn.
+     */
+    XC_BUILD_BUG_ON(GUEST_GNTTAB_SIZE < XC_PAGE_SIZE);
+
+    *gpfn =3D GUEST_GNTTAB_BASE >> XC_PAGE_SHIFT;
+
+    return 0;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
index f05060a..fac99ec 100644
--- a/tools/libxc/xc_core_x86.c
+++ b/tools/libxc/xc_core_x86.c
@@ -205,6 +205,23 @@ xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_do
     return xc_core_arch_map_p2m_rw(xch, dinfo, info,
                                    live_shinfo, live_p2m, pfnp, 1);
 }
+
+int
+xc_core_arch_get_scratch_gpfn(xc_interface *xch, domid_t domid,
+                              xen_pfn_t *gpfn)
+{
+    int rc;
+
+    rc =3D xc_domain_maximum_gpfn(xch, domid);
+
+    if ( rc <=3D 0 )
+        return rc;
+
+    *gpfn =3D rc + 1;
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f0a1c64..a141eb5 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -33,6 +33,7 @@
 
 #include "xg_private.h"
 #include "xc_dom.h"
+#include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
 
@@ -365,7 +366,7 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
                            domid_t xenstore_domid)
 {
     int rc;
-    xen_pfn_t max_gfn;
+    xen_pfn_t scratch_gpfn;
     struct xen_add_to_physmap xatp =3D {
         .domid =3D domid,
         .space =3D XENMAPSPACE_grant_table,
@@ -375,16 +376,21 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
         .domid =3D domid,
     };
 
-    max_gfn =3D xc_domain_maximum_gpfn(xch, domid);
-    if ( max_gfn <=3D 0 ) {
+    rc =3D xc_core_arch_get_scratch_gpfn(xch, domid, &scratch_gpfn);
+    if ( rc < 0 )
+    {
         xc_dom_panic(xch, XC_INTERNAL_ERROR,
-                     "%s: failed to get max gfn "
+                     "%s: failed to get a scratch gfn "
                      "[errno=3D%d]\n",
                      __FUNCTION__, errno);
         return -1;
     }
-    xatp.gpfn =3D max_gfn + 1;
-    xrfp.gpfn =3D max_gfn + 1;
+    xatp.gpfn =3D scratch_gpfn;
+    xrfp.gpfn =3D scratch_gpfn;
+
+    xc_dom_printf(xch, "%s: called, pfn=3D0x%"PRI_xen_pfn, __FUNCTION__,
+                  scratch_gpfn);
+
 
     rc =3D do_memory_op(xch, XENMEM_add_to_physmap, &xatp, sizeof(xatp));
     if ( rc !=3D 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5


--===============2600143458208469748==
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
--===============2600143458208469748==--

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjn3-00027Z-5V; Fri, 20 Feb 2015 09:22: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 1YOjn1-00027H-JZ
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:27 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	28/E5-02758-2DCF6E45; Fri, 20 Feb 2015 09:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1424424145!10931996!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27389 invoked from network); 20 Feb 2015 09:22:26 -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;
	20 Feb 2015 09:22: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 1YOjmy-0002R7-VW
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjmy-0003rf-Tx
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:24 +0000
Date: Fri, 20 Feb 2015 09:22:24 +0000
Message-Id: <E1YOjmy-0003rf-Tx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] rump kernels: use new platform
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fd6292ca3310bb712a82850d47d7e9a1f168e9f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Feb 3 13:47:08 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:47:14 2015 +0000

    rump kernels: use new platform macro
    
    Starting from rump kernel changeset 91d5623 ("Renaming platform macros,
    app-tools and autoconf target string"), __RUMPUSER_XEN__ and __RUMPAPP__
    are deleted. We are supposed to use __RUMPRUN__ instead.
    
    We still keep __RUMPUSER_XEN__ for now in order to make xen-unstable
    pass osstest push gate. I will remove __RUMPUSER_XEN__ later.
    
    Related discussion:
    http://thread.gmane.org/gmane.comp.rumpkernel.user/739
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 441256a532dd737905ce335506d2ffcf0ff0db7c)
---
 tools/libxc/xc_private.c |    2 +-
 tools/xenstore/xs_lib.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index e2441ad..df6cd9b 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -33,7 +33,7 @@
 
 #define XENCTRL_OSDEP "XENCTRL_OSDEP"
 
-#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) && !defined(__RUMPRUN__)
 #define DO_DYNAMIC_OSDEP
 #endif
 
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index d166497..4795162 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -79,7 +79,7 @@ const char *xs_domain_dev(void)
 	char *s = getenv("XENSTORED_PATH");
 	if (s)
 		return s;
-#if defined(__RUMPUSER_XEN__)
+#if defined(__RUMPUSER_XEN__) || defined(__RUMPRUN__)
 	return "/dev/xen/xenbus";
 #elif defined(__linux__)
 	return "/proc/xen/xenbus";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjn3-00027Z-5V; Fri, 20 Feb 2015 09:22: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 1YOjn1-00027H-JZ
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:27 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	28/E5-02758-2DCF6E45; Fri, 20 Feb 2015 09:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1424424145!10931996!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27389 invoked from network); 20 Feb 2015 09:22:26 -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;
	20 Feb 2015 09:22: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 1YOjmy-0002R7-VW
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjmy-0003rf-Tx
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:24 +0000
Date: Fri, 20 Feb 2015 09:22:24 +0000
Message-Id: <E1YOjmy-0003rf-Tx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] rump kernels: use new platform
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fd6292ca3310bb712a82850d47d7e9a1f168e9f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Feb 3 13:47:08 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:47:14 2015 +0000

    rump kernels: use new platform macro
    
    Starting from rump kernel changeset 91d5623 ("Renaming platform macros,
    app-tools and autoconf target string"), __RUMPUSER_XEN__ and __RUMPAPP__
    are deleted. We are supposed to use __RUMPRUN__ instead.
    
    We still keep __RUMPUSER_XEN__ for now in order to make xen-unstable
    pass osstest push gate. I will remove __RUMPUSER_XEN__ later.
    
    Related discussion:
    http://thread.gmane.org/gmane.comp.rumpkernel.user/739
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 441256a532dd737905ce335506d2ffcf0ff0db7c)
---
 tools/libxc/xc_private.c |    2 +-
 tools/xenstore/xs_lib.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index e2441ad..df6cd9b 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -33,7 +33,7 @@
 
 #define XENCTRL_OSDEP "XENCTRL_OSDEP"
 
-#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) && !defined(__RUMPRUN__)
 #define DO_DYNAMIC_OSDEP
 #endif
 
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index d166497..4795162 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -79,7 +79,7 @@ const char *xs_domain_dev(void)
 	char *s = getenv("XENSTORED_PATH");
 	if (s)
 		return s;
-#if defined(__RUMPUSER_XEN__)
+#if defined(__RUMPUSER_XEN__) || defined(__RUMPRUN__)
 	return "/dev/xen/xenbus";
 #elif defined(__linux__)
 	return "/proc/xen/xenbus";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjnD-00029I-89; Fri, 20 Feb 2015 09:22: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 1YOjnB-000290-Nh
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:38 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	5F/30-03172-DDCF6E45; Fri, 20 Feb 2015 09:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1424424155!11719519!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28595 invoked from network); 20 Feb 2015 09:22:36 -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;
	20 Feb 2015 09:22: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 1YOjn9-0002RF-8I
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjn9-0003s5-6s
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:35 +0000
Date: Fri, 20 Feb 2015 09:22:35 +0000
Message-Id: <E1YOjn9-0003s5-6s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools/configure: detect
	$host_vendor of rumprun, not just rumpxen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2035943cc54934ec262c657ea46a32ea880a8175
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Feb 13 16:04:34 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:47:22 2015 +0000

    tools/configure: detect $host_vendor of rumprun, not just rumpxen
    
    This has been renamed by the rumpkernels upstream.
    
    (This patch needs to be backported.)
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Antti Kantee <pooka@iki.fi>
    CC: Martin Lucina <martin@lucina.net>
    CC: Ian Campbell <Ian.Campbell@eu.citrix.com>
    (cherry picked from commit f4e99a4f5098f6fa3c856f79b8365bb29a3d3a15)
---
 tools/configure    |    4 ++--
 tools/configure.ac |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/configure b/tools/configure
index b0aea0a..2fa7426 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2396,8 +2396,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 case $host_vendor in
-rumpxen) CONFIG_RUMP=y; rump=true ;;
-*)       CONFIG_RUMP=n; rump=false ;;
+rumpxen|rumprun) CONFIG_RUMP=y; rump=true ;;
+*)               CONFIG_RUMP=n; rump=false ;;
 esac
 
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 1ac63a3..b7f1513 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -43,8 +43,8 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 AC_CANONICAL_HOST
 
 case $host_vendor in
-rumpxen) CONFIG_RUMP=y; rump=true ;;
-*)       CONFIG_RUMP=n; rump=false ;;
+rumpxen|rumprun) CONFIG_RUMP=y; rump=true ;;
+*)               CONFIG_RUMP=n; rump=false ;;
 esac
 AC_SUBST(CONFIG_RUMP)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:22: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 1YOjnD-00029I-89; Fri, 20 Feb 2015 09:22: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 1YOjnB-000290-Nh
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:38 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	5F/30-03172-DDCF6E45; Fri, 20 Feb 2015 09:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1424424155!11719519!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28595 invoked from network); 20 Feb 2015 09:22:36 -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;
	20 Feb 2015 09:22: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 1YOjn9-0002RF-8I
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjn9-0003s5-6s
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:35 +0000
Date: Fri, 20 Feb 2015 09:22:35 +0000
Message-Id: <E1YOjn9-0003s5-6s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools/configure: detect
	$host_vendor of rumprun, not just rumpxen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2035943cc54934ec262c657ea46a32ea880a8175
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Feb 13 16:04:34 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:47:22 2015 +0000

    tools/configure: detect $host_vendor of rumprun, not just rumpxen
    
    This has been renamed by the rumpkernels upstream.
    
    (This patch needs to be backported.)
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Antti Kantee <pooka@iki.fi>
    CC: Martin Lucina <martin@lucina.net>
    CC: Ian Campbell <Ian.Campbell@eu.citrix.com>
    (cherry picked from commit f4e99a4f5098f6fa3c856f79b8365bb29a3d3a15)
---
 tools/configure    |    4 ++--
 tools/configure.ac |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/configure b/tools/configure
index b0aea0a..2fa7426 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2396,8 +2396,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 case $host_vendor in
-rumpxen) CONFIG_RUMP=y; rump=true ;;
-*)       CONFIG_RUMP=n; rump=false ;;
+rumpxen|rumprun) CONFIG_RUMP=y; rump=true ;;
+*)               CONFIG_RUMP=n; rump=false ;;
 esac
 
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 1ac63a3..b7f1513 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -43,8 +43,8 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 AC_CANONICAL_HOST
 
 case $host_vendor in
-rumpxen) CONFIG_RUMP=y; rump=true ;;
-*)       CONFIG_RUMP=n; rump=false ;;
+rumpxen|rumprun) CONFIG_RUMP=y; rump=true ;;
+*)               CONFIG_RUMP=n; rump=false ;;
 esac
 AC_SUBST(CONFIG_RUMP)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:23:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:23: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 1YOjnX-0002BC-BH; Fri, 20 Feb 2015 09:22: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 1YOjnV-0002B4-Uv
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:58 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C3/D4-02830-1FCF6E45; Fri, 20 Feb 2015 09:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1424424165!4047098!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7031 invoked from network); 20 Feb 2015 09:22:56 -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;
	20 Feb 2015 09:22: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 1YOjnJ-0002RL-Df
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjnJ-0003sR-Ci
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:45 +0000
Date: Fri, 20 Feb 2015 09:22:45 +0000
Message-Id: <E1YOjnJ-0003sR-Ci@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2417e243bb510dafdbd589a5aeedb29095e62c10
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 16 14:57:01 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:57:01 2015 +0000

    QEMU_TAG update
---
 Config.mk |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7288326..127c2c5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -237,7 +237,9 @@ ifneq (,$(CONFIG_QEMU))
 QEMU_TRADITIONAL_LOC ?= $(CONFIG_QEMU)
 endif
 ifneq (,$(QEMU_TAG))
-QEMU_TRADITIONAL_REVISION ?= $(QEMU_TAG)
+QEMU_TRADITIONAL_REVISION ?= 3499745d3a8561cce67f3d4fbc2da60401253ad4
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 endif
 
 ifeq ($(GIT_HTTP),y)
@@ -260,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.5.0
-# Mon Oct 6 16:24:46 2014 +0100
-# qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
+QEMU_TRADITIONAL_REVISION ?= 3499745d3a8561cce67f3d4fbc2da60401253ad4
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Feb 20 09:23:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2015 09:23: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 1YOjnX-0002BC-BH; Fri, 20 Feb 2015 09:22: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 1YOjnV-0002B4-Uv
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:58 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C3/D4-02830-1FCF6E45; Fri, 20 Feb 2015 09:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1424424165!4047098!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7031 invoked from network); 20 Feb 2015 09:22:56 -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;
	20 Feb 2015 09:22: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 1YOjnJ-0002RL-Df
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YOjnJ-0003sR-Ci
	for xen-changelog@lists.xensource.com; Fri, 20 Feb 2015 09:22:45 +0000
Date: Fri, 20 Feb 2015 09:22:45 +0000
Message-Id: <E1YOjnJ-0003sR-Ci@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2417e243bb510dafdbd589a5aeedb29095e62c10
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 16 14:57:01 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:57:01 2015 +0000

    QEMU_TAG update
---
 Config.mk |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7288326..127c2c5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -237,7 +237,9 @@ ifneq (,$(CONFIG_QEMU))
 QEMU_TRADITIONAL_LOC ?= $(CONFIG_QEMU)
 endif
 ifneq (,$(QEMU_TAG))
-QEMU_TRADITIONAL_REVISION ?= $(QEMU_TAG)
+QEMU_TRADITIONAL_REVISION ?= 3499745d3a8561cce67f3d4fbc2da60401253ad4
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 endif
 
 ifeq ($(GIT_HTTP),y)
@@ -260,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.5.0
-# Mon Oct 6 16:24:46 2014 +0100
-# qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
+QEMU_TRADITIONAL_REVISION ?= 3499745d3a8561cce67f3d4fbc2da60401253ad4
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sat Feb 28 15:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDT-0006IF-Cf; Sat, 28 Feb 2015 15:22: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 1YRjDS-0006Hn-4O
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:06 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	1F/A2-02770-C1DD1F45; Sat, 28 Feb 2015 15:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1425136923!8977823!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21329 invoked from network); 28 Feb 2015 15:22: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;
	28 Feb 2015 15: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 1YRjDP-0003ar-4E
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDP-00050t-1d
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:03 +0000
Date: Sat, 28 Feb 2015 15:22:03 +0000
Message-Id: <E1YRjDP-00050t-1d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50a61de84f323e32a7ce0cfdf0ce8db39330de3d
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 16 14:55:04 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:55:04 2015 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7f3910d..bcfaa25 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.4.1
-# Tue Apr 8 16:50:06 2014 +0000
-# qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
+QEMU_TAG ?= e052bfcd0f2b0776f1f39f8282446ba8601bde82
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
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 Sat Feb 28 15:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDT-0006IF-Cf; Sat, 28 Feb 2015 15:22: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 1YRjDS-0006Hn-4O
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:06 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	1F/A2-02770-C1DD1F45; Sat, 28 Feb 2015 15:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1425136923!8977823!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21329 invoked from network); 28 Feb 2015 15:22: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;
	28 Feb 2015 15: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 1YRjDP-0003ar-4E
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDP-00050t-1d
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:03 +0000
Date: Sat, 28 Feb 2015 15:22:03 +0000
Message-Id: <E1YRjDP-00050t-1d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50a61de84f323e32a7ce0cfdf0ce8db39330de3d
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 16 14:55:04 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:55:04 2015 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7f3910d..bcfaa25 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.4.1
-# Tue Apr 8 16:50:06 2014 +0000
-# qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
+QEMU_TAG ?= e052bfcd0f2b0776f1f39f8282446ba8601bde82
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
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 Sat Feb 28 15:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDd-0006Iv-FD; Sat, 28 Feb 2015 15:22:17 +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 1YRjDb-0006Ib-OG
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:15 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	81/5E-03164-72DD1F45; Sat, 28 Feb 2015 15:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1425136933!13606349!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11668 invoked from network); 28 Feb 2015 15:22:14 -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;
	28 Feb 2015 15:22: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 1YRjDZ-0003au-9g
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDZ-00051K-7i
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:13 +0000
Date: Sat, 28 Feb 2015 15:22:13 +0000
Message-Id: <E1YRjDZ-00051K-7i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/VPMU: disable when NMI
	watchdog is on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9750068f80817261957ec8ce096c819d495af21
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Feb 18 16:45:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:45:14 2015 +0100

    x86/VPMU: disable when NMI watchdog is on
    
    NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
    overflow occurs. This may be overwritten by VPMU code later, effectively
    turning off the watchdog.
    
    We should disable VPMU when NMI watchdog is running.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e5e09b5c46444b0ab8450c6d6ee8316d4016ac18
    master date: 2015-02-03 11:30:09 +0100
---
 docs/misc/xen-command-line.markdown |    2 ++
 xen/arch/x86/hvm/vpmu.c             |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index b50a753..7cfa303 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1015,6 +1015,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 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!
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 27441e2..e6795a5 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -284,3 +285,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);
--
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 Sat Feb 28 15:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDd-0006Iv-FD; Sat, 28 Feb 2015 15:22:17 +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 1YRjDb-0006Ib-OG
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:15 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	81/5E-03164-72DD1F45; Sat, 28 Feb 2015 15:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1425136933!13606349!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11668 invoked from network); 28 Feb 2015 15:22:14 -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;
	28 Feb 2015 15:22: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 1YRjDZ-0003au-9g
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDZ-00051K-7i
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:13 +0000
Date: Sat, 28 Feb 2015 15:22:13 +0000
Message-Id: <E1YRjDZ-00051K-7i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/VPMU: disable when NMI
	watchdog is on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9750068f80817261957ec8ce096c819d495af21
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Feb 18 16:45:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:45:14 2015 +0100

    x86/VPMU: disable when NMI watchdog is on
    
    NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
    overflow occurs. This may be overwritten by VPMU code later, effectively
    turning off the watchdog.
    
    We should disable VPMU when NMI watchdog is running.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e5e09b5c46444b0ab8450c6d6ee8316d4016ac18
    master date: 2015-02-03 11:30:09 +0100
---
 docs/misc/xen-command-line.markdown |    2 ++
 xen/arch/x86/hvm/vpmu.c             |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index b50a753..7cfa303 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1015,6 +1015,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 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!
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 27441e2..e6795a5 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -284,3 +285,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);
--
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 Sat Feb 28 15:22:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDn-0006RH-I4; Sat, 28 Feb 2015 15:22: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 1YRjDm-0006NN-A3
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:26 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	34/A5-02804-13DD1F45; Sat, 28 Feb 2015 15:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1425136943!12074450!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9329 invoked from network); 28 Feb 2015 15:22:24 -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;
	28 Feb 2015 15:22: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 1YRjDj-0003b3-G3
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDj-00051k-Dv
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:23 +0000
Date: Sat, 28 Feb 2015 15:22:23 +0000
Message-Id: <E1YRjDj-00051k-Dv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/traps: export the
	exception_table[] function pointer table to C
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0cacaff174317609999f6f8b134db8a2f9e7ac08
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:46:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:46:18 2015 +0100

    x86/traps: export the exception_table[] function pointer table to C
    
    and use it in preference to the direct call to do_nmi() in vmx.c
    
    The value 'TRAP_last_reserved' was only used where 'TRAP_nr' would be more
    appropriate, so is replaced.
    
    No functional change
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d3eb16b8a7c06f0d2a2110948a8477a62b541bbf
    master date: 2015-02-11 17:16:18 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c      |    2 +-
 xen/arch/x86/x86_64/entry.S     |    1 +
 xen/include/asm-x86/processor.h |    5 ++++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1309c44..35b4935 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2563,7 +2563,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
                  (X86_EVENTTYPE_NMI << 8)) )
         {
-            do_nmi(regs);
+            exception_table[TRAP_nmi](regs);
             enable_nmis();
         }
         break;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index c634217..e287bfb 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -716,6 +716,7 @@ ENTRY(exception_table)
         .quad do_alignment_check
         .quad do_machine_check
         .quad do_simd_coprocessor_error
+        .size exception_table, . - exception_table
 
 ENTRY(hypercall_table)
         .quad do_set_trap_table     /*  0 */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index c120460..ec3da9b 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -113,7 +113,7 @@
 #define TRAP_alignment_check  17
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
-#define TRAP_last_reserved    31
+#define TRAP_nr               32
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */
@@ -523,6 +523,9 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
+/* Dispatch table for exceptions */
+extern void (* const exception_table[TRAP_nr])(struct cpu_user_regs *regs);
+
 #define DECLARE_TRAP_HANDLER(_name)                     \
 void _name(void);                            \
 void do_ ## _name(struct cpu_user_regs *regs)
--
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 Sat Feb 28 15:22:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDn-0006RH-I4; Sat, 28 Feb 2015 15:22: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 1YRjDm-0006NN-A3
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:26 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	34/A5-02804-13DD1F45; Sat, 28 Feb 2015 15:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1425136943!12074450!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9329 invoked from network); 28 Feb 2015 15:22:24 -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;
	28 Feb 2015 15:22: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 1YRjDj-0003b3-G3
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDj-00051k-Dv
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:23 +0000
Date: Sat, 28 Feb 2015 15:22:23 +0000
Message-Id: <E1YRjDj-00051k-Dv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/traps: export the
	exception_table[] function pointer table to C
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0cacaff174317609999f6f8b134db8a2f9e7ac08
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:46:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:46:18 2015 +0100

    x86/traps: export the exception_table[] function pointer table to C
    
    and use it in preference to the direct call to do_nmi() in vmx.c
    
    The value 'TRAP_last_reserved' was only used where 'TRAP_nr' would be more
    appropriate, so is replaced.
    
    No functional change
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d3eb16b8a7c06f0d2a2110948a8477a62b541bbf
    master date: 2015-02-11 17:16:18 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c      |    2 +-
 xen/arch/x86/x86_64/entry.S     |    1 +
 xen/include/asm-x86/processor.h |    5 ++++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1309c44..35b4935 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2563,7 +2563,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
                  (X86_EVENTTYPE_NMI << 8)) )
         {
-            do_nmi(regs);
+            exception_table[TRAP_nmi](regs);
             enable_nmis();
         }
         break;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index c634217..e287bfb 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -716,6 +716,7 @@ ENTRY(exception_table)
         .quad do_alignment_check
         .quad do_machine_check
         .quad do_simd_coprocessor_error
+        .size exception_table, . - exception_table
 
 ENTRY(hypercall_table)
         .quad do_set_trap_table     /*  0 */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index c120460..ec3da9b 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -113,7 +113,7 @@
 #define TRAP_alignment_check  17
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
-#define TRAP_last_reserved    31
+#define TRAP_nr               32
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */
@@ -523,6 +523,9 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
+/* Dispatch table for exceptions */
+extern void (* const exception_table[TRAP_nr])(struct cpu_user_regs *regs);
+
 #define DECLARE_TRAP_HANDLER(_name)                     \
 void _name(void);                            \
 void do_ ## _name(struct cpu_user_regs *regs)
--
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 Sat Feb 28 15:22:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDx-0006g7-Kn; Sat, 28 Feb 2015 15:22:37 +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 1YRjDw-0006ft-Ee
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:36 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	53/83-02755-B3DD1F45; Sat, 28 Feb 2015 15:22:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1425136953!13619525!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9777 invoked from network); 28 Feb 2015 15:22:34 -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;
	28 Feb 2015 15:22: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 1YRjDt-0003bC-Kb
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDt-00052u-Ji
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:33 +0000
Date: Sat, 28 Feb 2015 15:22:33 +0000
Message-Id: <E1YRjDt-00052u-Ji@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/nmi: fix shootdown of pcpus
	running in VMX non-root 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 6f2fc9bc1503f72e38b19c46b19215d817cd3e2d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:48:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:48:07 2015 +0100

    x86/nmi: fix shootdown of pcpus running in VMX non-root mode
    
    c/s 7dd3b06ff "vmx: fix handling of NMI VMEXIT" fixed one issue but
    inadvertently introduced a regression when it came to the NMI shootdown.  The
    shootdown code worked by patching vector 2 in each IDT, but the introduced
    direct call to do_nmi() bypassed this.
    
    Instead of patching each IDT, take a different approach by updating the
    existing dispatch table.  This allows for the removal of the remote IDT
    patching and the removal of the nmi_crash() entry point.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbeeaa7da01bfa37c1fcdfe79e8f4f1400262ccb
    master date: 2015-02-11 17:18:27 +0100
---
 xen/arch/x86/crash.c        |   52 ++++++++++++++++--------------------------
 xen/arch/x86/x86_64/entry.S |    8 ------
 2 files changed, 20 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index 01fd906..3d03bc1 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -38,7 +38,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
 void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 {
-    int cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
     ASSERT(cpu != crashing_cpu);
@@ -116,7 +116,7 @@ void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
-    int i, cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     disable_lapic_nmi_watchdog();
     local_irq_disable();
@@ -126,37 +126,25 @@ static void nmi_shootdown_cpus(void)
 
     cpumask_andnot(&waiting_to_crash, &cpu_online_map, cpumask_of(cpu));
 
-    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
-     * invokes do_nmi_crash (above), which cause them to write state and
-     * fall into a loop.  The crashing pcpu gets the nop handler to
-     * cause it to return to this function ASAP.
+    /*
+     * Disable IST for MCEs to avoid stack corruption race conditions, and
+     * change the NMI handler to a nop to avoid deviation from this codepath.
      */
-    for ( i = 0; i < nr_cpu_ids; i++ )
-    {
-        if ( idt_tables[i] == NULL )
-            continue;
-
-        if ( i == cpu )
-        {
-            /*
-             * Disable the interrupt stack tables for this cpu's MCE and NMI 
-             * handlers, and alter the NMI handler to have no operation.  
-             * Disabling the stack tables prevents stack corruption race 
-             * conditions, while changing the handler helps prevent cascading 
-             * faults; we are certainly going to crash by this point.
-             *
-             * This update is safe from a security point of view, as this pcpu 
-             * is never going to try to sysret back to a PV vcpu.
-             */
-            _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0, &trap_nop);
-            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
-        }
-        else
-        {
-            /* Do not update stack table for other pcpus. */
-            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
-        }
-    }
+    _set_gate_lower(&idt_tables[cpu][TRAP_nmi], 14, 0, &trap_nop);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+    /*
+     * Ideally would be:
+     *   exception_table[TRAP_nmi] = &do_nmi_crash;
+     *
+     * but the exception_table is read only.  Borrow an unused fixmap entry
+     * to construct a writable mapping.
+     */
+    set_fixmap(FIX_TBOOT_MAP_ADDRESS, __pa(&exception_table[TRAP_nmi]));
+    write_atomic((unsigned long *)
+                 (fix_to_virt(FIX_TBOOT_MAP_ADDRESS) +
+                  ((unsigned long)&exception_table[TRAP_nmi] & ~PAGE_MASK)),
+                 (unsigned long)&do_nmi_crash);
 
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index e287bfb..4bb48e7 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -658,14 +658,6 @@ handle_ist_exception:
         je    restore_all_guest
         jmp   compat_restore_all_guest
 
-ENTRY(nmi_crash)
-        pushq $0
-        movl $TRAP_nmi,4(%rsp)
-        SAVE_ALL
-        movq %rsp,%rdi
-        callq do_nmi_crash /* Does not return */
-        ud2
-
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
--
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 Sat Feb 28 15:22:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 15:22: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 1YRjDx-0006g7-Kn; Sat, 28 Feb 2015 15:22:37 +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 1YRjDw-0006ft-Ee
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:36 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	53/83-02755-B3DD1F45; Sat, 28 Feb 2015 15:22:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1425136953!13619525!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9777 invoked from network); 28 Feb 2015 15:22:34 -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;
	28 Feb 2015 15:22: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 1YRjDt-0003bC-Kb
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRjDt-00052u-Ji
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 15:22:33 +0000
Date: Sat, 28 Feb 2015 15:22:33 +0000
Message-Id: <E1YRjDt-00052u-Ji@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/nmi: fix shootdown of pcpus
	running in VMX non-root 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 6f2fc9bc1503f72e38b19c46b19215d817cd3e2d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:48:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:48:07 2015 +0100

    x86/nmi: fix shootdown of pcpus running in VMX non-root mode
    
    c/s 7dd3b06ff "vmx: fix handling of NMI VMEXIT" fixed one issue but
    inadvertently introduced a regression when it came to the NMI shootdown.  The
    shootdown code worked by patching vector 2 in each IDT, but the introduced
    direct call to do_nmi() bypassed this.
    
    Instead of patching each IDT, take a different approach by updating the
    existing dispatch table.  This allows for the removal of the remote IDT
    patching and the removal of the nmi_crash() entry point.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbeeaa7da01bfa37c1fcdfe79e8f4f1400262ccb
    master date: 2015-02-11 17:18:27 +0100
---
 xen/arch/x86/crash.c        |   52 ++++++++++++++++--------------------------
 xen/arch/x86/x86_64/entry.S |    8 ------
 2 files changed, 20 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index 01fd906..3d03bc1 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -38,7 +38,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
 void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 {
-    int cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
     ASSERT(cpu != crashing_cpu);
@@ -116,7 +116,7 @@ void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
-    int i, cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     disable_lapic_nmi_watchdog();
     local_irq_disable();
@@ -126,37 +126,25 @@ static void nmi_shootdown_cpus(void)
 
     cpumask_andnot(&waiting_to_crash, &cpu_online_map, cpumask_of(cpu));
 
-    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
-     * invokes do_nmi_crash (above), which cause them to write state and
-     * fall into a loop.  The crashing pcpu gets the nop handler to
-     * cause it to return to this function ASAP.
+    /*
+     * Disable IST for MCEs to avoid stack corruption race conditions, and
+     * change the NMI handler to a nop to avoid deviation from this codepath.
      */
-    for ( i = 0; i < nr_cpu_ids; i++ )
-    {
-        if ( idt_tables[i] == NULL )
-            continue;
-
-        if ( i == cpu )
-        {
-            /*
-             * Disable the interrupt stack tables for this cpu's MCE and NMI 
-             * handlers, and alter the NMI handler to have no operation.  
-             * Disabling the stack tables prevents stack corruption race 
-             * conditions, while changing the handler helps prevent cascading 
-             * faults; we are certainly going to crash by this point.
-             *
-             * This update is safe from a security point of view, as this pcpu 
-             * is never going to try to sysret back to a PV vcpu.
-             */
-            _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0, &trap_nop);
-            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
-        }
-        else
-        {
-            /* Do not update stack table for other pcpus. */
-            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
-        }
-    }
+    _set_gate_lower(&idt_tables[cpu][TRAP_nmi], 14, 0, &trap_nop);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+    /*
+     * Ideally would be:
+     *   exception_table[TRAP_nmi] = &do_nmi_crash;
+     *
+     * but the exception_table is read only.  Borrow an unused fixmap entry
+     * to construct a writable mapping.
+     */
+    set_fixmap(FIX_TBOOT_MAP_ADDRESS, __pa(&exception_table[TRAP_nmi]));
+    write_atomic((unsigned long *)
+                 (fix_to_virt(FIX_TBOOT_MAP_ADDRESS) +
+                  ((unsigned long)&exception_table[TRAP_nmi] & ~PAGE_MASK)),
+                 (unsigned long)&do_nmi_crash);
 
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index e287bfb..4bb48e7 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -658,14 +658,6 @@ handle_ist_exception:
         je    restore_all_guest
         jmp   compat_restore_all_guest
 
-ENTRY(nmi_crash)
-        pushq $0
-        movl $TRAP_nmi,4(%rsp)
-        SAVE_ALL
-        movq %rsp,%rdi
-        callq do_nmi_crash /* Does not return */
-        ud2
-
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
--
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 Sat Feb 28 17:55:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55: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 1YRlbd-0000kt-IZ; Sat, 28 Feb 2015 17:55:13 +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 1YRlbb-0000ko-VR
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:12 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	E2/50-02884-FF002F45; Sat, 28 Feb 2015 17:55:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1425146109!11882325!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28460 invoked from network); 28 Feb 2015 17:55:10 -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;
	28 Feb 2015 17: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 1YRlbT-0005V8-Ps
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlbT-0001oF-5A
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:03 +0000
Date: Sat, 28 Feb 2015 17:55:03 +0000
Message-Id: <E1YRlbT-0001oF-5A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9c9b73912759baa8cf9ca25256fe17d8407095fb
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 16 14:54:11 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:54:11 2015 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9a3a9f7..e5dd70b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.3.3
-# Tue Apr 8 16:50:06 2014 +0000
-# qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
+QEMU_TAG ?= 9550be0726b577cf038691c77d8c924c43e7cebd
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
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 Sat Feb 28 17:55:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55: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 1YRlbd-0000kt-IZ; Sat, 28 Feb 2015 17:55:13 +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 1YRlbb-0000ko-VR
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:12 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	E2/50-02884-FF002F45; Sat, 28 Feb 2015 17:55:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1425146109!11882325!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28460 invoked from network); 28 Feb 2015 17:55:10 -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;
	28 Feb 2015 17: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 1YRlbT-0005V8-Ps
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlbT-0001oF-5A
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:03 +0000
Date: Sat, 28 Feb 2015 17:55:03 +0000
Message-Id: <E1YRlbT-0001oF-5A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9c9b73912759baa8cf9ca25256fe17d8407095fb
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Feb 16 14:54:11 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Feb 16 14:54:11 2015 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9a3a9f7..e5dd70b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.3.3
-# Tue Apr 8 16:50:06 2014 +0000
-# qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
+QEMU_TAG ?= 9550be0726b577cf038691c77d8c924c43e7cebd
+# Mon Feb 2 16:49:59 2015 +0000
+# cirrus: fix an uninitialized variable
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
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 Sat Feb 28 17:55:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YRlbn-0000ld-L4; Sat, 28 Feb 2015 17:55:23 +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 1YRlbm-0000lR-27
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:22 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	15/3D-03185-90102F45; Sat, 28 Feb 2015 17:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1425146119!8135941!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21371 invoked from network); 28 Feb 2015 17:55:20 -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;
	28 Feb 2015 17:55: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 1YRlbj-0005VB-7d
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlbj-0001ol-6c
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:19 +0000
Date: Sat, 28 Feb 2015 17:55:19 +0000
Message-Id: <E1YRlbj-0001ol-6c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/VPMU: disable when NMI
	watchdog is on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e71c4e54d996d7ab70e778917cc1fff67a9f4dc0
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Feb 18 16:50:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:50:47 2015 +0100

    x86/VPMU: disable when NMI watchdog is on
    
    NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
    overflow occurs. This may be overwritten by VPMU code later, effectively
    turning off the watchdog.
    
    We should disable VPMU when NMI watchdog is running.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e5e09b5c46444b0ab8450c6d6ee8316d4016ac18
    master date: 2015-02-03 11:30:09 +0100
---
 docs/misc/xen-command-line.markdown |    2 ++
 xen/arch/x86/hvm/vpmu.c             |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index aa121fb..64c6fb7 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -981,6 +981,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 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!
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 27441e2..e6795a5 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -284,3 +285,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);
--
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 Sat Feb 28 17:55:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YRlbn-0000ld-L4; Sat, 28 Feb 2015 17:55:23 +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 1YRlbm-0000lR-27
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:22 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	15/3D-03185-90102F45; Sat, 28 Feb 2015 17:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1425146119!8135941!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21371 invoked from network); 28 Feb 2015 17:55:20 -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;
	28 Feb 2015 17:55: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 1YRlbj-0005VB-7d
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlbj-0001ol-6c
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:19 +0000
Date: Sat, 28 Feb 2015 17:55:19 +0000
Message-Id: <E1YRlbj-0001ol-6c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/VPMU: disable when NMI
	watchdog is on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e71c4e54d996d7ab70e778917cc1fff67a9f4dc0
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Feb 18 16:50:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:50:47 2015 +0100

    x86/VPMU: disable when NMI watchdog is on
    
    NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
    overflow occurs. This may be overwritten by VPMU code later, effectively
    turning off the watchdog.
    
    We should disable VPMU when NMI watchdog is running.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: e5e09b5c46444b0ab8450c6d6ee8316d4016ac18
    master date: 2015-02-03 11:30:09 +0100
---
 docs/misc/xen-command-line.markdown |    2 ++
 xen/arch/x86/hvm/vpmu.c             |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index aa121fb..64c6fb7 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -981,6 +981,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 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!
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 27441e2..e6795a5 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -284,3 +285,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);
--
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 Sat Feb 28 17:55:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55: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 1YRlbx-0000n5-Ng; Sat, 28 Feb 2015 17:55:33 +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 1YRlbv-0000mo-Sf
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:31 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EA/8B-02994-31102F45; Sat, 28 Feb 2015 17:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1425146129!12065583!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1716 invoked from network); 28 Feb 2015 17:55:30 -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;
	28 Feb 2015 17:55: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 1YRlbt-0005VN-CR
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlbt-0001pA-Ae
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:29 +0000
Date: Sat, 28 Feb 2015 17:55:29 +0000
Message-Id: <E1YRlbt-0001pA-Ae@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/traps: export the
	exception_table[] function pointer table to C
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b2d4e87af8966fd00cbb10f9890993f4800d4af
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:51:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:51:31 2015 +0100

    x86/traps: export the exception_table[] function pointer table to C
    
    and use it in preference to the direct call to do_nmi() in vmx.c
    
    The value 'TRAP_last_reserved' was only used where 'TRAP_nr' would be more
    appropriate, so is replaced.
    
    No functional change
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d3eb16b8a7c06f0d2a2110948a8477a62b541bbf
    master date: 2015-02-11 17:16:18 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c      |    2 +-
 xen/arch/x86/x86_64/entry.S     |    1 +
 xen/include/asm-x86/processor.h |    5 ++++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 7f38378..43741e6 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2507,7 +2507,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
                  (X86_EVENTTYPE_NMI << 8)) )
         {
-            do_nmi(regs);
+            exception_table[TRAP_nmi](regs);
             enable_nmis();
         }
         break;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 8870e84..63b1f3b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -721,6 +721,7 @@ ENTRY(exception_table)
         .quad do_alignment_check
         .quad do_machine_check
         .quad do_simd_coprocessor_error
+        .size exception_table, . - exception_table
 
 ENTRY(hypercall_table)
         .quad do_set_trap_table     /*  0 */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 893afa3..4fa4a61 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -112,7 +112,7 @@
 #define TRAP_alignment_check  17
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
-#define TRAP_last_reserved    31
+#define TRAP_nr               32
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */
@@ -522,6 +522,9 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
+/* Dispatch table for exceptions */
+extern void (* const exception_table[TRAP_nr])(struct cpu_user_regs *regs);
+
 #define DECLARE_TRAP_HANDLER(_name)                     \
 void _name(void);                            \
 void do_ ## _name(struct cpu_user_regs *regs)
--
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 Sat Feb 28 17:55:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55: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 1YRlbx-0000n5-Ng; Sat, 28 Feb 2015 17:55:33 +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 1YRlbv-0000mo-Sf
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:31 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EA/8B-02994-31102F45; Sat, 28 Feb 2015 17:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1425146129!12065583!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1716 invoked from network); 28 Feb 2015 17:55:30 -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;
	28 Feb 2015 17:55: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 1YRlbt-0005VN-CR
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlbt-0001pA-Ae
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:29 +0000
Date: Sat, 28 Feb 2015 17:55:29 +0000
Message-Id: <E1YRlbt-0001pA-Ae@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/traps: export the
	exception_table[] function pointer table to C
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b2d4e87af8966fd00cbb10f9890993f4800d4af
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:51:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:51:31 2015 +0100

    x86/traps: export the exception_table[] function pointer table to C
    
    and use it in preference to the direct call to do_nmi() in vmx.c
    
    The value 'TRAP_last_reserved' was only used where 'TRAP_nr' would be more
    appropriate, so is replaced.
    
    No functional change
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d3eb16b8a7c06f0d2a2110948a8477a62b541bbf
    master date: 2015-02-11 17:16:18 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c      |    2 +-
 xen/arch/x86/x86_64/entry.S     |    1 +
 xen/include/asm-x86/processor.h |    5 ++++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 7f38378..43741e6 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2507,7 +2507,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
                  (X86_EVENTTYPE_NMI << 8)) )
         {
-            do_nmi(regs);
+            exception_table[TRAP_nmi](regs);
             enable_nmis();
         }
         break;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 8870e84..63b1f3b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -721,6 +721,7 @@ ENTRY(exception_table)
         .quad do_alignment_check
         .quad do_machine_check
         .quad do_simd_coprocessor_error
+        .size exception_table, . - exception_table
 
 ENTRY(hypercall_table)
         .quad do_set_trap_table     /*  0 */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 893afa3..4fa4a61 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -112,7 +112,7 @@
 #define TRAP_alignment_check  17
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
-#define TRAP_last_reserved    31
+#define TRAP_nr               32
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */
@@ -522,6 +522,9 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
+/* Dispatch table for exceptions */
+extern void (* const exception_table[TRAP_nr])(struct cpu_user_regs *regs);
+
 #define DECLARE_TRAP_HANDLER(_name)                     \
 void _name(void);                            \
 void do_ ## _name(struct cpu_user_regs *regs)
--
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 Sat Feb 28 17:55:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YRlc9-0000pH-SZ; Sat, 28 Feb 2015 17:55:45 +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 1YRlc9-0000p3-2x
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:45 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	F4/EE-02755-02102F45; Sat, 28 Feb 2015 17:55:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1425146139!13618993!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22955 invoked from network); 28 Feb 2015 17:55:40 -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;
	28 Feb 2015 17:55: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 1YRlc3-0005VT-H3
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlc3-0001qE-Fp
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:39 +0000
Date: Sat, 28 Feb 2015 17:55:39 +0000
Message-Id: <E1YRlc3-0001qE-Fp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/nmi: fix shootdown of pcpus
	running in VMX non-root 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 9ebac5765496b34f15b2328f41c00f789ed6d712
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:52:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:52:25 2015 +0100

    x86/nmi: fix shootdown of pcpus running in VMX non-root mode
    
    c/s 7dd3b06ff "vmx: fix handling of NMI VMEXIT" fixed one issue but
    inadvertently introduced a regression when it came to the NMI shootdown.  The
    shootdown code worked by patching vector 2 in each IDT, but the introduced
    direct call to do_nmi() bypassed this.
    
    Instead of patching each IDT, take a different approach by updating the
    existing dispatch table.  This allows for the removal of the remote IDT
    patching and the removal of the nmi_crash() entry point.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbeeaa7da01bfa37c1fcdfe79e8f4f1400262ccb
    master date: 2015-02-11 17:18:27 +0100
---
 xen/arch/x86/crash.c        |   52 ++++++++++++++++--------------------------
 xen/arch/x86/x86_64/entry.S |    8 ------
 2 files changed, 20 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index 01fd906..3d03bc1 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -38,7 +38,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
 void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 {
-    int cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
     ASSERT(cpu != crashing_cpu);
@@ -116,7 +116,7 @@ void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
-    int i, cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     disable_lapic_nmi_watchdog();
     local_irq_disable();
@@ -126,37 +126,25 @@ static void nmi_shootdown_cpus(void)
 
     cpumask_andnot(&waiting_to_crash, &cpu_online_map, cpumask_of(cpu));
 
-    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
-     * invokes do_nmi_crash (above), which cause them to write state and
-     * fall into a loop.  The crashing pcpu gets the nop handler to
-     * cause it to return to this function ASAP.
+    /*
+     * Disable IST for MCEs to avoid stack corruption race conditions, and
+     * change the NMI handler to a nop to avoid deviation from this codepath.
      */
-    for ( i = 0; i < nr_cpu_ids; i++ )
-    {
-        if ( idt_tables[i] == NULL )
-            continue;
-
-        if ( i == cpu )
-        {
-            /*
-             * Disable the interrupt stack tables for this cpu's MCE and NMI 
-             * handlers, and alter the NMI handler to have no operation.  
-             * Disabling the stack tables prevents stack corruption race 
-             * conditions, while changing the handler helps prevent cascading 
-             * faults; we are certainly going to crash by this point.
-             *
-             * This update is safe from a security point of view, as this pcpu 
-             * is never going to try to sysret back to a PV vcpu.
-             */
-            _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0, &trap_nop);
-            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
-        }
-        else
-        {
-            /* Do not update stack table for other pcpus. */
-            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
-        }
-    }
+    _set_gate_lower(&idt_tables[cpu][TRAP_nmi], 14, 0, &trap_nop);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+    /*
+     * Ideally would be:
+     *   exception_table[TRAP_nmi] = &do_nmi_crash;
+     *
+     * but the exception_table is read only.  Borrow an unused fixmap entry
+     * to construct a writable mapping.
+     */
+    set_fixmap(FIX_TBOOT_MAP_ADDRESS, __pa(&exception_table[TRAP_nmi]));
+    write_atomic((unsigned long *)
+                 (fix_to_virt(FIX_TBOOT_MAP_ADDRESS) +
+                  ((unsigned long)&exception_table[TRAP_nmi] & ~PAGE_MASK)),
+                 (unsigned long)&do_nmi_crash);
 
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 63b1f3b..01432b8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -660,14 +660,6 @@ handle_ist_exception:
         je    restore_all_guest
         jmp   compat_restore_all_guest
 
-ENTRY(nmi_crash)
-        pushq $0
-        movl $TRAP_nmi,4(%rsp)
-        SAVE_ALL
-        movq %rsp,%rdi
-        callq do_nmi_crash /* Does not return */
-        ud2
-
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
--
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 Sat Feb 28 17:55:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 28 Feb 2015 17:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1YRlc9-0000pH-SZ; Sat, 28 Feb 2015 17:55:45 +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 1YRlc9-0000p3-2x
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:45 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	F4/EE-02755-02102F45; Sat, 28 Feb 2015 17:55:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1425146139!13618993!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.13.4; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22955 invoked from network); 28 Feb 2015 17:55:40 -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;
	28 Feb 2015 17:55: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 1YRlc3-0005VT-H3
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1YRlc3-0001qE-Fp
	for xen-changelog@lists.xensource.com; Sat, 28 Feb 2015 17:55:39 +0000
Date: Sat, 28 Feb 2015 17:55:39 +0000
Message-Id: <E1YRlc3-0001qE-Fp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/nmi: fix shootdown of pcpus
	running in VMX non-root 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 9ebac5765496b34f15b2328f41c00f789ed6d712
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 18 16:52:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 16:52:25 2015 +0100

    x86/nmi: fix shootdown of pcpus running in VMX non-root mode
    
    c/s 7dd3b06ff "vmx: fix handling of NMI VMEXIT" fixed one issue but
    inadvertently introduced a regression when it came to the NMI shootdown.  The
    shootdown code worked by patching vector 2 in each IDT, but the introduced
    direct call to do_nmi() bypassed this.
    
    Instead of patching each IDT, take a different approach by updating the
    existing dispatch table.  This allows for the removal of the remote IDT
    patching and the removal of the nmi_crash() entry point.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbeeaa7da01bfa37c1fcdfe79e8f4f1400262ccb
    master date: 2015-02-11 17:18:27 +0100
---
 xen/arch/x86/crash.c        |   52 ++++++++++++++++--------------------------
 xen/arch/x86/x86_64/entry.S |    8 ------
 2 files changed, 20 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index 01fd906..3d03bc1 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -38,7 +38,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 /* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
 void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 {
-    int cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
     ASSERT(cpu != crashing_cpu);
@@ -116,7 +116,7 @@ void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
-    int i, cpu = smp_processor_id();
+    unsigned int cpu = smp_processor_id();
 
     disable_lapic_nmi_watchdog();
     local_irq_disable();
@@ -126,37 +126,25 @@ static void nmi_shootdown_cpus(void)
 
     cpumask_andnot(&waiting_to_crash, &cpu_online_map, cpumask_of(cpu));
 
-    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
-     * invokes do_nmi_crash (above), which cause them to write state and
-     * fall into a loop.  The crashing pcpu gets the nop handler to
-     * cause it to return to this function ASAP.
+    /*
+     * Disable IST for MCEs to avoid stack corruption race conditions, and
+     * change the NMI handler to a nop to avoid deviation from this codepath.
      */
-    for ( i = 0; i < nr_cpu_ids; i++ )
-    {
-        if ( idt_tables[i] == NULL )
-            continue;
-
-        if ( i == cpu )
-        {
-            /*
-             * Disable the interrupt stack tables for this cpu's MCE and NMI 
-             * handlers, and alter the NMI handler to have no operation.  
-             * Disabling the stack tables prevents stack corruption race 
-             * conditions, while changing the handler helps prevent cascading 
-             * faults; we are certainly going to crash by this point.
-             *
-             * This update is safe from a security point of view, as this pcpu 
-             * is never going to try to sysret back to a PV vcpu.
-             */
-            _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0, &trap_nop);
-            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
-        }
-        else
-        {
-            /* Do not update stack table for other pcpus. */
-            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
-        }
-    }
+    _set_gate_lower(&idt_tables[cpu][TRAP_nmi], 14, 0, &trap_nop);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+    /*
+     * Ideally would be:
+     *   exception_table[TRAP_nmi] = &do_nmi_crash;
+     *
+     * but the exception_table is read only.  Borrow an unused fixmap entry
+     * to construct a writable mapping.
+     */
+    set_fixmap(FIX_TBOOT_MAP_ADDRESS, __pa(&exception_table[TRAP_nmi]));
+    write_atomic((unsigned long *)
+                 (fix_to_virt(FIX_TBOOT_MAP_ADDRESS) +
+                  ((unsigned long)&exception_table[TRAP_nmi] & ~PAGE_MASK)),
+                 (unsigned long)&do_nmi_crash);
 
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 63b1f3b..01432b8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -660,14 +660,6 @@ handle_ist_exception:
         je    restore_all_guest
         jmp   compat_restore_all_guest
 
-ENTRY(nmi_crash)
-        pushq $0
-        movl $TRAP_nmi,4(%rsp)
-        SAVE_ALL
-        movq %rsp,%rdi
-        callq do_nmi_crash /* Does not return */
-        ud2
-
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
--
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

