From xen-changelog-bounces@lists.xensource.com Mon Jan 02 08:44:14 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Jan 2012 08:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RhdV1-00009a-Id; Mon, 02 Jan 2012 08:44:07 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdV0-00009V-BV
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1325493824!60843239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5570 invoked from network); 2 Jan 2012 08:43:45 -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;
	2 Jan 2012 08:43:45 -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 1RhdUx-0002gt-NY
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdUx-0003kZ-Dr
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Message-Id: <E1RhdUx-0003kZ-Dr@xenbits.xen.org>
Date: Mon, 02 Jan 2012 08:44: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] blktap: ensure mmap() is called
	only once per region
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325493442 -3600
# Node ID fe1adb19ffe1df656e2bdc0799d024b514159a7b
# Parent  80fc8882d7f9730a231ecba84f5fcf738fc94d27
blktap: ensure mmap() is called only once per region

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


diff -r 80fc8882d7f9 -r fe1adb19ffe1 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Jan 02 09:35:07 2012 +0100
+++ b/drivers/xen/blktap/blktap.c	Mon Jan 02 09:37:22 2012 +0100
@@ -635,6 +635,7 @@
 
 	info->ring_ok = 0;
 	smp_wmb();
+	info->rings_vstart = 0;
 
 	mm = xchg(&info->mm, NULL);
 	if (mm)
@@ -694,7 +695,13 @@
 		WPRINTK("blktap: mmap, retrieving idx failed\n");
 		return -ENOMEM;
 	}
-	
+
+	if (info->rings_vstart) {
+		WPRINTK("mmap already called on filp %p (minor %d)\n",
+			filp, info->minor);
+		return -EPERM;
+	}
+
 	vma->vm_flags |= VM_RESERVED;
 	vma->vm_ops = &blktap_vm_ops;
 
@@ -746,6 +753,7 @@
 	/* Clear any active mappings. */
 	zap_page_range(vma, vma->vm_start, 
 		       vma->vm_end - vma->vm_start, NULL);
+	info->rings_vstart = 0;
 
 	return -ENOMEM;
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 02 08:44:14 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Jan 2012 08:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RhdV1-00009a-Id; Mon, 02 Jan 2012 08:44:07 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdV0-00009V-BV
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1325493824!60843239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5570 invoked from network); 2 Jan 2012 08:43:45 -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;
	2 Jan 2012 08:43:45 -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 1RhdUx-0002gt-NY
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdUx-0003kZ-Dr
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Message-Id: <E1RhdUx-0003kZ-Dr@xenbits.xen.org>
Date: Mon, 02 Jan 2012 08:44: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] blktap: ensure mmap() is called
	only once per region
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325493442 -3600
# Node ID fe1adb19ffe1df656e2bdc0799d024b514159a7b
# Parent  80fc8882d7f9730a231ecba84f5fcf738fc94d27
blktap: ensure mmap() is called only once per region

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


diff -r 80fc8882d7f9 -r fe1adb19ffe1 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Jan 02 09:35:07 2012 +0100
+++ b/drivers/xen/blktap/blktap.c	Mon Jan 02 09:37:22 2012 +0100
@@ -635,6 +635,7 @@
 
 	info->ring_ok = 0;
 	smp_wmb();
+	info->rings_vstart = 0;
 
 	mm = xchg(&info->mm, NULL);
 	if (mm)
@@ -694,7 +695,13 @@
 		WPRINTK("blktap: mmap, retrieving idx failed\n");
 		return -ENOMEM;
 	}
-	
+
+	if (info->rings_vstart) {
+		WPRINTK("mmap already called on filp %p (minor %d)\n",
+			filp, info->minor);
+		return -EPERM;
+	}
+
 	vma->vm_flags |= VM_RESERVED;
 	vma->vm_ops = &blktap_vm_ops;
 
@@ -746,6 +753,7 @@
 	/* Clear any active mappings. */
 	zap_page_range(vma, vma->vm_start, 
 		       vma->vm_end - vma->vm_start, NULL);
+	info->rings_vstart = 0;
 
 	return -ENOMEM;
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 02 08:44:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Jan 2012 08:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RhdV6-00009q-LK; Mon, 02 Jan 2012 08:44:12 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdV5-00009U-2k
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1325493843!9274105!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18166 invoked from network); 2 Jan 2012 08:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Jan 2012 08:44: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 1RhdUx-0002gq-BO
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdUx-0003k6-0r
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Message-Id: <E1RhdUx-0003k6-0r@xenbits.xen.org>
Date: Mon, 02 Jan 2012 08:44: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] blktap: fix locking (again)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325493307 -3600
# Node ID 80fc8882d7f9730a231ecba84f5fcf738fc94d27
# Parent  a7851a465b41332cf7871cc41fe7a95580816ed9
blktap: fix locking (again)

c/s 1090 wasn't really helping much - I was doing that under the wrong
impression that the zap_pte() hook would be called with the mmap_sem
held. That being wrong, none of the uses of mmap_sem here actually are
write ones (they only look up vma information), so convert them all to
read acquires/releases.

A new spinlock needs to be introduced, protecting idx_map. This has to
nest inside mmap_sem, which requires some code movement.

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


diff -r a7851a465b41 -r 80fc8882d7f9 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Dec 19 10:08:20 2011 +0100
+++ b/drivers/xen/blktap/blktap.c	Mon Jan 02 09:35:07 2012 +0100
@@ -113,6 +113,7 @@
 	pid_t pid;                    /*tapdisk process id                   */
 	enum { RUNNING, CLEANSHUTDOWN } status; /*Detect a clean userspace 
 						  shutdown                   */
+	spinlock_t map_lock;          /*protects idx_map                     */
 	struct idx_map {
 		u16 mem, req;
 	} *idx_map;                   /*Record the user ring id to kern
@@ -295,7 +296,7 @@
 	pte_t copy;
 	tap_blkif_t *info = NULL;
 	unsigned int seg, usr_idx, pending_idx, mmap_idx, count = 0;
-	unsigned long offset, uvstart = 0;
+	unsigned long offset;
 	struct page *pg;
 	struct grant_handle_pair *khandle;
 	struct gnttab_unmap_grant_ref unmap[2];
@@ -304,25 +305,28 @@
 	 * If the address is before the start of the grant mapped region or
 	 * if vm_file is NULL (meaning mmap failed and we have nothing to do)
 	 */
-	if (vma->vm_file != NULL) {
+	if (vma->vm_file != NULL)
 		info = vma->vm_file->private_data;
-		uvstart = info->rings_vstart + (RING_PAGES << PAGE_SHIFT);
-	}
-	if (vma->vm_file == NULL || uvaddr < uvstart)
+	if (info == NULL || uvaddr < info->user_vstart)
 		return ptep_get_and_clear_full(vma->vm_mm, uvaddr, 
 					       ptep, is_fullmm);
 
-	/* TODO Should these be changed to if statements? */
-	BUG_ON(!info);
-	BUG_ON(!info->idx_map);
-
-	offset = (uvaddr - uvstart) >> PAGE_SHIFT;
+	offset = (uvaddr - info->user_vstart) >> PAGE_SHIFT;
 	usr_idx = OFFSET_TO_USR_IDX(offset);
 	seg = OFFSET_TO_SEG(offset);
 
+	spin_lock(&info->map_lock);
+
 	pending_idx = info->idx_map[usr_idx].req;
 	mmap_idx = info->idx_map[usr_idx].mem;
 
+	/* fast_flush_area() may already have cleared this entry */
+	if (mmap_idx == INVALID_MIDX) {
+		spin_unlock(&info->map_lock);
+		return ptep_get_and_clear_full(vma->vm_mm, uvaddr, ptep,
+					       is_fullmm);
+	}
+
 	pg = idx_to_page(mmap_idx, pending_idx, seg);
 	ClearPageReserved(pg);
 	info->foreign_map.map[offset + RING_PAGES] = NULL;
@@ -365,6 +369,8 @@
 			BUG();
 	}
 
+	spin_unlock(&info->map_lock);
+
 	return copy;
 }
 
@@ -489,6 +495,7 @@
 		}
 
 		info->minor = minor;
+		spin_lock_init(&info->map_lock);
 		/*
 		 * Make sure that we have a minor before others can
 		 * see us.
@@ -1029,25 +1036,30 @@
 			     unsigned int u_idx, tap_blkif_t *info)
 {
 	struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST*2];
-	unsigned int i, mmap_idx, invcount = 0, locked = 0;
+	unsigned int i, mmap_idx, invcount = 0;
 	struct grant_handle_pair *khandle;
 	uint64_t ptep;
 	int ret;
 	unsigned long uvaddr;
 	struct mm_struct *mm = info->mm;
 
+	if (mm != NULL)
+		down_read(&mm->mmap_sem);
+
 	if (mm != NULL && xen_feature(XENFEAT_auto_translated_physmap)) {
-		down_write(&mm->mmap_sem);
+ slow:
 		blktap_zap_page_range(mm,
 				      MMAP_VADDR(info->user_vstart, u_idx, 0),
 				      req->nr_pages);
 		info->idx_map[u_idx].mem = INVALID_MIDX;
-		up_write(&mm->mmap_sem);
+		up_read(&mm->mmap_sem);
 		return;
 	}
 
 	mmap_idx = req->mem_idx;
 
+	spin_lock(&info->map_lock);
+
 	for (i = 0; i < req->nr_pages; i++) {
 		uvaddr = MMAP_VADDR(info->user_vstart, u_idx, i);
 
@@ -1066,15 +1078,13 @@
 
 		if (mm != NULL && khandle->user != INVALID_GRANT_HANDLE) {
 			BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));
-			if (!locked++)
-				down_write(&mm->mmap_sem);
 			if (create_lookup_pte_addr(
 				mm,
 				MMAP_VADDR(info->user_vstart, u_idx, i),
 				&ptep) !=0) {
-				up_write(&mm->mmap_sem);
+				spin_unlock(&info->map_lock);
 				WPRINTK("Couldn't get a pte addr!\n");
-				return;
+				goto slow;
 			}
 
 			gnttab_set_unmap_op(&unmap[invcount], ptep,
@@ -1091,19 +1101,11 @@
 		GNTTABOP_unmap_grant_ref, unmap, invcount);
 	BUG_ON(ret);
 	
-	if (mm != NULL && !xen_feature(XENFEAT_auto_translated_physmap)) {
-		if (!locked++)
-			down_write(&mm->mmap_sem);
-		blktap_zap_page_range(mm, 
-				      MMAP_VADDR(info->user_vstart, u_idx, 0), 
-				      req->nr_pages);
-	}
+	info->idx_map[u_idx].mem = INVALID_MIDX;
 
-	if (!locked && mm != NULL)
-		down_write(&mm->mmap_sem);
-	info->idx_map[u_idx].mem = INVALID_MIDX;
+	spin_unlock(&info->map_lock);
 	if (mm != NULL)
-		up_write(&mm->mmap_sem);
+		up_read(&mm->mmap_sem);
 }
 
 /******************************************************************
@@ -1406,7 +1408,9 @@
 		goto fail_response;
 
 	/* Check we have space on user ring - should never fail. */
+	spin_lock(&info->map_lock);
 	usr_idx = GET_NEXT_REQ(info->idx_map);
+	spin_unlock(&info->map_lock);
 	if (usr_idx >= MAX_PENDING_REQS) {
 		WARN_ON(1);
 		goto fail_response;
@@ -1445,7 +1449,7 @@
 	op = 0;
 	mm = info->mm;
 	if (!xen_feature(XENFEAT_auto_translated_physmap))
-		down_write(&mm->mmap_sem);
+		down_read(&mm->mmap_sem);
 	for (i = 0; i < nseg; i++) {
 		unsigned long uvaddr;
 		unsigned long kvaddr;
@@ -1462,9 +1466,9 @@
 			/* Now map it to user. */
 			ret = create_lookup_pte_addr(mm, uvaddr, &ptep);
 			if (ret) {
-				up_write(&mm->mmap_sem);
+				up_read(&mm->mmap_sem);
 				WPRINTK("Couldn't get a pte addr!\n");
-				goto fail_flush;
+				goto fail_response;
 			}
 
 			gnttab_set_map_op(&map[op], ptep,
@@ -1478,12 +1482,15 @@
 			     req->seg[i].first_sect + 1);
 	}
 
+	if (xen_feature(XENFEAT_auto_translated_physmap))
+		down_read(&mm->mmap_sem);
+
+	spin_lock(&info->map_lock);
+
 	ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map, op);
 	BUG_ON(ret);
 
 	if (!xen_feature(XENFEAT_auto_translated_physmap)) {
-		up_write(&mm->mmap_sem);
-
 		for (i = 0; i < (nseg*2); i+=2) {
 			unsigned long uvaddr;
 			unsigned long offset;
@@ -1548,18 +1555,18 @@
 		}
 	}
 
+	/*record [mmap_idx,pending_idx] to [usr_idx] mapping*/
+	info->idx_map[usr_idx].mem = mmap_idx;
+	info->idx_map[usr_idx].req = pending_idx;
+
+	spin_unlock(&info->map_lock);
+
 	if (ret)
 		goto fail_flush;
 
-	if (xen_feature(XENFEAT_auto_translated_physmap))
-		down_write(&mm->mmap_sem);
-	/* Mark mapped pages as reserved: */
-	for (i = 0; i < req->nr_segments; i++) {
-		struct page *pg;
-
-		pg = idx_to_page(mmap_idx, pending_idx, i);
-		SetPageReserved(pg);
-		if (xen_feature(XENFEAT_auto_translated_physmap)) {
+	if (xen_feature(XENFEAT_auto_translated_physmap)) {
+		for (i = 0; i < nseg; i++) {
+			struct page *pg = idx_to_page(mmap_idx, pending_idx, i);
 			unsigned long uvaddr = MMAP_VADDR(info->user_vstart,
 							  usr_idx, i);
 			if (vma && uvaddr >= vma->vm_end) {
@@ -1577,18 +1584,12 @@
 					continue;
 			}
 			ret = vm_insert_page(vma, uvaddr, pg);
-			if (ret) {
-				up_write(&mm->mmap_sem);
+			if (ret)
 				goto fail_flush;
-			}
 		}
 	}
-	if (xen_feature(XENFEAT_auto_translated_physmap))
-		up_write(&mm->mmap_sem);
 	
-	/*record [mmap_idx,pending_idx] to [usr_idx] mapping*/
-	info->idx_map[usr_idx].mem = mmap_idx;
-	info->idx_map[usr_idx].req = pending_idx;
+	up_read(&mm->mmap_sem);
 
 	blkif_get(blkif);
 	/* Finally, write the request message to the user ring. */
@@ -1611,6 +1612,7 @@
 	return;
 
  fail_flush:
+	up_read(&mm->mmap_sem);
 	WPRINTK("Reached Fail_flush\n");
 	fast_flush_area(pending_req, pending_idx, usr_idx, info);
  fail_response:

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 02 08:44:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Jan 2012 08:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RhdV6-00009q-LK; Mon, 02 Jan 2012 08:44:12 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdV5-00009U-2k
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1325493843!9274105!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18166 invoked from network); 2 Jan 2012 08:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Jan 2012 08:44: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 1RhdUx-0002gq-BO
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhdUx-0003k6-0r
	for xen-changelog@lists.xensource.com; Mon, 02 Jan 2012 08:44:03 +0000
Message-Id: <E1RhdUx-0003k6-0r@xenbits.xen.org>
Date: Mon, 02 Jan 2012 08:44: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] blktap: fix locking (again)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325493307 -3600
# Node ID 80fc8882d7f9730a231ecba84f5fcf738fc94d27
# Parent  a7851a465b41332cf7871cc41fe7a95580816ed9
blktap: fix locking (again)

c/s 1090 wasn't really helping much - I was doing that under the wrong
impression that the zap_pte() hook would be called with the mmap_sem
held. That being wrong, none of the uses of mmap_sem here actually are
write ones (they only look up vma information), so convert them all to
read acquires/releases.

A new spinlock needs to be introduced, protecting idx_map. This has to
nest inside mmap_sem, which requires some code movement.

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


diff -r a7851a465b41 -r 80fc8882d7f9 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Dec 19 10:08:20 2011 +0100
+++ b/drivers/xen/blktap/blktap.c	Mon Jan 02 09:35:07 2012 +0100
@@ -113,6 +113,7 @@
 	pid_t pid;                    /*tapdisk process id                   */
 	enum { RUNNING, CLEANSHUTDOWN } status; /*Detect a clean userspace 
 						  shutdown                   */
+	spinlock_t map_lock;          /*protects idx_map                     */
 	struct idx_map {
 		u16 mem, req;
 	} *idx_map;                   /*Record the user ring id to kern
@@ -295,7 +296,7 @@
 	pte_t copy;
 	tap_blkif_t *info = NULL;
 	unsigned int seg, usr_idx, pending_idx, mmap_idx, count = 0;
-	unsigned long offset, uvstart = 0;
+	unsigned long offset;
 	struct page *pg;
 	struct grant_handle_pair *khandle;
 	struct gnttab_unmap_grant_ref unmap[2];
@@ -304,25 +305,28 @@
 	 * If the address is before the start of the grant mapped region or
 	 * if vm_file is NULL (meaning mmap failed and we have nothing to do)
 	 */
-	if (vma->vm_file != NULL) {
+	if (vma->vm_file != NULL)
 		info = vma->vm_file->private_data;
-		uvstart = info->rings_vstart + (RING_PAGES << PAGE_SHIFT);
-	}
-	if (vma->vm_file == NULL || uvaddr < uvstart)
+	if (info == NULL || uvaddr < info->user_vstart)
 		return ptep_get_and_clear_full(vma->vm_mm, uvaddr, 
 					       ptep, is_fullmm);
 
-	/* TODO Should these be changed to if statements? */
-	BUG_ON(!info);
-	BUG_ON(!info->idx_map);
-
-	offset = (uvaddr - uvstart) >> PAGE_SHIFT;
+	offset = (uvaddr - info->user_vstart) >> PAGE_SHIFT;
 	usr_idx = OFFSET_TO_USR_IDX(offset);
 	seg = OFFSET_TO_SEG(offset);
 
+	spin_lock(&info->map_lock);
+
 	pending_idx = info->idx_map[usr_idx].req;
 	mmap_idx = info->idx_map[usr_idx].mem;
 
+	/* fast_flush_area() may already have cleared this entry */
+	if (mmap_idx == INVALID_MIDX) {
+		spin_unlock(&info->map_lock);
+		return ptep_get_and_clear_full(vma->vm_mm, uvaddr, ptep,
+					       is_fullmm);
+	}
+
 	pg = idx_to_page(mmap_idx, pending_idx, seg);
 	ClearPageReserved(pg);
 	info->foreign_map.map[offset + RING_PAGES] = NULL;
@@ -365,6 +369,8 @@
 			BUG();
 	}
 
+	spin_unlock(&info->map_lock);
+
 	return copy;
 }
 
@@ -489,6 +495,7 @@
 		}
 
 		info->minor = minor;
+		spin_lock_init(&info->map_lock);
 		/*
 		 * Make sure that we have a minor before others can
 		 * see us.
@@ -1029,25 +1036,30 @@
 			     unsigned int u_idx, tap_blkif_t *info)
 {
 	struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST*2];
-	unsigned int i, mmap_idx, invcount = 0, locked = 0;
+	unsigned int i, mmap_idx, invcount = 0;
 	struct grant_handle_pair *khandle;
 	uint64_t ptep;
 	int ret;
 	unsigned long uvaddr;
 	struct mm_struct *mm = info->mm;
 
+	if (mm != NULL)
+		down_read(&mm->mmap_sem);
+
 	if (mm != NULL && xen_feature(XENFEAT_auto_translated_physmap)) {
-		down_write(&mm->mmap_sem);
+ slow:
 		blktap_zap_page_range(mm,
 				      MMAP_VADDR(info->user_vstart, u_idx, 0),
 				      req->nr_pages);
 		info->idx_map[u_idx].mem = INVALID_MIDX;
-		up_write(&mm->mmap_sem);
+		up_read(&mm->mmap_sem);
 		return;
 	}
 
 	mmap_idx = req->mem_idx;
 
+	spin_lock(&info->map_lock);
+
 	for (i = 0; i < req->nr_pages; i++) {
 		uvaddr = MMAP_VADDR(info->user_vstart, u_idx, i);
 
@@ -1066,15 +1078,13 @@
 
 		if (mm != NULL && khandle->user != INVALID_GRANT_HANDLE) {
 			BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));
-			if (!locked++)
-				down_write(&mm->mmap_sem);
 			if (create_lookup_pte_addr(
 				mm,
 				MMAP_VADDR(info->user_vstart, u_idx, i),
 				&ptep) !=0) {
-				up_write(&mm->mmap_sem);
+				spin_unlock(&info->map_lock);
 				WPRINTK("Couldn't get a pte addr!\n");
-				return;
+				goto slow;
 			}
 
 			gnttab_set_unmap_op(&unmap[invcount], ptep,
@@ -1091,19 +1101,11 @@
 		GNTTABOP_unmap_grant_ref, unmap, invcount);
 	BUG_ON(ret);
 	
-	if (mm != NULL && !xen_feature(XENFEAT_auto_translated_physmap)) {
-		if (!locked++)
-			down_write(&mm->mmap_sem);
-		blktap_zap_page_range(mm, 
-				      MMAP_VADDR(info->user_vstart, u_idx, 0), 
-				      req->nr_pages);
-	}
+	info->idx_map[u_idx].mem = INVALID_MIDX;
 
-	if (!locked && mm != NULL)
-		down_write(&mm->mmap_sem);
-	info->idx_map[u_idx].mem = INVALID_MIDX;
+	spin_unlock(&info->map_lock);
 	if (mm != NULL)
-		up_write(&mm->mmap_sem);
+		up_read(&mm->mmap_sem);
 }
 
 /******************************************************************
@@ -1406,7 +1408,9 @@
 		goto fail_response;
 
 	/* Check we have space on user ring - should never fail. */
+	spin_lock(&info->map_lock);
 	usr_idx = GET_NEXT_REQ(info->idx_map);
+	spin_unlock(&info->map_lock);
 	if (usr_idx >= MAX_PENDING_REQS) {
 		WARN_ON(1);
 		goto fail_response;
@@ -1445,7 +1449,7 @@
 	op = 0;
 	mm = info->mm;
 	if (!xen_feature(XENFEAT_auto_translated_physmap))
-		down_write(&mm->mmap_sem);
+		down_read(&mm->mmap_sem);
 	for (i = 0; i < nseg; i++) {
 		unsigned long uvaddr;
 		unsigned long kvaddr;
@@ -1462,9 +1466,9 @@
 			/* Now map it to user. */
 			ret = create_lookup_pte_addr(mm, uvaddr, &ptep);
 			if (ret) {
-				up_write(&mm->mmap_sem);
+				up_read(&mm->mmap_sem);
 				WPRINTK("Couldn't get a pte addr!\n");
-				goto fail_flush;
+				goto fail_response;
 			}
 
 			gnttab_set_map_op(&map[op], ptep,
@@ -1478,12 +1482,15 @@
 			     req->seg[i].first_sect + 1);
 	}
 
+	if (xen_feature(XENFEAT_auto_translated_physmap))
+		down_read(&mm->mmap_sem);
+
+	spin_lock(&info->map_lock);
+
 	ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map, op);
 	BUG_ON(ret);
 
 	if (!xen_feature(XENFEAT_auto_translated_physmap)) {
-		up_write(&mm->mmap_sem);
-
 		for (i = 0; i < (nseg*2); i+=2) {
 			unsigned long uvaddr;
 			unsigned long offset;
@@ -1548,18 +1555,18 @@
 		}
 	}
 
+	/*record [mmap_idx,pending_idx] to [usr_idx] mapping*/
+	info->idx_map[usr_idx].mem = mmap_idx;
+	info->idx_map[usr_idx].req = pending_idx;
+
+	spin_unlock(&info->map_lock);
+
 	if (ret)
 		goto fail_flush;
 
-	if (xen_feature(XENFEAT_auto_translated_physmap))
-		down_write(&mm->mmap_sem);
-	/* Mark mapped pages as reserved: */
-	for (i = 0; i < req->nr_segments; i++) {
-		struct page *pg;
-
-		pg = idx_to_page(mmap_idx, pending_idx, i);
-		SetPageReserved(pg);
-		if (xen_feature(XENFEAT_auto_translated_physmap)) {
+	if (xen_feature(XENFEAT_auto_translated_physmap)) {
+		for (i = 0; i < nseg; i++) {
+			struct page *pg = idx_to_page(mmap_idx, pending_idx, i);
 			unsigned long uvaddr = MMAP_VADDR(info->user_vstart,
 							  usr_idx, i);
 			if (vma && uvaddr >= vma->vm_end) {
@@ -1577,18 +1584,12 @@
 					continue;
 			}
 			ret = vm_insert_page(vma, uvaddr, pg);
-			if (ret) {
-				up_write(&mm->mmap_sem);
+			if (ret)
 				goto fail_flush;
-			}
 		}
 	}
-	if (xen_feature(XENFEAT_auto_translated_physmap))
-		up_write(&mm->mmap_sem);
 	
-	/*record [mmap_idx,pending_idx] to [usr_idx] mapping*/
-	info->idx_map[usr_idx].mem = mmap_idx;
-	info->idx_map[usr_idx].req = pending_idx;
+	up_read(&mm->mmap_sem);
 
 	blkif_get(blkif);
 	/* Finally, write the request message to the user ring. */
@@ -1611,6 +1612,7 @@
 	return;
 
  fail_flush:
+	up_read(&mm->mmap_sem);
 	WPRINTK("Reached Fail_flush\n");
 	fast_flush_area(pending_req, pending_idx, usr_idx, info);
  fail_response:

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 01:11:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 01:11: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.xensource.com>)
	id 1RhsuM-0007HC-I0; Tue, 03 Jan 2012 01:11:18 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuK-0007Go-OY
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1325553069!2746263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17785 invoked from network); 3 Jan 2012 01:11:10 -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 Jan 2012 01:11:10 -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 1RhsuD-000607-4y
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuC-0007nt-QL
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Message-Id: <E1RhsuC-0007nt-QL@xenbits.xen.org>
Date: Tue, 03 Jan 2012 01:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/tboot: fix some coding style
	issues in tboot.c
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gang Wei <gang.wei@intel.com>
# Date 1325508187 0
# Node ID 50117a4d1a2c715b3da8b196c6e02b16d7a546d7
# Parent  fb1bd2a4ccab4886614d6f85f1b70d0d2e8d9af3
x86/tboot: fix some coding style issues in tboot.c

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by:  Joseph Cihula <joseph.cihula@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r fb1bd2a4ccab -r 50117a4d1a2c xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Mon Jan 02 12:42:15 2012 +0000
+++ b/xen/arch/x86/tboot.c	Mon Jan 02 12:43:07 2012 +0000
@@ -110,7 +110,8 @@
 
     /* new tboot_shared (w/ GAS support, integrity, etc.) is not backwards
        compatible */
-    if ( tboot_shared->version < 4 ) {
+    if ( tboot_shared->version < 4 )
+    {
         printk("unsupported version of tboot (%u)\n", tboot_shared->version);
         return;
     }
@@ -188,8 +189,10 @@
 
         if ( !mfn_valid(mfn) )
             continue;
-        if ( is_page_in_use(page) && !is_xen_heap_page(page) ) {
-            if ( page->count_info & PGC_page_table ) {
+        if ( is_page_in_use(page) && !is_xen_heap_page(page) )
+        {
+            if ( page->count_info & PGC_page_table )
+            {
                 void *pg = map_domain_page(mfn);
                 vmac_update(pg, PAGE_SIZE, ctx);
                 unmap_domain_page(pg);
@@ -283,7 +286,8 @@
                               + 3 * PAGE_SIZE)) )
             continue; /* skip tboot and its page tables */
 
-        if ( is_page_in_use(page) && is_xen_heap_page(page) ) {
+        if ( is_page_in_use(page) && is_xen_heap_page(page) )
+        {
             void *pg;
 
             if ( mfn_in_guarded_stack(mfn) )
@@ -344,14 +348,16 @@
 
     err = map_pages_to_xen(map_base << PAGE_SHIFT, map_base, map_size,
                            __PAGE_HYPERVISOR);
-    if ( err != 0 ) {
+    if ( err != 0 )
+    {
         printk("error (0x%x) mapping tboot pages (mfns) @ 0x%x, 0x%x\n", err,
                map_base, map_size);
         return;
     }
 
     /* if this is S3 then set regions to MAC */
-    if ( shutdown_type == TB_SHUTDOWN_S3 ) {
+    if ( shutdown_type == TB_SHUTDOWN_S3 )
+    {
         /*
          * Xen regions for tboot to MAC
          */
@@ -400,26 +406,25 @@
     /* TXT Heap */
     if ( txt_heap_base == 0 )
         return 0;
-    rc = e820_change_range_type(
-        &e820, txt_heap_base, txt_heap_base + txt_heap_size,
-        E820_RESERVED, E820_UNUSABLE);
+    rc = e820_change_range_type(&e820, txt_heap_base,
+                                txt_heap_base + txt_heap_size,
+                                E820_RESERVED, E820_UNUSABLE);
     if ( !rc )
         return 0;
 
     /* SINIT */
     if ( sinit_base == 0 )
         return 0;
-    rc = e820_change_range_type(
-        &e820, sinit_base, sinit_base + sinit_size,
-        E820_RESERVED, E820_UNUSABLE);
+    rc = e820_change_range_type(&e820, sinit_base,
+                                sinit_base + sinit_size,
+                                E820_RESERVED, E820_UNUSABLE);
     if ( !rc )
         return 0;
 
     /* TXT Private Space */
-    rc = e820_change_range_type(
-        &e820, TXT_PRIV_CONFIG_REGS_BASE,
-        TXT_PRIV_CONFIG_REGS_BASE + NR_TXT_CONFIG_PAGES * PAGE_SIZE,
-        E820_RESERVED, E820_UNUSABLE);
+    rc = e820_change_range_type(&e820, TXT_PRIV_CONFIG_REGS_BASE,
+                 TXT_PRIV_CONFIG_REGS_BASE + NR_TXT_CONFIG_PAGES * PAGE_SIZE,
+                 E820_RESERVED, E820_UNUSABLE);
     if ( !rc )
         return 0;
 
@@ -436,7 +441,6 @@
     sinit_mle_data_t sinit_mle_data;
     unsigned char *dmar_table_raw;
 
-
     if ( !tboot_in_measured_env() )
         return acpi_table_parse(ACPI_SIG_DMAR, dmar_handler);
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 01:11:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 01:11: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.xensource.com>)
	id 1RhsuM-0007HC-I0; Tue, 03 Jan 2012 01:11:18 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuK-0007Go-OY
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1325553069!2746263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17785 invoked from network); 3 Jan 2012 01:11:10 -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 Jan 2012 01:11:10 -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 1RhsuD-000607-4y
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuC-0007nt-QL
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Message-Id: <E1RhsuC-0007nt-QL@xenbits.xen.org>
Date: Tue, 03 Jan 2012 01:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/tboot: fix some coding style
	issues in tboot.c
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gang Wei <gang.wei@intel.com>
# Date 1325508187 0
# Node ID 50117a4d1a2c715b3da8b196c6e02b16d7a546d7
# Parent  fb1bd2a4ccab4886614d6f85f1b70d0d2e8d9af3
x86/tboot: fix some coding style issues in tboot.c

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by:  Joseph Cihula <joseph.cihula@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r fb1bd2a4ccab -r 50117a4d1a2c xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Mon Jan 02 12:42:15 2012 +0000
+++ b/xen/arch/x86/tboot.c	Mon Jan 02 12:43:07 2012 +0000
@@ -110,7 +110,8 @@
 
     /* new tboot_shared (w/ GAS support, integrity, etc.) is not backwards
        compatible */
-    if ( tboot_shared->version < 4 ) {
+    if ( tboot_shared->version < 4 )
+    {
         printk("unsupported version of tboot (%u)\n", tboot_shared->version);
         return;
     }
@@ -188,8 +189,10 @@
 
         if ( !mfn_valid(mfn) )
             continue;
-        if ( is_page_in_use(page) && !is_xen_heap_page(page) ) {
-            if ( page->count_info & PGC_page_table ) {
+        if ( is_page_in_use(page) && !is_xen_heap_page(page) )
+        {
+            if ( page->count_info & PGC_page_table )
+            {
                 void *pg = map_domain_page(mfn);
                 vmac_update(pg, PAGE_SIZE, ctx);
                 unmap_domain_page(pg);
@@ -283,7 +286,8 @@
                               + 3 * PAGE_SIZE)) )
             continue; /* skip tboot and its page tables */
 
-        if ( is_page_in_use(page) && is_xen_heap_page(page) ) {
+        if ( is_page_in_use(page) && is_xen_heap_page(page) )
+        {
             void *pg;
 
             if ( mfn_in_guarded_stack(mfn) )
@@ -344,14 +348,16 @@
 
     err = map_pages_to_xen(map_base << PAGE_SHIFT, map_base, map_size,
                            __PAGE_HYPERVISOR);
-    if ( err != 0 ) {
+    if ( err != 0 )
+    {
         printk("error (0x%x) mapping tboot pages (mfns) @ 0x%x, 0x%x\n", err,
                map_base, map_size);
         return;
     }
 
     /* if this is S3 then set regions to MAC */
-    if ( shutdown_type == TB_SHUTDOWN_S3 ) {
+    if ( shutdown_type == TB_SHUTDOWN_S3 )
+    {
         /*
          * Xen regions for tboot to MAC
          */
@@ -400,26 +406,25 @@
     /* TXT Heap */
     if ( txt_heap_base == 0 )
         return 0;
-    rc = e820_change_range_type(
-        &e820, txt_heap_base, txt_heap_base + txt_heap_size,
-        E820_RESERVED, E820_UNUSABLE);
+    rc = e820_change_range_type(&e820, txt_heap_base,
+                                txt_heap_base + txt_heap_size,
+                                E820_RESERVED, E820_UNUSABLE);
     if ( !rc )
         return 0;
 
     /* SINIT */
     if ( sinit_base == 0 )
         return 0;
-    rc = e820_change_range_type(
-        &e820, sinit_base, sinit_base + sinit_size,
-        E820_RESERVED, E820_UNUSABLE);
+    rc = e820_change_range_type(&e820, sinit_base,
+                                sinit_base + sinit_size,
+                                E820_RESERVED, E820_UNUSABLE);
     if ( !rc )
         return 0;
 
     /* TXT Private Space */
-    rc = e820_change_range_type(
-        &e820, TXT_PRIV_CONFIG_REGS_BASE,
-        TXT_PRIV_CONFIG_REGS_BASE + NR_TXT_CONFIG_PAGES * PAGE_SIZE,
-        E820_RESERVED, E820_UNUSABLE);
+    rc = e820_change_range_type(&e820, TXT_PRIV_CONFIG_REGS_BASE,
+                 TXT_PRIV_CONFIG_REGS_BASE + NR_TXT_CONFIG_PAGES * PAGE_SIZE,
+                 E820_RESERVED, E820_UNUSABLE);
     if ( !rc )
         return 0;
 
@@ -436,7 +441,6 @@
     sinit_mle_data_t sinit_mle_data;
     unsigned char *dmar_table_raw;
 
-
     if ( !tboot_in_measured_env() )
         return acpi_table_parse(ACPI_SIG_DMAR, dmar_handler);
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 01:11:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 01:11: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.xensource.com>)
	id 1RhsuL-0007H1-FH; Tue, 03 Jan 2012 01:11:17 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuK-0007Gn-35
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1325553068!9477231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4681 invoked from network); 3 Jan 2012 01:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jan 2012 01:11:09 -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 1RhsuC-000601-9Q
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuB-0007mq-O0
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:07 +0000
Message-Id: <E1RhsuB-0007mq-O0@xenbits.xen.org>
Date: Tue, 03 Jan 2012 01:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/passthrough: don't leak guest
	IRQs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325492779 -3600
# Node ID 3a22ed3ec534799b3cab55b0dc0a7380e701ecbe
# Parent  a7b2610b8e5c9a15b1f5de9a3eabf7f19d0b4199
x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---


diff -r a7b2610b8e5c -r 3a22ed3ec534 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Dec 29 10:07:54 2011 +0000
+++ b/xen/arch/x86/physdev.c	Mon Jan 02 09:26:19 2012 +0100
@@ -219,7 +219,8 @@
     if ( is_hvm_domain(d) )
     {
         spin_lock(&d->event_lock);
-        ret = unmap_domain_pirq_emuirq(d, pirq);
+        if ( domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND )
+            ret = unmap_domain_pirq_emuirq(d, pirq);
         spin_unlock(&d->event_lock);
         if ( domid == DOMID_SELF || ret )
             goto free_domain;

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 01:11:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 01:11: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.xensource.com>)
	id 1RhsuL-0007H1-FH; Tue, 03 Jan 2012 01:11:17 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuK-0007Gn-35
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1325553068!9477231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4681 invoked from network); 3 Jan 2012 01:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jan 2012 01:11:09 -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 1RhsuC-000601-9Q
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuB-0007mq-O0
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:07 +0000
Message-Id: <E1RhsuB-0007mq-O0@xenbits.xen.org>
Date: Tue, 03 Jan 2012 01:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/passthrough: don't leak guest
	IRQs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325492779 -3600
# Node ID 3a22ed3ec534799b3cab55b0dc0a7380e701ecbe
# Parent  a7b2610b8e5c9a15b1f5de9a3eabf7f19d0b4199
x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---


diff -r a7b2610b8e5c -r 3a22ed3ec534 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Dec 29 10:07:54 2011 +0000
+++ b/xen/arch/x86/physdev.c	Mon Jan 02 09:26:19 2012 +0100
@@ -219,7 +219,8 @@
     if ( is_hvm_domain(d) )
     {
         spin_lock(&d->event_lock);
-        ret = unmap_domain_pirq_emuirq(d, pirq);
+        if ( domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND )
+            ret = unmap_domain_pirq_emuirq(d, pirq);
         spin_unlock(&d->event_lock);
         if ( domid == DOMID_SELF || ret )
             goto free_domain;

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 01:11:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 01:11: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.xensource.com>)
	id 1RhsuM-0007HH-KT; Tue, 03 Jan 2012 01:11:18 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuL-0007Gp-6q
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1325553068!7412399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1602 invoked from network); 3 Jan 2012 01:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jan 2012 01:11:09 -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 1RhsuC-000603-FU
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuC-0007nN-9o
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Message-Id: <E1RhsuC-0007nN-9o@xenbits.xen.org>
Date: Tue, 03 Jan 2012 01:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update the maitainer list for
	Intel(R) TXT
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gang Wei <gang.wei@intel.com>
# Date 1325508135 0
# Node ID fb1bd2a4ccab4886614d6f85f1b70d0d2e8d9af3
# Parent  3a22ed3ec534799b3cab55b0dc0a7380e701ecbe
Update the maitainer list for Intel(R) TXT

Signed-off-by: Gang Wei <gang.wei@intel.com>
---


diff -r 3a22ed3ec534 -r fb1bd2a4ccab MAINTAINERS
--- a/MAINTAINERS	Mon Jan 02 09:26:19 2012 +0100
+++ b/MAINTAINERS	Mon Jan 02 12:42:15 2012 +0000
@@ -131,6 +131,7 @@
 
 INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
 M:	Joseph Cihula <joseph.cihula@intel.com>
+M:	Gang Wei <gang.wei@intel.com>
 M:	Shane Wang <shane.wang@intel.com>
 S:	Supported
 F:	xen/arch/x86/tboot.c

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 01:11:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 01:11: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.xensource.com>)
	id 1RhsuM-0007HH-KT; Tue, 03 Jan 2012 01:11:18 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuL-0007Gp-6q
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1325553068!7412399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1602 invoked from network); 3 Jan 2012 01:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jan 2012 01:11:09 -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 1RhsuC-000603-FU
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RhsuC-0007nN-9o
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 01:11:08 +0000
Message-Id: <E1RhsuC-0007nN-9o@xenbits.xen.org>
Date: Tue, 03 Jan 2012 01:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update the maitainer list for
	Intel(R) TXT
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Gang Wei <gang.wei@intel.com>
# Date 1325508135 0
# Node ID fb1bd2a4ccab4886614d6f85f1b70d0d2e8d9af3
# Parent  3a22ed3ec534799b3cab55b0dc0a7380e701ecbe
Update the maitainer list for Intel(R) TXT

Signed-off-by: Gang Wei <gang.wei@intel.com>
---


diff -r 3a22ed3ec534 -r fb1bd2a4ccab MAINTAINERS
--- a/MAINTAINERS	Mon Jan 02 09:26:19 2012 +0100
+++ b/MAINTAINERS	Mon Jan 02 12:42:15 2012 +0000
@@ -131,6 +131,7 @@
 
 INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
 M:	Joseph Cihula <joseph.cihula@intel.com>
+M:	Gang Wei <gang.wei@intel.com>
 M:	Shane Wang <shane.wang@intel.com>
 S:	Supported
 F:	xen/arch/x86/tboot.c

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 07:44:12 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 07:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rhz2W-00076d-3X; Tue, 03 Jan 2012 07:44:08 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2U-00076S-KU
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1325576611!46878533!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29769 invoked from network); 3 Jan 2012 07:43:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jan 2012 07:43:32 -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 1Rhz2S-0002NW-2D
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2R-0007Ap-Sf
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:03 +0000
Message-Id: <E1Rhz2R-0007Ap-Sf@xenbits.xen.org>
Date: Tue, 03 Jan 2012 07:44: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] blktap: clean up some log
	messages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325575901 -3600
# Node ID 831d4ef1e575f2fe640842066effb30e78367e9f
# Parent  fe1adb19ffe1df656e2bdc0799d024b514159a7b
blktap: clean up some log messages

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


diff -r fe1adb19ffe1 -r 831d4ef1e575 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Jan 02 09:37:22 2012 +0100
+++ b/drivers/xen/blktap/blktap.c	Tue Jan 03 08:31:41 2012 +0100
@@ -692,7 +692,7 @@
 	int ret;
 
 	if (info == NULL) {
-		WPRINTK("blktap: mmap, retrieving idx failed\n");
+		WPRINTK("mmap: no private data?\n");
 		return -ENOMEM;
 	}
 
@@ -776,8 +776,7 @@
 			if (BLKTAP_MODE_VALID(arg)) {
 				info->mode = arg;
 				/* XXX: may need to flush rings here. */
-				DPRINTK("blktap: set mode to %lx\n", 
-				       arg);
+				DPRINTK("set mode to %lx\n", arg);
 				return 0;
 			}
 		}
@@ -800,8 +799,7 @@
 	{
 		if (info) {
 			info->pid = (pid_t)arg;
-			DPRINTK("blktap: pid received %d\n", 
-			       info->pid);
+			DPRINTK("pid received %d\n", info->pid);
 		}
 		return 0;
 	}
@@ -942,8 +940,7 @@
 	if (!pending_reqs[mmap_alloc] || !foreign_pages[mmap_alloc])
 		goto out_of_memory;
 
-	DPRINTK("%s: reqs=%lu, pages=%d\n",
-		__FUNCTION__, MAX_PENDING_REQS, mmap_pages);
+	DPRINTK("reqs=%lu, pages=%d\n", MAX_PENDING_REQS, mmap_pages);
 
 	for (i = 0; i < MAX_PENDING_REQS; i++) {
 		list_add_tail(&pending_reqs[mmap_alloc][i].free_list, 
@@ -1434,13 +1431,13 @@
 	
 	/* Make sure userspace is ready. */
 	if (!info->ring_ok) {
-		WPRINTK("blktap: ring not ready for requests!\n");
+		WPRINTK("ring not ready for requests!\n");
 		goto fail_response;
 	}
 	smp_rmb();
 
 	if (RING_FULL(&info->ufe_ring)) {
-		WPRINTK("blktap: fe_ring is full, can't add "
+		WPRINTK("fe_ring is full, "
 			"IO Request will be dropped. %d %d\n",
 			RING_SIZE(&info->ufe_ring),
 			RING_SIZE(&blkif->blk_rings.common));
@@ -1515,7 +1512,7 @@
 			}
 
 			if (unlikely(map[i+1].status != GNTST_okay)) {
-				WPRINTK("invalid kernel buffer -- could not remap it\n");
+				WPRINTK("invalid user buffer -- could not remap it\n");
 				ret = 1;
 				map[i+1].handle = INVALID_GRANT_HANDLE;
 			}
@@ -1743,7 +1740,7 @@
 				    "blktap0");
 	} else {
 		/* this is bad, but not fatal */
-		WPRINTK("blktap: sysfs xen_class not created\n");
+		WPRINTK("sysfs xen_class not created\n");
 	}
 
 	DPRINTK("Blktap device successfully created\n");

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 07:44:12 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 07:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rhz2W-00076d-3X; Tue, 03 Jan 2012 07:44:08 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2U-00076S-KU
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1325576611!46878533!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29769 invoked from network); 3 Jan 2012 07:43:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Jan 2012 07:43:32 -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 1Rhz2S-0002NW-2D
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2R-0007Ap-Sf
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:03 +0000
Message-Id: <E1Rhz2R-0007Ap-Sf@xenbits.xen.org>
Date: Tue, 03 Jan 2012 07:44: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] blktap: clean up some log
	messages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325575901 -3600
# Node ID 831d4ef1e575f2fe640842066effb30e78367e9f
# Parent  fe1adb19ffe1df656e2bdc0799d024b514159a7b
blktap: clean up some log messages

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


diff -r fe1adb19ffe1 -r 831d4ef1e575 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Jan 02 09:37:22 2012 +0100
+++ b/drivers/xen/blktap/blktap.c	Tue Jan 03 08:31:41 2012 +0100
@@ -692,7 +692,7 @@
 	int ret;
 
 	if (info == NULL) {
-		WPRINTK("blktap: mmap, retrieving idx failed\n");
+		WPRINTK("mmap: no private data?\n");
 		return -ENOMEM;
 	}
 
@@ -776,8 +776,7 @@
 			if (BLKTAP_MODE_VALID(arg)) {
 				info->mode = arg;
 				/* XXX: may need to flush rings here. */
-				DPRINTK("blktap: set mode to %lx\n", 
-				       arg);
+				DPRINTK("set mode to %lx\n", arg);
 				return 0;
 			}
 		}
@@ -800,8 +799,7 @@
 	{
 		if (info) {
 			info->pid = (pid_t)arg;
-			DPRINTK("blktap: pid received %d\n", 
-			       info->pid);
+			DPRINTK("pid received %d\n", info->pid);
 		}
 		return 0;
 	}
@@ -942,8 +940,7 @@
 	if (!pending_reqs[mmap_alloc] || !foreign_pages[mmap_alloc])
 		goto out_of_memory;
 
-	DPRINTK("%s: reqs=%lu, pages=%d\n",
-		__FUNCTION__, MAX_PENDING_REQS, mmap_pages);
+	DPRINTK("reqs=%lu, pages=%d\n", MAX_PENDING_REQS, mmap_pages);
 
 	for (i = 0; i < MAX_PENDING_REQS; i++) {
 		list_add_tail(&pending_reqs[mmap_alloc][i].free_list, 
@@ -1434,13 +1431,13 @@
 	
 	/* Make sure userspace is ready. */
 	if (!info->ring_ok) {
-		WPRINTK("blktap: ring not ready for requests!\n");
+		WPRINTK("ring not ready for requests!\n");
 		goto fail_response;
 	}
 	smp_rmb();
 
 	if (RING_FULL(&info->ufe_ring)) {
-		WPRINTK("blktap: fe_ring is full, can't add "
+		WPRINTK("fe_ring is full, "
 			"IO Request will be dropped. %d %d\n",
 			RING_SIZE(&info->ufe_ring),
 			RING_SIZE(&blkif->blk_rings.common));
@@ -1515,7 +1512,7 @@
 			}
 
 			if (unlikely(map[i+1].status != GNTST_okay)) {
-				WPRINTK("invalid kernel buffer -- could not remap it\n");
+				WPRINTK("invalid user buffer -- could not remap it\n");
 				ret = 1;
 				map[i+1].handle = INVALID_GRANT_HANDLE;
 			}
@@ -1743,7 +1740,7 @@
 				    "blktap0");
 	} else {
 		/* this is bad, but not fatal */
-		WPRINTK("blktap: sysfs xen_class not created\n");
+		WPRINTK("sysfs xen_class not created\n");
 	}
 
 	DPRINTK("Blktap device successfully created\n");

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 07:44:15 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 07:44: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.xensource.com>)
	id 1Rhz2b-00077L-6P; Tue, 03 Jan 2012 07:44:13 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2a-00076X-Ig
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1325576644!10045437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28024 invoked from network); 3 Jan 2012 07:44:05 -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 Jan 2012 07:44:05 -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 1Rhz2S-0002NZ-EL
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2S-0007B4-8N
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Message-Id: <E1Rhz2S-0007B4-8N@xenbits.xen.org>
Date: Tue, 03 Jan 2012 07:44: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] Subject: netback: wait for
	hotplug scripts to complete before signalling connected to frontend
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1325576344 -3600
# Node ID bd6298cb67d3ab2f0cf849bb60afa2f5b8898e8d
# Parent  831d4ef1e575f2fe640842066effb30e78367e9f
Subject: netback: wait for hotplug scripts to complete before signalling connected to frontend
Patch-mainline: n/a

Avoid the situation where the frontend is sending packets but the
domain 0 bridging (or whatever) is not yet configured (because the
hotplug scripts are too slow) and so packets get dropped.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Steven.Smith@citrix.com
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 831d4ef1e575 -r bd6298cb67d3 drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h	Tue Jan 03 08:31:41 2012 +0100
+++ b/drivers/xen/netback/common.h	Tue Jan 03 08:39:04 2012 +0100
@@ -141,6 +141,8 @@
 	struct xenbus_device *dev;
 	netif_t *netif;
 	enum xenbus_state frontend_state;
+	struct xenbus_watch hotplug_status_watch;
+	int have_hotplug_status_watch:1;
 
 	/* State relating to the netback accelerator */
 	void *netback_accel_priv;
diff -r 831d4ef1e575 -r bd6298cb67d3 drivers/xen/netback/xenbus.c
--- a/drivers/xen/netback/xenbus.c	Tue Jan 03 08:31:41 2012 +0100
+++ b/drivers/xen/netback/xenbus.c	Tue Jan 03 08:39:04 2012 +0100
@@ -32,6 +32,7 @@
 static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_netif(struct backend_info *be);
+static void unregister_hotplug_status_watch(struct backend_info *be);
 static void netback_disconnect(struct device *);
 
 static int netback_remove(struct xenbus_device *dev)
@@ -50,8 +51,10 @@
 {
 	struct backend_info *be = xbdev_dev->driver_data;
 
+	unregister_hotplug_status_watch(be);
 	if (be->netif) {
 		kobject_uevent(&xbdev_dev->kobj, KOBJ_OFFLINE);
+		xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status");
 		netif_disconnect(be);
 		be->netif = NULL;
 	}
@@ -329,6 +332,36 @@
 	return 0;
 }
 
+static void unregister_hotplug_status_watch(struct backend_info *be)
+{
+	if (be->have_hotplug_status_watch) {
+		unregister_xenbus_watch(&be->hotplug_status_watch);
+		kfree(be->hotplug_status_watch.node);
+	}
+	be->have_hotplug_status_watch = 0;
+}
+
+static void hotplug_status_changed(struct xenbus_watch *watch,
+				   const char **vec,
+				   unsigned int vec_size)
+{
+	struct backend_info *be = container_of(watch,
+					       struct backend_info,
+					       hotplug_status_watch);
+	char *str;
+	unsigned int len;
+
+	str = xenbus_read(XBT_NIL, be->dev->nodename, "hotplug-status", &len);
+	if (IS_ERR(str))
+		return;
+	if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
+		xenbus_switch_state(be->dev, XenbusStateConnected);
+		/* Not interested in this watch anymore. */
+		unregister_hotplug_status_watch(be);
+	}
+	kfree(str);
+}
+
 static void connect(struct backend_info *be)
 {
 	int err;
@@ -348,7 +381,16 @@
 			  &be->netif->credit_usec);
 	be->netif->remaining_credit = be->netif->credit_bytes;
 
-	xenbus_switch_state(dev, XenbusStateConnected);
+	unregister_hotplug_status_watch(be);
+	err = xenbus_watch_path2(dev, dev->nodename, "hotplug-status",
+				 &be->hotplug_status_watch,
+				 hotplug_status_changed);
+	if (err) {
+		/* Switch now, since we can't do a watch. */
+		xenbus_switch_state(dev, XenbusStateConnected);
+	} else {
+		be->have_hotplug_status_watch = 1;
+	}
 
 	netif_wake_queue(be->netif->dev);
 }

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 07:44:15 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 07:44: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.xensource.com>)
	id 1Rhz2b-00077L-6P; Tue, 03 Jan 2012 07:44:13 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2a-00076X-Ig
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1325576644!10045437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28024 invoked from network); 3 Jan 2012 07:44:05 -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 Jan 2012 07:44:05 -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 1Rhz2S-0002NZ-EL
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2S-0007B4-8N
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Message-Id: <E1Rhz2S-0007B4-8N@xenbits.xen.org>
Date: Tue, 03 Jan 2012 07:44: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] Subject: netback: wait for
	hotplug scripts to complete before signalling connected to frontend
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1325576344 -3600
# Node ID bd6298cb67d3ab2f0cf849bb60afa2f5b8898e8d
# Parent  831d4ef1e575f2fe640842066effb30e78367e9f
Subject: netback: wait for hotplug scripts to complete before signalling connected to frontend
Patch-mainline: n/a

Avoid the situation where the frontend is sending packets but the
domain 0 bridging (or whatever) is not yet configured (because the
hotplug scripts are too slow) and so packets get dropped.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Steven.Smith@citrix.com
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 831d4ef1e575 -r bd6298cb67d3 drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h	Tue Jan 03 08:31:41 2012 +0100
+++ b/drivers/xen/netback/common.h	Tue Jan 03 08:39:04 2012 +0100
@@ -141,6 +141,8 @@
 	struct xenbus_device *dev;
 	netif_t *netif;
 	enum xenbus_state frontend_state;
+	struct xenbus_watch hotplug_status_watch;
+	int have_hotplug_status_watch:1;
 
 	/* State relating to the netback accelerator */
 	void *netback_accel_priv;
diff -r 831d4ef1e575 -r bd6298cb67d3 drivers/xen/netback/xenbus.c
--- a/drivers/xen/netback/xenbus.c	Tue Jan 03 08:31:41 2012 +0100
+++ b/drivers/xen/netback/xenbus.c	Tue Jan 03 08:39:04 2012 +0100
@@ -32,6 +32,7 @@
 static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_netif(struct backend_info *be);
+static void unregister_hotplug_status_watch(struct backend_info *be);
 static void netback_disconnect(struct device *);
 
 static int netback_remove(struct xenbus_device *dev)
@@ -50,8 +51,10 @@
 {
 	struct backend_info *be = xbdev_dev->driver_data;
 
+	unregister_hotplug_status_watch(be);
 	if (be->netif) {
 		kobject_uevent(&xbdev_dev->kobj, KOBJ_OFFLINE);
+		xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status");
 		netif_disconnect(be);
 		be->netif = NULL;
 	}
@@ -329,6 +332,36 @@
 	return 0;
 }
 
+static void unregister_hotplug_status_watch(struct backend_info *be)
+{
+	if (be->have_hotplug_status_watch) {
+		unregister_xenbus_watch(&be->hotplug_status_watch);
+		kfree(be->hotplug_status_watch.node);
+	}
+	be->have_hotplug_status_watch = 0;
+}
+
+static void hotplug_status_changed(struct xenbus_watch *watch,
+				   const char **vec,
+				   unsigned int vec_size)
+{
+	struct backend_info *be = container_of(watch,
+					       struct backend_info,
+					       hotplug_status_watch);
+	char *str;
+	unsigned int len;
+
+	str = xenbus_read(XBT_NIL, be->dev->nodename, "hotplug-status", &len);
+	if (IS_ERR(str))
+		return;
+	if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
+		xenbus_switch_state(be->dev, XenbusStateConnected);
+		/* Not interested in this watch anymore. */
+		unregister_hotplug_status_watch(be);
+	}
+	kfree(str);
+}
+
 static void connect(struct backend_info *be)
 {
 	int err;
@@ -348,7 +381,16 @@
 			  &be->netif->credit_usec);
 	be->netif->remaining_credit = be->netif->credit_bytes;
 
-	xenbus_switch_state(dev, XenbusStateConnected);
+	unregister_hotplug_status_watch(be);
+	err = xenbus_watch_path2(dev, dev->nodename, "hotplug-status",
+				 &be->hotplug_status_watch,
+				 hotplug_status_changed);
+	if (err) {
+		/* Switch now, since we can't do a watch. */
+		xenbus_switch_state(dev, XenbusStateConnected);
+	} else {
+		be->have_hotplug_status_watch = 1;
+	}
 
 	netif_wake_queue(be->netif->dev);
 }

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 07:44:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 07:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rhz2c-00077b-9H; Tue, 03 Jan 2012 07:44:14 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2b-00076c-1N
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1325576645!2768937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1409 invoked from network); 3 Jan 2012 07:44:06 -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 Jan 2012 07:44:06 -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 1Rhz2S-0002Nc-OT
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2S-0007BJ-K8
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Message-Id: <E1Rhz2S-0007BJ-K8@xenbits.xen.org>
Date: Tue, 03 Jan 2012 07:44:04 +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] From: Laszlo Ersek
	<lersek@redhat.com>
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1325576422 -3600
# Node ID 90182138690d8055b09f3cc0495666590341b434
# Parent  bd6298cb67d3ab2f0cf849bb60afa2f5b8898e8d
From: Laszlo Ersek <lersek@redhat.com>
Subject: netfront: delay gARP until backend switches to Connected
Patch-mainline: n/a

After a guest is live migrated, the xen-netfront driver emits a gratuitous
ARP message, so that networking hardware on the target host's subnet can
take notice, and public routing to the guest is re-established. However,
if the packet appears on the backend interface before the backend is added
to the target host's bridge, the packet is lost, and the migrated guest's
peers become unable to talk to the guest.

A sufficient two-parts condition to prevent the above is:

(1) ensure that the backend only moves to Connected xenbus state after its
hotplug scripts completed, ie. the netback interface got added to the
bridge; and

(2) ensure the frontend only queues the gARP when it sees the backend move
to Connected.

These two together provide complete ordering. Sub-condition (1) is already
satisfied by commit f942dc2552b8 in Linus' tree, based on commit
6b0b80ca7165 from [1].

In general, the full condition is sufficient, not necessary, because,
according to [2], live migration has been working for a long time without
satisfying sub-condition (2). However, after 6b0b80ca7165 was backported
to the RHEL-5 host to ensure (1), (2) still proved necessary in the RHEL-6
guest. This patch intends to provide (2) for upstream.

The Reviewed-by line comes from [3].

[1] git://xenbits.xen.org/people/ianc/linux-2.6.git#upstream/dom0/backend/netback-history
[2] http://old-list-archives.xen.org/xen-devel/2011-06/msg01969.html
[3] http://old-list-archives.xen.org/xen-devel/2011-07/msg00484.html

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bd6298cb67d3 -r 90182138690d drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Tue Jan 03 08:39:04 2012 +0100
+++ b/drivers/xen/netfront/netfront.c	Tue Jan 03 08:40:22 2012 +0100
@@ -541,7 +541,6 @@
 	switch (backend_state) {
 	case XenbusStateInitialising:
 	case XenbusStateInitialised:
-	case XenbusStateConnected:
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
@@ -554,6 +553,9 @@
 		if (network_connect(netdev) != 0)
 			break;
 		xenbus_switch_state(dev, XenbusStateConnected);
+		break;
+
+	case XenbusStateConnected:
 		send_fake_arp(netdev);
 		break;
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 03 07:44:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Jan 2012 07:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rhz2c-00077b-9H; Tue, 03 Jan 2012 07:44:14 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2b-00076c-1N
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1325576645!2768937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1409 invoked from network); 3 Jan 2012 07:44:06 -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 Jan 2012 07:44:06 -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 1Rhz2S-0002Nc-OT
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rhz2S-0007BJ-K8
	for xen-changelog@lists.xensource.com; Tue, 03 Jan 2012 07:44:04 +0000
Message-Id: <E1Rhz2S-0007BJ-K8@xenbits.xen.org>
Date: Tue, 03 Jan 2012 07:44:04 +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] From: Laszlo Ersek
	<lersek@redhat.com>
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1325576422 -3600
# Node ID 90182138690d8055b09f3cc0495666590341b434
# Parent  bd6298cb67d3ab2f0cf849bb60afa2f5b8898e8d
From: Laszlo Ersek <lersek@redhat.com>
Subject: netfront: delay gARP until backend switches to Connected
Patch-mainline: n/a

After a guest is live migrated, the xen-netfront driver emits a gratuitous
ARP message, so that networking hardware on the target host's subnet can
take notice, and public routing to the guest is re-established. However,
if the packet appears on the backend interface before the backend is added
to the target host's bridge, the packet is lost, and the migrated guest's
peers become unable to talk to the guest.

A sufficient two-parts condition to prevent the above is:

(1) ensure that the backend only moves to Connected xenbus state after its
hotplug scripts completed, ie. the netback interface got added to the
bridge; and

(2) ensure the frontend only queues the gARP when it sees the backend move
to Connected.

These two together provide complete ordering. Sub-condition (1) is already
satisfied by commit f942dc2552b8 in Linus' tree, based on commit
6b0b80ca7165 from [1].

In general, the full condition is sufficient, not necessary, because,
according to [2], live migration has been working for a long time without
satisfying sub-condition (2). However, after 6b0b80ca7165 was backported
to the RHEL-5 host to ensure (1), (2) still proved necessary in the RHEL-6
guest. This patch intends to provide (2) for upstream.

The Reviewed-by line comes from [3].

[1] git://xenbits.xen.org/people/ianc/linux-2.6.git#upstream/dom0/backend/netback-history
[2] http://old-list-archives.xen.org/xen-devel/2011-06/msg01969.html
[3] http://old-list-archives.xen.org/xen-devel/2011-07/msg00484.html

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bd6298cb67d3 -r 90182138690d drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Tue Jan 03 08:39:04 2012 +0100
+++ b/drivers/xen/netfront/netfront.c	Tue Jan 03 08:40:22 2012 +0100
@@ -541,7 +541,6 @@
 	switch (backend_state) {
 	case XenbusStateInitialising:
 	case XenbusStateInitialised:
-	case XenbusStateConnected:
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
@@ -554,6 +553,9 @@
 		if (network_connect(netdev) != 0)
 			break;
 		xenbus_switch_state(dev, XenbusStateConnected);
+		break;
+
+	case XenbusStateConnected:
 		send_fake_arp(netdev);
 		break;
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 01:33:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 01: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.xensource.com>)
	id 1RiFj7-0003M9-Ks; Wed, 04 Jan 2012 01:33:13 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiFj6-0003M4-6P
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 01:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1325640662!50412470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21167 invoked from network); 4 Jan 2012 01:31: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;
	4 Jan 2012 01:31:03 -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 1RiFj3-0007V5-7j
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 01:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiFj2-0003G0-QO
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 01:33:08 +0000
Message-Id: <E1RiFj2-0003G0-QO@xenbits.xen.org>
Date: Wed, 04 Jan 2012 01:33:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86/ucode: fix for AMD Fam15 CPUs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325640717 18000
# Node ID 165f252b04b86bb941dc747f584de9a5432c69fe
# Parent  548923a4fcf66b51d6d5332f5de575116e2ce67a
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
xen-unstable changeset: 24411:ca5f588bd203
xen-unstable date: Thu Dec 15 11:00:09 2011 +0100
---


diff -r 548923a4fcf6 -r 165f252b04b8 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Tue Dec 20 20:50:49 2011 -0500
+++ b/xen/arch/x86/microcode_amd.c	Tue Jan 03 20:31:57 2012 -0500
@@ -33,11 +33,11 @@
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
 #define UCODE_UCODE_TYPE           0x00000001
 
-#define UCODE_MAX_SIZE          (2048)
-#define DEFAULT_UCODE_DATASIZE  (896)
-#define MC_HEADER_SIZE          (sizeof(struct microcode_header_amd))
-#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
-#define DWSIZE                  (sizeof(uint32_t))
+struct mpbhdr {
+    uint32_t type;
+    uint32_t len;
+    uint8_t data[];
+};
 
 /* serialize access to the physical write */
 static DEFINE_SPINLOCK(microcode_update_lock);
@@ -66,10 +66,10 @@
     return 0;
 }
 
-static int microcode_fits(void *mc, int cpu)
+static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
-    struct microcode_header_amd *mc_header = mc;
+    struct microcode_header_amd *mc_header = mc_amd->mpb;
     unsigned int current_cpu_id;
     unsigned int equiv_cpu_id = 0x0;
     unsigned int i;
@@ -98,9 +98,9 @@
 
     if ( !equiv_cpu_id )
     {
-        printk(KERN_ERR "microcode: CPU%d cpu_id "
+        printk(KERN_INFO "microcode: CPU%d cpu_id "
                "not found in equivalent cpu table\n", cpu);
-        return -EINVAL;
+        return 0;
     }
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
@@ -112,14 +112,14 @@
     }
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
-        return -EINVAL;
+	return 0;
 
     printk(KERN_INFO "microcode: CPU%d found a matching microcode "
            "update with version 0x%x (current=0x%x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
 out:
-    return 0;
+    return 1;
 }
 
 static int apply_microcode(int cpu)
@@ -128,16 +128,21 @@
     struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
     uint32_t rev, dummy;
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
+    struct microcode_header_amd *hdr; 
 
     /* We should bind the task to the CPU */
     BUG_ON(raw_smp_processor_id() != cpu);
 
     if ( mc_amd == NULL )
-        return -EINVAL;
+	return -EINVAL;
+
+    hdr = mc_amd->mpb;
+    if ( hdr == NULL )
+	return -EINVAL;
 
     spin_lock_irqsave(&microcode_update_lock, flags);
 
-    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)&mc_amd->hdr.data_code);
+    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
     rdmsr(MSR_AMD_PATCHLEVEL, rev, dummy);
@@ -145,61 +150,67 @@
     spin_unlock_irqrestore(&microcode_update_lock, flags);
 
     /* check current patch id and patch's id for match */
-    if ( rev != mc_amd->hdr.patch_id )
+    if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
                "0x%x to 0x%x failed\n", cpu,
-               mc_amd->hdr.patch_id, rev);
+               hdr->patch_id, rev);
         return -EIO;
     }
 
     printk("microcode: CPU%d updated from revision "
            "0x%x to 0x%x \n",
-           cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
+           cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
 
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
-                                         size_t size, unsigned long *offset)
+static int get_next_ucode_from_buffer_amd(struct microcode_amd *mc_amd,
+					  const void *buf, size_t bufsize,
+					  unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
-    size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
+    const struct mpbhdr *mpbuf;
 
     off = *offset;
 
     /* No more data */
-    if ( off >= size )
+    if ( off >= bufsize )
         return 1;
 
-    if ( bufp[off] != UCODE_UCODE_TYPE )
+    mpbuf = (const struct mpbhdr *)&bufp[off];
+    if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
         printk(KERN_ERR "microcode: error! "
                "Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
+    printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n",
+           bufsize, mpbuf->len, off);
 
-    total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
-
-    printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
-           (unsigned long)size, total_size, off);
-
-    if ( (off + total_size) > size )
+    if ( (off + mpbuf->len) > bufsize )
     {
         printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
         return -EINVAL;
     }
 
-    memset(mc, 0, UCODE_MAX_SIZE);
-    memcpy(mc, (const void *)(&bufp[off + 8]), total_size);
+    if (mc_amd->mpb_size < mpbuf->len) {
+        if (mc_amd->mpb) {
+            xfree(mc_amd->mpb);
+            mc_amd->mpb_size = 0;
+        }
+        mc_amd->mpb = xmalloc_bytes(mpbuf->len);
+        if (mc_amd->mpb == NULL)
+            return -ENOMEM;
+        mc_amd->mpb_size = mpbuf->len;
+    }
+    memcpy(mc_amd->mpb, mpbuf->data, mpbuf->len);
 
-    *offset = off + total_size + 8;
+    *offset = off + mpbuf->len + 8;
 
     return 0;
 }
@@ -254,7 +265,7 @@
     int error = 0;
     int ret;
     struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
-    void *mc;
+    struct microcode_amd *mc_amd, *mc_old;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -275,8 +286,8 @@
         return -EINVAL;
     }
 
-    mc = xmalloc_bytes(UCODE_MAX_SIZE);
-    if ( mc == NULL )
+    mc_amd = xmalloc(struct microcode_amd);
+    if ( mc_amd == NULL )
     {
         printk(KERN_ERR "microcode: error! "
                "Can not allocate memory for microcode patch\n");
@@ -284,32 +295,37 @@
         goto out;
     }
 
+    mc_old = uci->mc.mc_amd;
     /* implicitely validates uci->mc.mc_valid */
-    uci->mc.mc_amd = mc;
+    uci->mc.mc_amd = mc_amd;
 
     /*
      * It's possible the data file has multiple matching ucode,
      * lets keep searching till the latest version
      */
-    while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
+    mc_amd->mpb = NULL;
+    mc_amd->mpb_size = 0;
+    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, size,
+						  &offset)) == 0 )
     {
-        error = microcode_fits(mc, cpu);
-        if (error != 0)
+        error = microcode_fits(mc_amd, cpu);
+        if (error <= 0)
             continue;
 
         error = apply_microcode(cpu);
-        if (error == 0)
+        if (error == 0) {
+	    error = 1;
             break;
+	}
     }
 
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if (error) {
-        xfree(mc);
-        mc = NULL;
+    if (error == 1) {
+	xfree(mc_old);
+	return 0;
     }
-    uci->mc.mc_amd = mc;
 
 out:
     xfree(equiv_cpu_table);
diff -r 548923a4fcf6 -r 165f252b04b8 xen/include/asm-x86/microcode.h
--- a/xen/include/asm-x86/microcode.h	Tue Dec 20 20:50:49 2011 -0500
+++ b/xen/include/asm-x86/microcode.h	Tue Jan 03 20:31:57 2012 -0500
@@ -69,8 +69,8 @@
 } __attribute__((packed));
 
 struct microcode_amd {
-    struct microcode_header_amd hdr;
-    unsigned int mpb[0];
+    void *mpb;
+    size_t mpb_size;
 };
 
 struct cpu_signature {

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 01:33:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 01: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.xensource.com>)
	id 1RiFj7-0003M9-Ks; Wed, 04 Jan 2012 01:33:13 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiFj6-0003M4-6P
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 01:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1325640662!50412470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21167 invoked from network); 4 Jan 2012 01:31: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;
	4 Jan 2012 01:31:03 -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 1RiFj3-0007V5-7j
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 01:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiFj2-0003G0-QO
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 01:33:08 +0000
Message-Id: <E1RiFj2-0003G0-QO@xenbits.xen.org>
Date: Wed, 04 Jan 2012 01:33:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86/ucode: fix for AMD Fam15 CPUs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325640717 18000
# Node ID 165f252b04b86bb941dc747f584de9a5432c69fe
# Parent  548923a4fcf66b51d6d5332f5de575116e2ce67a
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
xen-unstable changeset: 24411:ca5f588bd203
xen-unstable date: Thu Dec 15 11:00:09 2011 +0100
---


diff -r 548923a4fcf6 -r 165f252b04b8 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Tue Dec 20 20:50:49 2011 -0500
+++ b/xen/arch/x86/microcode_amd.c	Tue Jan 03 20:31:57 2012 -0500
@@ -33,11 +33,11 @@
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
 #define UCODE_UCODE_TYPE           0x00000001
 
-#define UCODE_MAX_SIZE          (2048)
-#define DEFAULT_UCODE_DATASIZE  (896)
-#define MC_HEADER_SIZE          (sizeof(struct microcode_header_amd))
-#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
-#define DWSIZE                  (sizeof(uint32_t))
+struct mpbhdr {
+    uint32_t type;
+    uint32_t len;
+    uint8_t data[];
+};
 
 /* serialize access to the physical write */
 static DEFINE_SPINLOCK(microcode_update_lock);
@@ -66,10 +66,10 @@
     return 0;
 }
 
-static int microcode_fits(void *mc, int cpu)
+static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
-    struct microcode_header_amd *mc_header = mc;
+    struct microcode_header_amd *mc_header = mc_amd->mpb;
     unsigned int current_cpu_id;
     unsigned int equiv_cpu_id = 0x0;
     unsigned int i;
@@ -98,9 +98,9 @@
 
     if ( !equiv_cpu_id )
     {
-        printk(KERN_ERR "microcode: CPU%d cpu_id "
+        printk(KERN_INFO "microcode: CPU%d cpu_id "
                "not found in equivalent cpu table\n", cpu);
-        return -EINVAL;
+        return 0;
     }
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
@@ -112,14 +112,14 @@
     }
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
-        return -EINVAL;
+	return 0;
 
     printk(KERN_INFO "microcode: CPU%d found a matching microcode "
            "update with version 0x%x (current=0x%x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
 out:
-    return 0;
+    return 1;
 }
 
 static int apply_microcode(int cpu)
@@ -128,16 +128,21 @@
     struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
     uint32_t rev, dummy;
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
+    struct microcode_header_amd *hdr; 
 
     /* We should bind the task to the CPU */
     BUG_ON(raw_smp_processor_id() != cpu);
 
     if ( mc_amd == NULL )
-        return -EINVAL;
+	return -EINVAL;
+
+    hdr = mc_amd->mpb;
+    if ( hdr == NULL )
+	return -EINVAL;
 
     spin_lock_irqsave(&microcode_update_lock, flags);
 
-    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)&mc_amd->hdr.data_code);
+    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
     rdmsr(MSR_AMD_PATCHLEVEL, rev, dummy);
@@ -145,61 +150,67 @@
     spin_unlock_irqrestore(&microcode_update_lock, flags);
 
     /* check current patch id and patch's id for match */
-    if ( rev != mc_amd->hdr.patch_id )
+    if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
                "0x%x to 0x%x failed\n", cpu,
-               mc_amd->hdr.patch_id, rev);
+               hdr->patch_id, rev);
         return -EIO;
     }
 
     printk("microcode: CPU%d updated from revision "
            "0x%x to 0x%x \n",
-           cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
+           cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
 
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
-                                         size_t size, unsigned long *offset)
+static int get_next_ucode_from_buffer_amd(struct microcode_amd *mc_amd,
+					  const void *buf, size_t bufsize,
+					  unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
-    size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
+    const struct mpbhdr *mpbuf;
 
     off = *offset;
 
     /* No more data */
-    if ( off >= size )
+    if ( off >= bufsize )
         return 1;
 
-    if ( bufp[off] != UCODE_UCODE_TYPE )
+    mpbuf = (const struct mpbhdr *)&bufp[off];
+    if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
         printk(KERN_ERR "microcode: error! "
                "Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
+    printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n",
+           bufsize, mpbuf->len, off);
 
-    total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
-
-    printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
-           (unsigned long)size, total_size, off);
-
-    if ( (off + total_size) > size )
+    if ( (off + mpbuf->len) > bufsize )
     {
         printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
         return -EINVAL;
     }
 
-    memset(mc, 0, UCODE_MAX_SIZE);
-    memcpy(mc, (const void *)(&bufp[off + 8]), total_size);
+    if (mc_amd->mpb_size < mpbuf->len) {
+        if (mc_amd->mpb) {
+            xfree(mc_amd->mpb);
+            mc_amd->mpb_size = 0;
+        }
+        mc_amd->mpb = xmalloc_bytes(mpbuf->len);
+        if (mc_amd->mpb == NULL)
+            return -ENOMEM;
+        mc_amd->mpb_size = mpbuf->len;
+    }
+    memcpy(mc_amd->mpb, mpbuf->data, mpbuf->len);
 
-    *offset = off + total_size + 8;
+    *offset = off + mpbuf->len + 8;
 
     return 0;
 }
@@ -254,7 +265,7 @@
     int error = 0;
     int ret;
     struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
-    void *mc;
+    struct microcode_amd *mc_amd, *mc_old;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -275,8 +286,8 @@
         return -EINVAL;
     }
 
-    mc = xmalloc_bytes(UCODE_MAX_SIZE);
-    if ( mc == NULL )
+    mc_amd = xmalloc(struct microcode_amd);
+    if ( mc_amd == NULL )
     {
         printk(KERN_ERR "microcode: error! "
                "Can not allocate memory for microcode patch\n");
@@ -284,32 +295,37 @@
         goto out;
     }
 
+    mc_old = uci->mc.mc_amd;
     /* implicitely validates uci->mc.mc_valid */
-    uci->mc.mc_amd = mc;
+    uci->mc.mc_amd = mc_amd;
 
     /*
      * It's possible the data file has multiple matching ucode,
      * lets keep searching till the latest version
      */
-    while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
+    mc_amd->mpb = NULL;
+    mc_amd->mpb_size = 0;
+    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, size,
+						  &offset)) == 0 )
     {
-        error = microcode_fits(mc, cpu);
-        if (error != 0)
+        error = microcode_fits(mc_amd, cpu);
+        if (error <= 0)
             continue;
 
         error = apply_microcode(cpu);
-        if (error == 0)
+        if (error == 0) {
+	    error = 1;
             break;
+	}
     }
 
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if (error) {
-        xfree(mc);
-        mc = NULL;
+    if (error == 1) {
+	xfree(mc_old);
+	return 0;
     }
-    uci->mc.mc_amd = mc;
 
 out:
     xfree(equiv_cpu_table);
diff -r 548923a4fcf6 -r 165f252b04b8 xen/include/asm-x86/microcode.h
--- a/xen/include/asm-x86/microcode.h	Tue Dec 20 20:50:49 2011 -0500
+++ b/xen/include/asm-x86/microcode.h	Tue Jan 03 20:31:57 2012 -0500
@@ -69,8 +69,8 @@
 } __attribute__((packed));
 
 struct microcode_amd {
-    struct microcode_header_amd hdr;
-    unsigned int mpb[0];
+    void *mpb;
+    size_t mpb_size;
 };
 
 struct cpu_signature {

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEq-0005op-PW; Wed, 04 Jan 2012 06:22:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEp-0005oY-5d
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1325658092!54573399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10266 invoked from network); 4 Jan 2012 06:21:33 -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;
	4 Jan 2012 06:21:33 -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 1RiKEj-0002gd-U3
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEj-0006bC-P2
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Message-Id: <E1RiKEj-0006bC-P2@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86/vmx: don't call __vmxoff()
	blindly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325655120 18000
# Node ID c96f1d6f98d0aea013085cf933b6c9e01a6dadfd
# Parent  0a06336fd9f857778b6666aacd5258c83c6f7574
x86/vmx: don't call __vmxoff() blindly

If vmx_vcpu_up() failed, __vmxon() would generally not have got
(successfully) executed, and in that case __vmxoff() will #UD.

Additionally, any panic() during early resume (namely the tboot
related one) would cause vmx_cpu_down() to get executed without
vmx_cpu_up() having run before.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   23848:cf37d2eec2ef
xen-unstable date:        Sat Sep 17 16:26:37 2011 +0100
---


diff -r 0a06336fd9f8 -r c96f1d6f98d0 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Wed Jan 04 00:15:47 2012 -0500
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Wed Jan 04 00:32:00 2012 -0500
@@ -53,6 +53,7 @@
 static DEFINE_PER_CPU(struct vmcs_struct *, host_vmcs);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
+static DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 
@@ -375,6 +376,7 @@
         printk("CPU%d: unexpected VMXON failure\n", cpu);
         return 0;
     case 0: /* success */
+        this_cpu(vmxon) = 1;
         break;
     default:
         BUG();
@@ -392,6 +394,9 @@
     struct list_head *active_vmcs_list = &this_cpu(active_vmcs_list);
     unsigned long flags;
 
+    if ( !this_cpu(vmxon) )
+        return;
+
     local_irq_save(flags);
 
     while ( !list_empty(active_vmcs_list) )
@@ -399,6 +404,7 @@
                                     struct vcpu, arch.hvm_vmx.active_list));
 
     BUG_ON(!(read_cr4() & X86_CR4_VMXE));
+    this_cpu(vmxon) = 0;
     __vmxoff();
 
     local_irq_restore(flags);

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEq-0005op-PW; Wed, 04 Jan 2012 06:22:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEp-0005oY-5d
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1325658092!54573399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10266 invoked from network); 4 Jan 2012 06:21:33 -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;
	4 Jan 2012 06:21:33 -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 1RiKEj-0002gd-U3
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEj-0006bC-P2
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Message-Id: <E1RiKEj-0006bC-P2@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86/vmx: don't call __vmxoff()
	blindly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325655120 18000
# Node ID c96f1d6f98d0aea013085cf933b6c9e01a6dadfd
# Parent  0a06336fd9f857778b6666aacd5258c83c6f7574
x86/vmx: don't call __vmxoff() blindly

If vmx_vcpu_up() failed, __vmxon() would generally not have got
(successfully) executed, and in that case __vmxoff() will #UD.

Additionally, any panic() during early resume (namely the tboot
related one) would cause vmx_cpu_down() to get executed without
vmx_cpu_up() having run before.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   23848:cf37d2eec2ef
xen-unstable date:        Sat Sep 17 16:26:37 2011 +0100
---


diff -r 0a06336fd9f8 -r c96f1d6f98d0 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Wed Jan 04 00:15:47 2012 -0500
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Wed Jan 04 00:32:00 2012 -0500
@@ -53,6 +53,7 @@
 static DEFINE_PER_CPU(struct vmcs_struct *, host_vmcs);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
+static DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 
@@ -375,6 +376,7 @@
         printk("CPU%d: unexpected VMXON failure\n", cpu);
         return 0;
     case 0: /* success */
+        this_cpu(vmxon) = 1;
         break;
     default:
         BUG();
@@ -392,6 +394,9 @@
     struct list_head *active_vmcs_list = &this_cpu(active_vmcs_list);
     unsigned long flags;
 
+    if ( !this_cpu(vmxon) )
+        return;
+
     local_irq_save(flags);
 
     while ( !list_empty(active_vmcs_list) )
@@ -399,6 +404,7 @@
                                     struct vcpu, arch.hvm_vmx.active_list));
 
     BUG_ON(!(read_cr4() & X86_CR4_VMXE));
+    this_cpu(vmxon) = 0;
     __vmxoff();
 
     local_irq_restore(flags);

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEu-0005pN-1O; Wed, 04 Jan 2012 06:22:20 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEs-0005oa-9e
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1325658130!7751984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9634 invoked from network); 4 Jan 2012 06:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 06:22:11 -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 1RiKEj-0002gb-Pp
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEj-0006ay-Bs
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Message-Id: <E1RiKEj-0006ay-Bs@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] VT-d: fix off-by-one error in
	RMRR validation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325654147 18000
# Node ID 0a06336fd9f857778b6666aacd5258c83c6f7574
# Parent  46f133149343e8b280c9fa687ec65ddd5da83718
VT-d: fix off-by-one error in RMRR validation

(base_addr,end_addr) is an inclusive range, and hence there shouldn't
be a subtraction of 1 in the second invocation of page_is_ram_type().
For RMRRs covering a single page that actually resulted in the
immediately preceding page to get checked (which could have resulted
in a false warning).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 23868:28147fd781af
xen-unstable date: Thu Sep 22 18:32:34 2011 +0100
---


diff -r 46f133149343 -r 0a06336fd9f8 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Wed Jan 04 00:05:17 2012 -0500
+++ b/xen/drivers/passthrough/vtd/dmar.c	Wed Jan 04 00:15:47 2012 -0500
@@ -393,7 +393,7 @@
     /* This check is here simply to detect when RMRR values are not properly represented in the 
        system memory map and inform the user */
     if ( (!page_is_ram_type(paddr_to_pfn(rmrr->base_address), RAM_TYPE_RESERVED))||
-         (!page_is_ram_type(paddr_to_pfn(rmrr->end_address) - 1, RAM_TYPE_RESERVED)) )
+         (!page_is_ram_type(paddr_to_pfn(rmrr->end_address), RAM_TYPE_RESERVED)) )
     {
         dprintk(XENLOG_WARNING VTDPREFIX,
                 "RMRR address range not in reserved memory base = %"PRIx64" end = %"PRIx64"; " \

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEu-0005pN-1O; Wed, 04 Jan 2012 06:22:20 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEs-0005oa-9e
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1325658130!7751984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9634 invoked from network); 4 Jan 2012 06:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 06:22:11 -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 1RiKEj-0002gb-Pp
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEj-0006ay-Bs
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Message-Id: <E1RiKEj-0006ay-Bs@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] VT-d: fix off-by-one error in
	RMRR validation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325654147 18000
# Node ID 0a06336fd9f857778b6666aacd5258c83c6f7574
# Parent  46f133149343e8b280c9fa687ec65ddd5da83718
VT-d: fix off-by-one error in RMRR validation

(base_addr,end_addr) is an inclusive range, and hence there shouldn't
be a subtraction of 1 in the second invocation of page_is_ram_type().
For RMRRs covering a single page that actually resulted in the
immediately preceding page to get checked (which could have resulted
in a false warning).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 23868:28147fd781af
xen-unstable date: Thu Sep 22 18:32:34 2011 +0100
---


diff -r 46f133149343 -r 0a06336fd9f8 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Wed Jan 04 00:05:17 2012 -0500
+++ b/xen/drivers/passthrough/vtd/dmar.c	Wed Jan 04 00:15:47 2012 -0500
@@ -393,7 +393,7 @@
     /* This check is here simply to detect when RMRR values are not properly represented in the 
        system memory map and inform the user */
     if ( (!page_is_ram_type(paddr_to_pfn(rmrr->base_address), RAM_TYPE_RESERVED))||
-         (!page_is_ram_type(paddr_to_pfn(rmrr->end_address) - 1, RAM_TYPE_RESERVED)) )
+         (!page_is_ram_type(paddr_to_pfn(rmrr->end_address), RAM_TYPE_RESERVED)) )
     {
         dprintk(XENLOG_WARNING VTDPREFIX,
                 "RMRR address range not in reserved memory base = %"PRIx64" end = %"PRIx64"; " \

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEv-0005pY-43; Wed, 04 Jan 2012 06:22:21 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEt-0005of-I4
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1325658131!9576668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30023 invoked from network); 4 Jan 2012 06:22:12 -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 Jan 2012 06:22:12 -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 1RiKEl-0002gn-B7
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEl-0006bw-0a
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:11 +0000
Message-Id: <E1RiKEl-0006bw-0a@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] xen/libxc: set CPUID topology
	leaf as unsupported for PV guests
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325657708 18000
# Node ID 606abc216dbb9cbdb8af02b50fc135e9c4e60786
# Parent  7b68af1f52e749084bfd03eac97191d8ae8a7a90
xen/libxc: set CPUID topology leaf as unsupported for PV guests

The result of a CPUID Extended Topology Enumeration leaf for PV guests
is invalid as the level in ECX is ignored. This can cause some guests
to loop endlessly when trying to enumerate the topology.

Since the physical topology isn't useful to PV guests set the topology
leaf as unsupported.

Guests affected include Linux kernels prior 2.6.32 where a workaround
was applied ("xen: mask extended topology info in cpu",
82d6469916c6fcfa345636a49004c9d1753905d1).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
xen-unstable changeset: 23700:867bb675b57b
xen-unstable date: Sat Jul 16 09:05:45 2011 +0100
---


diff -r 7b68af1f52e7 -r 606abc216dbb tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Wed Jan 04 01:07:02 2012 -0500
+++ b/tools/libxc/xc_cpuid_x86.c	Wed Jan 04 01:15:08 2012 -0500
@@ -334,6 +334,7 @@
         break;
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
+    case 0x0000000b: /* Extended Topology Enumeration */
     case 0x8000000a: /* SVM revision and features */
     case 0x8000001b: /* Instruction Based Sampling */
         regs[0] = regs[1] = regs[2] = regs[3] = 0;
diff -r 7b68af1f52e7 -r 606abc216dbb xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Jan 04 01:07:02 2012 -0500
+++ b/xen/arch/x86/traps.c	Wed Jan 04 01:15:08 2012 -0500
@@ -784,6 +784,7 @@
         break;
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
+    case 0x0000000b: /* Extended Topology Enumeration */
     case 0x8000000a: /* SVM revision and features */
     case 0x8000001b: /* Instruction Based Sampling */
         a = b = c = d = 0;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEv-0005pY-43; Wed, 04 Jan 2012 06:22:21 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEt-0005of-I4
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1325658131!9576668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30023 invoked from network); 4 Jan 2012 06:22:12 -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 Jan 2012 06:22:12 -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 1RiKEl-0002gn-B7
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEl-0006bw-0a
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:11 +0000
Message-Id: <E1RiKEl-0006bw-0a@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] xen/libxc: set CPUID topology
	leaf as unsupported for PV guests
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325657708 18000
# Node ID 606abc216dbb9cbdb8af02b50fc135e9c4e60786
# Parent  7b68af1f52e749084bfd03eac97191d8ae8a7a90
xen/libxc: set CPUID topology leaf as unsupported for PV guests

The result of a CPUID Extended Topology Enumeration leaf for PV guests
is invalid as the level in ECX is ignored. This can cause some guests
to loop endlessly when trying to enumerate the topology.

Since the physical topology isn't useful to PV guests set the topology
leaf as unsupported.

Guests affected include Linux kernels prior 2.6.32 where a workaround
was applied ("xen: mask extended topology info in cpu",
82d6469916c6fcfa345636a49004c9d1753905d1).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
xen-unstable changeset: 23700:867bb675b57b
xen-unstable date: Sat Jul 16 09:05:45 2011 +0100
---


diff -r 7b68af1f52e7 -r 606abc216dbb tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Wed Jan 04 01:07:02 2012 -0500
+++ b/tools/libxc/xc_cpuid_x86.c	Wed Jan 04 01:15:08 2012 -0500
@@ -334,6 +334,7 @@
         break;
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
+    case 0x0000000b: /* Extended Topology Enumeration */
     case 0x8000000a: /* SVM revision and features */
     case 0x8000001b: /* Instruction Based Sampling */
         regs[0] = regs[1] = regs[2] = regs[3] = 0;
diff -r 7b68af1f52e7 -r 606abc216dbb xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Jan 04 01:07:02 2012 -0500
+++ b/xen/arch/x86/traps.c	Wed Jan 04 01:15:08 2012 -0500
@@ -784,6 +784,7 @@
         break;
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
+    case 0x0000000b: /* Extended Topology Enumeration */
     case 0x8000000a: /* SVM revision and features */
     case 0x8000001b: /* Instruction Based Sampling */
         a = b = c = d = 0;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEt-0005pI-Uw; Wed, 04 Jan 2012 06:22:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEr-0005oZ-W8
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1325658130!10403135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4751 invoked from network); 4 Jan 2012 06:22:11 -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;
	4 Jan 2012 06:22:11 -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 1RiKEj-0002gY-AS
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEi-0006aj-UB
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:08 +0000
Message-Id: <E1RiKEi-0006aj-UB@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86/AMD: use correct shift count
	when merging model and stepping
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325653517 18000
# Node ID 46f133149343e8b280c9fa687ec65ddd5da83718
# Parent  165f252b04b86bb941dc747f584de9a5432c69fe
x86/AMD: use correct shift count when merging model and stepping

... for legacy errata matching.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24412:99caac2e35df
xen-unstable date: Thu Dec 15 14:28:45 2011 +0100
---


diff -r 165f252b04b8 -r 46f133149343 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Tue Jan 03 20:31:57 2012 -0500
+++ b/xen/arch/x86/cpu/amd.c	Wed Jan 04 00:05:17 2012 -0500
@@ -189,7 +189,7 @@
 	}
 
 	/* OSVW unavailable or ID unknown, match family-model-stepping range */
-	ms = (cpu->x86_model << 8) | cpu->x86_mask;
+	ms = (cpu->x86_model << 4) | cpu->x86_mask;
 	while ((range = va_arg(ap, int))) {
 		if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
 		    (ms >= AMD_MODEL_RANGE_START(range)) &&

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEt-0005pI-Uw; Wed, 04 Jan 2012 06:22:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEr-0005oZ-W8
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1325658130!10403135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4751 invoked from network); 4 Jan 2012 06:22:11 -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;
	4 Jan 2012 06:22:11 -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 1RiKEj-0002gY-AS
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEi-0006aj-UB
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:08 +0000
Message-Id: <E1RiKEi-0006aj-UB@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86/AMD: use correct shift count
	when merging model and stepping
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325653517 18000
# Node ID 46f133149343e8b280c9fa687ec65ddd5da83718
# Parent  165f252b04b86bb941dc747f584de9a5432c69fe
x86/AMD: use correct shift count when merging model and stepping

... for legacy errata matching.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24412:99caac2e35df
xen-unstable date: Thu Dec 15 14:28:45 2011 +0100
---


diff -r 165f252b04b8 -r 46f133149343 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Tue Jan 03 20:31:57 2012 -0500
+++ b/xen/arch/x86/cpu/amd.c	Wed Jan 04 00:05:17 2012 -0500
@@ -189,7 +189,7 @@
 	}
 
 	/* OSVW unavailable or ID unknown, match family-model-stepping range */
-	ms = (cpu->x86_model << 8) | cpu->x86_mask;
+	ms = (cpu->x86_model << 4) | cpu->x86_mask;
 	while ((range = va_arg(ap, int))) {
 		if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
 		    (ms >= AMD_MODEL_RANGE_START(range)) &&

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEr-0005ow-SJ; Wed, 04 Jan 2012 06:22:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEq-0005ob-6e
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1325658087!48928604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21624 invoked from network); 4 Jan 2012 06:21:28 -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;
	4 Jan 2012 06:21:28 -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 1RiKEk-0002gk-TZ
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEk-0006bh-It
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Message-Id: <E1RiKEk-0006bh-It@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86 cpu: Fix bug: unify cpu_dev
	attr as __cpuinitdata
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325657222 18000
# Node ID 7b68af1f52e749084bfd03eac97191d8ae8a7a90
# Parent  2300742519c3b3f6b145b94e3cbe803902c311cc
x86 cpu: Fix bug: unify cpu_dev attr as __cpuinitdata

Currently different x86 cpu define different attr for cpu_dev.
Some cpu define as __initdata, this would be risk under cpu hotplug.
This patch fix the bug, unify them as __cpuinitdata, as what AMD cpu
define now.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Shan, Haitao <haitao.shan@intel.com>
xen-unstable changeset: 23659:7fe0331986c5
xen-unstable date: Fri Jul 08 08:30:41 2011 +0100
---


diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/centaur.c	Wed Jan 04 01:07:02 2012 -0500
@@ -86,7 +86,7 @@
 	return size;
 }
 
-static struct cpu_dev centaur_cpu_dev __initdata = {
+static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Centaur",
 	.c_ident	= { "CentaurHauls" },
 	.c_init		= init_centaur,
diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/cyrix.c	Wed Jan 04 01:07:02 2012 -0500
@@ -368,7 +368,7 @@
 	generic_identify(c);
 }
 
-static struct cpu_dev cyrix_cpu_dev __initdata = {
+static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Cyrix",
 	.c_ident 	= { "CyrixInstead" },
 	.c_init		= init_cyrix,
@@ -383,7 +383,7 @@
 
 //early_arch_initcall(cyrix_init_cpu);
 
-static struct cpu_dev nsc_cpu_dev __initdata = {
+static struct cpu_dev nsc_cpu_dev __cpuinitdata = {
 	.c_vendor	= "NSC",
 	.c_ident 	= { "Geode by NSC" },
 	.c_init		= init_cyrix,
diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/intel.c	Wed Jan 04 01:07:02 2012 -0500
@@ -242,7 +242,7 @@
 	return size;
 }
 
-static struct cpu_dev intel_cpu_dev __devinitdata = {
+static struct cpu_dev intel_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Intel",
 	.c_ident 	= { "GenuineIntel" },
 	.c_models = {
diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/transmeta.c
--- a/xen/arch/x86/cpu/transmeta.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/transmeta.c	Wed Jan 04 01:07:02 2012 -0500
@@ -92,7 +92,7 @@
 	}
 }
 
-static struct cpu_dev transmeta_cpu_dev __initdata = {
+static struct cpu_dev transmeta_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Transmeta",
 	.c_ident	= { "GenuineTMx86", "TransmetaCPU" },
 	.c_init		= init_transmeta,

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEr-0005ow-SJ; Wed, 04 Jan 2012 06:22:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEq-0005ob-6e
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1325658087!48928604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21624 invoked from network); 4 Jan 2012 06:21:28 -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;
	4 Jan 2012 06:21:28 -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 1RiKEk-0002gk-TZ
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEk-0006bh-It
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Message-Id: <E1RiKEk-0006bh-It@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] x86 cpu: Fix bug: unify cpu_dev
	attr as __cpuinitdata
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325657222 18000
# Node ID 7b68af1f52e749084bfd03eac97191d8ae8a7a90
# Parent  2300742519c3b3f6b145b94e3cbe803902c311cc
x86 cpu: Fix bug: unify cpu_dev attr as __cpuinitdata

Currently different x86 cpu define different attr for cpu_dev.
Some cpu define as __initdata, this would be risk under cpu hotplug.
This patch fix the bug, unify them as __cpuinitdata, as what AMD cpu
define now.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Shan, Haitao <haitao.shan@intel.com>
xen-unstable changeset: 23659:7fe0331986c5
xen-unstable date: Fri Jul 08 08:30:41 2011 +0100
---


diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/centaur.c	Wed Jan 04 01:07:02 2012 -0500
@@ -86,7 +86,7 @@
 	return size;
 }
 
-static struct cpu_dev centaur_cpu_dev __initdata = {
+static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Centaur",
 	.c_ident	= { "CentaurHauls" },
 	.c_init		= init_centaur,
diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/cyrix.c	Wed Jan 04 01:07:02 2012 -0500
@@ -368,7 +368,7 @@
 	generic_identify(c);
 }
 
-static struct cpu_dev cyrix_cpu_dev __initdata = {
+static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Cyrix",
 	.c_ident 	= { "CyrixInstead" },
 	.c_init		= init_cyrix,
@@ -383,7 +383,7 @@
 
 //early_arch_initcall(cyrix_init_cpu);
 
-static struct cpu_dev nsc_cpu_dev __initdata = {
+static struct cpu_dev nsc_cpu_dev __cpuinitdata = {
 	.c_vendor	= "NSC",
 	.c_ident 	= { "Geode by NSC" },
 	.c_init		= init_cyrix,
diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/intel.c	Wed Jan 04 01:07:02 2012 -0500
@@ -242,7 +242,7 @@
 	return size;
 }
 
-static struct cpu_dev intel_cpu_dev __devinitdata = {
+static struct cpu_dev intel_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Intel",
 	.c_ident 	= { "GenuineIntel" },
 	.c_models = {
diff -r 2300742519c3 -r 7b68af1f52e7 xen/arch/x86/cpu/transmeta.c
--- a/xen/arch/x86/cpu/transmeta.c	Wed Jan 04 00:54:37 2012 -0500
+++ b/xen/arch/x86/cpu/transmeta.c	Wed Jan 04 01:07:02 2012 -0500
@@ -92,7 +92,7 @@
 	}
 }
 
-static struct cpu_dev transmeta_cpu_dev __initdata = {
+static struct cpu_dev transmeta_cpu_dev __cpuinitdata = {
 	.c_vendor	= "Transmeta",
 	.c_ident	= { "GenuineTMx86", "TransmetaCPU" },
 	.c_init		= init_transmeta,

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEx-0005pr-70; Wed, 04 Jan 2012 06:22:23 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEv-0005ok-GJ
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1325658130!4198118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10271 invoked from network); 4 Jan 2012 06:22:14 -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;
	4 Jan 2012 06:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEk-0002gh-6r
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEk-0006bS-5i
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Message-Id: <E1RiKEk-0006bS-5i@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] VT-d: always clean up dpci timers.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325656477 18000
# Node ID 2300742519c3b3f6b145b94e3cbe803902c311cc
# Parent  c96f1d6f98d0aea013085cf933b6c9e01a6dadfd
VT-d: always clean up dpci timers.

If a VM has all its PCI devices deassigned, need_iommu(d) becomes
false but it might still have DPCI EOI timers that were init_timer()d
but not yet kill_timer()d. That causes xen to crash later because the
linked list of inactive timers gets corrupted, e.g.:

(XEN) Xen call trace:
(XEN) [<ffff82c480126256>] set_timer+0x1c2/0x24f
(XEN) [<ffff82c48011fbf8>] schedule+0x129/0x5dd
(XEN) [<ffff82c480122c1e>] __do_softirq+0x7e/0x89
(XEN) [<ffff82c480122c9d>] do_softirq+0x26/0x28
(XEN) [<ffff82c480153c85>] idle_loop+0x5a/0x5c
(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion 'entry->next->prev == entry' failed at
/local/scratch/tdeegan/xen-unstable.hg/xen/include:172
(XEN) ****************************************

The following patch makes sure that the domain destruction path always
clears up the DPCI state even if !needs_iommu(d).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 23746:aa54b8175954
xen-unstable date: Mon Jul 25 16:41:33 2011 +0100
---


diff -r c96f1d6f98d0 -r 2300742519c3 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Jan 04 00:32:00 2012 -0500
+++ b/xen/drivers/passthrough/pci.c	Wed Jan 04 00:54:37 2012 -0500
@@ -194,9 +194,6 @@
     if ( !iommu_enabled )
         return;
 
-    if ( !is_hvm_domain(d) && !need_iommu(d) )
-        return;
-
     spin_lock(&d->event_lock);
     hvm_irq_dpci = domain_get_irq_dpci(d);
     if ( hvm_irq_dpci != NULL )

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:22:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:22: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.xensource.com>)
	id 1RiKEx-0005pr-70; Wed, 04 Jan 2012 06:22:23 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEv-0005ok-GJ
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1325658130!4198118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10271 invoked from network); 4 Jan 2012 06:22:14 -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;
	4 Jan 2012 06:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEk-0002gh-6r
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKEk-0006bS-5i
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:22:10 +0000
Message-Id: <E1RiKEk-0006bS-5i@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:22:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] VT-d: always clean up dpci timers.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325656477 18000
# Node ID 2300742519c3b3f6b145b94e3cbe803902c311cc
# Parent  c96f1d6f98d0aea013085cf933b6c9e01a6dadfd
VT-d: always clean up dpci timers.

If a VM has all its PCI devices deassigned, need_iommu(d) becomes
false but it might still have DPCI EOI timers that were init_timer()d
but not yet kill_timer()d. That causes xen to crash later because the
linked list of inactive timers gets corrupted, e.g.:

(XEN) Xen call trace:
(XEN) [<ffff82c480126256>] set_timer+0x1c2/0x24f
(XEN) [<ffff82c48011fbf8>] schedule+0x129/0x5dd
(XEN) [<ffff82c480122c1e>] __do_softirq+0x7e/0x89
(XEN) [<ffff82c480122c9d>] do_softirq+0x26/0x28
(XEN) [<ffff82c480153c85>] idle_loop+0x5a/0x5c
(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion 'entry->next->prev == entry' failed at
/local/scratch/tdeegan/xen-unstable.hg/xen/include:172
(XEN) ****************************************

The following patch makes sure that the domain destruction path always
clears up the DPCI state even if !needs_iommu(d).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 23746:aa54b8175954
xen-unstable date: Mon Jul 25 16:41:33 2011 +0100
---


diff -r c96f1d6f98d0 -r 2300742519c3 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c	Wed Jan 04 00:32:00 2012 -0500
+++ b/xen/drivers/passthrough/pci.c	Wed Jan 04 00:54:37 2012 -0500
@@ -194,9 +194,6 @@
     if ( !iommu_enabled )
         return;
 
-    if ( !is_hvm_domain(d) && !need_iommu(d) )
-        return;
-
     spin_lock(&d->event_lock);
     hvm_irq_dpci = domain_get_irq_dpci(d);
     if ( hvm_irq_dpci != NULL )

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:33:14 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06: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.xensource.com>)
	id 1RiKPQ-00068z-HI; Wed, 04 Jan 2012 06:33:12 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPP-00068p-AP
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1325658745!50804063!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4522 invoked from network); 4 Jan 2012 06:32:26 -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;
	4 Jan 2012 06:32:26 -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 1RiKPM-0002o8-Tp
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPM-0006sK-LI
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Message-Id: <E1RiKPM-0006sK-LI@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:33:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added signature for changeset
	fa0b63cdbedc
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325658294 18000
# Node ID 62dbbdb8dc993dc122d368aa8d29b8f780702ba7
# Parent  2c40f3ba8d03ffcf7609d132cddc1bc4c2f193d2
Added signature for changeset fa0b63cdbedc
---


diff -r 2c40f3ba8d03 -r 62dbbdb8dc99 .hgsigs
--- a/.hgsigs	Wed Jan 04 01:21:59 2012 -0500
+++ b/.hgsigs	Wed Jan 04 01:24:54 2012 -0500
@@ -5,3 +5,4 @@
 635c48b8e646319c6c01767df5ac75e907285ac6 0 iQEcBAABAgAGBQJL/2snAAoJEIP+FMlX6CvZoqAH/3HL5W+Iq/UrabhbDMAy6+XzuHVIZaJ+CxHFNuli4REV8xcRLg6kLkRrcHdsFWkcUheFuyh+8wRzCkAiCui1BtdWy/Aad7oDK3R0ox5IcAM4oscZqewfHnJcpn7CFBEmp9/eOerZkqu7oCGspvw4Nj/26Tp3yE5S6zYcNtactFhSWplypjybAwF0Xos9pMik/KNYmSqU0b/0AlHTmiY7R0clnPrb8G9/PgttcU17kTR30+1RpyNOTRtx0IGDYLXDl8HZavbV5JbvYppk4E+93YfUjmlB+1D6er45GKLN3oOkaivEyxVYIY1nlCK6kI69od1ZkzdrvTzFM6RQDxzq3do=
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 0 iQIcBAABAgAGBQJOhkWFAAoJEHs3akJKJvCcMsYP/RrHcgTqPQ2KcToamxKFy0iuiFDhUZ/4Hdyw8eEcUMsls8iHLoCR0W8q3NfxN5AffZ5iWbw4oZUXlt5KxLe3u2WvvvjOWlk4YS3H4eY0nD3IDixrT44YE+/Ga5L4a1K95cpuGCTCIHwfHhJ1Et4xMJx3DsBLIytQyrHLq7DA8IulY5wjwKMLwrJoH9QTKIHZ6zz92fHjHzlb10mXzg3Bb9wPSslGuaAPDPGdBrFJHcIe/ItAug/h+Sl8x9ig8mm4ji/jPo2FRnnwzIUt/u46XFEUS4UkEMivqzlYsB/zf3IkOD6Ldg+QuT+WdEin49KCsa7h8NbHmLSiyNPkHc+9CpgV92M81+XiYSat32b72kJMrU35JzAEV+iJyvtz8oWOW1iapbDXRyjMh0hoMUPESwm8SDvk8EFBI72dOhkVchkDkiKCCU3mpSWVBEr6YQ4bxNGxdiJnBucbxMTGR4njE/A2jneAbfWzlJftoY1Byn5ql+rITAKIHjGB7bnf5KCIiYqNkrwO3cNAGZa+t+SZV6qdkyVzSwsHurYt5J+wbiDML6fjnDsvPJa9pbmZKyLppFImxtsTyZsm/ftZ+fQLK0IqsS9f5TW3YnP4SnGp573hFVe1FG3P/AAqY0lpbuR0WaKs7374sS7wNg42uYa8sE6JWquFMvNg4zQSNyQwdL4h
 6b411577871da411a0822fd732900acb5ca244d0 0 iQIcBAABAgAGBQJO8TtmAAoJEHs3akJKJvCcBKQP+wSF9pD7ebGcxBcRptBdiw+a1DId2UkTzJOT3HhlcaXu85uVhdf1lHSdMAPZAOT8vVrPQwYwdy3/wzD8YpKavy/n1cqgYXDwECPTodpjgh66JiWpkVE2wV0YgjvxtAQ9qPiNyQOeF1zhszA+xFbI2DVhzgR8LP/+J9gGEmk1FHXy1g/J3lpUmGEy+DIkzFG6t17PTM1j/5Q+6QwmE5Knkambl61hk9D5BCfP42V5AxLbYaBW4nL+Ro8mQa8wXbIUPPwq3VyoI2Via1yunpR0nY96qQzJ+h8Kz0US0S/qkuYhewuScv8sX+EMHppSCFRx6ZAIV5c2D5MrWg5IQJGeNTshBLOC2aGIuJU5vQpw0MYNHqZablQwvjyVx9wLRCW2SYBpi/HgJ7RDk3l5N1K9u+nszSJTh1AGtBCbOUze4UZOFs6Wk2tLhSReDKewimFZlnw12U3jdvwyoRDeO5iY5o2jlpEI0U13XWk7cfKXLdzqzp2wystXDHKA904/8ZeSB0mYNwoAGOXGX3L8R79gajb3NgZaD40IGQa2tLcXfmA9y5rcFOeAsxv9ZwFALtKW5/OqROQZ3RYd5Yo0fFotFwGwmNmLh4+xNsVjnidcUO7Nz2zSdx+QMWSqhYIfufz2rjM2lYVv++5zx6/D82//31Kqb/aXC3Vq4PolHmSVq3qE
+fa0b63cdbedc4a985d4710476640b42f0f9de1cc 0 iQIcBAABAgAGBQJPA/CWAAoJEHs3akJKJvCcaeAQANQgQBI8BtruBdj5v3+5y4tPfSYl8R2HWFqRBC+AUFzqQYvzv1uJVoiGJPvlZNjd8eEKtLxJ612NFBgL6hSfwNMKx6Ab13gnQU/voiF9PR4yfdMmSwzC8NLYlwjtco3/0SKgg5AX5TCZwqp4BPpducWC/x6/TW2y91bOcaOHfMuWtfmN3GLHshSliAMEyqWbRebWCiZXNucRg+wDa5OksbF/cITATPxL7zz0rvygAiMrkS/yp+WgEqTQL/epGkgzZH/OVNkSLp+sw/r3iUVQjkryK7XvMGuJUJBxs8SSJDESjvgMOxZ/HuDEuroavbLNzCfH9KwqUQDgaI5QPecUPzpfFK/pOlReVAu4WB096AL4HO+eeD2kMGcxOyEB4Ld+p1Et80ZUFHUkLdbfsUUN1P2KKfEM9sKN0i0QSoWK7ZPyPRlGOqriT+CsWqOvYJPYQX2z/XHAkegUzaYFYES+P6gDC/3NGva9jb8apx9W3l5ujsYis8/EKtY9U2Mm2DP19nxeAAGGLYqWv44kA6zGjtATP8x9iH2ci+eOjcTJFFwQzBQA5Fwdmlv+CV5aGpvDajVzJU6Il0wcuFKMPRiZRaBAMJ/jZCcyJ8NNwonLPoWMSFhaY9F3Zn3AXawvMV2/PYYgpOEwqkJyf2UdYk7D45irM6lbekAQXp8p6RTDcUJv

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:33:14 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06: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.xensource.com>)
	id 1RiKPQ-00068z-HI; Wed, 04 Jan 2012 06:33:12 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPP-00068p-AP
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1325658745!50804063!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4522 invoked from network); 4 Jan 2012 06:32:26 -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;
	4 Jan 2012 06:32:26 -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 1RiKPM-0002o8-Tp
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPM-0006sK-LI
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Message-Id: <E1RiKPM-0006sK-LI@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:33:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added signature for changeset
	fa0b63cdbedc
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325658294 18000
# Node ID 62dbbdb8dc993dc122d368aa8d29b8f780702ba7
# Parent  2c40f3ba8d03ffcf7609d132cddc1bc4c2f193d2
Added signature for changeset fa0b63cdbedc
---


diff -r 2c40f3ba8d03 -r 62dbbdb8dc99 .hgsigs
--- a/.hgsigs	Wed Jan 04 01:21:59 2012 -0500
+++ b/.hgsigs	Wed Jan 04 01:24:54 2012 -0500
@@ -5,3 +5,4 @@
 635c48b8e646319c6c01767df5ac75e907285ac6 0 iQEcBAABAgAGBQJL/2snAAoJEIP+FMlX6CvZoqAH/3HL5W+Iq/UrabhbDMAy6+XzuHVIZaJ+CxHFNuli4REV8xcRLg6kLkRrcHdsFWkcUheFuyh+8wRzCkAiCui1BtdWy/Aad7oDK3R0ox5IcAM4oscZqewfHnJcpn7CFBEmp9/eOerZkqu7oCGspvw4Nj/26Tp3yE5S6zYcNtactFhSWplypjybAwF0Xos9pMik/KNYmSqU0b/0AlHTmiY7R0clnPrb8G9/PgttcU17kTR30+1RpyNOTRtx0IGDYLXDl8HZavbV5JbvYppk4E+93YfUjmlB+1D6er45GKLN3oOkaivEyxVYIY1nlCK6kI69od1ZkzdrvTzFM6RQDxzq3do=
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 0 iQIcBAABAgAGBQJOhkWFAAoJEHs3akJKJvCcMsYP/RrHcgTqPQ2KcToamxKFy0iuiFDhUZ/4Hdyw8eEcUMsls8iHLoCR0W8q3NfxN5AffZ5iWbw4oZUXlt5KxLe3u2WvvvjOWlk4YS3H4eY0nD3IDixrT44YE+/Ga5L4a1K95cpuGCTCIHwfHhJ1Et4xMJx3DsBLIytQyrHLq7DA8IulY5wjwKMLwrJoH9QTKIHZ6zz92fHjHzlb10mXzg3Bb9wPSslGuaAPDPGdBrFJHcIe/ItAug/h+Sl8x9ig8mm4ji/jPo2FRnnwzIUt/u46XFEUS4UkEMivqzlYsB/zf3IkOD6Ldg+QuT+WdEin49KCsa7h8NbHmLSiyNPkHc+9CpgV92M81+XiYSat32b72kJMrU35JzAEV+iJyvtz8oWOW1iapbDXRyjMh0hoMUPESwm8SDvk8EFBI72dOhkVchkDkiKCCU3mpSWVBEr6YQ4bxNGxdiJnBucbxMTGR4njE/A2jneAbfWzlJftoY1Byn5ql+rITAKIHjGB7bnf5KCIiYqNkrwO3cNAGZa+t+SZV6qdkyVzSwsHurYt5J+wbiDML6fjnDsvPJa9pbmZKyLppFImxtsTyZsm/ftZ+fQLK0IqsS9f5TW3YnP4SnGp573hFVe1FG3P/AAqY0lpbuR0WaKs7374sS7wNg42uYa8sE6JWquFMvNg4zQSNyQwdL4h
 6b411577871da411a0822fd732900acb5ca244d0 0 iQIcBAABAgAGBQJO8TtmAAoJEHs3akJKJvCcBKQP+wSF9pD7ebGcxBcRptBdiw+a1DId2UkTzJOT3HhlcaXu85uVhdf1lHSdMAPZAOT8vVrPQwYwdy3/wzD8YpKavy/n1cqgYXDwECPTodpjgh66JiWpkVE2wV0YgjvxtAQ9qPiNyQOeF1zhszA+xFbI2DVhzgR8LP/+J9gGEmk1FHXy1g/J3lpUmGEy+DIkzFG6t17PTM1j/5Q+6QwmE5Knkambl61hk9D5BCfP42V5AxLbYaBW4nL+Ro8mQa8wXbIUPPwq3VyoI2Via1yunpR0nY96qQzJ+h8Kz0US0S/qkuYhewuScv8sX+EMHppSCFRx6ZAIV5c2D5MrWg5IQJGeNTshBLOC2aGIuJU5vQpw0MYNHqZablQwvjyVx9wLRCW2SYBpi/HgJ7RDk3l5N1K9u+nszSJTh1AGtBCbOUze4UZOFs6Wk2tLhSReDKewimFZlnw12U3jdvwyoRDeO5iY5o2jlpEI0U13XWk7cfKXLdzqzp2wystXDHKA904/8ZeSB0mYNwoAGOXGX3L8R79gajb3NgZaD40IGQa2tLcXfmA9y5rcFOeAsxv9ZwFALtKW5/OqROQZ3RYd5Yo0fFotFwGwmNmLh4+xNsVjnidcUO7Nz2zSdx+QMWSqhYIfufz2rjM2lYVv++5zx6/D82//31Kqb/aXC3Vq4PolHmSVq3qE
+fa0b63cdbedc4a985d4710476640b42f0f9de1cc 0 iQIcBAABAgAGBQJPA/CWAAoJEHs3akJKJvCcaeAQANQgQBI8BtruBdj5v3+5y4tPfSYl8R2HWFqRBC+AUFzqQYvzv1uJVoiGJPvlZNjd8eEKtLxJ612NFBgL6hSfwNMKx6Ab13gnQU/voiF9PR4yfdMmSwzC8NLYlwjtco3/0SKgg5AX5TCZwqp4BPpducWC/x6/TW2y91bOcaOHfMuWtfmN3GLHshSliAMEyqWbRebWCiZXNucRg+wDa5OksbF/cITATPxL7zz0rvygAiMrkS/yp+WgEqTQL/epGkgzZH/OVNkSLp+sw/r3iUVQjkryK7XvMGuJUJBxs8SSJDESjvgMOxZ/HuDEuroavbLNzCfH9KwqUQDgaI5QPecUPzpfFK/pOlReVAu4WB096AL4HO+eeD2kMGcxOyEB4Ld+p1Et80ZUFHUkLdbfsUUN1P2KKfEM9sKN0i0QSoWK7ZPyPRlGOqriT+CsWqOvYJPYQX2z/XHAkegUzaYFYES+P6gDC/3NGva9jb8apx9W3l5ujsYis8/EKtY9U2Mm2DP19nxeAAGGLYqWv44kA6zGjtATP8x9iH2ci+eOjcTJFFwQzBQA5Fwdmlv+CV5aGpvDajVzJU6Il0wcuFKMPRiZRaBAMJ/jZCcyJ8NNwonLPoWMSFhaY9F3Zn3AXawvMV2/PYYgpOEwqkJyf2UdYk7D45irM6lbekAQXp8p6RTDcUJv

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:33:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06: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.xensource.com>)
	id 1RiKPS-00069D-Ju; Wed, 04 Jan 2012 06:33:14 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPR-00068o-Oj
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1325658749!58835485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13781 invoked from network); 4 Jan 2012 06:32:30 -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;
	4 Jan 2012 06:32:30 -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 1RiKPM-0002o5-Fp
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPM-0006s5-7j
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Message-Id: <E1RiKPM-0006s5-7j@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:33:07 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added tag 3.4.4-rc3 for changeset
	fa0b63cdbedc
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325658119 18000
# Node ID 2c40f3ba8d03ffcf7609d132cddc1bc4c2f193d2
# Parent  fa0b63cdbedc4a985d4710476640b42f0f9de1cc
Added tag 3.4.4-rc3 for changeset fa0b63cdbedc
---


diff -r fa0b63cdbedc -r 2c40f3ba8d03 .hgtags
--- a/.hgtags	Wed Jan 04 01:21:28 2012 -0500
+++ b/.hgtags	Wed Jan 04 01:21:59 2012 -0500
@@ -63,3 +63,4 @@
 635c48b8e646319c6c01767df5ac75e907285ac6 RELEASE-3.4.3
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 3.4.4-rc1
 6b411577871da411a0822fd732900acb5ca244d0 3.4.4-rc2
+fa0b63cdbedc4a985d4710476640b42f0f9de1cc 3.4.4-rc3

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:33:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06: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.xensource.com>)
	id 1RiKPS-00069D-Ju; Wed, 04 Jan 2012 06:33:14 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPR-00068o-Oj
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1325658749!58835485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13781 invoked from network); 4 Jan 2012 06:32:30 -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;
	4 Jan 2012 06:32:30 -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 1RiKPM-0002o5-Fp
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPM-0006s5-7j
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Message-Id: <E1RiKPM-0006s5-7j@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:33:07 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added tag 3.4.4-rc3 for changeset
	fa0b63cdbedc
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325658119 18000
# Node ID 2c40f3ba8d03ffcf7609d132cddc1bc4c2f193d2
# Parent  fa0b63cdbedc4a985d4710476640b42f0f9de1cc
Added tag 3.4.4-rc3 for changeset fa0b63cdbedc
---


diff -r fa0b63cdbedc -r 2c40f3ba8d03 .hgtags
--- a/.hgtags	Wed Jan 04 01:21:28 2012 -0500
+++ b/.hgtags	Wed Jan 04 01:21:59 2012 -0500
@@ -63,3 +63,4 @@
 635c48b8e646319c6c01767df5ac75e907285ac6 RELEASE-3.4.3
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 3.4.4-rc1
 6b411577871da411a0822fd732900acb5ca244d0 3.4.4-rc2
+fa0b63cdbedc4a985d4710476640b42f0f9de1cc 3.4.4-rc3

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:33:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RiKPV-00069t-Mu; Wed, 04 Jan 2012 06:33:17 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPU-00068q-C5
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1325658788!9450048!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30842 invoked from network); 4 Jan 2012 06:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 06:33:09 -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 1RiKPM-0002o2-6B
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPL-0006rq-Q9
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:07 +0000
Message-Id: <E1RiKPL-0006rq-Q9@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:33:07 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to 3.4.4-rc3
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325658088 18000
# Node ID fa0b63cdbedc4a985d4710476640b42f0f9de1cc
# Parent  606abc216dbb9cbdb8af02b50fc135e9c4e60786
Update Xen version to 3.4.4-rc3
---


diff -r 606abc216dbb -r fa0b63cdbedc xen/Makefile
--- a/xen/Makefile	Wed Jan 04 01:15:08 2012 -0500
+++ b/xen/Makefile	Wed Jan 04 01:21:28 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc3$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 06:33:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 06:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RiKPV-00069t-Mu; Wed, 04 Jan 2012 06:33:17 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPU-00068q-C5
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1325658788!9450048!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30842 invoked from network); 4 Jan 2012 06:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 06:33:09 -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 1RiKPM-0002o2-6B
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiKPL-0006rq-Q9
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 06:33:07 +0000
Message-Id: <E1RiKPL-0006rq-Q9@xenbits.xen.org>
Date: Wed, 04 Jan 2012 06:33:07 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to 3.4.4-rc3
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325658088 18000
# Node ID fa0b63cdbedc4a985d4710476640b42f0f9de1cc
# Parent  606abc216dbb9cbdb8af02b50fc135e9c4e60786
Update Xen version to 3.4.4-rc3
---


diff -r 606abc216dbb -r fa0b63cdbedc xen/Makefile
--- a/xen/Makefile	Wed Jan 04 01:15:08 2012 -0500
+++ b/xen/Makefile	Wed Jan 04 01:21:28 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc3$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgt-0006nU-Um; Wed, 04 Jan 2012 07:55:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgs-0006n5-Pr
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1325663711!1275497!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19925 invoked from network); 4 Jan 2012 07:55:12 -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;
	4 Jan 2012 07:55:12 -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 1RiLgl-0003fR-4w
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgk-0000JG-Tg
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Message-Id: <E1RiLgk-0000JG-Tg@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to 3.4.4-rc4
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662752 18000
# Node ID dda061bf71b6f11e91a38b8f96ba47a55729ed97
# Parent  bb0f813e0fb5c56b40c6c92b8281f61554cc0046
Update Xen version to 3.4.4-rc4
---


diff -r bb0f813e0fb5 -r dda061bf71b6 xen/Makefile
--- a/xen/Makefile	Wed Jan 04 02:37:29 2012 -0500
+++ b/xen/Makefile	Wed Jan 04 02:39:12 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgt-0006nU-Um; Wed, 04 Jan 2012 07:55:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgs-0006n5-Pr
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1325663711!1275497!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19925 invoked from network); 4 Jan 2012 07:55:12 -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;
	4 Jan 2012 07:55:12 -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 1RiLgl-0003fR-4w
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgk-0000JG-Tg
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Message-Id: <E1RiLgk-0000JG-Tg@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to 3.4.4-rc4
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662752 18000
# Node ID dda061bf71b6f11e91a38b8f96ba47a55729ed97
# Parent  bb0f813e0fb5c56b40c6c92b8281f61554cc0046
Update Xen version to 3.4.4-rc4
---


diff -r bb0f813e0fb5 -r dda061bf71b6 xen/Makefile
--- a/xen/Makefile	Wed Jan 04 02:37:29 2012 -0500
+++ b/xen/Makefile	Wed Jan 04 02:39:12 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgv-0006no-2k; Wed, 04 Jan 2012 07:55:21 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgu-0006n6-Dr
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1325663712!9656756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10871 invoked from network); 4 Jan 2012 07:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 07:55:13 -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 1RiLgm-0003fX-9H
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgm-0000Jk-0t
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:12 +0000
Message-Id: <E1RiLgm-0000Jk-0t@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:11 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added signature for changeset
	dda061bf71b6
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662881 18000
# Node ID d0b8738f6e9f4ac8a1a749637df4424bfd30e9f5
# Parent  23e78eaba11b984afb5955dd04692b2ebb9b6728
Added signature for changeset dda061bf71b6
---


diff -r 23e78eaba11b -r d0b8738f6e9f .hgsigs
--- a/.hgsigs	Wed Jan 04 02:39:26 2012 -0500
+++ b/.hgsigs	Wed Jan 04 02:41:21 2012 -0500
@@ -6,3 +6,4 @@
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 0 iQIcBAABAgAGBQJOhkWFAAoJEHs3akJKJvCcMsYP/RrHcgTqPQ2KcToamxKFy0iuiFDhUZ/4Hdyw8eEcUMsls8iHLoCR0W8q3NfxN5AffZ5iWbw4oZUXlt5KxLe3u2WvvvjOWlk4YS3H4eY0nD3IDixrT44YE+/Ga5L4a1K95cpuGCTCIHwfHhJ1Et4xMJx3DsBLIytQyrHLq7DA8IulY5wjwKMLwrJoH9QTKIHZ6zz92fHjHzlb10mXzg3Bb9wPSslGuaAPDPGdBrFJHcIe/ItAug/h+Sl8x9ig8mm4ji/jPo2FRnnwzIUt/u46XFEUS4UkEMivqzlYsB/zf3IkOD6Ldg+QuT+WdEin49KCsa7h8NbHmLSiyNPkHc+9CpgV92M81+XiYSat32b72kJMrU35JzAEV+iJyvtz8oWOW1iapbDXRyjMh0hoMUPESwm8SDvk8EFBI72dOhkVchkDkiKCCU3mpSWVBEr6YQ4bxNGxdiJnBucbxMTGR4njE/A2jneAbfWzlJftoY1Byn5ql+rITAKIHjGB7bnf5KCIiYqNkrwO3cNAGZa+t+SZV6qdkyVzSwsHurYt5J+wbiDML6fjnDsvPJa9pbmZKyLppFImxtsTyZsm/ftZ+fQLK0IqsS9f5TW3YnP4SnGp573hFVe1FG3P/AAqY0lpbuR0WaKs7374sS7wNg42uYa8sE6JWquFMvNg4zQSNyQwdL4h
 6b411577871da411a0822fd732900acb5ca244d0 0 iQIcBAABAgAGBQJO8TtmAAoJEHs3akJKJvCcBKQP+wSF9pD7ebGcxBcRptBdiw+a1DId2UkTzJOT3HhlcaXu85uVhdf1lHSdMAPZAOT8vVrPQwYwdy3/wzD8YpKavy/n1cqgYXDwECPTodpjgh66JiWpkVE2wV0YgjvxtAQ9qPiNyQOeF1zhszA+xFbI2DVhzgR8LP/+J9gGEmk1FHXy1g/J3lpUmGEy+DIkzFG6t17PTM1j/5Q+6QwmE5Knkambl61hk9D5BCfP42V5AxLbYaBW4nL+Ro8mQa8wXbIUPPwq3VyoI2Via1yunpR0nY96qQzJ+h8Kz0US0S/qkuYhewuScv8sX+EMHppSCFRx6ZAIV5c2D5MrWg5IQJGeNTshBLOC2aGIuJU5vQpw0MYNHqZablQwvjyVx9wLRCW2SYBpi/HgJ7RDk3l5N1K9u+nszSJTh1AGtBCbOUze4UZOFs6Wk2tLhSReDKewimFZlnw12U3jdvwyoRDeO5iY5o2jlpEI0U13XWk7cfKXLdzqzp2wystXDHKA904/8ZeSB0mYNwoAGOXGX3L8R79gajb3NgZaD40IGQa2tLcXfmA9y5rcFOeAsxv9ZwFALtKW5/OqROQZ3RYd5Yo0fFotFwGwmNmLh4+xNsVjnidcUO7Nz2zSdx+QMWSqhYIfufz2rjM2lYVv++5zx6/D82//31Kqb/aXC3Vq4PolHmSVq3qE
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 0 iQIcBAABAgAGBQJPA/CWAAoJEHs3akJKJvCcaeAQANQgQBI8BtruBdj5v3+5y4tPfSYl8R2HWFqRBC+AUFzqQYvzv1uJVoiGJPvlZNjd8eEKtLxJ612NFBgL6hSfwNMKx6Ab13gnQU/voiF9PR4yfdMmSwzC8NLYlwjtco3/0SKgg5AX5TCZwqp4BPpducWC/x6/TW2y91bOcaOHfMuWtfmN3GLHshSliAMEyqWbRebWCiZXNucRg+wDa5OksbF/cITATPxL7zz0rvygAiMrkS/yp+WgEqTQL/epGkgzZH/OVNkSLp+sw/r3iUVQjkryK7XvMGuJUJBxs8SSJDESjvgMOxZ/HuDEuroavbLNzCfH9KwqUQDgaI5QPecUPzpfFK/pOlReVAu4WB096AL4HO+eeD2kMGcxOyEB4Ld+p1Et80ZUFHUkLdbfsUUN1P2KKfEM9sKN0i0QSoWK7ZPyPRlGOqriT+CsWqOvYJPYQX2z/XHAkegUzaYFYES+P6gDC/3NGva9jb8apx9W3l5ujsYis8/EKtY9U2Mm2DP19nxeAAGGLYqWv44kA6zGjtATP8x9iH2ci+eOjcTJFFwQzBQA5Fwdmlv+CV5aGpvDajVzJU6Il0wcuFKMPRiZRaBAMJ/jZCcyJ8NNwonLPoWMSFhaY9F3Zn3AXawvMV2/PYYgpOEwqkJyf2UdYk7D45irM6lbekAQXp8p6RTDcUJv
+dda061bf71b6f11e91a38b8f96ba47a55729ed97 0 iQIcBAABAgAGBQJPBAJ6AAoJEHs3akJKJvCcZZ8QAMxGgfAptV88ZQ065MqJwrHwYtgUaqYpGLal4cGIYg1XmAlVM0uTSk6kIJqjwMlWS0ByyPBCGo6PSP6lWA4VAFM8X0207DVN+OeO7eRWKj06Qv9QV77Kck/3525rrd13CuMBo3DpPHg+VpOYLnnVYFl3qebJCet6ITPp0P1OLg+khp2YCxbXAB2ZZfg3FfiUuvuGDomCTJgR16l5SHUIFxPAfuLKKuO3vX1a24eIAxI2HjUtTiGC0t8G9Oahy5pGdGsi7mzflv68Y5SWBy0GfFXzsop96yXyU62FpqQwPoKFPANpVYi2oSut574pzO/6YyeYdwAggkD45xyHAZcj/VH/wE8cfdB40x7Pyez09lSVjkAOb+Rr8CGtExt0aJfqz3ozXNwM+5WbQ/28jv475dCJfQweBkBik6PQnyrRcdBD3Mzoqr833Ux9rFp9afLxEo8aKBQ2P72hoJjQVWW/1rvHP3MfBg970C65zWOSkixZjw2vk9c0zwBa4pZ0Ss3ku+aLfaWGVzeg2Y/eLeIZMBu04alkMOdxzh4yDkSuxEF98rfty8qvtoVhpuQvMmuOtvJ2bWgYhqL7Aylh6fFnA65t/9ED+2kLP53iid6rBqokZ7pH/nOuzD2M+g0vtLgBl8wcrU61Ovtcqcqwkt1GJpPmF3aRteaM7fDgePj76Gz1

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgv-0006no-2k; Wed, 04 Jan 2012 07:55:21 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgu-0006n6-Dr
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1325663712!9656756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10871 invoked from network); 4 Jan 2012 07:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 07:55:13 -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 1RiLgm-0003fX-9H
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgm-0000Jk-0t
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:12 +0000
Message-Id: <E1RiLgm-0000Jk-0t@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:11 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added signature for changeset
	dda061bf71b6
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662881 18000
# Node ID d0b8738f6e9f4ac8a1a749637df4424bfd30e9f5
# Parent  23e78eaba11b984afb5955dd04692b2ebb9b6728
Added signature for changeset dda061bf71b6
---


diff -r 23e78eaba11b -r d0b8738f6e9f .hgsigs
--- a/.hgsigs	Wed Jan 04 02:39:26 2012 -0500
+++ b/.hgsigs	Wed Jan 04 02:41:21 2012 -0500
@@ -6,3 +6,4 @@
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 0 iQIcBAABAgAGBQJOhkWFAAoJEHs3akJKJvCcMsYP/RrHcgTqPQ2KcToamxKFy0iuiFDhUZ/4Hdyw8eEcUMsls8iHLoCR0W8q3NfxN5AffZ5iWbw4oZUXlt5KxLe3u2WvvvjOWlk4YS3H4eY0nD3IDixrT44YE+/Ga5L4a1K95cpuGCTCIHwfHhJ1Et4xMJx3DsBLIytQyrHLq7DA8IulY5wjwKMLwrJoH9QTKIHZ6zz92fHjHzlb10mXzg3Bb9wPSslGuaAPDPGdBrFJHcIe/ItAug/h+Sl8x9ig8mm4ji/jPo2FRnnwzIUt/u46XFEUS4UkEMivqzlYsB/zf3IkOD6Ldg+QuT+WdEin49KCsa7h8NbHmLSiyNPkHc+9CpgV92M81+XiYSat32b72kJMrU35JzAEV+iJyvtz8oWOW1iapbDXRyjMh0hoMUPESwm8SDvk8EFBI72dOhkVchkDkiKCCU3mpSWVBEr6YQ4bxNGxdiJnBucbxMTGR4njE/A2jneAbfWzlJftoY1Byn5ql+rITAKIHjGB7bnf5KCIiYqNkrwO3cNAGZa+t+SZV6qdkyVzSwsHurYt5J+wbiDML6fjnDsvPJa9pbmZKyLppFImxtsTyZsm/ftZ+fQLK0IqsS9f5TW3YnP4SnGp573hFVe1FG3P/AAqY0lpbuR0WaKs7374sS7wNg42uYa8sE6JWquFMvNg4zQSNyQwdL4h
 6b411577871da411a0822fd732900acb5ca244d0 0 iQIcBAABAgAGBQJO8TtmAAoJEHs3akJKJvCcBKQP+wSF9pD7ebGcxBcRptBdiw+a1DId2UkTzJOT3HhlcaXu85uVhdf1lHSdMAPZAOT8vVrPQwYwdy3/wzD8YpKavy/n1cqgYXDwECPTodpjgh66JiWpkVE2wV0YgjvxtAQ9qPiNyQOeF1zhszA+xFbI2DVhzgR8LP/+J9gGEmk1FHXy1g/J3lpUmGEy+DIkzFG6t17PTM1j/5Q+6QwmE5Knkambl61hk9D5BCfP42V5AxLbYaBW4nL+Ro8mQa8wXbIUPPwq3VyoI2Via1yunpR0nY96qQzJ+h8Kz0US0S/qkuYhewuScv8sX+EMHppSCFRx6ZAIV5c2D5MrWg5IQJGeNTshBLOC2aGIuJU5vQpw0MYNHqZablQwvjyVx9wLRCW2SYBpi/HgJ7RDk3l5N1K9u+nszSJTh1AGtBCbOUze4UZOFs6Wk2tLhSReDKewimFZlnw12U3jdvwyoRDeO5iY5o2jlpEI0U13XWk7cfKXLdzqzp2wystXDHKA904/8ZeSB0mYNwoAGOXGX3L8R79gajb3NgZaD40IGQa2tLcXfmA9y5rcFOeAsxv9ZwFALtKW5/OqROQZ3RYd5Yo0fFotFwGwmNmLh4+xNsVjnidcUO7Nz2zSdx+QMWSqhYIfufz2rjM2lYVv++5zx6/D82//31Kqb/aXC3Vq4PolHmSVq3qE
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 0 iQIcBAABAgAGBQJPA/CWAAoJEHs3akJKJvCcaeAQANQgQBI8BtruBdj5v3+5y4tPfSYl8R2HWFqRBC+AUFzqQYvzv1uJVoiGJPvlZNjd8eEKtLxJ612NFBgL6hSfwNMKx6Ab13gnQU/voiF9PR4yfdMmSwzC8NLYlwjtco3/0SKgg5AX5TCZwqp4BPpducWC/x6/TW2y91bOcaOHfMuWtfmN3GLHshSliAMEyqWbRebWCiZXNucRg+wDa5OksbF/cITATPxL7zz0rvygAiMrkS/yp+WgEqTQL/epGkgzZH/OVNkSLp+sw/r3iUVQjkryK7XvMGuJUJBxs8SSJDESjvgMOxZ/HuDEuroavbLNzCfH9KwqUQDgaI5QPecUPzpfFK/pOlReVAu4WB096AL4HO+eeD2kMGcxOyEB4Ld+p1Et80ZUFHUkLdbfsUUN1P2KKfEM9sKN0i0QSoWK7ZPyPRlGOqriT+CsWqOvYJPYQX2z/XHAkegUzaYFYES+P6gDC/3NGva9jb8apx9W3l5ujsYis8/EKtY9U2Mm2DP19nxeAAGGLYqWv44kA6zGjtATP8x9iH2ci+eOjcTJFFwQzBQA5Fwdmlv+CV5aGpvDajVzJU6Il0wcuFKMPRiZRaBAMJ/jZCcyJ8NNwonLPoWMSFhaY9F3Zn3AXawvMV2/PYYgpOEwqkJyf2UdYk7D45irM6lbekAQXp8p6RTDcUJv
+dda061bf71b6f11e91a38b8f96ba47a55729ed97 0 iQIcBAABAgAGBQJPBAJ6AAoJEHs3akJKJvCcZZ8QAMxGgfAptV88ZQ065MqJwrHwYtgUaqYpGLal4cGIYg1XmAlVM0uTSk6kIJqjwMlWS0ByyPBCGo6PSP6lWA4VAFM8X0207DVN+OeO7eRWKj06Qv9QV77Kck/3525rrd13CuMBo3DpPHg+VpOYLnnVYFl3qebJCet6ITPp0P1OLg+khp2YCxbXAB2ZZfg3FfiUuvuGDomCTJgR16l5SHUIFxPAfuLKKuO3vX1a24eIAxI2HjUtTiGC0t8G9Oahy5pGdGsi7mzflv68Y5SWBy0GfFXzsop96yXyU62FpqQwPoKFPANpVYi2oSut574pzO/6YyeYdwAggkD45xyHAZcj/VH/wE8cfdB40x7Pyez09lSVjkAOb+Rr8CGtExt0aJfqz3ozXNwM+5WbQ/28jv475dCJfQweBkBik6PQnyrRcdBD3Mzoqr833Ux9rFp9afLxEo8aKBQ2P72hoJjQVWW/1rvHP3MfBg970C65zWOSkixZjw2vk9c0zwBa4pZ0Ss3ku+aLfaWGVzeg2Y/eLeIZMBu04alkMOdxzh4yDkSuxEF98rfty8qvtoVhpuQvMmuOtvJ2bWgYhqL7Aylh6fFnA65t/9ED+2kLP53iid6rBqokZ7pH/nOuzD2M+g0vtLgBl8wcrU61Ovtcqcqwkt1GJpPmF3aRteaM7fDgePj76Gz1

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgt-0006nP-S6; Wed, 04 Jan 2012 07:55:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgs-0006n4-J0
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1325663656!59442635!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.2 required=7.0 tests=UPPERCASE_50_75
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20916 invoked from network); 4 Jan 2012 07:54:17 -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;
	4 Jan 2012 07:54:17 -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 1RiLgk-0003fO-Qh
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgk-0000J1-G7
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Message-Id: <E1RiLgk-0000J1-G7@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] fix for changeset
	19997:985c41cd52da AMD OSVW for Xen
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662649 18000
# Node ID bb0f813e0fb5c56b40c6c92b8281f61554cc0046
# Parent  25a6060ebd6684ded50cb7bf4b8dab819d4b7f92
fix for changeset 19997:985c41cd52da AMD OSVW for Xen

This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a specific
erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW feature
isn't applicable.  This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
---


diff -r 25a6060ebd66 -r bb0f813e0fb5 xen/arch/x86/cpu/amd.h
--- a/xen/arch/x86/cpu/amd.h	Wed Jan 04 02:27:21 2012 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * amd.h - AMD processor specific definitions
- */
-
-#ifndef __AMD_H__
-#define __AMD_H__
-
-#include <asm/cpufeature.h>
-
-/* CPUID masked for use by AMD-V Extended Migration */
-
-#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
-#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
-
-/* Family 0Fh, Revision C */
-#define AMD_FEATURES_K8_REV_C_ECX  0
-#define AMD_FEATURES_K8_REV_C_EDX (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SEP)      | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   | 	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_CLFLSH)|	\
-	__bit(X86_FEATURE_MMX)      | __bit(X86_FEATURE_FXSR)  | 	\
-	__bit(X86_FEATURE_XMM)      | __bit(X86_FEATURE_XMM2))
-#define AMD_EXTFEATURES_K8_REV_C_ECX  0 
-#define AMD_EXTFEATURES_K8_REV_C_EDX  (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SYSCALL)  | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   |	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_NX)    |	\
-	__bit(X86_FEATURE_MMXEXT)   | __bit(X86_FEATURE_MMX)   |	\
-	__bit(X86_FEATURE_FXSR)     | __bit(X86_FEATURE_LM)    |	\
-	__bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
-
-/* Family 0Fh, Revision D */
-#define AMD_FEATURES_K8_REV_D_ECX         AMD_FEATURES_K8_REV_C_ECX
-#define AMD_FEATURES_K8_REV_D_EDX         AMD_FEATURES_K8_REV_C_EDX
-#define AMD_EXTFEATURES_K8_REV_D_ECX     (AMD_EXTFEATURES_K8_REV_C_ECX |\
-	__bit(X86_FEATURE_LAHF_LM))
-#define AMD_EXTFEATURES_K8_REV_D_EDX     (AMD_EXTFEATURES_K8_REV_C_EDX |\
-	__bit(X86_FEATURE_FFXSR))
-
-/* Family 0Fh, Revision E */
-#define AMD_FEATURES_K8_REV_E_ECX        (AMD_FEATURES_K8_REV_D_ECX |	\
-	__bit(X86_FEATURE_XMM3))
-#define AMD_FEATURES_K8_REV_E_EDX        (AMD_FEATURES_K8_REV_D_EDX | 	\
-	__bit(X86_FEATURE_HT))
-#define AMD_EXTFEATURES_K8_REV_E_ECX     (AMD_EXTFEATURES_K8_REV_D_ECX |\
-	__bit(X86_FEATURE_CMP_LEGACY)) 
-#define AMD_EXTFEATURES_K8_REV_E_EDX      AMD_EXTFEATURES_K8_REV_D_EDX
-
-/* Family 0Fh, Revision F */
-#define AMD_FEATURES_K8_REV_F_ECX        (AMD_FEATURES_K8_REV_E_ECX | 	\
-	__bit(X86_FEATURE_CX16))
-#define AMD_FEATURES_K8_REV_F_EDX         AMD_FEATURES_K8_REV_E_EDX
-#define AMD_EXTFEATURES_K8_REV_F_ECX     (AMD_EXTFEATURES_K8_REV_E_ECX |\
-	__bit(X86_FEATURE_SVME) | __bit(X86_FEATURE_EXTAPICSPACE) |	\
-	__bit(X86_FEATURE_ALTMOVCR))
-#define AMD_EXTFEATURES_K8_REV_F_EDX     (AMD_EXTFEATURES_K8_REV_E_EDX |\
-	__bit(X86_FEATURE_RDTSCP))
-
-/* Family 0Fh, Revision G */
-#define AMD_FEATURES_K8_REV_G_ECX         AMD_FEATURES_K8_REV_F_ECX
-#define AMD_FEATURES_K8_REV_G_EDX         AMD_FEATURES_K8_REV_F_EDX
-#define AMD_EXTFEATURES_K8_REV_G_ECX     (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_3DNOWPF))
-#define AMD_EXTFEATURES_K8_REV_G_EDX      AMD_EXTFEATURES_K8_REV_F_EDX
-
-/* Family 10h, Revision B */
-#define AMD_FEATURES_FAM10h_REV_B_ECX    (AMD_FEATURES_K8_REV_F_ECX | 	\
-	__bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
-#define AMD_FEATURES_FAM10h_REV_B_EDX     AMD_FEATURES_K8_REV_F_EDX
-#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | 		\
-	__bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | 	\
-	__bit(X86_FEATURE_IBS))
-#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
-	__bit(X86_FEATURE_PAGE1GB))
-
-/* Family 10h, Revision C */
-#define AMD_FEATURES_FAM10h_REV_C_ECX     AMD_FEATURES_FAM10h_REV_B_ECX
-#define AMD_FEATURES_FAM10h_REV_C_EDX     AMD_FEATURES_FAM10h_REV_B_EDX
-#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
-	__bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
-#define AMD_EXTFEATURES_FAM10h_REV_C_EDX  AMD_EXTFEATURES_FAM10h_REV_B_EDX
-
-/* Family 11h, Revision B */
-#define AMD_FEATURES_FAM11h_REV_B_ECX     AMD_FEATURES_K8_REV_G_ECX
-#define AMD_FEATURES_FAM11h_REV_B_EDX     AMD_FEATURES_K8_REV_G_EDX
-#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
-	__bit(X86_FEATURE_SKINIT))
-#define AMD_EXTFEATURES_FAM11h_REV_B_EDX  AMD_EXTFEATURES_K8_REV_G_EDX
-
-#endif /* __AMD_H__ */
diff -r 25a6060ebd66 -r bb0f813e0fb5 xen/include/asm-x86/amd.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/amd.h	Wed Jan 04 02:37:29 2012 -0500
@@ -0,0 +1,139 @@
+/*
+ * amd.h - AMD processor specific definitions
+ */
+
+#ifndef __AMD_H__
+#define __AMD_H__
+
+#include <asm/cpufeature.h>
+
+/* CPUID masked for use by AMD-V Extended Migration */
+
+#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
+#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
+
+/* Family 0Fh, Revision C */
+#define AMD_FEATURES_K8_REV_C_ECX  0
+#define AMD_FEATURES_K8_REV_C_EDX (					\
+	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
+	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
+	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
+	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
+	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
+	__bit(X86_FEATURE_SEP)      | __bit(X86_FEATURE_MTRR)  |	\
+	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   | 	\
+	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
+	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_CLFLSH)|	\
+	__bit(X86_FEATURE_MMX)      | __bit(X86_FEATURE_FXSR)  | 	\
+	__bit(X86_FEATURE_XMM)      | __bit(X86_FEATURE_XMM2))
+#define AMD_EXTFEATURES_K8_REV_C_ECX  0 
+#define AMD_EXTFEATURES_K8_REV_C_EDX  (					\
+	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
+	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
+	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
+	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
+	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
+	__bit(X86_FEATURE_SYSCALL)  | __bit(X86_FEATURE_MTRR)  |	\
+	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   |	\
+	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
+	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_NX)    |	\
+	__bit(X86_FEATURE_MMXEXT)   | __bit(X86_FEATURE_MMX)   |	\
+	__bit(X86_FEATURE_FXSR)     | __bit(X86_FEATURE_LM)    |	\
+	__bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
+
+/* Family 0Fh, Revision D */
+#define AMD_FEATURES_K8_REV_D_ECX         AMD_FEATURES_K8_REV_C_ECX
+#define AMD_FEATURES_K8_REV_D_EDX         AMD_FEATURES_K8_REV_C_EDX
+#define AMD_EXTFEATURES_K8_REV_D_ECX     (AMD_EXTFEATURES_K8_REV_C_ECX |\
+	__bit(X86_FEATURE_LAHF_LM))
+#define AMD_EXTFEATURES_K8_REV_D_EDX     (AMD_EXTFEATURES_K8_REV_C_EDX |\
+	__bit(X86_FEATURE_FFXSR))
+
+/* Family 0Fh, Revision E */
+#define AMD_FEATURES_K8_REV_E_ECX        (AMD_FEATURES_K8_REV_D_ECX |	\
+	__bit(X86_FEATURE_XMM3))
+#define AMD_FEATURES_K8_REV_E_EDX        (AMD_FEATURES_K8_REV_D_EDX | 	\
+	__bit(X86_FEATURE_HT))
+#define AMD_EXTFEATURES_K8_REV_E_ECX     (AMD_EXTFEATURES_K8_REV_D_ECX |\
+	__bit(X86_FEATURE_CMP_LEGACY)) 
+#define AMD_EXTFEATURES_K8_REV_E_EDX      AMD_EXTFEATURES_K8_REV_D_EDX
+
+/* Family 0Fh, Revision F */
+#define AMD_FEATURES_K8_REV_F_ECX        (AMD_FEATURES_K8_REV_E_ECX | 	\
+	__bit(X86_FEATURE_CX16))
+#define AMD_FEATURES_K8_REV_F_EDX         AMD_FEATURES_K8_REV_E_EDX
+#define AMD_EXTFEATURES_K8_REV_F_ECX     (AMD_EXTFEATURES_K8_REV_E_ECX |\
+	__bit(X86_FEATURE_SVME) | __bit(X86_FEATURE_EXTAPICSPACE) |	\
+	__bit(X86_FEATURE_ALTMOVCR))
+#define AMD_EXTFEATURES_K8_REV_F_EDX     (AMD_EXTFEATURES_K8_REV_E_EDX |\
+	__bit(X86_FEATURE_RDTSCP))
+
+/* Family 0Fh, Revision G */
+#define AMD_FEATURES_K8_REV_G_ECX         AMD_FEATURES_K8_REV_F_ECX
+#define AMD_FEATURES_K8_REV_G_EDX         AMD_FEATURES_K8_REV_F_EDX
+#define AMD_EXTFEATURES_K8_REV_G_ECX     (AMD_EXTFEATURES_K8_REV_F_ECX |\
+	__bit(X86_FEATURE_3DNOWPF))
+#define AMD_EXTFEATURES_K8_REV_G_EDX      AMD_EXTFEATURES_K8_REV_F_EDX
+
+/* Family 10h, Revision B */
+#define AMD_FEATURES_FAM10h_REV_B_ECX    (AMD_FEATURES_K8_REV_F_ECX | 	\
+	__bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
+#define AMD_FEATURES_FAM10h_REV_B_EDX     AMD_FEATURES_K8_REV_F_EDX
+#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
+	__bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | 		\
+	__bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | 	\
+	__bit(X86_FEATURE_IBS))
+#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
+	__bit(X86_FEATURE_PAGE1GB))
+
+/* Family 10h, Revision C */
+#define AMD_FEATURES_FAM10h_REV_C_ECX     AMD_FEATURES_FAM10h_REV_B_ECX
+#define AMD_FEATURES_FAM10h_REV_C_EDX     AMD_FEATURES_FAM10h_REV_B_EDX
+#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
+	__bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
+#define AMD_EXTFEATURES_FAM10h_REV_C_EDX  AMD_EXTFEATURES_FAM10h_REV_B_EDX
+
+/* Family 11h, Revision B */
+#define AMD_FEATURES_FAM11h_REV_B_ECX     AMD_FEATURES_K8_REV_G_ECX
+#define AMD_FEATURES_FAM11h_REV_B_EDX     AMD_FEATURES_K8_REV_G_EDX
+#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
+	__bit(X86_FEATURE_SKINIT))
+#define AMD_EXTFEATURES_FAM11h_REV_B_EDX  AMD_EXTFEATURES_K8_REV_G_EDX
+
+/* AMD errata checking
+ *
+ * Errata are defined using the AMD_LEGACY_ERRATUM() or AMD_OSVW_ERRATUM()
+ * macros. The latter is intended for newer errata that have an OSVW id
+ * assigned, which it takes as first argument. Both take a variable number
+ * of family-specific model-stepping ranges created by AMD_MODEL_RANGE().
+ *
+ * Example 1:
+ * #define AMD_ERRATUM_319                                              \
+ *   AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0x4, 0x2),      \
+ *                      AMD_MODEL_RANGE(0x10, 0x8, 0x0, 0x8, 0x0),      \
+ *                      AMD_MODEL_RANGE(0x10, 0x9, 0x0, 0x9, 0x0))
+ * Example 2:
+ * #define AMD_ERRATUM_400                                              \
+ *   AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf),    \
+ *                       AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf))
+ *   
+ */
+
+#define AMD_LEGACY_ERRATUM(...)         0 /* legacy */, __VA_ARGS__, 0
+#define AMD_OSVW_ERRATUM(osvw_id, ...)  1 /* osvw */, osvw_id, __VA_ARGS__, 0
+#define AMD_MODEL_RANGE(f, m_start, s_start, m_end, s_end)              \
+    ((f << 24) | (m_start << 16) | (s_start << 12) | (m_end << 4) | (s_end))
+#define AMD_MODEL_RANGE_FAMILY(range)   (((range) >> 24) & 0xff)
+#define AMD_MODEL_RANGE_START(range)    (((range) >> 12) & 0xfff)
+#define AMD_MODEL_RANGE_END(range)      ((range) & 0xfff)
+
+#define AMD_ERRATUM_170                                                 \
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf))
+
+#define AMD_ERRATUM_383                                                 \
+    AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf),	\
+		        AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0x1, 0x0))
+
+int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
+
+#endif /* __AMD_H__ */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgt-0006nP-S6; Wed, 04 Jan 2012 07:55:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgs-0006n4-J0
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1325663656!59442635!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.2 required=7.0 tests=UPPERCASE_50_75
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20916 invoked from network); 4 Jan 2012 07:54:17 -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;
	4 Jan 2012 07:54:17 -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 1RiLgk-0003fO-Qh
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgk-0000J1-G7
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Message-Id: <E1RiLgk-0000J1-G7@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] fix for changeset
	19997:985c41cd52da AMD OSVW for Xen
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662649 18000
# Node ID bb0f813e0fb5c56b40c6c92b8281f61554cc0046
# Parent  25a6060ebd6684ded50cb7bf4b8dab819d4b7f92
fix for changeset 19997:985c41cd52da AMD OSVW for Xen

This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a specific
erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW feature
isn't applicable.  This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
---


diff -r 25a6060ebd66 -r bb0f813e0fb5 xen/arch/x86/cpu/amd.h
--- a/xen/arch/x86/cpu/amd.h	Wed Jan 04 02:27:21 2012 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * amd.h - AMD processor specific definitions
- */
-
-#ifndef __AMD_H__
-#define __AMD_H__
-
-#include <asm/cpufeature.h>
-
-/* CPUID masked for use by AMD-V Extended Migration */
-
-#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
-#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
-
-/* Family 0Fh, Revision C */
-#define AMD_FEATURES_K8_REV_C_ECX  0
-#define AMD_FEATURES_K8_REV_C_EDX (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SEP)      | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   | 	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_CLFLSH)|	\
-	__bit(X86_FEATURE_MMX)      | __bit(X86_FEATURE_FXSR)  | 	\
-	__bit(X86_FEATURE_XMM)      | __bit(X86_FEATURE_XMM2))
-#define AMD_EXTFEATURES_K8_REV_C_ECX  0 
-#define AMD_EXTFEATURES_K8_REV_C_EDX  (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SYSCALL)  | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   |	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_NX)    |	\
-	__bit(X86_FEATURE_MMXEXT)   | __bit(X86_FEATURE_MMX)   |	\
-	__bit(X86_FEATURE_FXSR)     | __bit(X86_FEATURE_LM)    |	\
-	__bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
-
-/* Family 0Fh, Revision D */
-#define AMD_FEATURES_K8_REV_D_ECX         AMD_FEATURES_K8_REV_C_ECX
-#define AMD_FEATURES_K8_REV_D_EDX         AMD_FEATURES_K8_REV_C_EDX
-#define AMD_EXTFEATURES_K8_REV_D_ECX     (AMD_EXTFEATURES_K8_REV_C_ECX |\
-	__bit(X86_FEATURE_LAHF_LM))
-#define AMD_EXTFEATURES_K8_REV_D_EDX     (AMD_EXTFEATURES_K8_REV_C_EDX |\
-	__bit(X86_FEATURE_FFXSR))
-
-/* Family 0Fh, Revision E */
-#define AMD_FEATURES_K8_REV_E_ECX        (AMD_FEATURES_K8_REV_D_ECX |	\
-	__bit(X86_FEATURE_XMM3))
-#define AMD_FEATURES_K8_REV_E_EDX        (AMD_FEATURES_K8_REV_D_EDX | 	\
-	__bit(X86_FEATURE_HT))
-#define AMD_EXTFEATURES_K8_REV_E_ECX     (AMD_EXTFEATURES_K8_REV_D_ECX |\
-	__bit(X86_FEATURE_CMP_LEGACY)) 
-#define AMD_EXTFEATURES_K8_REV_E_EDX      AMD_EXTFEATURES_K8_REV_D_EDX
-
-/* Family 0Fh, Revision F */
-#define AMD_FEATURES_K8_REV_F_ECX        (AMD_FEATURES_K8_REV_E_ECX | 	\
-	__bit(X86_FEATURE_CX16))
-#define AMD_FEATURES_K8_REV_F_EDX         AMD_FEATURES_K8_REV_E_EDX
-#define AMD_EXTFEATURES_K8_REV_F_ECX     (AMD_EXTFEATURES_K8_REV_E_ECX |\
-	__bit(X86_FEATURE_SVME) | __bit(X86_FEATURE_EXTAPICSPACE) |	\
-	__bit(X86_FEATURE_ALTMOVCR))
-#define AMD_EXTFEATURES_K8_REV_F_EDX     (AMD_EXTFEATURES_K8_REV_E_EDX |\
-	__bit(X86_FEATURE_RDTSCP))
-
-/* Family 0Fh, Revision G */
-#define AMD_FEATURES_K8_REV_G_ECX         AMD_FEATURES_K8_REV_F_ECX
-#define AMD_FEATURES_K8_REV_G_EDX         AMD_FEATURES_K8_REV_F_EDX
-#define AMD_EXTFEATURES_K8_REV_G_ECX     (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_3DNOWPF))
-#define AMD_EXTFEATURES_K8_REV_G_EDX      AMD_EXTFEATURES_K8_REV_F_EDX
-
-/* Family 10h, Revision B */
-#define AMD_FEATURES_FAM10h_REV_B_ECX    (AMD_FEATURES_K8_REV_F_ECX | 	\
-	__bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
-#define AMD_FEATURES_FAM10h_REV_B_EDX     AMD_FEATURES_K8_REV_F_EDX
-#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | 		\
-	__bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | 	\
-	__bit(X86_FEATURE_IBS))
-#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
-	__bit(X86_FEATURE_PAGE1GB))
-
-/* Family 10h, Revision C */
-#define AMD_FEATURES_FAM10h_REV_C_ECX     AMD_FEATURES_FAM10h_REV_B_ECX
-#define AMD_FEATURES_FAM10h_REV_C_EDX     AMD_FEATURES_FAM10h_REV_B_EDX
-#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
-	__bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
-#define AMD_EXTFEATURES_FAM10h_REV_C_EDX  AMD_EXTFEATURES_FAM10h_REV_B_EDX
-
-/* Family 11h, Revision B */
-#define AMD_FEATURES_FAM11h_REV_B_ECX     AMD_FEATURES_K8_REV_G_ECX
-#define AMD_FEATURES_FAM11h_REV_B_EDX     AMD_FEATURES_K8_REV_G_EDX
-#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
-	__bit(X86_FEATURE_SKINIT))
-#define AMD_EXTFEATURES_FAM11h_REV_B_EDX  AMD_EXTFEATURES_K8_REV_G_EDX
-
-#endif /* __AMD_H__ */
diff -r 25a6060ebd66 -r bb0f813e0fb5 xen/include/asm-x86/amd.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/amd.h	Wed Jan 04 02:37:29 2012 -0500
@@ -0,0 +1,139 @@
+/*
+ * amd.h - AMD processor specific definitions
+ */
+
+#ifndef __AMD_H__
+#define __AMD_H__
+
+#include <asm/cpufeature.h>
+
+/* CPUID masked for use by AMD-V Extended Migration */
+
+#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
+#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
+
+/* Family 0Fh, Revision C */
+#define AMD_FEATURES_K8_REV_C_ECX  0
+#define AMD_FEATURES_K8_REV_C_EDX (					\
+	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
+	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
+	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
+	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
+	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
+	__bit(X86_FEATURE_SEP)      | __bit(X86_FEATURE_MTRR)  |	\
+	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   | 	\
+	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
+	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_CLFLSH)|	\
+	__bit(X86_FEATURE_MMX)      | __bit(X86_FEATURE_FXSR)  | 	\
+	__bit(X86_FEATURE_XMM)      | __bit(X86_FEATURE_XMM2))
+#define AMD_EXTFEATURES_K8_REV_C_ECX  0 
+#define AMD_EXTFEATURES_K8_REV_C_EDX  (					\
+	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
+	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
+	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
+	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
+	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
+	__bit(X86_FEATURE_SYSCALL)  | __bit(X86_FEATURE_MTRR)  |	\
+	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   |	\
+	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
+	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_NX)    |	\
+	__bit(X86_FEATURE_MMXEXT)   | __bit(X86_FEATURE_MMX)   |	\
+	__bit(X86_FEATURE_FXSR)     | __bit(X86_FEATURE_LM)    |	\
+	__bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
+
+/* Family 0Fh, Revision D */
+#define AMD_FEATURES_K8_REV_D_ECX         AMD_FEATURES_K8_REV_C_ECX
+#define AMD_FEATURES_K8_REV_D_EDX         AMD_FEATURES_K8_REV_C_EDX
+#define AMD_EXTFEATURES_K8_REV_D_ECX     (AMD_EXTFEATURES_K8_REV_C_ECX |\
+	__bit(X86_FEATURE_LAHF_LM))
+#define AMD_EXTFEATURES_K8_REV_D_EDX     (AMD_EXTFEATURES_K8_REV_C_EDX |\
+	__bit(X86_FEATURE_FFXSR))
+
+/* Family 0Fh, Revision E */
+#define AMD_FEATURES_K8_REV_E_ECX        (AMD_FEATURES_K8_REV_D_ECX |	\
+	__bit(X86_FEATURE_XMM3))
+#define AMD_FEATURES_K8_REV_E_EDX        (AMD_FEATURES_K8_REV_D_EDX | 	\
+	__bit(X86_FEATURE_HT))
+#define AMD_EXTFEATURES_K8_REV_E_ECX     (AMD_EXTFEATURES_K8_REV_D_ECX |\
+	__bit(X86_FEATURE_CMP_LEGACY)) 
+#define AMD_EXTFEATURES_K8_REV_E_EDX      AMD_EXTFEATURES_K8_REV_D_EDX
+
+/* Family 0Fh, Revision F */
+#define AMD_FEATURES_K8_REV_F_ECX        (AMD_FEATURES_K8_REV_E_ECX | 	\
+	__bit(X86_FEATURE_CX16))
+#define AMD_FEATURES_K8_REV_F_EDX         AMD_FEATURES_K8_REV_E_EDX
+#define AMD_EXTFEATURES_K8_REV_F_ECX     (AMD_EXTFEATURES_K8_REV_E_ECX |\
+	__bit(X86_FEATURE_SVME) | __bit(X86_FEATURE_EXTAPICSPACE) |	\
+	__bit(X86_FEATURE_ALTMOVCR))
+#define AMD_EXTFEATURES_K8_REV_F_EDX     (AMD_EXTFEATURES_K8_REV_E_EDX |\
+	__bit(X86_FEATURE_RDTSCP))
+
+/* Family 0Fh, Revision G */
+#define AMD_FEATURES_K8_REV_G_ECX         AMD_FEATURES_K8_REV_F_ECX
+#define AMD_FEATURES_K8_REV_G_EDX         AMD_FEATURES_K8_REV_F_EDX
+#define AMD_EXTFEATURES_K8_REV_G_ECX     (AMD_EXTFEATURES_K8_REV_F_ECX |\
+	__bit(X86_FEATURE_3DNOWPF))
+#define AMD_EXTFEATURES_K8_REV_G_EDX      AMD_EXTFEATURES_K8_REV_F_EDX
+
+/* Family 10h, Revision B */
+#define AMD_FEATURES_FAM10h_REV_B_ECX    (AMD_FEATURES_K8_REV_F_ECX | 	\
+	__bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
+#define AMD_FEATURES_FAM10h_REV_B_EDX     AMD_FEATURES_K8_REV_F_EDX
+#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
+	__bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | 		\
+	__bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | 	\
+	__bit(X86_FEATURE_IBS))
+#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
+	__bit(X86_FEATURE_PAGE1GB))
+
+/* Family 10h, Revision C */
+#define AMD_FEATURES_FAM10h_REV_C_ECX     AMD_FEATURES_FAM10h_REV_B_ECX
+#define AMD_FEATURES_FAM10h_REV_C_EDX     AMD_FEATURES_FAM10h_REV_B_EDX
+#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
+	__bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
+#define AMD_EXTFEATURES_FAM10h_REV_C_EDX  AMD_EXTFEATURES_FAM10h_REV_B_EDX
+
+/* Family 11h, Revision B */
+#define AMD_FEATURES_FAM11h_REV_B_ECX     AMD_FEATURES_K8_REV_G_ECX
+#define AMD_FEATURES_FAM11h_REV_B_EDX     AMD_FEATURES_K8_REV_G_EDX
+#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
+	__bit(X86_FEATURE_SKINIT))
+#define AMD_EXTFEATURES_FAM11h_REV_B_EDX  AMD_EXTFEATURES_K8_REV_G_EDX
+
+/* AMD errata checking
+ *
+ * Errata are defined using the AMD_LEGACY_ERRATUM() or AMD_OSVW_ERRATUM()
+ * macros. The latter is intended for newer errata that have an OSVW id
+ * assigned, which it takes as first argument. Both take a variable number
+ * of family-specific model-stepping ranges created by AMD_MODEL_RANGE().
+ *
+ * Example 1:
+ * #define AMD_ERRATUM_319                                              \
+ *   AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0x4, 0x2),      \
+ *                      AMD_MODEL_RANGE(0x10, 0x8, 0x0, 0x8, 0x0),      \
+ *                      AMD_MODEL_RANGE(0x10, 0x9, 0x0, 0x9, 0x0))
+ * Example 2:
+ * #define AMD_ERRATUM_400                                              \
+ *   AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf),    \
+ *                       AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf))
+ *   
+ */
+
+#define AMD_LEGACY_ERRATUM(...)         0 /* legacy */, __VA_ARGS__, 0
+#define AMD_OSVW_ERRATUM(osvw_id, ...)  1 /* osvw */, osvw_id, __VA_ARGS__, 0
+#define AMD_MODEL_RANGE(f, m_start, s_start, m_end, s_end)              \
+    ((f << 24) | (m_start << 16) | (s_start << 12) | (m_end << 4) | (s_end))
+#define AMD_MODEL_RANGE_FAMILY(range)   (((range) >> 24) & 0xff)
+#define AMD_MODEL_RANGE_START(range)    (((range) >> 12) & 0xfff)
+#define AMD_MODEL_RANGE_END(range)      ((range) & 0xfff)
+
+#define AMD_ERRATUM_170                                                 \
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf))
+
+#define AMD_ERRATUM_383                                                 \
+    AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf),	\
+		        AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0x1, 0x0))
+
+int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
+
+#endif /* __AMD_H__ */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgt-0006nK-P9; Wed, 04 Jan 2012 07:55:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgr-0006n3-Gs
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1325663666!48860708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29919 invoked from network); 4 Jan 2012 07:54:27 -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;
	4 Jan 2012 07:54:27 -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 1RiLgk-0003fL-A2
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgk-0000Im-1E
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Message-Id: <E1RiLgk-0000Im-1E@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to
	3.4.4-rc4-pre
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662041 18000
# Node ID 25a6060ebd6684ded50cb7bf4b8dab819d4b7f92
# Parent  62dbbdb8dc993dc122d368aa8d29b8f780702ba7
Update Xen version to 3.4.4-rc4-pre
---


diff -r 62dbbdb8dc99 -r 25a6060ebd66 xen/Makefile
--- a/xen/Makefile	Wed Jan 04 01:24:54 2012 -0500
+++ b/xen/Makefile	Wed Jan 04 02:27:21 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgt-0006nK-P9; Wed, 04 Jan 2012 07:55:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgr-0006n3-Gs
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1325663666!48860708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29919 invoked from network); 4 Jan 2012 07:54:27 -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;
	4 Jan 2012 07:54:27 -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 1RiLgk-0003fL-A2
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgk-0000Im-1E
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:10 +0000
Message-Id: <E1RiLgk-0000Im-1E@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to
	3.4.4-rc4-pre
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662041 18000
# Node ID 25a6060ebd6684ded50cb7bf4b8dab819d4b7f92
# Parent  62dbbdb8dc993dc122d368aa8d29b8f780702ba7
Update Xen version to 3.4.4-rc4-pre
---


diff -r 62dbbdb8dc99 -r 25a6060ebd66 xen/Makefile
--- a/xen/Makefile	Wed Jan 04 01:24:54 2012 -0500
+++ b/xen/Makefile	Wed Jan 04 02:27:21 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgy-0006oE-6Q; Wed, 04 Jan 2012 07:55:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgw-0006n7-MV
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1325663712!9485384!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25471 invoked from network); 4 Jan 2012 07:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 07:55:13 -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 1RiLgl-0003fU-UK
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgl-0000JV-IT
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:11 +0000
Message-Id: <E1RiLgl-0000JV-IT@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added tag 3.4.4-rc4 for changeset
	dda061bf71b6
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662766 18000
# Node ID 23e78eaba11b984afb5955dd04692b2ebb9b6728
# Parent  dda061bf71b6f11e91a38b8f96ba47a55729ed97
Added tag 3.4.4-rc4 for changeset dda061bf71b6
---


diff -r dda061bf71b6 -r 23e78eaba11b .hgtags
--- a/.hgtags	Wed Jan 04 02:39:12 2012 -0500
+++ b/.hgtags	Wed Jan 04 02:39:26 2012 -0500
@@ -64,3 +64,4 @@
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 3.4.4-rc1
 6b411577871da411a0822fd732900acb5ca244d0 3.4.4-rc2
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 3.4.4-rc3
+dda061bf71b6f11e91a38b8f96ba47a55729ed97 3.4.4-rc4

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 04 07:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jan 2012 07:55: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.xensource.com>)
	id 1RiLgy-0006oE-6Q; Wed, 04 Jan 2012 07:55:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgw-0006n7-MV
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1325663712!9485384!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25471 invoked from network); 4 Jan 2012 07:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2012 07:55:13 -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 1RiLgl-0003fU-UK
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RiLgl-0000JV-IT
	for xen-changelog@lists.xensource.com; Wed, 04 Jan 2012 07:55:11 +0000
Message-Id: <E1RiLgl-0000JV-IT@xenbits.xen.org>
Date: Wed, 04 Jan 2012 07:55:10 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added tag 3.4.4-rc4 for changeset
	dda061bf71b6
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1325662766 18000
# Node ID 23e78eaba11b984afb5955dd04692b2ebb9b6728
# Parent  dda061bf71b6f11e91a38b8f96ba47a55729ed97
Added tag 3.4.4-rc4 for changeset dda061bf71b6
---


diff -r dda061bf71b6 -r 23e78eaba11b .hgtags
--- a/.hgtags	Wed Jan 04 02:39:12 2012 -0500
+++ b/.hgtags	Wed Jan 04 02:39:26 2012 -0500
@@ -64,3 +64,4 @@
 79eaab9de39124d2f17cd4f5e8542a895281ea4f 3.4.4-rc1
 6b411577871da411a0822fd732900acb5ca244d0 3.4.4-rc2
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 3.4.4-rc3
+dda061bf71b6f11e91a38b8f96ba47a55729ed97 3.4.4-rc4

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 00:55: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.xensource.com>)
	id 1Ribby-0001An-89; Thu, 05 Jan 2012 00:55:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribbx-0001A9-Mb
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1325724910!9099866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2452 invoked from network); 5 Jan 2012 00:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 00:55:11 -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 1Ribbp-00087D-MM
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribbp-0006e9-BR
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:09 +0000
Message-Id: <E1Ribbp-0006e9-BR@xenbits.xen.org>
Date: Thu, 05 Jan 2012 00:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] All domains (including dom0) should
	be best effort on creation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1325693506 0
# Node ID d82be53b3ea1db2f9810eeadc2f5bfe80b910b5f
# Parent  50117a4d1a2c715b3da8b196c6e02b16d7a546d7
All domains (including dom0) should be best effort on creation

In the sedf scheduler, while trying to guarantee to dom0 the proper
amount of CPU time for being able to do its job, we end up allocating
75% CPU-share to each and every of its VCPUs. This, combined with the
fact that such a scheduler has no load balancing logic at all (and
thus *all* dom0's VCPUs just rise and stay on physical CPU #0), means
that for example on a 12-cores system we're trying to exploit
75x12=3D900% of what we have on a PCPU, which is definitely too much!

Moreover, even if a cleverer mechanism for distributing VCPUs among
the available PCPUs (if not a proper load balancer) will be put in
place some day, it will still be difficult to decide how much
guaranteed CPU bandwidth each of the dom0's VCPUs should be provided
with, without posing the system at risk of livelock or starvation,
even during boot time.

Therefore, since sedf is capable of some form of best-effort
scheduling, the best thing we can do is ask for this behaviour for
dom0, as it is for all other domains, right upon creation. It will
then be the sysadmin's job to modify dom0's scheduling parameters to
better fit his particular needs, maybe after spreading the load a bit
by pinning VCPUs on PCPUs, or using cpupools, etc.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 50117a4d1a2c -r d82be53b3ea1 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Mon Jan 02 12:43:07 2012 +0000
+++ b/xen/common/sched_sedf.c	Wed Jan 04 16:11:46 2012 +0000
@@ -359,19 +359,9 @@
     inf->latency     = 0;
     inf->status      = EXTRA_AWARE | SEDF_ASLEEP;
     inf->extraweight = 1;
-
-    if ( v->domain->domain_id == 0 )
-    {
-        /* Domain0 gets 75% guaranteed (15ms every 20ms). */
-        inf->period    = MILLISECS(20);
-        inf->slice     = MILLISECS(15);
-    }
-    else
-    {
-        /* Best-effort extratime only. */
-        inf->period    = WEIGHT_PERIOD;
-        inf->slice     = 0;
-    }
+    /* Upon creation all domain are best-effort. */
+    inf->period      = WEIGHT_PERIOD;
+    inf->slice       = 0;
 
     inf->period_orig = inf->period; inf->slice_orig = inf->slice;
     INIT_LIST_HEAD(&(inf->list));

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 00:55: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.xensource.com>)
	id 1Ribby-0001An-89; Thu, 05 Jan 2012 00:55:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribbx-0001A9-Mb
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1325724910!9099866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2452 invoked from network); 5 Jan 2012 00:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 00:55:11 -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 1Ribbp-00087D-MM
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribbp-0006e9-BR
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:09 +0000
Message-Id: <E1Ribbp-0006e9-BR@xenbits.xen.org>
Date: Thu, 05 Jan 2012 00:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] All domains (including dom0) should
	be best effort on creation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1325693506 0
# Node ID d82be53b3ea1db2f9810eeadc2f5bfe80b910b5f
# Parent  50117a4d1a2c715b3da8b196c6e02b16d7a546d7
All domains (including dom0) should be best effort on creation

In the sedf scheduler, while trying to guarantee to dom0 the proper
amount of CPU time for being able to do its job, we end up allocating
75% CPU-share to each and every of its VCPUs. This, combined with the
fact that such a scheduler has no load balancing logic at all (and
thus *all* dom0's VCPUs just rise and stay on physical CPU #0), means
that for example on a 12-cores system we're trying to exploit
75x12=3D900% of what we have on a PCPU, which is definitely too much!

Moreover, even if a cleverer mechanism for distributing VCPUs among
the available PCPUs (if not a proper load balancer) will be put in
place some day, it will still be difficult to decide how much
guaranteed CPU bandwidth each of the dom0's VCPUs should be provided
with, without posing the system at risk of livelock or starvation,
even during boot time.

Therefore, since sedf is capable of some form of best-effort
scheduling, the best thing we can do is ask for this behaviour for
dom0, as it is for all other domains, right upon creation. It will
then be the sysadmin's job to modify dom0's scheduling parameters to
better fit his particular needs, maybe after spreading the load a bit
by pinning VCPUs on PCPUs, or using cpupools, etc.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 50117a4d1a2c -r d82be53b3ea1 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Mon Jan 02 12:43:07 2012 +0000
+++ b/xen/common/sched_sedf.c	Wed Jan 04 16:11:46 2012 +0000
@@ -359,19 +359,9 @@
     inf->latency     = 0;
     inf->status      = EXTRA_AWARE | SEDF_ASLEEP;
     inf->extraweight = 1;
-
-    if ( v->domain->domain_id == 0 )
-    {
-        /* Domain0 gets 75% guaranteed (15ms every 20ms). */
-        inf->period    = MILLISECS(20);
-        inf->slice     = MILLISECS(15);
-    }
-    else
-    {
-        /* Best-effort extratime only. */
-        inf->period    = WEIGHT_PERIOD;
-        inf->slice     = 0;
-    }
+    /* Upon creation all domain are best-effort. */
+    inf->period      = WEIGHT_PERIOD;
+    inf->slice       = 0;
 
     inf->period_orig = inf->period; inf->slice_orig = inf->slice;
     INIT_LIST_HEAD(&(inf->list));

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 00:55: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.xensource.com>)
	id 1Ribc0-0001BC-Ay; Thu, 05 Jan 2012 00:55:20 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribby-0001AH-Th
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1325724910!7848120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,DIET_1
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8835 invoked from network); 5 Jan 2012 00:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 00:55:11 -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 1Ribbq-00087G-BN
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribbp-0006el-U5
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:09 +0000
Message-Id: <E1Ribbp-0006el-U5@xenbits.xen.org>
Date: Thu, 05 Jan 2012 00:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Rework locking for sched_adjust.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1325693564 0
# Node ID efaa28639a71524a693ba500624f8512e5795e18
# Parent  d82be53b3ea1db2f9810eeadc2f5bfe80b910b5f
Rework locking for sched_adjust.

The main idea is to move (as much as possible) locking logic
from generic code to the various pluggable schedulers.

While at it, the following is also accomplished:
 - pausing all the non-current VCPUs of a domain while changing its
   scheduling parameters is not effective in avoiding races and it is
   prone to deadlock, so that is removed.
 - sedf needs a global lock for preventing races while adjusting
   domains' scheduling parameters (as it is for credit and credit2),
   so that is added.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d82be53b3ea1 -r efaa28639a71 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/sched_credit.c	Wed Jan 04 16:12:44 2012 +0000
@@ -161,6 +161,7 @@
  * System-wide private data
  */
 struct csched_private {
+    /* lock for the whole pluggable scheduler, nests inside cpupool_lock */
     spinlock_t lock;
     struct list_head active_sdom;
     uint32_t ncpus;
@@ -800,6 +801,10 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     unsigned long flags;
 
+    /* Protect both get and put branches with the pluggable scheduler
+     * lock. Runq lock not needed anywhere in here. */
+    spin_lock_irqsave(&prv->lock, flags);
+
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
     {
         op->u.credit.weight = sdom->weight;
@@ -809,8 +814,6 @@
     {
         ASSERT(op->cmd == XEN_DOMCTL_SCHEDOP_putinfo);
 
-        spin_lock_irqsave(&prv->lock, flags);
-
         if ( op->u.credit.weight != 0 )
         {
             if ( !list_empty(&sdom->active_sdom_elem) )
@@ -824,9 +827,10 @@
         if ( op->u.credit.cap != (uint16_t)~0U )
             sdom->cap = op->u.credit.cap;
 
-        spin_unlock_irqrestore(&prv->lock, flags);
     }
 
+    spin_unlock_irqrestore(&prv->lock, flags);
+
     return 0;
 }
 
diff -r d82be53b3ea1 -r efaa28639a71 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/sched_credit2.c	Wed Jan 04 16:12:44 2012 +0000
@@ -1384,6 +1384,10 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     unsigned long flags;
 
+    /* Must hold csched_priv lock to read and update sdom,
+     * runq lock to update csvcs. */
+    spin_lock_irqsave(&prv->lock, flags);
+
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
     {
         op->u.credit2.weight = sdom->weight;
@@ -1397,10 +1401,6 @@
             struct list_head *iter;
             int old_weight;
 
-            /* Must hold csched_priv lock to update sdom, runq lock to
-             * update csvcs. */
-            spin_lock_irqsave(&prv->lock, flags);
-
             old_weight = sdom->weight;
 
             sdom->weight = op->u.credit2.weight;
@@ -1411,22 +1411,23 @@
                 struct csched_vcpu *svc = list_entry(iter, struct csched_vcpu, sdom_elem);
 
                 /* NB: Locking order is important here.  Because we grab this lock here, we
-                 * must never lock csched_priv.lock if we're holding a runqueue
-                 * lock. */
-                vcpu_schedule_lock_irq(svc->vcpu);
+                 * must never lock csched_priv.lock if we're holding a runqueue lock.
+                 * Also, calling vcpu_schedule_lock() is enough, since IRQs have already
+                 * been disabled. */
+                vcpu_schedule_lock(svc->vcpu);
 
                 BUG_ON(svc->rqd != RQD(ops, svc->vcpu->processor));
 
                 svc->weight = sdom->weight;
                 update_max_weight(svc->rqd, svc->weight, old_weight);
 
-                vcpu_schedule_unlock_irq(svc->vcpu);
+                vcpu_schedule_unlock(svc->vcpu);
             }
-
-            spin_unlock_irqrestore(&prv->lock, flags);
         }
     }
 
+    spin_unlock_irqrestore(&prv->lock, flags);
+
     return 0;
 }
 
diff -r d82be53b3ea1 -r efaa28639a71 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/sched_sedf.c	Wed Jan 04 16:12:44 2012 +0000
@@ -61,6 +61,11 @@
     struct domain  *domain;
 };
 
+struct sedf_priv_info {
+    /* lock for the whole pluggable scheduler, nests inside cpupool_lock */
+    spinlock_t lock;
+};
+
 struct sedf_vcpu_info {
     struct vcpu *vcpu;
     struct list_head list;
@@ -115,6 +120,8 @@
     s_time_t         current_slice_expires;
 };
 
+#define SEDF_PRIV(_ops) \
+    ((struct sedf_priv_info *)((_ops)->sched_data))
 #define EDOM_INFO(d)   ((struct sedf_vcpu_info *)((d)->sched_priv))
 #define CPU_INFO(cpu)  \
     ((struct sedf_cpu_info *)per_cpu(schedule_data, cpu).sched_priv)
@@ -762,6 +769,31 @@
 }
 
 
+static int sedf_init(struct scheduler *ops)
+{
+    struct sedf_priv_info *prv;
+
+    prv = xzalloc(struct sedf_priv_info);
+    if ( prv == NULL )
+        return -ENOMEM;
+
+    ops->sched_data = prv;
+    spin_lock_init(&prv->lock);
+
+    return 0;
+}
+
+
+static void sedf_deinit(const struct scheduler *ops)
+{
+    struct sedf_priv_info *prv;
+
+    prv = SEDF_PRIV(ops);
+    if ( prv != NULL )
+        xfree(prv);
+}
+
+
 /* Main scheduling function
    Reasons for calling this function are:
    -timeslice for the current period used up
@@ -1310,22 +1342,15 @@
 
 
 /* Adjusts periods and slices of the domains accordingly to their weights. */
-static int sedf_adjust_weights(struct cpupool *c, struct xen_domctl_scheduler_op *cmd)
+static int sedf_adjust_weights(struct cpupool *c, int nr_cpus, int *sumw, s_time_t *sumt)
 {
     struct vcpu *p;
     struct domain      *d;
-    unsigned int        cpu, nr_cpus = cpumask_last(&cpu_online_map) + 1;
-    int                *sumw = xzalloc_array(int, nr_cpus);
-    s_time_t           *sumt = xzalloc_array(s_time_t, nr_cpus);
+    unsigned int        cpu;
 
-    if ( !sumw || !sumt )
-    {
-        xfree(sumt);
-        xfree(sumw);
-        return -ENOMEM;
-    }
-
-    /* Sum across all weights. */
+    /* Sum across all weights. Notice that no runq locking is needed
+     * here: the caller holds sedf_priv_info.lock and we're not changing
+     * anything that is accessed during scheduling. */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1355,7 +1380,9 @@
     }
     rcu_read_unlock(&domlist_read_lock);
 
-    /* Adjust all slices (and periods) to the new weight. */
+    /* Adjust all slices (and periods) to the new weight. Unlike above, we
+     * need to take thr runq lock for the various VCPUs: we're modyfing
+     * slice and period which are referenced during scheduling. */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1365,20 +1392,20 @@
                 continue;
             if ( EDOM_INFO(p)->weight )
             {
+                /* Interrupts already off */
+                vcpu_schedule_lock(p);
                 EDOM_INFO(p)->period_orig = 
                     EDOM_INFO(p)->period  = WEIGHT_PERIOD;
                 EDOM_INFO(p)->slice_orig  =
                     EDOM_INFO(p)->slice   = 
                     (EDOM_INFO(p)->weight *
                      (WEIGHT_PERIOD - WEIGHT_SAFETY - sumt[cpu])) / sumw[cpu];
+                vcpu_schedule_unlock(p);
             }
         }
     }
     rcu_read_unlock(&domlist_read_lock);
 
-    xfree(sumt);
-    xfree(sumw);
-
     return 0;
 }
 
@@ -1386,19 +1413,45 @@
 /* set or fetch domain scheduling parameters */
 static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen_domctl_scheduler_op *op)
 {
+    struct sedf_priv_info *prv = SEDF_PRIV(ops);
+    unsigned long flags;
+    unsigned int nr_cpus = cpumask_last(&cpu_online_map) + 1;
+    int *sumw = xzalloc_array(int, nr_cpus);
+    s_time_t *sumt = xzalloc_array(s_time_t, nr_cpus);
     struct vcpu *v;
-    int rc;
+    int rc = 0;
 
     PRINT(2,"sedf_adjust was called, domain-id %i new period %"PRIu64" "
           "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
           p->domain_id, op->u.sedf.period, op->u.sedf.slice,
           op->u.sedf.latency, (op->u.sedf.extratime)?"yes":"no");
 
+    /* Serialize against the pluggable scheduler lock to protect from
+     * concurrent updates. We need to take the runq lock for the VCPUs
+     * as well, since we are touching extraweight, weight, slice and
+     * period. As in sched_credit2.c, runq locks nest inside the
+     * pluggable scheduler lock. */
+    spin_lock_irqsave(&prv->lock, flags);
+
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_putinfo )
     {
+        /* These are used in sedf_adjust_weights() but have to be allocated in
+         * this function, as we need to avoid nesting xmem_pool_alloc's lock
+         * within our prv->lock. */
+        if ( !sumw || !sumt )
+        {
+            /* Check for errors here, the _getinfo branch doesn't care */
+            rc = -ENOMEM;
+            goto out;
+        }
+
         /* Check for sane parameters. */
         if ( !op->u.sedf.period && !op->u.sedf.weight )
-            return -EINVAL;
+        {
+            rc = -EINVAL;
+            goto out;
+        }
+
         if ( op->u.sedf.weight )
         {
             if ( (op->u.sedf.extratime & EXTRA_AWARE) &&
@@ -1407,59 +1460,78 @@
                 /* Weight-driven domains with extratime only. */
                 for_each_vcpu ( p, v )
                 {
+                    /* (Here and everywhere in the following) IRQs are already off,
+                     * hence vcpu_spin_lock() is the one. */
+                    vcpu_schedule_lock(v);
                     EDOM_INFO(v)->extraweight = op->u.sedf.weight;
                     EDOM_INFO(v)->weight = 0;
                     EDOM_INFO(v)->slice = 0;
                     EDOM_INFO(v)->period = WEIGHT_PERIOD;
+                    vcpu_schedule_unlock(v);
                 }
             }
             else
             {
                 /* Weight-driven domains with real-time execution. */
-                for_each_vcpu ( p, v )
+                for_each_vcpu ( p, v ) {
+                    vcpu_schedule_lock(v);
                     EDOM_INFO(v)->weight = op->u.sedf.weight;
+                    vcpu_schedule_unlock(v);
+                }
             }
         }
         else
         {
+            /*
+             * Sanity checking: note that disabling extra weight requires
+             * that we set a non-zero slice.
+             */
+            if ( (op->u.sedf.period > PERIOD_MAX) ||
+                 (op->u.sedf.period < PERIOD_MIN) ||
+                 (op->u.sedf.slice  > op->u.sedf.period) ||
+                 (op->u.sedf.slice  < SLICE_MIN) )
+            {
+                rc = -EINVAL;
+                goto out;
+            }
+
             /* Time-driven domains. */
             for_each_vcpu ( p, v )
             {
-                /*
-                 * Sanity checking: note that disabling extra weight requires
-                 * that we set a non-zero slice.
-                 */
-                if ( (op->u.sedf.period > PERIOD_MAX) ||
-                     (op->u.sedf.period < PERIOD_MIN) ||
-                     (op->u.sedf.slice  > op->u.sedf.period) ||
-                     (op->u.sedf.slice  < SLICE_MIN) )
-                    return -EINVAL;
+                vcpu_schedule_lock(v);
                 EDOM_INFO(v)->weight = 0;
                 EDOM_INFO(v)->extraweight = 0;
                 EDOM_INFO(v)->period_orig = 
                     EDOM_INFO(v)->period  = op->u.sedf.period;
                 EDOM_INFO(v)->slice_orig  = 
                     EDOM_INFO(v)->slice   = op->u.sedf.slice;
+                vcpu_schedule_unlock(v);
             }
         }
 
-        rc = sedf_adjust_weights(p->cpupool, op);
+        rc = sedf_adjust_weights(p->cpupool, nr_cpus, sumw, sumt);
         if ( rc )
-            return rc;
+            goto out;
 
         for_each_vcpu ( p, v )
         {
+            vcpu_schedule_lock(v);
             EDOM_INFO(v)->status  = 
                 (EDOM_INFO(v)->status &
                  ~EXTRA_AWARE) | (op->u.sedf.extratime & EXTRA_AWARE);
             EDOM_INFO(v)->latency = op->u.sedf.latency;
             extraq_check(v);
+            vcpu_schedule_unlock(v);
         }
     }
     else if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
     {
         if ( p->vcpu[0] == NULL )
-            return -EINVAL;
+        {
+            rc = -EINVAL;
+            goto out;
+        }
+
         op->u.sedf.period    = EDOM_INFO(p->vcpu[0])->period;
         op->u.sedf.slice     = EDOM_INFO(p->vcpu[0])->slice;
         op->u.sedf.extratime = EDOM_INFO(p->vcpu[0])->status & EXTRA_AWARE;
@@ -1467,14 +1539,23 @@
         op->u.sedf.weight    = EDOM_INFO(p->vcpu[0])->weight;
     }
 
-    PRINT(2,"sedf_adjust_finished\n");
-    return 0;
+out:
+    spin_unlock_irqrestore(&prv->lock, flags);
+
+    xfree(sumt);
+    xfree(sumw);
+
+    PRINT(2,"sedf_adjust_finished with return code %d\n", rc);
+    return rc;
 }
 
+static struct sedf_priv_info _sedf_priv;
+
 const struct scheduler sched_sedf_def = {
-    .name     = "Simple EDF Scheduler",
-    .opt_name = "sedf",
-    .sched_id = XEN_SCHEDULER_SEDF,
+    .name           = "Simple EDF Scheduler",
+    .opt_name       = "sedf",
+    .sched_id       = XEN_SCHEDULER_SEDF,
+    .sched_data     = &_sedf_priv,
     
     .init_domain    = sedf_init_domain,
     .destroy_domain = sedf_destroy_domain,
@@ -1488,6 +1569,9 @@
     .alloc_domdata  = sedf_alloc_domdata,
     .free_domdata   = sedf_free_domdata,
 
+    .init           = sedf_init,
+    .deinit         = sedf_deinit,
+
     .do_schedule    = sedf_do_schedule,
     .pick_cpu       = sedf_pick_cpu,
     .dump_cpu_state = sedf_dump_cpu_state,
diff -r d82be53b3ea1 -r efaa28639a71 xen/common/schedule.c
--- a/xen/common/schedule.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/schedule.c	Wed Jan 04 16:12:44 2012 +0000
@@ -1005,7 +1005,6 @@
 /* Adjust scheduling parameter for a given domain. */
 long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
 {
-    struct vcpu *v;
     long ret;
     
     if ( (op->sched_id != DOM2OP(d)->sched_id) ||
@@ -1013,40 +1012,11 @@
           (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo)) )
         return -EINVAL;
 
-    /*
-     * Most VCPUs we can simply pause. If we are adjusting this VCPU then
-     * we acquire the local schedule_lock to guard against concurrent updates.
-     *
-     * We only acquire the local schedule lock after we have paused all other
-     * VCPUs in this domain. There are two reasons for this:
-     * 1- We don't want to hold up interrupts as pausing a VCPU can
-     *    trigger a tlb shootdown.
-     * 2- Pausing other VCPUs involves briefly locking the schedule
-     *    lock of the CPU they are running on. This CPU could be the
-     *    same as ours.
-     */
-
-    for_each_vcpu ( d, v )
-    {
-        if ( v != current )
-            vcpu_pause(v);
-    }
-
-    if ( d == current->domain )
-        vcpu_schedule_lock_irq(current);
-
+    /* NB: the pluggable scheduler code needs to take care
+     * of locking by itself. */
     if ( (ret = SCHED_OP(DOM2OP(d), adjust, d, op)) == 0 )
         TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
 
-    if ( d == current->domain )
-        vcpu_schedule_unlock_irq(current);
-
-    for_each_vcpu ( d, v )
-    {
-        if ( v != current )
-            vcpu_unpause(v);
-    }
-
     return ret;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 00:55: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.xensource.com>)
	id 1Ribc0-0001BC-Ay; Thu, 05 Jan 2012 00:55:20 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribby-0001AH-Th
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1325724910!7848120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,DIET_1
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8835 invoked from network); 5 Jan 2012 00:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 00:55:11 -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 1Ribbq-00087G-BN
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ribbp-0006el-U5
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 00:55:09 +0000
Message-Id: <E1Ribbp-0006el-U5@xenbits.xen.org>
Date: Thu, 05 Jan 2012 00:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Rework locking for sched_adjust.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1325693564 0
# Node ID efaa28639a71524a693ba500624f8512e5795e18
# Parent  d82be53b3ea1db2f9810eeadc2f5bfe80b910b5f
Rework locking for sched_adjust.

The main idea is to move (as much as possible) locking logic
from generic code to the various pluggable schedulers.

While at it, the following is also accomplished:
 - pausing all the non-current VCPUs of a domain while changing its
   scheduling parameters is not effective in avoiding races and it is
   prone to deadlock, so that is removed.
 - sedf needs a global lock for preventing races while adjusting
   domains' scheduling parameters (as it is for credit and credit2),
   so that is added.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d82be53b3ea1 -r efaa28639a71 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/sched_credit.c	Wed Jan 04 16:12:44 2012 +0000
@@ -161,6 +161,7 @@
  * System-wide private data
  */
 struct csched_private {
+    /* lock for the whole pluggable scheduler, nests inside cpupool_lock */
     spinlock_t lock;
     struct list_head active_sdom;
     uint32_t ncpus;
@@ -800,6 +801,10 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     unsigned long flags;
 
+    /* Protect both get and put branches with the pluggable scheduler
+     * lock. Runq lock not needed anywhere in here. */
+    spin_lock_irqsave(&prv->lock, flags);
+
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
     {
         op->u.credit.weight = sdom->weight;
@@ -809,8 +814,6 @@
     {
         ASSERT(op->cmd == XEN_DOMCTL_SCHEDOP_putinfo);
 
-        spin_lock_irqsave(&prv->lock, flags);
-
         if ( op->u.credit.weight != 0 )
         {
             if ( !list_empty(&sdom->active_sdom_elem) )
@@ -824,9 +827,10 @@
         if ( op->u.credit.cap != (uint16_t)~0U )
             sdom->cap = op->u.credit.cap;
 
-        spin_unlock_irqrestore(&prv->lock, flags);
     }
 
+    spin_unlock_irqrestore(&prv->lock, flags);
+
     return 0;
 }
 
diff -r d82be53b3ea1 -r efaa28639a71 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/sched_credit2.c	Wed Jan 04 16:12:44 2012 +0000
@@ -1384,6 +1384,10 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     unsigned long flags;
 
+    /* Must hold csched_priv lock to read and update sdom,
+     * runq lock to update csvcs. */
+    spin_lock_irqsave(&prv->lock, flags);
+
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
     {
         op->u.credit2.weight = sdom->weight;
@@ -1397,10 +1401,6 @@
             struct list_head *iter;
             int old_weight;
 
-            /* Must hold csched_priv lock to update sdom, runq lock to
-             * update csvcs. */
-            spin_lock_irqsave(&prv->lock, flags);
-
             old_weight = sdom->weight;
 
             sdom->weight = op->u.credit2.weight;
@@ -1411,22 +1411,23 @@
                 struct csched_vcpu *svc = list_entry(iter, struct csched_vcpu, sdom_elem);
 
                 /* NB: Locking order is important here.  Because we grab this lock here, we
-                 * must never lock csched_priv.lock if we're holding a runqueue
-                 * lock. */
-                vcpu_schedule_lock_irq(svc->vcpu);
+                 * must never lock csched_priv.lock if we're holding a runqueue lock.
+                 * Also, calling vcpu_schedule_lock() is enough, since IRQs have already
+                 * been disabled. */
+                vcpu_schedule_lock(svc->vcpu);
 
                 BUG_ON(svc->rqd != RQD(ops, svc->vcpu->processor));
 
                 svc->weight = sdom->weight;
                 update_max_weight(svc->rqd, svc->weight, old_weight);
 
-                vcpu_schedule_unlock_irq(svc->vcpu);
+                vcpu_schedule_unlock(svc->vcpu);
             }
-
-            spin_unlock_irqrestore(&prv->lock, flags);
         }
     }
 
+    spin_unlock_irqrestore(&prv->lock, flags);
+
     return 0;
 }
 
diff -r d82be53b3ea1 -r efaa28639a71 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/sched_sedf.c	Wed Jan 04 16:12:44 2012 +0000
@@ -61,6 +61,11 @@
     struct domain  *domain;
 };
 
+struct sedf_priv_info {
+    /* lock for the whole pluggable scheduler, nests inside cpupool_lock */
+    spinlock_t lock;
+};
+
 struct sedf_vcpu_info {
     struct vcpu *vcpu;
     struct list_head list;
@@ -115,6 +120,8 @@
     s_time_t         current_slice_expires;
 };
 
+#define SEDF_PRIV(_ops) \
+    ((struct sedf_priv_info *)((_ops)->sched_data))
 #define EDOM_INFO(d)   ((struct sedf_vcpu_info *)((d)->sched_priv))
 #define CPU_INFO(cpu)  \
     ((struct sedf_cpu_info *)per_cpu(schedule_data, cpu).sched_priv)
@@ -762,6 +769,31 @@
 }
 
 
+static int sedf_init(struct scheduler *ops)
+{
+    struct sedf_priv_info *prv;
+
+    prv = xzalloc(struct sedf_priv_info);
+    if ( prv == NULL )
+        return -ENOMEM;
+
+    ops->sched_data = prv;
+    spin_lock_init(&prv->lock);
+
+    return 0;
+}
+
+
+static void sedf_deinit(const struct scheduler *ops)
+{
+    struct sedf_priv_info *prv;
+
+    prv = SEDF_PRIV(ops);
+    if ( prv != NULL )
+        xfree(prv);
+}
+
+
 /* Main scheduling function
    Reasons for calling this function are:
    -timeslice for the current period used up
@@ -1310,22 +1342,15 @@
 
 
 /* Adjusts periods and slices of the domains accordingly to their weights. */
-static int sedf_adjust_weights(struct cpupool *c, struct xen_domctl_scheduler_op *cmd)
+static int sedf_adjust_weights(struct cpupool *c, int nr_cpus, int *sumw, s_time_t *sumt)
 {
     struct vcpu *p;
     struct domain      *d;
-    unsigned int        cpu, nr_cpus = cpumask_last(&cpu_online_map) + 1;
-    int                *sumw = xzalloc_array(int, nr_cpus);
-    s_time_t           *sumt = xzalloc_array(s_time_t, nr_cpus);
+    unsigned int        cpu;
 
-    if ( !sumw || !sumt )
-    {
-        xfree(sumt);
-        xfree(sumw);
-        return -ENOMEM;
-    }
-
-    /* Sum across all weights. */
+    /* Sum across all weights. Notice that no runq locking is needed
+     * here: the caller holds sedf_priv_info.lock and we're not changing
+     * anything that is accessed during scheduling. */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1355,7 +1380,9 @@
     }
     rcu_read_unlock(&domlist_read_lock);
 
-    /* Adjust all slices (and periods) to the new weight. */
+    /* Adjust all slices (and periods) to the new weight. Unlike above, we
+     * need to take thr runq lock for the various VCPUs: we're modyfing
+     * slice and period which are referenced during scheduling. */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1365,20 +1392,20 @@
                 continue;
             if ( EDOM_INFO(p)->weight )
             {
+                /* Interrupts already off */
+                vcpu_schedule_lock(p);
                 EDOM_INFO(p)->period_orig = 
                     EDOM_INFO(p)->period  = WEIGHT_PERIOD;
                 EDOM_INFO(p)->slice_orig  =
                     EDOM_INFO(p)->slice   = 
                     (EDOM_INFO(p)->weight *
                      (WEIGHT_PERIOD - WEIGHT_SAFETY - sumt[cpu])) / sumw[cpu];
+                vcpu_schedule_unlock(p);
             }
         }
     }
     rcu_read_unlock(&domlist_read_lock);
 
-    xfree(sumt);
-    xfree(sumw);
-
     return 0;
 }
 
@@ -1386,19 +1413,45 @@
 /* set or fetch domain scheduling parameters */
 static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen_domctl_scheduler_op *op)
 {
+    struct sedf_priv_info *prv = SEDF_PRIV(ops);
+    unsigned long flags;
+    unsigned int nr_cpus = cpumask_last(&cpu_online_map) + 1;
+    int *sumw = xzalloc_array(int, nr_cpus);
+    s_time_t *sumt = xzalloc_array(s_time_t, nr_cpus);
     struct vcpu *v;
-    int rc;
+    int rc = 0;
 
     PRINT(2,"sedf_adjust was called, domain-id %i new period %"PRIu64" "
           "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
           p->domain_id, op->u.sedf.period, op->u.sedf.slice,
           op->u.sedf.latency, (op->u.sedf.extratime)?"yes":"no");
 
+    /* Serialize against the pluggable scheduler lock to protect from
+     * concurrent updates. We need to take the runq lock for the VCPUs
+     * as well, since we are touching extraweight, weight, slice and
+     * period. As in sched_credit2.c, runq locks nest inside the
+     * pluggable scheduler lock. */
+    spin_lock_irqsave(&prv->lock, flags);
+
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_putinfo )
     {
+        /* These are used in sedf_adjust_weights() but have to be allocated in
+         * this function, as we need to avoid nesting xmem_pool_alloc's lock
+         * within our prv->lock. */
+        if ( !sumw || !sumt )
+        {
+            /* Check for errors here, the _getinfo branch doesn't care */
+            rc = -ENOMEM;
+            goto out;
+        }
+
         /* Check for sane parameters. */
         if ( !op->u.sedf.period && !op->u.sedf.weight )
-            return -EINVAL;
+        {
+            rc = -EINVAL;
+            goto out;
+        }
+
         if ( op->u.sedf.weight )
         {
             if ( (op->u.sedf.extratime & EXTRA_AWARE) &&
@@ -1407,59 +1460,78 @@
                 /* Weight-driven domains with extratime only. */
                 for_each_vcpu ( p, v )
                 {
+                    /* (Here and everywhere in the following) IRQs are already off,
+                     * hence vcpu_spin_lock() is the one. */
+                    vcpu_schedule_lock(v);
                     EDOM_INFO(v)->extraweight = op->u.sedf.weight;
                     EDOM_INFO(v)->weight = 0;
                     EDOM_INFO(v)->slice = 0;
                     EDOM_INFO(v)->period = WEIGHT_PERIOD;
+                    vcpu_schedule_unlock(v);
                 }
             }
             else
             {
                 /* Weight-driven domains with real-time execution. */
-                for_each_vcpu ( p, v )
+                for_each_vcpu ( p, v ) {
+                    vcpu_schedule_lock(v);
                     EDOM_INFO(v)->weight = op->u.sedf.weight;
+                    vcpu_schedule_unlock(v);
+                }
             }
         }
         else
         {
+            /*
+             * Sanity checking: note that disabling extra weight requires
+             * that we set a non-zero slice.
+             */
+            if ( (op->u.sedf.period > PERIOD_MAX) ||
+                 (op->u.sedf.period < PERIOD_MIN) ||
+                 (op->u.sedf.slice  > op->u.sedf.period) ||
+                 (op->u.sedf.slice  < SLICE_MIN) )
+            {
+                rc = -EINVAL;
+                goto out;
+            }
+
             /* Time-driven domains. */
             for_each_vcpu ( p, v )
             {
-                /*
-                 * Sanity checking: note that disabling extra weight requires
-                 * that we set a non-zero slice.
-                 */
-                if ( (op->u.sedf.period > PERIOD_MAX) ||
-                     (op->u.sedf.period < PERIOD_MIN) ||
-                     (op->u.sedf.slice  > op->u.sedf.period) ||
-                     (op->u.sedf.slice  < SLICE_MIN) )
-                    return -EINVAL;
+                vcpu_schedule_lock(v);
                 EDOM_INFO(v)->weight = 0;
                 EDOM_INFO(v)->extraweight = 0;
                 EDOM_INFO(v)->period_orig = 
                     EDOM_INFO(v)->period  = op->u.sedf.period;
                 EDOM_INFO(v)->slice_orig  = 
                     EDOM_INFO(v)->slice   = op->u.sedf.slice;
+                vcpu_schedule_unlock(v);
             }
         }
 
-        rc = sedf_adjust_weights(p->cpupool, op);
+        rc = sedf_adjust_weights(p->cpupool, nr_cpus, sumw, sumt);
         if ( rc )
-            return rc;
+            goto out;
 
         for_each_vcpu ( p, v )
         {
+            vcpu_schedule_lock(v);
             EDOM_INFO(v)->status  = 
                 (EDOM_INFO(v)->status &
                  ~EXTRA_AWARE) | (op->u.sedf.extratime & EXTRA_AWARE);
             EDOM_INFO(v)->latency = op->u.sedf.latency;
             extraq_check(v);
+            vcpu_schedule_unlock(v);
         }
     }
     else if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
     {
         if ( p->vcpu[0] == NULL )
-            return -EINVAL;
+        {
+            rc = -EINVAL;
+            goto out;
+        }
+
         op->u.sedf.period    = EDOM_INFO(p->vcpu[0])->period;
         op->u.sedf.slice     = EDOM_INFO(p->vcpu[0])->slice;
         op->u.sedf.extratime = EDOM_INFO(p->vcpu[0])->status & EXTRA_AWARE;
@@ -1467,14 +1539,23 @@
         op->u.sedf.weight    = EDOM_INFO(p->vcpu[0])->weight;
     }
 
-    PRINT(2,"sedf_adjust_finished\n");
-    return 0;
+out:
+    spin_unlock_irqrestore(&prv->lock, flags);
+
+    xfree(sumt);
+    xfree(sumw);
+
+    PRINT(2,"sedf_adjust_finished with return code %d\n", rc);
+    return rc;
 }
 
+static struct sedf_priv_info _sedf_priv;
+
 const struct scheduler sched_sedf_def = {
-    .name     = "Simple EDF Scheduler",
-    .opt_name = "sedf",
-    .sched_id = XEN_SCHEDULER_SEDF,
+    .name           = "Simple EDF Scheduler",
+    .opt_name       = "sedf",
+    .sched_id       = XEN_SCHEDULER_SEDF,
+    .sched_data     = &_sedf_priv,
     
     .init_domain    = sedf_init_domain,
     .destroy_domain = sedf_destroy_domain,
@@ -1488,6 +1569,9 @@
     .alloc_domdata  = sedf_alloc_domdata,
     .free_domdata   = sedf_free_domdata,
 
+    .init           = sedf_init,
+    .deinit         = sedf_deinit,
+
     .do_schedule    = sedf_do_schedule,
     .pick_cpu       = sedf_pick_cpu,
     .dump_cpu_state = sedf_dump_cpu_state,
diff -r d82be53b3ea1 -r efaa28639a71 xen/common/schedule.c
--- a/xen/common/schedule.c	Wed Jan 04 16:11:46 2012 +0000
+++ b/xen/common/schedule.c	Wed Jan 04 16:12:44 2012 +0000
@@ -1005,7 +1005,6 @@
 /* Adjust scheduling parameter for a given domain. */
 long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
 {
-    struct vcpu *v;
     long ret;
     
     if ( (op->sched_id != DOM2OP(d)->sched_id) ||
@@ -1013,40 +1012,11 @@
           (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo)) )
         return -EINVAL;
 
-    /*
-     * Most VCPUs we can simply pause. If we are adjusting this VCPU then
-     * we acquire the local schedule_lock to guard against concurrent updates.
-     *
-     * We only acquire the local schedule lock after we have paused all other
-     * VCPUs in this domain. There are two reasons for this:
-     * 1- We don't want to hold up interrupts as pausing a VCPU can
-     *    trigger a tlb shootdown.
-     * 2- Pausing other VCPUs involves briefly locking the schedule
-     *    lock of the CPU they are running on. This CPU could be the
-     *    same as ours.
-     */
-
-    for_each_vcpu ( d, v )
-    {
-        if ( v != current )
-            vcpu_pause(v);
-    }
-
-    if ( d == current->domain )
-        vcpu_schedule_lock_irq(current);
-
+    /* NB: the pluggable scheduler code needs to take care
+     * of locking by itself. */
     if ( (ret = SCHED_OP(DOM2OP(d), adjust, d, op)) == 0 )
         TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
 
-    if ( d == current->domain )
-        vcpu_schedule_unlock_irq(current);
-
-    for_each_vcpu ( d, v )
-    {
-        if ( v != current )
-            vcpu_unpause(v);
-    }
-
     return ret;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 08:44:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 08:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Riivk-0001Ra-Mn; Thu, 05 Jan 2012 08:44:12 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riivj-0001R9-6M
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 08:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1325753043!7900590!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15486 invoked from network); 5 Jan 2012 08:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 08:44: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 1Riivb-0005r6-ET
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riivb-000681-8e
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 08:44:03 +0000
Message-Id: <E1Riivb-000681-8e@xenbits.xen.org>
Date: Thu, 05 Jan 2012 08:44: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] scsiback: allow RESERVE/RELEASE
	commands
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User James Harper <james.harper@bendigoit.com.au>
# Date 1325752621 -3600
# Node ID bf19dd41c5c9bf6a30d8405a9e1f3b17884b1e4e
# Parent  90182138690d8055b09f3cc0495666590341b434
scsiback: allow RESERVE/RELEASE commands

Some Windows software makes use of RESERVE/RELEASE SCSI commands. Allow
them through scsiback, without any emulation.

Signed-off-by: James Harper <james.harper@bendigoit.com.au>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 90182138690d -r bf19dd41c5c9 drivers/xen/scsiback/emulate.c
--- a/drivers/xen/scsiback/emulate.c	Tue Jan 03 08:40:22 2012 +0100
+++ b/drivers/xen/scsiback/emulate.c	Thu Jan 05 09:37:01 2012 +0100
@@ -403,8 +403,8 @@
 	NO_EMULATE(INQUIRY);               /*0x12*/
 	/*NO_EMULATE(RECOVER_BUFFERED_DATA); *//*0x14*/
 	NO_EMULATE(MODE_SELECT);           /*0x15*/ /* st */
-	/*NO_EMULATE(RESERVE);               *//*0x16*/
-	/*NO_EMULATE(RELEASE);               *//*0x17*/
+	NO_EMULATE(RESERVE);               /*0x16*/
+	NO_EMULATE(RELEASE);               /*0x17*/
 	/*NO_EMULATE(COPY);                  *//*0x18*/
 	NO_EMULATE(ERASE);                 /*0x19*/ /* st */
 	NO_EMULATE(MODE_SENSE);            /*0x1a*/ /* st */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 08:44:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 08:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Riivk-0001Ra-Mn; Thu, 05 Jan 2012 08:44:12 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riivj-0001R9-6M
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 08:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1325753043!7900590!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15486 invoked from network); 5 Jan 2012 08:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 08:44: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 1Riivb-0005r6-ET
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riivb-000681-8e
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 08:44:03 +0000
Message-Id: <E1Riivb-000681-8e@xenbits.xen.org>
Date: Thu, 05 Jan 2012 08:44: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] scsiback: allow RESERVE/RELEASE
	commands
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User James Harper <james.harper@bendigoit.com.au>
# Date 1325752621 -3600
# Node ID bf19dd41c5c9bf6a30d8405a9e1f3b17884b1e4e
# Parent  90182138690d8055b09f3cc0495666590341b434
scsiback: allow RESERVE/RELEASE commands

Some Windows software makes use of RESERVE/RELEASE SCSI commands. Allow
them through scsiback, without any emulation.

Signed-off-by: James Harper <james.harper@bendigoit.com.au>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 90182138690d -r bf19dd41c5c9 drivers/xen/scsiback/emulate.c
--- a/drivers/xen/scsiback/emulate.c	Tue Jan 03 08:40:22 2012 +0100
+++ b/drivers/xen/scsiback/emulate.c	Thu Jan 05 09:37:01 2012 +0100
@@ -403,8 +403,8 @@
 	NO_EMULATE(INQUIRY);               /*0x12*/
 	/*NO_EMULATE(RECOVER_BUFFERED_DATA); *//*0x14*/
 	NO_EMULATE(MODE_SELECT);           /*0x15*/ /* st */
-	/*NO_EMULATE(RESERVE);               *//*0x16*/
-	/*NO_EMULATE(RELEASE);               *//*0x17*/
+	NO_EMULATE(RESERVE);               /*0x16*/
+	NO_EMULATE(RELEASE);               /*0x17*/
 	/*NO_EMULATE(COPY);                  *//*0x18*/
 	NO_EMULATE(ERASE);                 /*0x19*/ /* st */
 	NO_EMULATE(MODE_SENSE);            /*0x1a*/ /* st */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 09:22:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 09: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.xensource.com>)
	id 1RijWW-0002b0-6U; Thu, 05 Jan 2012 09:22:12 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RijWU-0002ao-Ud
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 09:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1325755323!9679430!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20917 invoked from network); 5 Jan 2012 09:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 09:22: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 1RijWN-0006OJ-CB
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 09:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RijWN-0001An-0o
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 09:22:03 +0000
Message-Id: <E1RijWN-0001An-0o@xenbits.xen.org>
Date: Thu, 05 Jan 2012 09:22: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] xenbus: Reject replies with
	payload > XENSTORE_PAYLOAD_MAX
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1325755282 -3600
# Node ID 821a5b2a10c86f18fbce0907af0db6905b9d540a
# Parent  bf19dd41c5c9bf6a30d8405a9e1f3b17884b1e4e
xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX

This also avoids a potential integer overflow pointed out by Haogang
Chen.

Also use this in struct xenbus_dev_data even though it happens to be
== PAGE_SIZE.

The code which takes requests from userspace already validates against
the size of this buffer so no further checks are required to ensure
that userspace requests comply with the protocol in this respect.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Haogang Chen <haogangchen@gmail.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bf19dd41c5c9 -r 821a5b2a10c8 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c	Thu Jan 05 09:37:01 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c	Thu Jan 05 10:21:22 2012 +0100
@@ -78,7 +78,7 @@
 	unsigned int len;
 	union {
 		struct xsd_sockmsg msg;
-		char buffer[PAGE_SIZE];
+		char buffer[XENSTORE_PAYLOAD_MAX];
 	} u;
 
 	/* Response queue. */
diff -r bf19dd41c5c9 -r 821a5b2a10c8 drivers/xen/xenbus/xenbus_xs.c
--- a/drivers/xen/xenbus/xenbus_xs.c	Thu Jan 05 09:37:01 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_xs.c	Thu Jan 05 10:21:22 2012 +0100
@@ -847,6 +847,12 @@
 		goto out;
 	}
 
+	if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) {
+		kfree(msg);
+		err = -EINVAL;
+		goto out;
+	}
+
 	body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH);
 	if (body == NULL) {
 		kfree(msg);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 09:22:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 09: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.xensource.com>)
	id 1RijWW-0002b0-6U; Thu, 05 Jan 2012 09:22:12 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RijWU-0002ao-Ud
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 09:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1325755323!9679430!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20917 invoked from network); 5 Jan 2012 09:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 09:22: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 1RijWN-0006OJ-CB
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 09:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RijWN-0001An-0o
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 09:22:03 +0000
Message-Id: <E1RijWN-0001An-0o@xenbits.xen.org>
Date: Thu, 05 Jan 2012 09:22: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] xenbus: Reject replies with
	payload > XENSTORE_PAYLOAD_MAX
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1325755282 -3600
# Node ID 821a5b2a10c86f18fbce0907af0db6905b9d540a
# Parent  bf19dd41c5c9bf6a30d8405a9e1f3b17884b1e4e
xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX

This also avoids a potential integer overflow pointed out by Haogang
Chen.

Also use this in struct xenbus_dev_data even though it happens to be
== PAGE_SIZE.

The code which takes requests from userspace already validates against
the size of this buffer so no further checks are required to ensure
that userspace requests comply with the protocol in this respect.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Haogang Chen <haogangchen@gmail.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bf19dd41c5c9 -r 821a5b2a10c8 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c	Thu Jan 05 09:37:01 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c	Thu Jan 05 10:21:22 2012 +0100
@@ -78,7 +78,7 @@
 	unsigned int len;
 	union {
 		struct xsd_sockmsg msg;
-		char buffer[PAGE_SIZE];
+		char buffer[XENSTORE_PAYLOAD_MAX];
 	} u;
 
 	/* Response queue. */
diff -r bf19dd41c5c9 -r 821a5b2a10c8 drivers/xen/xenbus/xenbus_xs.c
--- a/drivers/xen/xenbus/xenbus_xs.c	Thu Jan 05 09:37:01 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_xs.c	Thu Jan 05 10:21:22 2012 +0100
@@ -847,6 +847,12 @@
 		goto out;
 	}
 
+	if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) {
+		kfree(msg);
+		err = -EINVAL;
+		goto out;
+	}
+
 	body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH);
 	if (body == NULL) {
 		kfree(msg);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 17:33:13 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 17:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RirBc-0007df-5l; Thu, 05 Jan 2012 17:33:08 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBa-0007da-9p
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1325784723!63126644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25954 invoked from network); 5 Jan 2012 17:32:04 -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;
	5 Jan 2012 17:32: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 1RirBX-0005LA-Jk
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBX-0002lm-EV
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:03 +0000
Date: Thu, 05 Jan 2012 17:33:03 +0000
Message-Id: <E1RirBX-0002lm-EV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: fix sequence of
	operations in pt_msix_init()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 4181a6d8c38bb86b1d8c3ef1b41831bee03424dd
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Jan 5 17:15:46 2012 +0000

    qemu-xen: fix sequence of operations in pt_msix_init()
    
    Checking the return value of mmap() must be done before adjusting the
    value, otherwise failure may not be detected.
    
    Closing the file handle, on the other hand, can be done before checking
    the return value.
    
    Finally, printing the errno value without knowing whether the previous
    function actually failed is bogus (and superfluous since a subsequent
    message prints the strerror() representaton anyway).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/pt-msi.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 4a444ad..cf123ba 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -537,7 +537,6 @@ int pt_msix_init(struct pt_dev *dev, int pos)
     int i, total_entries, table_off, bar_index;
     struct pci_dev *pd = dev->pci_dev;
     int fd;
-    int err;
 
     id = pci_read_byte(pd, pos + PCI_CAP_LIST_ID);
 
@@ -585,17 +584,14 @@ int pt_msix_init(struct pt_dev *dev, int pos)
     dev->msix->phys_iomem_base = mmap(0, total_entries * 16 + dev->msix->table_offset_adjust,
                           PROT_READ, MAP_SHARED | MAP_LOCKED,
                           fd, dev->msix->table_base + table_off - dev->msix->table_offset_adjust);
-    dev->msix->phys_iomem_base = (void *)((char *)dev->msix->phys_iomem_base + 
-                          dev->msix->table_offset_adjust);
-    err = errno;
-    PT_LOG("errno = %d\n",err);
+    close(fd);
     if ( dev->msix->phys_iomem_base == MAP_FAILED )
     {
         PT_LOG("Error: Can't map physical MSI-X table: %s\n", strerror(errno));
-        close(fd);
         goto error_out;
     }
-    close(fd);
+
+    dev->msix->phys_iomem_base += dev->msix->table_offset_adjust;
 
     PT_LOG("mapping physical MSI-X table to %lx\n",
            (unsigned long)dev->msix->phys_iomem_base);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 17:33:13 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 17:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RirBc-0007df-5l; Thu, 05 Jan 2012 17:33:08 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBa-0007da-9p
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1325784723!63126644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25954 invoked from network); 5 Jan 2012 17:32:04 -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;
	5 Jan 2012 17:32: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 1RirBX-0005LA-Jk
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBX-0002lm-EV
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:03 +0000
Date: Thu, 05 Jan 2012 17:33:03 +0000
Message-Id: <E1RirBX-0002lm-EV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: fix sequence of
	operations in pt_msix_init()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit 4181a6d8c38bb86b1d8c3ef1b41831bee03424dd
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Jan 5 17:15:46 2012 +0000

    qemu-xen: fix sequence of operations in pt_msix_init()
    
    Checking the return value of mmap() must be done before adjusting the
    value, otherwise failure may not be detected.
    
    Closing the file handle, on the other hand, can be done before checking
    the return value.
    
    Finally, printing the errno value without knowing whether the previous
    function actually failed is bogus (and superfluous since a subsequent
    message prints the strerror() representaton anyway).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/pt-msi.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 4a444ad..cf123ba 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -537,7 +537,6 @@ int pt_msix_init(struct pt_dev *dev, int pos)
     int i, total_entries, table_off, bar_index;
     struct pci_dev *pd = dev->pci_dev;
     int fd;
-    int err;
 
     id = pci_read_byte(pd, pos + PCI_CAP_LIST_ID);
 
@@ -585,17 +584,14 @@ int pt_msix_init(struct pt_dev *dev, int pos)
     dev->msix->phys_iomem_base = mmap(0, total_entries * 16 + dev->msix->table_offset_adjust,
                           PROT_READ, MAP_SHARED | MAP_LOCKED,
                           fd, dev->msix->table_base + table_off - dev->msix->table_offset_adjust);
-    dev->msix->phys_iomem_base = (void *)((char *)dev->msix->phys_iomem_base + 
-                          dev->msix->table_offset_adjust);
-    err = errno;
-    PT_LOG("errno = %d\n",err);
+    close(fd);
     if ( dev->msix->phys_iomem_base == MAP_FAILED )
     {
         PT_LOG("Error: Can't map physical MSI-X table: %s\n", strerror(errno));
-        close(fd);
         goto error_out;
     }
-    close(fd);
+
+    dev->msix->phys_iomem_base += dev->msix->table_offset_adjust;
 
     PT_LOG("mapping physical MSI-X table to %lx\n",
            (unsigned long)dev->msix->phys_iomem_base);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 17:33:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 17:33: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.xensource.com>)
	id 1RirBr-0007ec-8u; Thu, 05 Jan 2012 17:33:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBp-0007eF-NP
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1325784794!9703210!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24631 invoked from network); 5 Jan 2012 17:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 17:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBh-0005LD-UP
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBh-0002rQ-Mf
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:13 +0000
Date: Thu, 05 Jan 2012 17:33:13 +0000
Message-Id: <E1RirBh-0002rQ-Mf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: adjust MSI-X related
	log messages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit bb36d632e4cabf47882adff07a45c6702c4a5b30
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Jan 5 17:16:46 2012 +0000

    qemu-xen: adjust MSI-X related log messages
    
    Several of these messages we coded using line continuation within a
    string literal. This is generally not recommended and also lead to odd
    sequences of many blanks in the middle of the messages.
    
    The message indicating a discarded write due to MSI-X already being
    enabled doesn't need to be issued when a write doesn't actually modify
    the current value. Adjust the surrounding logic accordingly, and
    eliminate some redundancy as well as the sometimes unnecessary access
    to the physical MSI-X table.
    
    Finally, adjust the wording of a few messages to be more precise and/or
    more useful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/pt-msi.c |   52 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index cf123ba..f95f6c0 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -431,8 +431,8 @@ int pt_msix_update_remap(struct pt_dev *dev, int bar_index)
 static void pci_msix_invalid_write(void *opaque, target_phys_addr_t addr,
                                    uint32_t val)
 {
-    PT_LOG("Error: Invalid write to MSI-X table, \
-            only dword access is allowed.\n");
+    PT_LOG("Error: Invalid write to MSI-X table, addr %016"PRIx64";"
+           " only dword access is allowed\n", addr);
 }
 
 static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
@@ -441,13 +441,11 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
     struct pt_msix_info *msix = dev->msix;
     struct msix_entry_info *entry;
     int entry_nr, offset;
-    void *phys_off;
-    uint32_t vec_ctrl;
 
     if ( addr % 4 )
     {
-        PT_LOG("Error: Unaligned dword access to MSI-X table, \
-                addr %016"PRIx64"\n", addr);
+        PT_LOG("Error: Unaligned dword write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
         return;
     }
 
@@ -455,22 +453,30 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
 
-    /*
-     * If Xen intercepts the mask bit access, io_mem[3] may not be
-     * up-to-date. Read from hardware directly.
-     */
-    phys_off = dev->msix->phys_iomem_base + 16 * entry_nr + 12;
-    vec_ctrl = *(uint32_t *)phys_off;
-
-    if ( offset != 3 && msix->enabled && !(vec_ctrl & 0x1) )
+    if ( offset != 3 )
     {
-        PT_LOG("Error: Can't update msix entry %d since MSI-X is already \
-                function.\n", entry_nr);
-        return;
-    }
+        const volatile uint32_t *vec_ctrl;
+
+        if ( entry->io_mem[offset] == val )
+            return;
+
+        /*
+         * If Xen intercepts the mask bit access, io_mem[3] may not be
+         * up-to-date. Read from hardware directly.
+         */
+        vec_ctrl = msix->phys_iomem_base + 16 * entry_nr + 12;
+
+        if ( msix->enabled && !(*vec_ctrl & 0x1) )
+        {
+            PT_LOG("Can't update entry %d since MSI-X is already enabled"
+                   " (%08"PRIx32" -> %08"PRIx32")\n",
+                   entry_nr, entry->io_mem[offset], val);
+            return;
+        }
 
-    if ( offset != 3 && entry->io_mem[offset] != val )
         entry->flags = 1;
+    }
+
     entry->io_mem[offset] = val;
 
     if ( offset == 3 )
@@ -488,8 +494,8 @@ static CPUWriteMemoryFunc *pci_msix_write[] = {
 
 static uint32_t pci_msix_invalid_read(void *opaque, target_phys_addr_t addr)
 {
-    PT_LOG("Error: Invalid read to MSI-X table, \
-            only dword access is allowed.\n");
+    PT_LOG("Error: Invalid read >from MSI-X table, addr %016"PRIx64";"
+           " only dword access is allowed\n", addr);
     return 0;
 }
 
@@ -501,8 +507,8 @@ static uint32_t pci_msix_readl(void *opaque, target_phys_addr_t addr)
 
     if ( addr % 4 )
     {
-        PT_LOG("Error: Unaligned dword access to MSI-X table, \
-                addr %016"PRIx64"\n", addr);
+        PT_LOG("Error: Unaligned dword read from MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
         return 0;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 17:33:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 17:33: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.xensource.com>)
	id 1RirBr-0007ec-8u; Thu, 05 Jan 2012 17:33:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBp-0007eF-NP
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1325784794!9703210!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24631 invoked from network); 5 Jan 2012 17:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 17:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBh-0005LD-UP
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RirBh-0002rQ-Mf
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 17:33:13 +0000
Date: Thu, 05 Jan 2012 17:33:13 +0000
Message-Id: <E1RirBh-0002rQ-Mf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: adjust MSI-X related
	log messages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit bb36d632e4cabf47882adff07a45c6702c4a5b30
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Jan 5 17:16:46 2012 +0000

    qemu-xen: adjust MSI-X related log messages
    
    Several of these messages we coded using line continuation within a
    string literal. This is generally not recommended and also lead to odd
    sequences of many blanks in the middle of the messages.
    
    The message indicating a discarded write due to MSI-X already being
    enabled doesn't need to be issued when a write doesn't actually modify
    the current value. Adjust the surrounding logic accordingly, and
    eliminate some redundancy as well as the sometimes unnecessary access
    to the physical MSI-X table.
    
    Finally, adjust the wording of a few messages to be more precise and/or
    more useful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/pt-msi.c |   52 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index cf123ba..f95f6c0 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -431,8 +431,8 @@ int pt_msix_update_remap(struct pt_dev *dev, int bar_index)
 static void pci_msix_invalid_write(void *opaque, target_phys_addr_t addr,
                                    uint32_t val)
 {
-    PT_LOG("Error: Invalid write to MSI-X table, \
-            only dword access is allowed.\n");
+    PT_LOG("Error: Invalid write to MSI-X table, addr %016"PRIx64";"
+           " only dword access is allowed\n", addr);
 }
 
 static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
@@ -441,13 +441,11 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
     struct pt_msix_info *msix = dev->msix;
     struct msix_entry_info *entry;
     int entry_nr, offset;
-    void *phys_off;
-    uint32_t vec_ctrl;
 
     if ( addr % 4 )
     {
-        PT_LOG("Error: Unaligned dword access to MSI-X table, \
-                addr %016"PRIx64"\n", addr);
+        PT_LOG("Error: Unaligned dword write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
         return;
     }
 
@@ -455,22 +453,30 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
 
-    /*
-     * If Xen intercepts the mask bit access, io_mem[3] may not be
-     * up-to-date. Read from hardware directly.
-     */
-    phys_off = dev->msix->phys_iomem_base + 16 * entry_nr + 12;
-    vec_ctrl = *(uint32_t *)phys_off;
-
-    if ( offset != 3 && msix->enabled && !(vec_ctrl & 0x1) )
+    if ( offset != 3 )
     {
-        PT_LOG("Error: Can't update msix entry %d since MSI-X is already \
-                function.\n", entry_nr);
-        return;
-    }
+        const volatile uint32_t *vec_ctrl;
+
+        if ( entry->io_mem[offset] == val )
+            return;
+
+        /*
+         * If Xen intercepts the mask bit access, io_mem[3] may not be
+         * up-to-date. Read from hardware directly.
+         */
+        vec_ctrl = msix->phys_iomem_base + 16 * entry_nr + 12;
+
+        if ( msix->enabled && !(*vec_ctrl & 0x1) )
+        {
+            PT_LOG("Can't update entry %d since MSI-X is already enabled"
+                   " (%08"PRIx32" -> %08"PRIx32")\n",
+                   entry_nr, entry->io_mem[offset], val);
+            return;
+        }
 
-    if ( offset != 3 && entry->io_mem[offset] != val )
         entry->flags = 1;
+    }
+
     entry->io_mem[offset] = val;
 
     if ( offset == 3 )
@@ -488,8 +494,8 @@ static CPUWriteMemoryFunc *pci_msix_write[] = {
 
 static uint32_t pci_msix_invalid_read(void *opaque, target_phys_addr_t addr)
 {
-    PT_LOG("Error: Invalid read to MSI-X table, \
-            only dword access is allowed.\n");
+    PT_LOG("Error: Invalid read >from MSI-X table, addr %016"PRIx64";"
+           " only dword access is allowed\n", addr);
     return 0;
 }
 
@@ -501,8 +507,8 @@ static uint32_t pci_msix_readl(void *opaque, target_phys_addr_t addr)
 
     if ( addr % 4 )
     {
-        PT_LOG("Error: Unaligned dword access to MSI-X table, \
-                addr %016"PRIx64"\n", addr);
+        PT_LOG("Error: Unaligned dword read from MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
         return 0;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw0-0003lP-0B; Thu, 05 Jan 2012 21:33:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvy-0003lF-Dk
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1325799154!54826349!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18028 invoked from network); 5 Jan 2012 21:32:35 -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;
	5 Jan 2012 21:32:35 -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 1Riuvw-0000Cz-6R
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvw-0002Sv-52
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:12 +0000
Message-Id: <E1Riuvw-0002Sv-52@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1325784323 0
# Node ID 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
# Parent  26e1cf6d888655019a2c4024fb53d9ba25d4f9c5
Update QEMU_TAG
---


diff -r 26e1cf6d8886 -r 4086e4811547 Config.mk
--- a/Config.mk	Thu Jan 05 17:21:04 2012 +0000
+++ b/Config.mk	Thu Jan 05 17:25:23 2012 +0000
@@ -207,9 +207,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 56d7747a3cf811910c4cf865e1ebcb8b82502005
-# Thu Dec 22 14:46:31 2011 +0000
-# qemu: clean up MSI-X table handling
+QEMU_TAG ?= bb36d632e4cabf47882adff07a45c6702c4a5b30
+# Thu Jan 5 17:16:46 2012 +0000
+# qemu-xen: adjust MSI-X related log messages
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw0-0003lP-0B; Thu, 05 Jan 2012 21:33:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvy-0003lF-Dk
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1325799154!54826349!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18028 invoked from network); 5 Jan 2012 21:32:35 -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;
	5 Jan 2012 21:32:35 -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 1Riuvw-0000Cz-6R
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvw-0002Sv-52
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:12 +0000
Message-Id: <E1Riuvw-0002Sv-52@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update QEMU_TAG
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1325784323 0
# Node ID 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
# Parent  26e1cf6d888655019a2c4024fb53d9ba25d4f9c5
Update QEMU_TAG
---


diff -r 26e1cf6d8886 -r 4086e4811547 Config.mk
--- a/Config.mk	Thu Jan 05 17:21:04 2012 +0000
+++ b/Config.mk	Thu Jan 05 17:25:23 2012 +0000
@@ -207,9 +207,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 56d7747a3cf811910c4cf865e1ebcb8b82502005
-# Thu Dec 22 14:46:31 2011 +0000
-# qemu: clean up MSI-X table handling
+QEMU_TAG ?= bb36d632e4cabf47882adff07a45c6702c4a5b30
+# Thu Jan 5 17:16:46 2012 +0000
+# qemu-xen: adjust MSI-X related log messages
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw4-0003nM-NT; Thu, 05 Jan 2012 21:33:20 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw3-0003lG-Et
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1325799192!7943650!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14821 invoked from network); 5 Jan 2012 21:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:13 -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 1Riuvv-0000Cw-MT
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvv-0002Sg-LZ
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Message-Id: <E1Riuvv-0002Sg-LZ@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ipxe: remove tarball on clean
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1325784064 0
# Node ID 26e1cf6d888655019a2c4024fb53d9ba25d4f9c5
# Parent  ff0685e8419bc54b631f017c63a983362363c87a
ipxe: remove tarball on clean

This prevents us picking up a stale tarball when the tag changes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ff0685e8419b -r 26e1cf6d8886 tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile	Tue Jan 03 13:11:46 2012 +0100
+++ b/tools/firmware/etherboot/Makefile	Thu Jan 05 17:21:04 2012 +0000
@@ -56,7 +56,7 @@
 
 .PHONY: clean
 clean:
-	rm -rf $D $D.git *~ eb-roms.h _$T
+	rm -rf $D $D.git *~ eb-roms.h _$T $T
 
 .PHONY: distclean
 distclean: clean

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw4-0003nM-NT; Thu, 05 Jan 2012 21:33:20 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw3-0003lG-Et
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1325799192!7943650!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14821 invoked from network); 5 Jan 2012 21:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:13 -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 1Riuvv-0000Cw-MT
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvv-0002Sg-LZ
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Message-Id: <E1Riuvv-0002Sg-LZ@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ipxe: remove tarball on clean
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1325784064 0
# Node ID 26e1cf6d888655019a2c4024fb53d9ba25d4f9c5
# Parent  ff0685e8419bc54b631f017c63a983362363c87a
ipxe: remove tarball on clean

This prevents us picking up a stale tarball when the tag changes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ff0685e8419b -r 26e1cf6d8886 tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile	Tue Jan 03 13:11:46 2012 +0100
+++ b/tools/firmware/etherboot/Makefile	Thu Jan 05 17:21:04 2012 +0000
@@ -56,7 +56,7 @@
 
 .PHONY: clean
 clean:
-	rm -rf $D $D.git *~ eb-roms.h _$T
+	rm -rf $D $D.git *~ eb-roms.h _$T $T
 
 .PHONY: distclean
 distclean: clean

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw2-0003lx-5d; Thu, 05 Jan 2012 21:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw0-0003ku-DW
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1325799188!9772440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20528 invoked from network); 5 Jan 2012 21:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:09 -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 1Riuvs-0000CY-61
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvr-0002Qk-Kr
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:07 +0000
Message-Id: <E1Riuvr-0002Qk-Kr@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vIRQ: IRR and TMR race condition
	bug fix
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Yongan Liu<Liuyongan@huawei.com>
# Date 1325752199 -3600
# Node ID 02b92d035f6484ea33f03c4a59630d82e0469eeb
# Parent  efaa28639a71524a693ba500624f8512e5795e18
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r efaa28639a71 -r 02b92d035f64 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Wed Jan 04 16:12:44 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Thu Jan 05 09:29:59 2012 +0100
@@ -142,14 +142,11 @@
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
-    int ret;
-
-    ret = !vlapic_test_and_set_irr(vec, vlapic);
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return ret;
+    return !vlapic_test_and_set_irr(vec, vlapic);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw2-0003lx-5d; Thu, 05 Jan 2012 21:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw0-0003ku-DW
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1325799188!9772440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20528 invoked from network); 5 Jan 2012 21:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:09 -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 1Riuvs-0000CY-61
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvr-0002Qk-Kr
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:07 +0000
Message-Id: <E1Riuvr-0002Qk-Kr@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vIRQ: IRR and TMR race condition
	bug fix
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Yongan Liu<Liuyongan@huawei.com>
# Date 1325752199 -3600
# Node ID 02b92d035f6484ea33f03c4a59630d82e0469eeb
# Parent  efaa28639a71524a693ba500624f8512e5795e18
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r efaa28639a71 -r 02b92d035f64 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Wed Jan 04 16:12:44 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Thu Jan 05 09:29:59 2012 +0100
@@ -142,14 +142,11 @@
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
-    int ret;
-
-    ret = !vlapic_test_and_set_irr(vec, vlapic);
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return ret;
+    return !vlapic_test_and_set_irr(vec, vlapic);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw2-0003m6-87; Thu, 05 Jan 2012 21:33:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw0-0003l6-Oh
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1325799171!61323103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13712 invoked from network); 5 Jan 2012 21:32:52 -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;
	5 Jan 2012 21:32:52 -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 1Riuvu-0000Cq-UB
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvu-0002SC-Mu
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Message-Id: <E1Riuvu-0002SC-Mu@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: write vifname in xenstore if
	set.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1325783613 0
# Node ID caf9753d4cc100183eeda26d00c8c38f14215651
# Parent  19ac027a3c311159dc0f3696d6e571314f0bf0c3
libxl: write vifname in xenstore if set.

Simple fix to enable user to specify vif names.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 19ac027a3c31 -r caf9753d4cc1 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Jan 05 17:13:33 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Jan 05 17:13:33 2012 +0000
@@ -1534,6 +1534,12 @@
                                           libxl_xen_script_dir_path(),
                                           nic->script));
     }
+
+    if (nic->ifname) {
+        flexarray_append(back, "vifname");
+        flexarray_append(back, nic->ifname);
+    }
+
     flexarray_append(back, "mac");
     flexarray_append(back,libxl__sprintf(gc,
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw2-0003m6-87; Thu, 05 Jan 2012 21:33:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw0-0003l6-Oh
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1325799171!61323103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13712 invoked from network); 5 Jan 2012 21:32:52 -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;
	5 Jan 2012 21:32:52 -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 1Riuvu-0000Cq-UB
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvu-0002SC-Mu
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Message-Id: <E1Riuvu-0002SC-Mu@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: write vifname in xenstore if
	set.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1325783613 0
# Node ID caf9753d4cc100183eeda26d00c8c38f14215651
# Parent  19ac027a3c311159dc0f3696d6e571314f0bf0c3
libxl: write vifname in xenstore if set.

Simple fix to enable user to specify vif names.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 19ac027a3c31 -r caf9753d4cc1 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Jan 05 17:13:33 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Jan 05 17:13:33 2012 +0000
@@ -1534,6 +1534,12 @@
                                           libxl_xen_script_dir_path(),
                                           nic->script));
     }
+
+    if (nic->ifname) {
+        flexarray_append(back, "vifname");
+        flexarray_append(back, nic->ifname);
+    }
+
     flexarray_append(back, "mac");
     flexarray_append(back,libxl__sprintf(gc,
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw3-0003mq-Ko; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw2-0003l5-Ls
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1325799190!7298703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18438 invoked from network); 5 Jan 2012 21:33:11 -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 Jan 2012 21:33:11 -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 1Riuvu-0000Cn-7w
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvu-0002Rx-74
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Message-Id: <E1Riuvu-0002Rx-74@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: print out vifname in create
	dryrun.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1325783613 0
# Node ID 19ac027a3c311159dc0f3696d6e571314f0bf0c3
# Parent  aaad6a035efb0fcd2d3d7a7320ce9b8ead0ba163
libxl: print out vifname in create dryrun.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r aaad6a035efb -r 19ac027a3c31 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Jan 05 15:51:28 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Jan 05 17:13:33 2012 +0000
@@ -419,6 +419,8 @@
     for (i = 0; i < d_config->num_vifs; i++) {
         printf("\t(device\n");
         printf("\t\t(vif\n");
+        if (d_config->vifs[i].ifname)
+            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
         printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw3-0003mq-Ko; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw2-0003l5-Ls
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1325799190!7298703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18438 invoked from network); 5 Jan 2012 21:33:11 -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 Jan 2012 21:33:11 -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 1Riuvu-0000Cn-7w
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvu-0002Rx-74
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:10 +0000
Message-Id: <E1Riuvu-0002Rx-74@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: print out vifname in create
	dryrun.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1325783613 0
# Node ID 19ac027a3c311159dc0f3696d6e571314f0bf0c3
# Parent  aaad6a035efb0fcd2d3d7a7320ce9b8ead0ba163
libxl: print out vifname in create dryrun.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r aaad6a035efb -r 19ac027a3c31 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Jan 05 15:51:28 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Jan 05 17:13:33 2012 +0000
@@ -419,6 +419,8 @@
     for (i = 0; i < d_config->num_vifs; i++) {
         printf("\t(device\n");
         printf("\t\t(vif\n");
+        if (d_config->vifs[i].ifname)
+            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
         printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw3-0003mk-Ic; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw2-0003l4-6t
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1325799189!9831881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8743 invoked from network); 5 Jan 2012 21:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:10 -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 1Riuvt-0000Ch-J3
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvt-0002RT-7w
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Message-Id: <E1Riuvt-0002RT-7w@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: emulate lea with two register
	operands correctly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1325778436 0
# Node ID 03781de56c31072266fb464e7dfeec133bcf0fb4
# Parent  94180a5a0c7c7d680ede2e54bd13f56ed43f452d
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 94180a5a0c7c -r 03781de56c31 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Dec 20 08:21:11 2011 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Thu Jan 05 15:47:16 2012 +0000
@@ -2240,6 +2240,7 @@
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21:33: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.xensource.com>)
	id 1Riuw3-0003mk-Ic; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw2-0003l4-6t
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1325799189!9831881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8743 invoked from network); 5 Jan 2012 21:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:10 -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 1Riuvt-0000Ch-J3
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvt-0002RT-7w
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Message-Id: <E1Riuvt-0002RT-7w@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: emulate lea with two register
	operands correctly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1325778436 0
# Node ID 03781de56c31072266fb464e7dfeec133bcf0fb4
# Parent  94180a5a0c7c7d680ede2e54bd13f56ed43f452d
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 94180a5a0c7c -r 03781de56c31 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Dec 20 08:21:11 2011 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Thu Jan 05 15:47:16 2012 +0000
@@ -2240,6 +2240,7 @@
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw2-0003ls-38; Thu, 05 Jan 2012 21:33:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw0-0003kt-8c
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1325799188!9274072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32766 invoked from network); 5 Jan 2012 21:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:09 -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 1Riuvs-0000Cb-E2
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvs-0002Qz-8F
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Message-Id: <E1Riuvs-0002Qz-8F@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove _XOPEN_SOURCE
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1325774138 0
# Node ID f2a781ab96bab45c0713f85e4279a59892b5a3ff
# Parent  02b92d035f6484ea33f03c4a59630d82e0469eeb
xenpaging: remove _XOPEN_SOURCE

The _XOPEN_SOURCE define was breaking the compilation under NetBSD.
I've removed it becasue it is not necessary.

Error message:

gcc  -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing
-std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value
-Wdeclaration-after-statement   -D__XEN_TOOLS__ -MMD -MF
.xenpaging.o.d -fno-optimize-sibling-calls
-I/root/xen-04102011/tools/xenpaging/../../tools/libxc
-I/root/xen-04102011/tools/xenpaging/../../tools/include
-I/root/xen-04102011/tools/xenpaging/../../tools/xenstore
-I/root/xen-04102011/tools/xenpaging/../../tools/include -Werror
-Wno-unused -g  -c -o xenpaging.o xenpaging.c  -I/usr/xen42/include
-I/usr/include
cc1: warnings being treated as errors
xenpaging.c: In function 'xenpaging_init':
xenpaging.c:333: warning: implicit declaration of function 'asprintf'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 02b92d035f64 -r f2a781ab96ba tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Jan 05 09:29:59 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Thu Jan 05 14:35:38 2012 +0000
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define _XOPEN_SOURCE	600
 #define _GNU_SOURCE
 
 #include <inttypes.h>

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw2-0003ls-38; Thu, 05 Jan 2012 21:33:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw0-0003kt-8c
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1325799188!9274072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32766 invoked from network); 5 Jan 2012 21:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:09 -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 1Riuvs-0000Cb-E2
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvs-0002Qz-8F
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Message-Id: <E1Riuvs-0002Qz-8F@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove _XOPEN_SOURCE
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1325774138 0
# Node ID f2a781ab96bab45c0713f85e4279a59892b5a3ff
# Parent  02b92d035f6484ea33f03c4a59630d82e0469eeb
xenpaging: remove _XOPEN_SOURCE

The _XOPEN_SOURCE define was breaking the compilation under NetBSD.
I've removed it becasue it is not necessary.

Error message:

gcc  -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing
-std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value
-Wdeclaration-after-statement   -D__XEN_TOOLS__ -MMD -MF
.xenpaging.o.d -fno-optimize-sibling-calls
-I/root/xen-04102011/tools/xenpaging/../../tools/libxc
-I/root/xen-04102011/tools/xenpaging/../../tools/include
-I/root/xen-04102011/tools/xenpaging/../../tools/xenstore
-I/root/xen-04102011/tools/xenpaging/../../tools/include -Werror
-Wno-unused -g  -c -o xenpaging.o xenpaging.c  -I/usr/xen42/include
-I/usr/include
cc1: warnings being treated as errors
xenpaging.c: In function 'xenpaging_init':
xenpaging.c:333: warning: implicit declaration of function 'asprintf'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 02b92d035f64 -r f2a781ab96ba tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Jan 05 09:29:59 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Thu Jan 05 14:35:38 2012 +0000
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define _XOPEN_SOURCE	600
 #define _GNU_SOURCE
 
 #include <inttypes.h>

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw4-0003nT-Ps; Thu, 05 Jan 2012 21:33:20 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw3-0003lI-LH
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1325799191!10315175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32580 invoked from network); 5 Jan 2012 21:33:12 -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;
	5 Jan 2012 21:33:12 -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 1Riuvv-0000Ct-AI
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvv-0002SR-6D
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Message-Id: <E1Riuvv-0002SR-6D@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: fix extlinux parsing
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1325592706 -3600
# Node ID ff0685e8419bc54b631f017c63a983362363c87a
# Parent  caf9753d4cc100183eeda26d00c8c38f14215651
pygrub: fix extlinux parsing

pygrub was unable to parse extlinux config files correctly, exactly
the ones like:

LABEL grsec
  KERNEL vmlinuz-3.0.10-grsec
  APPEND initrd=initramfs-3.0.10-grsec
root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
modules=sd-mod,usb-storage,ext4 xen quiet

This patch fixes it, adding a new case when parsing the "append" line,
that searches for the initrd image.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r caf9753d4cc1 -r ff0685e8419b tools/pygrub/examples/alpine-linux-2.3.2.extlinux
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux	Tue Jan 03 13:11:46 2012 +0100
@@ -0,0 +1,11 @@
+DEFAULT menu.c32
+PROMPT 0
+MENU TITLE Alpine/Linux Boot Menu
+MENU HIDDEN
+MENU AUTOBOOT Alpine will be booted automatically in # seconds.
+TIMEOUT 30
+LABEL grsec
+  MENU DEFAULT
+  MENU LABEL Linux 3.0.10-grsec
+  KERNEL vmlinuz-3.0.10-grsec
+  APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet
diff -r caf9753d4cc1 -r ff0685e8419b tools/pygrub/src/ExtLinuxConf.py
--- a/tools/pygrub/src/ExtLinuxConf.py	Thu Jan 05 17:13:33 2012 +0000
+++ b/tools/pygrub/src/ExtLinuxConf.py	Tue Jan 03 13:11:46 2012 +0100
@@ -60,6 +60,13 @@
 
                 # Bypass regular self.commands handling
                 com = None
+            elif arg.find("initrd="):
+                # find initrd image in append line
+                args = arg.strip().split(" ")
+                for a in args:
+                    if a.lower().startswith("initrd="):
+                        setattr(self, "initrd", a.replace("initrd=", ""))
+                        arg = arg.replace(a, "")
 
         if com is not None and self.commands.has_key(com):
             if self.commands[com] is not None:
@@ -86,10 +93,12 @@
         self._args = args
     def get_kernel(self):
         return self._kernel
+    def set_args(self, val):
+        self._args = val
     def get_args(self):
         return self._args
     kernel = property(get_kernel, set_kernel)
-    args = property(get_args)
+    args = property(get_args, set_args)
 
     def set_initrd(self, val):
         self._initrd = (None,val)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw4-0003nT-Ps; Thu, 05 Jan 2012 21:33:20 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw3-0003lI-LH
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1325799191!10315175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32580 invoked from network); 5 Jan 2012 21:33:12 -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;
	5 Jan 2012 21:33:12 -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 1Riuvv-0000Ct-AI
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvv-0002SR-6D
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:11 +0000
Message-Id: <E1Riuvv-0002SR-6D@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: fix extlinux parsing
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1325592706 -3600
# Node ID ff0685e8419bc54b631f017c63a983362363c87a
# Parent  caf9753d4cc100183eeda26d00c8c38f14215651
pygrub: fix extlinux parsing

pygrub was unable to parse extlinux config files correctly, exactly
the ones like:

LABEL grsec
  KERNEL vmlinuz-3.0.10-grsec
  APPEND initrd=initramfs-3.0.10-grsec
root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
modules=sd-mod,usb-storage,ext4 xen quiet

This patch fixes it, adding a new case when parsing the "append" line,
that searches for the initrd image.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r caf9753d4cc1 -r ff0685e8419b tools/pygrub/examples/alpine-linux-2.3.2.extlinux
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux	Tue Jan 03 13:11:46 2012 +0100
@@ -0,0 +1,11 @@
+DEFAULT menu.c32
+PROMPT 0
+MENU TITLE Alpine/Linux Boot Menu
+MENU HIDDEN
+MENU AUTOBOOT Alpine will be booted automatically in # seconds.
+TIMEOUT 30
+LABEL grsec
+  MENU DEFAULT
+  MENU LABEL Linux 3.0.10-grsec
+  KERNEL vmlinuz-3.0.10-grsec
+  APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet
diff -r caf9753d4cc1 -r ff0685e8419b tools/pygrub/src/ExtLinuxConf.py
--- a/tools/pygrub/src/ExtLinuxConf.py	Thu Jan 05 17:13:33 2012 +0000
+++ b/tools/pygrub/src/ExtLinuxConf.py	Tue Jan 03 13:11:46 2012 +0100
@@ -60,6 +60,13 @@
 
                 # Bypass regular self.commands handling
                 com = None
+            elif arg.find("initrd="):
+                # find initrd image in append line
+                args = arg.strip().split(" ")
+                for a in args:
+                    if a.lower().startswith("initrd="):
+                        setattr(self, "initrd", a.replace("initrd=", ""))
+                        arg = arg.replace(a, "")
 
         if com is not None and self.commands.has_key(com):
             if self.commands[com] is not None:
@@ -86,10 +93,12 @@
         self._args = args
     def get_kernel(self):
         return self._kernel
+    def set_args(self, val):
+        self._args = val
     def get_args(self):
         return self._args
     kernel = property(get_kernel, set_kernel)
-    args = property(get_args)
+    args = property(get_args, set_args)
 
     def set_initrd(self, val):
         self._initrd = (None,val)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw3-0003ma-Dc; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw1-0003l3-Up
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1325799190!9752997!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25315 invoked from network); 5 Jan 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:11 -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 1Riuvt-0000Ck-VY
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvt-0002Ri-N6
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Message-Id: <E1Riuvt-0002Ri-N6@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] netbsd: build fix with gcc 4.5
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Brownlee <abs@netbsd.org>
# Date 1325778688 0
# Node ID aaad6a035efb0fcd2d3d7a7320ce9b8ead0ba163
# Parent  03781de56c31072266fb464e7dfeec133bcf0fb4
netbsd: build fix with gcc 4.5

Fix build failure with gcc 4.5:
implicit declaration of __builtin_stdarg_start

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
From: David Brownlee <abs@netbsd.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 03781de56c31 -r aaad6a035efb xen/include/xen/stdarg.h
--- a/xen/include/xen/stdarg.h	Thu Jan 05 15:47:16 2012 +0000
+++ b/xen/include/xen/stdarg.h	Thu Jan 05 15:51:28 2012 +0000
@@ -5,7 +5,17 @@
 #  include "/usr/include/stdarg.h"
 #elif defined (__NetBSD__)
    typedef __builtin_va_list va_list;
-#  define va_start(ap, last)    __builtin_stdarg_start((ap), (last))
+#  ifdef __GNUC__
+#    define __GNUC_PREREQ__(x, y)                                       \
+        ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||                  \
+         (__GNUC__ > (x)))
+#  else
+#    define __GNUC_PREREQ__(x, y)   0
+#  endif
+#  if !__GNUC_PREREQ__(4, 5)
+#    define __builtin_va_start(ap, last)    __builtin_stdarg_start((ap), (last))
+#  endif
+#  define va_start(ap, last)    __builtin_va_start((ap), (last))
 #  define va_end(ap)            __builtin_va_end(ap)
 #  define va_arg                __builtin_va_arg
 #else

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw3-0003mU-B2; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw1-0003l1-Lf
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1325799189!9766193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15781 invoked from network); 5 Jan 2012 21:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:10 -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 1Riuvs-0000Ce-S7
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvs-0002RE-O1
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Message-Id: <E1Riuvs-0002RE-O1@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ipxe: update to upstream version
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324365671 -3600
# Node ID 94180a5a0c7c7d680ede2e54bd13f56ed43f452d
# Parent  f2a781ab96bab45c0713f85e4279a59892b5a3ff
ipxe: update to upstream version

Updated ipxe to current tree, which is
540e5960dc6b49eacf367f7c319fd0546474b845:

Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 builds

Removed all the backported patches and updated
boot_prompt_option.patch to apply against current ipxe.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile	Thu Jan 05 14:35:38 2012 +0000
+++ b/tools/firmware/etherboot/Makefile	Tue Dec 20 08:21:11 2011 +0100
@@ -10,7 +10,7 @@
 IPXE_GIT_URL := git://git.ipxe.org/ipxe.git
 endif
 
-IPXE_GIT_TAG := v1.0.0
+IPXE_GIT_TAG := 9a93db3f0947484e30e753bbd61a10b17336e20e
 
 IPXE_TARBALL_URL := $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
 
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/boot_prompt_option.patch
--- a/tools/firmware/etherboot/patches/boot_prompt_option.patch	Thu Jan 05 14:35:38 2012 +0000
+++ b/tools/firmware/etherboot/patches/boot_prompt_option.patch	Tue Dec 20 08:21:11 2011 +0100
@@ -1,7 +1,8 @@
-diff -pruN gpxe/src/arch/i386/prefix/romprefix.S gpxe.new/src/arch/i386/prefix/romprefix.S
---- gpxe/src/arch/i386/prefix/romprefix.S	2010-06-29 20:31:33.000000000 +0100
-+++ gpxe.new/src/arch/i386/prefix/romprefix.S	2010-07-20 10:40:20.000000000 +0100
-@@ -458,6 +458,7 @@ no_pmm:
+diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
+index 0f92415..cce7505 100644
+--- a/src/arch/i386/prefix/romprefix.S
++++ b/src/arch/i386/prefix/romprefix.S
+@@ -391,6 +391,7 @@ no_pmm:
  	xorw	%di, %di
  	cs rep	movsb
  
@@ -9,15 +10,15 @@
  	/* Prompt for POST-time shell */
  	movw	$init_message_prompt, %si
  	xorw	%di, %di
-@@ -484,6 +485,7 @@ no_pmm:
+@@ -418,6 +419,7 @@ no_pmm:
  	pushw	%cs
  	call	exec
- out:
+ 2:
 +#endif
  	/* Restore registers */
  	popw	%gs
  	popw	%fs
-@@ -538,6 +540,7 @@ init_message_no_pmm:
+@@ -546,6 +548,7 @@ init_message_pmm:
  init_message_int19:
  	.asciz	" INT19"
  	.size	init_message_int19, . - init_message_int19
@@ -25,11 +26,11 @@
  init_message_prompt:
  	.asciz	"\nPress Ctrl-B to configure "
  	.size	init_message_prompt, . - init_message_prompt
-@@ -547,6 +550,7 @@ init_message_dots:
+@@ -555,6 +558,7 @@ init_message_dots:
  init_message_done:
  	.asciz	"\n\n"
  	.size	init_message_done, . - init_message_done
 +#endif
  
- /* ROM image location
+ /* PCI bus:dev.fn
   *
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/gpxe-git-0edf2405b457
--- a/tools/firmware/etherboot/patches/gpxe-git-0edf2405b457	Thu Jan 05 14:35:38 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-commit 0edf2405b457e542c244a72285511b3ff5c06885
-Author: Michael Brown <mcb30@ipxe.org>
-Date:   Tue Apr 27 09:52:22 2010 +0100
-
-    [build] Fix building with binutils 2.16
-    
-    Signed-off-by: Michael Brown <mcb30@ipxe.org>
-    Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
-
-diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
-index 278a397..0ce2c10 100644
---- a/src/arch/i386/scripts/i386.lds
-+++ b/src/arch/i386/scripts/i386.lds
-@@ -24,6 +24,8 @@ SECTIONS {
-      *
-      */
- 
-+    PROVIDE ( _max_align = 16 );
-+
-     /*
-      * The prefix
-      *
-@@ -169,7 +171,6 @@ SECTIONS {
-      *
-      */
- 
--    PROVIDE ( _max_align = 16 );
-     .			= 0;
- 
-     .			= ALIGN ( _max_align );
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/gpxe-git-a803ef3dfeac
--- a/tools/firmware/etherboot/patches/gpxe-git-a803ef3dfeac	Thu Jan 05 14:35:38 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-commit a803ef3dfeac4e8aa35810bba65f9ccab0bdf264
-Author: Michael Brown <mcb30@ipxe.org>
-Date:   Thu Jun 24 01:23:00 2010 +0100
-
-    [build] Avoid hard-coding the path to perl
-    
-    The path "/usr/bin/perl" has been hard-coded since Etherboot 5.1, for
-    no discernible reason.  Use just "perl" instead to fix the
-    inconsistency and allow building on systems with Perl installed
-    outside of /usr/bin.
-    
-    This commit also includes a later fix that removes a dependency on
-    "perl" which broke builds from fully clean trees.
-    
-    Reported-by: Gabor Z. Papp <gzp@papp.hu>
-    Signed-off-by: Michael Brown <mcb30@ipxe.org>
-    Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
-
-diff -pruN a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios
---- a/src/arch/i386/Makefile.pcbios	2010-06-29 20:31:33.000000000 +0100
-+++ b/src/arch/i386/Makefile.pcbios	2010-07-20 16:07:06.000000000 +0100
-@@ -24,11 +24,11 @@ MEDIA		+= raw
- 
- # Padding rules
- #
--PAD_rom		= $(PADIMG) --blksize=512 --byte=0xff $@
-+PAD_rom		= $(PERL) $(PADIMG) --blksize=512 --byte=0xff $@
- PAD_hrom	= $(PAD_rom)
- PAD_xrom	= $(PAD_rom)
--PAD_dsk		= $(PADIMG) --blksize=512 $@
--PAD_hd		= $(PADIMG) --blksize=32768 $@
-+PAD_dsk		= $(PERL) $(PADIMG) --blksize=512 $@
-+PAD_hd		= $(PERL) $(PADIMG) --blksize=32768 $@
- 
- # rule to make a non-emulation ISO boot image
- NON_AUTO_MEDIA	+= iso
-@@ -67,4 +67,4 @@ NON_AUTO_MEDIA	+= usb
- NON_AUTO_MEDIA += pdsk
- %pdsk : %dsk
- 	$(Q)cp $< $@
--	$(Q)$(PADIMG) --blksize=1474560 $@
-+	$(Q)$(PERL) $(PADIMG) --blksize=1474560 $@
-diff -pruN a/src/Makefile b/src/Makefile
---- a/src/Makefile	2010-06-29 20:31:33.000000000 +0100
-+++ b/src/Makefile	2010-07-20 16:02:56.000000000 +0100
-@@ -20,7 +20,7 @@ MKDIR		:= mkdir
- CP		:= cp
- ECHO		:= echo
- PRINTF		:= printf
--PERL		:= /usr/bin/perl
-+PERL		:= perl
- CC		:= $(CROSS_COMPILE)gcc
- CPP		:= $(CC) -E
- AS		:= $(CROSS_COMPILE)as
-@@ -31,12 +31,12 @@ RANLIB		:= $(CROSS_COMPILE)ranlib
- OBJCOPY		:= $(CROSS_COMPILE)objcopy
- NM		:= $(CROSS_COMPILE)nm
- OBJDUMP		:= $(CROSS_COMPILE)objdump
--PARSEROM	:= $(PERL) ./util/parserom.pl
--MAKEROM		:= $(PERL) ./util/makerom.pl
--SYMCHECK	:= $(PERL) ./util/symcheck.pl
--SORTOBJDUMP	:= $(PERL) ./util/sortobjdump.pl
--PADIMG		:= $(PERL) ./util/padimg.pl
--LICENCE		:= $(PERL) ./util/licence.pl
-+PARSEROM	:= ./util/parserom.pl
-+MAKEROM		:= ./util/makerom.pl
-+SYMCHECK	:= ./util/symcheck.pl
-+SORTOBJDUMP	:= ./util/sortobjdump.pl
-+PADIMG		:= ./util/padimg.pl
-+LICENCE		:= ./util/licence.pl
- NRV2B		:= ./util/nrv2b
- ZBIN		:= ./util/zbin
- ELF2EFI32	:= ./util/elf2efi32
-diff -pruN a/src/Makefile.housekeeping b/src/Makefile.housekeeping
---- a/src/Makefile.housekeeping	2010-06-29 20:31:33.000000000 +0100
-+++ b/src/Makefile.housekeeping	2010-07-20 16:04:42.000000000 +0100
-@@ -486,7 +486,7 @@ define src_template
- 		 '\n$(2) : $$($(4)_DEPS)\n' \
- 		 '\nTAGS : $$($(4)_DEPS)\n' \
- 		>> $(2)
--	@$(PARSEROM) $(1) >> $(2)
-+	@$(PERL) $(PARSEROM) $(1) >> $(2)
- 
- endef
- 
-@@ -695,7 +695,7 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDS
- 	$(QM)$(ECHO) "  [LD] $@"
- 	$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
- 		-Map $(BIN)/$*.tmp.map
--	$(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
-+	$(Q)$(OBJDUMP) -ht $@ | $(PERL) $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
- 
- # Keep intermediate object file (useful for debugging)
- .PRECIOUS : $(BIN)/%.tmp
-@@ -752,7 +752,7 @@ $(BIN)/%.licence : $(BIN)/%.tmp
- 		echo "files are missing a licence declaration:" ;\
- 		echo $(call unlicensed_deps_list,$<);\
- 		exit 1,\
--		$(LICENCE) $(call licence_list,$<))
-+		$(PERL) $(LICENCE) $(call licence_list,$<))
- 
- # Extract compression information from intermediate object file
- #
-@@ -866,10 +866,10 @@ endif # defined(BIN)
- # the automatic build system and varies by target; it includes the
- # "-p 0x1234,0x5678" string to set the PCI IDs.
- #
--FINALISE_rom	= $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
-+FINALISE_rom	= $(PERL) $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
- 		  -i$(IDENT) -s 0 $@
- FINALISE_hrom	= $(FINALISE_rom)
--FINALISE_xrom	= $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
-+FINALISE_xrom	= $(PERL) $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
- 		  -i$(IDENT) -n -s 0 $@
- 
- # Some ROMs require specific flags to be passed to makerom.pl
-@@ -987,7 +987,7 @@ $(SYMTAB) : $(BLIB)
- CLEANUP	+= $(BIN)/symtab
- 
- symcheck : $(SYMTAB)
--	$(SYMCHECK) $<
-+	$(PERL) $(SYMCHECK) $<
- 
- endif # defined(BIN)
- 
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/series
--- a/tools/firmware/etherboot/patches/series	Thu Jan 05 14:35:38 2012 +0000
+++ b/tools/firmware/etherboot/patches/series	Tue Dec 20 08:21:11 2011 +0100
@@ -1,3 +1,1 @@
 boot_prompt_option.patch
-gpxe-git-0edf2405b457
-gpxe-git-a803ef3dfeac

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw3-0003mU-B2; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw1-0003l1-Lf
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1325799189!9766193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15781 invoked from network); 5 Jan 2012 21:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:10 -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 1Riuvs-0000Ce-S7
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvs-0002RE-O1
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:08 +0000
Message-Id: <E1Riuvs-0002RE-O1@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ipxe: update to upstream version
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324365671 -3600
# Node ID 94180a5a0c7c7d680ede2e54bd13f56ed43f452d
# Parent  f2a781ab96bab45c0713f85e4279a59892b5a3ff
ipxe: update to upstream version

Updated ipxe to current tree, which is
540e5960dc6b49eacf367f7c319fd0546474b845:

Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 builds

Removed all the backported patches and updated
boot_prompt_option.patch to apply against current ipxe.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile	Thu Jan 05 14:35:38 2012 +0000
+++ b/tools/firmware/etherboot/Makefile	Tue Dec 20 08:21:11 2011 +0100
@@ -10,7 +10,7 @@
 IPXE_GIT_URL := git://git.ipxe.org/ipxe.git
 endif
 
-IPXE_GIT_TAG := v1.0.0
+IPXE_GIT_TAG := 9a93db3f0947484e30e753bbd61a10b17336e20e
 
 IPXE_TARBALL_URL := $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
 
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/boot_prompt_option.patch
--- a/tools/firmware/etherboot/patches/boot_prompt_option.patch	Thu Jan 05 14:35:38 2012 +0000
+++ b/tools/firmware/etherboot/patches/boot_prompt_option.patch	Tue Dec 20 08:21:11 2011 +0100
@@ -1,7 +1,8 @@
-diff -pruN gpxe/src/arch/i386/prefix/romprefix.S gpxe.new/src/arch/i386/prefix/romprefix.S
---- gpxe/src/arch/i386/prefix/romprefix.S	2010-06-29 20:31:33.000000000 +0100
-+++ gpxe.new/src/arch/i386/prefix/romprefix.S	2010-07-20 10:40:20.000000000 +0100
-@@ -458,6 +458,7 @@ no_pmm:
+diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
+index 0f92415..cce7505 100644
+--- a/src/arch/i386/prefix/romprefix.S
++++ b/src/arch/i386/prefix/romprefix.S
+@@ -391,6 +391,7 @@ no_pmm:
  	xorw	%di, %di
  	cs rep	movsb
  
@@ -9,15 +10,15 @@
  	/* Prompt for POST-time shell */
  	movw	$init_message_prompt, %si
  	xorw	%di, %di
-@@ -484,6 +485,7 @@ no_pmm:
+@@ -418,6 +419,7 @@ no_pmm:
  	pushw	%cs
  	call	exec
- out:
+ 2:
 +#endif
  	/* Restore registers */
  	popw	%gs
  	popw	%fs
-@@ -538,6 +540,7 @@ init_message_no_pmm:
+@@ -546,6 +548,7 @@ init_message_pmm:
  init_message_int19:
  	.asciz	" INT19"
  	.size	init_message_int19, . - init_message_int19
@@ -25,11 +26,11 @@
  init_message_prompt:
  	.asciz	"\nPress Ctrl-B to configure "
  	.size	init_message_prompt, . - init_message_prompt
-@@ -547,6 +550,7 @@ init_message_dots:
+@@ -555,6 +558,7 @@ init_message_dots:
  init_message_done:
  	.asciz	"\n\n"
  	.size	init_message_done, . - init_message_done
 +#endif
  
- /* ROM image location
+ /* PCI bus:dev.fn
   *
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/gpxe-git-0edf2405b457
--- a/tools/firmware/etherboot/patches/gpxe-git-0edf2405b457	Thu Jan 05 14:35:38 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-commit 0edf2405b457e542c244a72285511b3ff5c06885
-Author: Michael Brown <mcb30@ipxe.org>
-Date:   Tue Apr 27 09:52:22 2010 +0100
-
-    [build] Fix building with binutils 2.16
-    
-    Signed-off-by: Michael Brown <mcb30@ipxe.org>
-    Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
-
-diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
-index 278a397..0ce2c10 100644
---- a/src/arch/i386/scripts/i386.lds
-+++ b/src/arch/i386/scripts/i386.lds
-@@ -24,6 +24,8 @@ SECTIONS {
-      *
-      */
- 
-+    PROVIDE ( _max_align = 16 );
-+
-     /*
-      * The prefix
-      *
-@@ -169,7 +171,6 @@ SECTIONS {
-      *
-      */
- 
--    PROVIDE ( _max_align = 16 );
-     .			= 0;
- 
-     .			= ALIGN ( _max_align );
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/gpxe-git-a803ef3dfeac
--- a/tools/firmware/etherboot/patches/gpxe-git-a803ef3dfeac	Thu Jan 05 14:35:38 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-commit a803ef3dfeac4e8aa35810bba65f9ccab0bdf264
-Author: Michael Brown <mcb30@ipxe.org>
-Date:   Thu Jun 24 01:23:00 2010 +0100
-
-    [build] Avoid hard-coding the path to perl
-    
-    The path "/usr/bin/perl" has been hard-coded since Etherboot 5.1, for
-    no discernible reason.  Use just "perl" instead to fix the
-    inconsistency and allow building on systems with Perl installed
-    outside of /usr/bin.
-    
-    This commit also includes a later fix that removes a dependency on
-    "perl" which broke builds from fully clean trees.
-    
-    Reported-by: Gabor Z. Papp <gzp@papp.hu>
-    Signed-off-by: Michael Brown <mcb30@ipxe.org>
-    Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
-
-diff -pruN a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios
---- a/src/arch/i386/Makefile.pcbios	2010-06-29 20:31:33.000000000 +0100
-+++ b/src/arch/i386/Makefile.pcbios	2010-07-20 16:07:06.000000000 +0100
-@@ -24,11 +24,11 @@ MEDIA		+= raw
- 
- # Padding rules
- #
--PAD_rom		= $(PADIMG) --blksize=512 --byte=0xff $@
-+PAD_rom		= $(PERL) $(PADIMG) --blksize=512 --byte=0xff $@
- PAD_hrom	= $(PAD_rom)
- PAD_xrom	= $(PAD_rom)
--PAD_dsk		= $(PADIMG) --blksize=512 $@
--PAD_hd		= $(PADIMG) --blksize=32768 $@
-+PAD_dsk		= $(PERL) $(PADIMG) --blksize=512 $@
-+PAD_hd		= $(PERL) $(PADIMG) --blksize=32768 $@
- 
- # rule to make a non-emulation ISO boot image
- NON_AUTO_MEDIA	+= iso
-@@ -67,4 +67,4 @@ NON_AUTO_MEDIA	+= usb
- NON_AUTO_MEDIA += pdsk
- %pdsk : %dsk
- 	$(Q)cp $< $@
--	$(Q)$(PADIMG) --blksize=1474560 $@
-+	$(Q)$(PERL) $(PADIMG) --blksize=1474560 $@
-diff -pruN a/src/Makefile b/src/Makefile
---- a/src/Makefile	2010-06-29 20:31:33.000000000 +0100
-+++ b/src/Makefile	2010-07-20 16:02:56.000000000 +0100
-@@ -20,7 +20,7 @@ MKDIR		:= mkdir
- CP		:= cp
- ECHO		:= echo
- PRINTF		:= printf
--PERL		:= /usr/bin/perl
-+PERL		:= perl
- CC		:= $(CROSS_COMPILE)gcc
- CPP		:= $(CC) -E
- AS		:= $(CROSS_COMPILE)as
-@@ -31,12 +31,12 @@ RANLIB		:= $(CROSS_COMPILE)ranlib
- OBJCOPY		:= $(CROSS_COMPILE)objcopy
- NM		:= $(CROSS_COMPILE)nm
- OBJDUMP		:= $(CROSS_COMPILE)objdump
--PARSEROM	:= $(PERL) ./util/parserom.pl
--MAKEROM		:= $(PERL) ./util/makerom.pl
--SYMCHECK	:= $(PERL) ./util/symcheck.pl
--SORTOBJDUMP	:= $(PERL) ./util/sortobjdump.pl
--PADIMG		:= $(PERL) ./util/padimg.pl
--LICENCE		:= $(PERL) ./util/licence.pl
-+PARSEROM	:= ./util/parserom.pl
-+MAKEROM		:= ./util/makerom.pl
-+SYMCHECK	:= ./util/symcheck.pl
-+SORTOBJDUMP	:= ./util/sortobjdump.pl
-+PADIMG		:= ./util/padimg.pl
-+LICENCE		:= ./util/licence.pl
- NRV2B		:= ./util/nrv2b
- ZBIN		:= ./util/zbin
- ELF2EFI32	:= ./util/elf2efi32
-diff -pruN a/src/Makefile.housekeeping b/src/Makefile.housekeeping
---- a/src/Makefile.housekeeping	2010-06-29 20:31:33.000000000 +0100
-+++ b/src/Makefile.housekeeping	2010-07-20 16:04:42.000000000 +0100
-@@ -486,7 +486,7 @@ define src_template
- 		 '\n$(2) : $$($(4)_DEPS)\n' \
- 		 '\nTAGS : $$($(4)_DEPS)\n' \
- 		>> $(2)
--	@$(PARSEROM) $(1) >> $(2)
-+	@$(PERL) $(PARSEROM) $(1) >> $(2)
- 
- endef
- 
-@@ -695,7 +695,7 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDS
- 	$(QM)$(ECHO) "  [LD] $@"
- 	$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
- 		-Map $(BIN)/$*.tmp.map
--	$(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
-+	$(Q)$(OBJDUMP) -ht $@ | $(PERL) $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
- 
- # Keep intermediate object file (useful for debugging)
- .PRECIOUS : $(BIN)/%.tmp
-@@ -752,7 +752,7 @@ $(BIN)/%.licence : $(BIN)/%.tmp
- 		echo "files are missing a licence declaration:" ;\
- 		echo $(call unlicensed_deps_list,$<);\
- 		exit 1,\
--		$(LICENCE) $(call licence_list,$<))
-+		$(PERL) $(LICENCE) $(call licence_list,$<))
- 
- # Extract compression information from intermediate object file
- #
-@@ -866,10 +866,10 @@ endif # defined(BIN)
- # the automatic build system and varies by target; it includes the
- # "-p 0x1234,0x5678" string to set the PCI IDs.
- #
--FINALISE_rom	= $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
-+FINALISE_rom	= $(PERL) $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
- 		  -i$(IDENT) -s 0 $@
- FINALISE_hrom	= $(FINALISE_rom)
--FINALISE_xrom	= $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
-+FINALISE_xrom	= $(PERL) $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
- 		  -i$(IDENT) -n -s 0 $@
- 
- # Some ROMs require specific flags to be passed to makerom.pl
-@@ -987,7 +987,7 @@ $(SYMTAB) : $(BLIB)
- CLEANUP	+= $(BIN)/symtab
- 
- symcheck : $(SYMTAB)
--	$(SYMCHECK) $<
-+	$(PERL) $(SYMCHECK) $<
- 
- endif # defined(BIN)
- 
diff -r f2a781ab96ba -r 94180a5a0c7c tools/firmware/etherboot/patches/series
--- a/tools/firmware/etherboot/patches/series	Thu Jan 05 14:35:38 2012 +0000
+++ b/tools/firmware/etherboot/patches/series	Tue Dec 20 08:21:11 2011 +0100
@@ -1,3 +1,1 @@
 boot_prompt_option.patch
-gpxe-git-0edf2405b457
-gpxe-git-a803ef3dfeac

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 05 21:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jan 2012 21: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.xensource.com>)
	id 1Riuw3-0003ma-Dc; Thu, 05 Jan 2012 21:33:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuw1-0003l3-Up
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1325799190!9752997!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25315 invoked from network); 5 Jan 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jan 2012 21:33:11 -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 1Riuvt-0000Ck-VY
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Riuvt-0002Ri-N6
	for xen-changelog@lists.xensource.com; Thu, 05 Jan 2012 21:33:09 +0000
Message-Id: <E1Riuvt-0002Ri-N6@xenbits.xen.org>
Date: Thu, 05 Jan 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] netbsd: build fix with gcc 4.5
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Brownlee <abs@netbsd.org>
# Date 1325778688 0
# Node ID aaad6a035efb0fcd2d3d7a7320ce9b8ead0ba163
# Parent  03781de56c31072266fb464e7dfeec133bcf0fb4
netbsd: build fix with gcc 4.5

Fix build failure with gcc 4.5:
implicit declaration of __builtin_stdarg_start

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
From: David Brownlee <abs@netbsd.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 03781de56c31 -r aaad6a035efb xen/include/xen/stdarg.h
--- a/xen/include/xen/stdarg.h	Thu Jan 05 15:47:16 2012 +0000
+++ b/xen/include/xen/stdarg.h	Thu Jan 05 15:51:28 2012 +0000
@@ -5,7 +5,17 @@
 #  include "/usr/include/stdarg.h"
 #elif defined (__NetBSD__)
    typedef __builtin_va_list va_list;
-#  define va_start(ap, last)    __builtin_stdarg_start((ap), (last))
+#  ifdef __GNUC__
+#    define __GNUC_PREREQ__(x, y)                                       \
+        ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||                  \
+         (__GNUC__ > (x)))
+#  else
+#    define __GNUC_PREREQ__(x, y)   0
+#  endif
+#  if !__GNUC_PREREQ__(4, 5)
+#    define __builtin_va_start(ap, last)    __builtin_stdarg_start((ap), (last))
+#  endif
+#  define va_start(ap, last)    __builtin_va_start((ap), (last))
 #  define va_end(ap)            __builtin_va_end(ap)
 #  define va_arg                __builtin_va_arg
 #else

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 09 10:00:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Jan 2012 10: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.xensource.com>)
	id 1RkC1X-0007DW-AF; Mon, 09 Jan 2012 10:00:15 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1V-0007CV-HZ
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1326103206!10193438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8190 invoked from network); 9 Jan 2012 10:00:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2012 10:00:07 -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 1RkC1N-0004J0-GA
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1M-0006Yr-V3
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:04 +0000
Message-Id: <E1RkC1M-0006Yr-V3@xenbits.xen.org>
Date: Mon, 09 Jan 2012 10:00:04 +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] xenbus: check availibility of
	XS_RESET_WATCHES command
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326102808 -3600
# Node ID cdbf3be3f2bd1e3988ea3f1c795e5636c0b53d4b
# Parent  b4e1b9ff189f3b04475a1d0118932316abf26e19
xenbus: check availibility of XS_RESET_WATCHES command

Check platform-feature-xs_reset_watches before sending XS_RESET_WATCHES
command. Buggy xenstored implementations such as EC2 do not ignore unknown
commands properly and cause a guest hang.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b4e1b9ff189f -r cdbf3be3f2bd drivers/xen/xenbus/xenbus_xs.c
--- a/drivers/xen/xenbus/xenbus_xs.c	Mon Jan 09 10:50:24 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_xs.c	Mon Jan 09 10:53:28 2012 +0100
@@ -630,7 +630,13 @@
 static void xs_reset_watches(void)
 {
 #ifndef CONFIG_XEN
-	int err;
+	int err, supported = 0;
+
+	err = xenbus_scanf(XBT_NIL, "control",
+			   "platform-feature-xs_reset_watches", "%d",
+			   &supported);
+	if (err != 1 || !supported)
+		return;
 
 	err = xs_error(xs_single(XBT_NIL, XS_RESET_WATCHES, "", NULL));
 	if (err && err != -EEXIST)

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 09 10:00:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Jan 2012 10: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.xensource.com>)
	id 1RkC1X-0007DW-AF; Mon, 09 Jan 2012 10:00:15 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1V-0007CV-HZ
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1326103206!10193438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8190 invoked from network); 9 Jan 2012 10:00:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2012 10:00:07 -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 1RkC1N-0004J0-GA
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1M-0006Yr-V3
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:04 +0000
Message-Id: <E1RkC1M-0006Yr-V3@xenbits.xen.org>
Date: Mon, 09 Jan 2012 10:00:04 +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] xenbus: check availibility of
	XS_RESET_WATCHES command
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326102808 -3600
# Node ID cdbf3be3f2bd1e3988ea3f1c795e5636c0b53d4b
# Parent  b4e1b9ff189f3b04475a1d0118932316abf26e19
xenbus: check availibility of XS_RESET_WATCHES command

Check platform-feature-xs_reset_watches before sending XS_RESET_WATCHES
command. Buggy xenstored implementations such as EC2 do not ignore unknown
commands properly and cause a guest hang.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b4e1b9ff189f -r cdbf3be3f2bd drivers/xen/xenbus/xenbus_xs.c
--- a/drivers/xen/xenbus/xenbus_xs.c	Mon Jan 09 10:50:24 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_xs.c	Mon Jan 09 10:53:28 2012 +0100
@@ -630,7 +630,13 @@
 static void xs_reset_watches(void)
 {
 #ifndef CONFIG_XEN
-	int err;
+	int err, supported = 0;
+
+	err = xenbus_scanf(XBT_NIL, "control",
+			   "platform-feature-xs_reset_watches", "%d",
+			   &supported);
+	if (err != 1 || !supported)
+		return;
 
 	err = xs_error(xs_single(XBT_NIL, XS_RESET_WATCHES, "", NULL));
 	if (err && err != -EEXIST)

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 09 10:00:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Jan 2012 10: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.xensource.com>)
	id 1RkC1X-0007DQ-71; Mon, 09 Jan 2012 10:00:15 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1V-0007CS-9O
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1326103205!8301797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16166 invoked from network); 9 Jan 2012 10:00:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2012 10:00:06 -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 1RkC1M-0004Ix-K5
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1M-0006YI-Dn
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:04 +0000
Message-Id: <E1RkC1M-0006YI-Dn@xenbits.xen.org>
Date: Mon, 09 Jan 2012 10:00: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] CVE-2012-0028: Move
	"exit_robust_list" into mm_release(); nullify lists after cleanup
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1326102624 -3600
# Node ID b4e1b9ff189f3b04475a1d0118932316abf26e19
# Parent  821a5b2a10c86f18fbce0907af0db6905b9d540a
CVE-2012-0028: Move "exit_robust_list" into mm_release(); nullify lists after cleanup

This is a backport of upstream commits 8141c7f3 & fc6b177d:

    We don't want to get rid of the futexes just at exit() time, we want
    to drop them when doing an execve() too, since that gets rid of the
    previous VM image too.

    Doing it at mm_release() time means that we automatically always do it
    when we disassociate a VM map from the task.

    The robust list pointers of user space held futexes are kept intact
    over an exec() call. When the exec'ed task exits exit_robust_list() is
    called with the stale pointer. The risk of corruption is minimal, but
    still it is incorrect to keep the pointers valid. Actually glibc
    should uninstall the robust list before calling exec() but we have to
    deal with it anyway.

    Nullify the pointers after [compat_]exit_robust_list() has been
    called.

In Xen HVM guests on IA64, the stale robust_list pointer, inherited over
execve(), caused a fault that was spuriously resolved to a legacy MMIO
request with wrong size, forcing the qemu-dm process to exit.

322a2c10 is not squashed in this patch because the Priority Inheritance
state cleanup (exit_pi_state_list()) seems to be restricted to kernel
space.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 821a5b2a10c8 -r b4e1b9ff189f kernel/exit.c
--- a/kernel/exit.c	Thu Jan 05 10:21:22 2012 +0100
+++ b/kernel/exit.c	Mon Jan 09 10:50:24 2012 +0100
@@ -34,7 +34,6 @@
 #include <linux/cn_proc.h>
 #include <linux/mutex.h>
 #include <linux/futex.h>
-#include <linux/compat.h>
 #include <linux/pipe_fs_i.h>
 #include <linux/audit.h> /* for audit_free() */
 #include <linux/resource.h>
@@ -898,12 +897,6 @@
 		exit_itimers(tsk->signal);
 	}
 	acct_collect(code, group_dead);
-	if (unlikely(tsk->robust_list))
-		exit_robust_list(tsk);
-#if defined(CONFIG_FUTEX) && defined(CONFIG_COMPAT)
-	if (unlikely(tsk->compat_robust_list))
-		compat_exit_robust_list(tsk);
-#endif
 	if (unlikely(tsk->audit_context))
 		audit_free(tsk);
 	taskstats_exit_send(tsk, tidstats, group_dead, mycpu);
diff -r 821a5b2a10c8 -r b4e1b9ff189f kernel/fork.c
--- a/kernel/fork.c	Thu Jan 05 10:21:22 2012 +0100
+++ b/kernel/fork.c	Mon Jan 09 10:50:24 2012 +0100
@@ -35,6 +35,7 @@
 #include <linux/syscalls.h>
 #include <linux/jiffies.h>
 #include <linux/futex.h>
+#include <linux/compat.h>
 #include <linux/rcupdate.h>
 #include <linux/ptrace.h>
 #include <linux/mount.h>
@@ -434,6 +435,20 @@
 {
 	struct completion *vfork_done = tsk->vfork_done;
 
+	/* Get rid of any futexes when releasing the mm */
+#ifdef CONFIG_FUTEX
+	if (unlikely(tsk->robust_list)) {
+		exit_robust_list(tsk);
+		tsk->robust_list = NULL;
+	}
+#ifdef CONFIG_COMPAT
+	if (unlikely(tsk->compat_robust_list)) {
+		compat_exit_robust_list(tsk);
+		tsk->compat_robust_list = NULL;
+	}
+#endif
+#endif
+
 	/* Get rid of any cached register state */
 	deactivate_mm(tsk, mm);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 09 10:00:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Jan 2012 10: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.xensource.com>)
	id 1RkC1X-0007DQ-71; Mon, 09 Jan 2012 10:00:15 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1V-0007CS-9O
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1326103205!8301797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16166 invoked from network); 9 Jan 2012 10:00:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2012 10:00:06 -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 1RkC1M-0004Ix-K5
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1M-0006YI-Dn
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:04 +0000
Message-Id: <E1RkC1M-0006YI-Dn@xenbits.xen.org>
Date: Mon, 09 Jan 2012 10:00: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] CVE-2012-0028: Move
	"exit_robust_list" into mm_release(); nullify lists after cleanup
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1326102624 -3600
# Node ID b4e1b9ff189f3b04475a1d0118932316abf26e19
# Parent  821a5b2a10c86f18fbce0907af0db6905b9d540a
CVE-2012-0028: Move "exit_robust_list" into mm_release(); nullify lists after cleanup

This is a backport of upstream commits 8141c7f3 & fc6b177d:

    We don't want to get rid of the futexes just at exit() time, we want
    to drop them when doing an execve() too, since that gets rid of the
    previous VM image too.

    Doing it at mm_release() time means that we automatically always do it
    when we disassociate a VM map from the task.

    The robust list pointers of user space held futexes are kept intact
    over an exec() call. When the exec'ed task exits exit_robust_list() is
    called with the stale pointer. The risk of corruption is minimal, but
    still it is incorrect to keep the pointers valid. Actually glibc
    should uninstall the robust list before calling exec() but we have to
    deal with it anyway.

    Nullify the pointers after [compat_]exit_robust_list() has been
    called.

In Xen HVM guests on IA64, the stale robust_list pointer, inherited over
execve(), caused a fault that was spuriously resolved to a legacy MMIO
request with wrong size, forcing the qemu-dm process to exit.

322a2c10 is not squashed in this patch because the Priority Inheritance
state cleanup (exit_pi_state_list()) seems to be restricted to kernel
space.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 821a5b2a10c8 -r b4e1b9ff189f kernel/exit.c
--- a/kernel/exit.c	Thu Jan 05 10:21:22 2012 +0100
+++ b/kernel/exit.c	Mon Jan 09 10:50:24 2012 +0100
@@ -34,7 +34,6 @@
 #include <linux/cn_proc.h>
 #include <linux/mutex.h>
 #include <linux/futex.h>
-#include <linux/compat.h>
 #include <linux/pipe_fs_i.h>
 #include <linux/audit.h> /* for audit_free() */
 #include <linux/resource.h>
@@ -898,12 +897,6 @@
 		exit_itimers(tsk->signal);
 	}
 	acct_collect(code, group_dead);
-	if (unlikely(tsk->robust_list))
-		exit_robust_list(tsk);
-#if defined(CONFIG_FUTEX) && defined(CONFIG_COMPAT)
-	if (unlikely(tsk->compat_robust_list))
-		compat_exit_robust_list(tsk);
-#endif
 	if (unlikely(tsk->audit_context))
 		audit_free(tsk);
 	taskstats_exit_send(tsk, tidstats, group_dead, mycpu);
diff -r 821a5b2a10c8 -r b4e1b9ff189f kernel/fork.c
--- a/kernel/fork.c	Thu Jan 05 10:21:22 2012 +0100
+++ b/kernel/fork.c	Mon Jan 09 10:50:24 2012 +0100
@@ -35,6 +35,7 @@
 #include <linux/syscalls.h>
 #include <linux/jiffies.h>
 #include <linux/futex.h>
+#include <linux/compat.h>
 #include <linux/rcupdate.h>
 #include <linux/ptrace.h>
 #include <linux/mount.h>
@@ -434,6 +435,20 @@
 {
 	struct completion *vfork_done = tsk->vfork_done;
 
+	/* Get rid of any futexes when releasing the mm */
+#ifdef CONFIG_FUTEX
+	if (unlikely(tsk->robust_list)) {
+		exit_robust_list(tsk);
+		tsk->robust_list = NULL;
+	}
+#ifdef CONFIG_COMPAT
+	if (unlikely(tsk->compat_robust_list)) {
+		compat_exit_robust_list(tsk);
+		tsk->compat_robust_list = NULL;
+	}
+#endif
+#endif
+
 	/* Get rid of any cached register state */
 	deactivate_mm(tsk, mm);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 09 10:00:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Jan 2012 10:00: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.xensource.com>)
	id 1RkC1X-0007DL-4P; Mon, 09 Jan 2012 10:00:15 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1V-0007CT-7I
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1326103156!51718679!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29294 invoked from network); 9 Jan 2012 09:59:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2012 09:59:17 -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 1RkC1N-0004J3-W0
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1N-0006ZM-Fh
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:05 +0000
Message-Id: <E1RkC1N-0006ZM-Fh@xenbits.xen.org>
Date: Mon, 09 Jan 2012 10:00:05 +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] scsiback: fix initialization
	error paths
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326102860 -3600
# Node ID c3d7beacd036903e397da7cbbabbebcd59f56650
# Parent  cdbf3be3f2bd1e3988ea3f1c795e5636c0b53d4b
scsiback: fix initialization error paths

scsiback_interface_exit() must not be called upon failure of
scsiback_interface_init().

Similarly, scsiback_xenbus_unregister() shouldn't be called when
scsiback_xenbus_init() failed. With this reference to it removed, the
function can be marked __exit (and its initialization counterpart
should have been __init from the beginning).

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


diff -r cdbf3be3f2bd -r c3d7beacd036 drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c	Mon Jan 09 10:53:28 2012 +0100
+++ b/drivers/xen/scsiback/scsiback.c	Mon Jan 09 10:54:20 2012 +0100
@@ -700,7 +700,7 @@
 		pending_grant_handles[i] = SCSIBACK_INVALID_HANDLE;
 
 	if (scsiback_interface_init() < 0)
-		goto out_of_kmem;
+		goto out_of_memory;
 
 	INIT_LIST_HEAD(&pending_free);
 
@@ -708,15 +708,13 @@
 		list_add_tail(&pending_reqs[i].free_list, &pending_free);
 
 	if (scsiback_xenbus_init())
-		goto out_of_xenbus;
+		goto out_interface;
 
 	scsiback_emulation_init();
 
 	return 0;
 
-out_of_xenbus:
-	scsiback_xenbus_unregister();
-out_of_kmem:
+out_interface:
 	scsiback_interface_exit();
 out_of_memory:
 	kfree(pending_reqs);
diff -r cdbf3be3f2bd -r c3d7beacd036 drivers/xen/scsiback/xenbus.c
--- a/drivers/xen/scsiback/xenbus.c	Mon Jan 09 10:53:28 2012 +0100
+++ b/drivers/xen/scsiback/xenbus.c	Mon Jan 09 10:54:20 2012 +0100
@@ -363,12 +363,12 @@
 	.otherend_changed	= scsiback_frontend_changed
 );
 
-int scsiback_xenbus_init(void)
+int __init scsiback_xenbus_init(void)
 {
 	return xenbus_register_backend(&scsiback_driver);
 }
 
-void scsiback_xenbus_unregister(void)
+void __exit scsiback_xenbus_unregister(void)
 {
 	xenbus_unregister_driver(&scsiback_driver);
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 09 10:00:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Jan 2012 10:00: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.xensource.com>)
	id 1RkC1X-0007DL-4P; Mon, 09 Jan 2012 10:00:15 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1V-0007CT-7I
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1326103156!51718679!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29294 invoked from network); 9 Jan 2012 09:59:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2012 09:59:17 -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 1RkC1N-0004J3-W0
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkC1N-0006ZM-Fh
	for xen-changelog@lists.xensource.com; Mon, 09 Jan 2012 10:00:05 +0000
Message-Id: <E1RkC1N-0006ZM-Fh@xenbits.xen.org>
Date: Mon, 09 Jan 2012 10:00:05 +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] scsiback: fix initialization
	error paths
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326102860 -3600
# Node ID c3d7beacd036903e397da7cbbabbebcd59f56650
# Parent  cdbf3be3f2bd1e3988ea3f1c795e5636c0b53d4b
scsiback: fix initialization error paths

scsiback_interface_exit() must not be called upon failure of
scsiback_interface_init().

Similarly, scsiback_xenbus_unregister() shouldn't be called when
scsiback_xenbus_init() failed. With this reference to it removed, the
function can be marked __exit (and its initialization counterpart
should have been __init from the beginning).

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


diff -r cdbf3be3f2bd -r c3d7beacd036 drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c	Mon Jan 09 10:53:28 2012 +0100
+++ b/drivers/xen/scsiback/scsiback.c	Mon Jan 09 10:54:20 2012 +0100
@@ -700,7 +700,7 @@
 		pending_grant_handles[i] = SCSIBACK_INVALID_HANDLE;
 
 	if (scsiback_interface_init() < 0)
-		goto out_of_kmem;
+		goto out_of_memory;
 
 	INIT_LIST_HEAD(&pending_free);
 
@@ -708,15 +708,13 @@
 		list_add_tail(&pending_reqs[i].free_list, &pending_free);
 
 	if (scsiback_xenbus_init())
-		goto out_of_xenbus;
+		goto out_interface;
 
 	scsiback_emulation_init();
 
 	return 0;
 
-out_of_xenbus:
-	scsiback_xenbus_unregister();
-out_of_kmem:
+out_interface:
 	scsiback_interface_exit();
 out_of_memory:
 	kfree(pending_reqs);
diff -r cdbf3be3f2bd -r c3d7beacd036 drivers/xen/scsiback/xenbus.c
--- a/drivers/xen/scsiback/xenbus.c	Mon Jan 09 10:53:28 2012 +0100
+++ b/drivers/xen/scsiback/xenbus.c	Mon Jan 09 10:54:20 2012 +0100
@@ -363,12 +363,12 @@
 	.otherend_changed	= scsiback_frontend_changed
 );
 
-int scsiback_xenbus_init(void)
+int __init scsiback_xenbus_init(void)
 {
 	return xenbus_register_backend(&scsiback_driver);
 }
 
-void scsiback_xenbus_unregister(void)
+void __exit scsiback_xenbus_unregister(void)
 {
 	xenbus_unregister_driver(&scsiback_driver);
 }

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 10 00:44:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Jan 2012 00:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RkPp3-0001to-En; Tue, 10 Jan 2012 00:44:17 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPp2-0001t9-NK
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1326156249!8413830!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18240 invoked from network); 10 Jan 2012 00:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2012 00:44:10 -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 1RkPou-0006pa-Tl
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPou-0005qW-OM
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Message-Id: <E1RkPou-0005qW-OM@xenbits.xen.org>
Date: Tue, 10 Jan 2012 00:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VMX: print Pause Loop Exiting
	disabled message just once
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326121304 -3600
# Node ID 5b2676ac13218951698c49fa0350f2ac48220f3d
# Parent  a7c763a92ba1eac1407257f6accf74a8d4f7e619
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r a7c763a92ba1 -r 5b2676ac1321 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Jan 09 15:59:59 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Jan 09 16:01:44 2012 +0100
@@ -249,7 +249,8 @@
     if ( (_vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING) &&
           ple_gap == 0 )
     {
-        printk("Disable Pause-Loop Exiting.\n");
+        if ( !vmx_pin_based_exec_control )
+            printk(XENLOG_INFO "Disable Pause-Loop Exiting.\n");
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 10 00:44:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Jan 2012 00:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RkPp3-0001to-En; Tue, 10 Jan 2012 00:44:17 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPp2-0001t9-NK
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1326156249!8413830!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18240 invoked from network); 10 Jan 2012 00:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2012 00:44:10 -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 1RkPou-0006pa-Tl
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPou-0005qW-OM
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Message-Id: <E1RkPou-0005qW-OM@xenbits.xen.org>
Date: Tue, 10 Jan 2012 00:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VMX: print Pause Loop Exiting
	disabled message just once
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326121304 -3600
# Node ID 5b2676ac13218951698c49fa0350f2ac48220f3d
# Parent  a7c763a92ba1eac1407257f6accf74a8d4f7e619
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r a7c763a92ba1 -r 5b2676ac1321 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Jan 09 15:59:59 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Jan 09 16:01:44 2012 +0100
@@ -249,7 +249,8 @@
     if ( (_vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING) &&
           ple_gap == 0 )
     {
-        printk("Disable Pause-Loop Exiting.\n");
+        if ( !vmx_pin_based_exec_control )
+            printk(XENLOG_INFO "Disable Pause-Loop Exiting.\n");
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 10 00:44:49 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Jan 2012 00:44: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.xensource.com>)
	id 1RkPp3-0001td-9M; Tue, 10 Jan 2012 00:44:17 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPp2-0001t2-5r
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1326156248!8449075!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10804 invoked from network); 10 Jan 2012 00:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2012 00:44:09 -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 1RkPou-0006pU-0a
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPot-0005pU-Mo
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:07 +0000
Message-Id: <E1RkPot-0005pU-Mo@xenbits.xen.org>
Date: Tue, 10 Jan 2012 00:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: shrink pci_dev_info's
	is_extfn/is_virtfn members
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326120900 -3600
# Node ID bfbfd2006ffcfe56b46909bd8fe2c553ebc43eda
# Parent  4086e4811547ddffb9a53fbf2efb6c2fa436b70a
PCI: shrink pci_dev_info's is_extfn/is_virtfn members

They are used as boolean flags only, so convert them accordingly
(shrinking the structure size by 8 bytes).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 4086e4811547 -r bfbfd2006ffc xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c	Thu Jan 05 17:25:23 2012 +0000
+++ b/xen/arch/ia64/xen/hypercall.c	Mon Jan 09 15:55:00 2012 +0100
@@ -695,8 +695,8 @@
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
 
-        pdev_info.is_extfn = manage_pci_ext.is_extfn;
-        pdev_info.is_virtfn = manage_pci_ext.is_virtfn;
+        pdev_info.is_extfn = !!manage_pci_ext.is_extfn;
+        pdev_info.is_virtfn = !!manage_pci_ext.is_virtfn;
         pdev_info.physfn.bus = manage_pci_ext.physfn.bus;
         pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn;
         ret = pci_add_device(0, manage_pci_ext.bus,
diff -r 4086e4811547 -r bfbfd2006ffc xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Thu Jan 05 17:25:23 2012 +0000
+++ b/xen/include/xen/pci.h	Mon Jan 09 15:55:00 2012 +0100
@@ -33,8 +33,8 @@
 #define MAX_MSIX_TABLE_ENTRIES  2048
 #define MAX_MSIX_TABLE_PAGES    8
 struct pci_dev_info {
-    unsigned is_extfn;
-    unsigned is_virtfn;
+    bool_t is_extfn;
+    bool_t is_virtfn;
     struct {
         u8 bus;
         u8 devfn;

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 10 00:44:49 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Jan 2012 00:44: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.xensource.com>)
	id 1RkPp3-0001td-9M; Tue, 10 Jan 2012 00:44:17 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPp2-0001t2-5r
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1326156248!8449075!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10804 invoked from network); 10 Jan 2012 00:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2012 00:44:09 -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 1RkPou-0006pU-0a
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPot-0005pU-Mo
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:07 +0000
Message-Id: <E1RkPot-0005pU-Mo@xenbits.xen.org>
Date: Tue, 10 Jan 2012 00:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: shrink pci_dev_info's
	is_extfn/is_virtfn members
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326120900 -3600
# Node ID bfbfd2006ffcfe56b46909bd8fe2c553ebc43eda
# Parent  4086e4811547ddffb9a53fbf2efb6c2fa436b70a
PCI: shrink pci_dev_info's is_extfn/is_virtfn members

They are used as boolean flags only, so convert them accordingly
(shrinking the structure size by 8 bytes).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 4086e4811547 -r bfbfd2006ffc xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c	Thu Jan 05 17:25:23 2012 +0000
+++ b/xen/arch/ia64/xen/hypercall.c	Mon Jan 09 15:55:00 2012 +0100
@@ -695,8 +695,8 @@
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
 
-        pdev_info.is_extfn = manage_pci_ext.is_extfn;
-        pdev_info.is_virtfn = manage_pci_ext.is_virtfn;
+        pdev_info.is_extfn = !!manage_pci_ext.is_extfn;
+        pdev_info.is_virtfn = !!manage_pci_ext.is_virtfn;
         pdev_info.physfn.bus = manage_pci_ext.physfn.bus;
         pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn;
         ret = pci_add_device(0, manage_pci_ext.bus,
diff -r 4086e4811547 -r bfbfd2006ffc xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Thu Jan 05 17:25:23 2012 +0000
+++ b/xen/include/xen/pci.h	Mon Jan 09 15:55:00 2012 +0100
@@ -33,8 +33,8 @@
 #define MAX_MSIX_TABLE_ENTRIES  2048
 #define MAX_MSIX_TABLE_PAGES    8
 struct pci_dev_info {
-    unsigned is_extfn;
-    unsigned is_virtfn;
+    bool_t is_extfn;
+    bool_t is_virtfn;
     struct {
         u8 bus;
         u8 devfn;

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 10 00:44:59 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Jan 2012 00:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RkPp3-0001ti-Bu; Tue, 10 Jan 2012 00:44:17 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPp2-0001t8-Iw
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1326156249!10218416!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5316 invoked from network); 10 Jan 2012 00:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2012 00:44:10 -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 1RkPou-0006pX-CN
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPou-0005q2-84
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Message-Id: <E1RkPou-0005q2-84@xenbits.xen.org>
Date: Tue, 10 Jan 2012 00:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: properly abstract out
	per-architecture extensions to struct pci_dev
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326121199 -3600
# Node ID a7c763a92ba1eac1407257f6accf74a8d4f7e619
# Parent  bfbfd2006ffcfe56b46909bd8fe2c553ebc43eda
PCI: properly abstract out per-architecture extensions to struct pci_dev

x86's used_vectors member was both misplaced (in struct pci_dev_info,
which acts as a hypercall input data passing container only) and
improperly abstracted (requiring a CONFIG_X86 conditional in a generic
header).

The adjustment requires hiding several more lines in IA64's pci.h, but
as a benefit this allows removing one of the "null" headers.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r bfbfd2006ffc -r a7c763a92ba1 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Mon Jan 09 15:55:00 2012 +0100
+++ b/xen/arch/x86/irq.c	Mon Jan 09 15:59:59 2012 +0100
@@ -1877,7 +1877,7 @@
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
              && !desc->arch.used_vectors )
         {
-            desc->arch.used_vectors = &pdev->info.used_vectors;
+            desc->arch.used_vectors = &pdev->arch.used_vectors;
             if ( desc->arch.vector != IRQ_VECTOR_UNASSIGNED )
             {
                 int vector = desc->arch.vector;
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/asm-ia64/linux-null/asm-generic/pci-dma-compat.h
--- a/xen/include/asm-ia64/linux-null/asm-generic/pci-dma-compat.h	Mon Jan 09 15:55:00 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-/* This file is intentionally left empty. */
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/asm-ia64/linux-xen/asm/pci.h
--- a/xen/include/asm-ia64/linux-xen/asm/pci.h	Mon Jan 09 15:55:00 2012 +0100
+++ b/xen/include/asm-ia64/linux-xen/asm/pci.h	Mon Jan 09 15:59:59 2012 +0100
@@ -28,6 +28,10 @@
 
 struct pci_dev;
 
+#ifdef XEN
+struct arch_pci_dev {};
+#endif
+
 /*
  * PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct correspondence
  * between device bus addresses and CPU physical addresses.  Platforms with a hardware I/O
@@ -43,6 +47,7 @@
 extern unsigned long ia64_max_iommu_merge_mask;
 #define PCI_DMA_BUS_IS_PHYS	(ia64_max_iommu_merge_mask == ~0UL)
 
+#ifndef XEN
 static inline void
 pcibios_set_master (struct pci_dev *dev)
 {
@@ -110,7 +115,6 @@
 #define HAVE_PCI_LEGACY
 extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
 				      struct vm_area_struct *vma);
-#ifndef XEN
 extern ssize_t pci_read_legacy_io(struct kobject *kobj, char *buf, loff_t off,
 				  size_t count);
 extern ssize_t pci_write_legacy_io(struct kobject *kobj, char *buf, loff_t off,
@@ -144,6 +148,7 @@
 #define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
 #define pci_domain_nr(busdev)    (PCI_CONTROLLER(busdev)->segment)
 
+#ifndef XEN
 extern struct pci_ops pci_root_ops;
 
 static inline int pci_proc_domain(struct pci_bus *bus)
@@ -161,7 +166,6 @@
 extern void pcibios_bus_to_resource(struct pci_dev *dev,
 		struct resource *res, struct pci_bus_region *region);
 
-#ifndef XEN
 static inline struct resource *
 pcibios_select_root(struct pci_dev *pdev, struct resource *res)
 {
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/asm-x86/pci.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/pci.h	Mon Jan 09 15:59:59 2012 +0100
@@ -0,0 +1,8 @@
+#ifndef __X86_PCI_H__
+#define __X86_PCI_H__
+
+struct arch_pci_dev {
+    vmask_t used_vectors;
+};
+
+#endif /* __X86_PCI_H__ */
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Mon Jan 09 15:55:00 2012 +0100
+++ b/xen/include/xen/pci.h	Mon Jan 09 15:59:59 2012 +0100
@@ -12,6 +12,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/irq.h>
+#include <asm/pci.h>
 
 /*
  * The PCI interface treats multi-function devices as independent
@@ -39,9 +40,6 @@
         u8 bus;
         u8 devfn;
     } physfn;
-#ifdef CONFIG_X86
-    vmask_t used_vectors;
-#endif
 };
 
 struct pci_dev {
@@ -62,6 +60,7 @@
     const u8 bus;
     const u8 devfn;
     struct pci_dev_info info;
+    struct arch_pci_dev arch;
     u64 vf_rlen[6];
 };
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 10 00:44:59 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Jan 2012 00:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RkPp3-0001ti-Bu; Tue, 10 Jan 2012 00:44:17 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPp2-0001t8-Iw
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1326156249!10218416!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5316 invoked from network); 10 Jan 2012 00:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2012 00:44:10 -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 1RkPou-0006pX-CN
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RkPou-0005q2-84
	for xen-changelog@lists.xensource.com; Tue, 10 Jan 2012 00:44:08 +0000
Message-Id: <E1RkPou-0005q2-84@xenbits.xen.org>
Date: Tue, 10 Jan 2012 00:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] PCI: properly abstract out
	per-architecture extensions to struct pci_dev
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326121199 -3600
# Node ID a7c763a92ba1eac1407257f6accf74a8d4f7e619
# Parent  bfbfd2006ffcfe56b46909bd8fe2c553ebc43eda
PCI: properly abstract out per-architecture extensions to struct pci_dev

x86's used_vectors member was both misplaced (in struct pci_dev_info,
which acts as a hypercall input data passing container only) and
improperly abstracted (requiring a CONFIG_X86 conditional in a generic
header).

The adjustment requires hiding several more lines in IA64's pci.h, but
as a benefit this allows removing one of the "null" headers.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r bfbfd2006ffc -r a7c763a92ba1 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Mon Jan 09 15:55:00 2012 +0100
+++ b/xen/arch/x86/irq.c	Mon Jan 09 15:59:59 2012 +0100
@@ -1877,7 +1877,7 @@
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
              && !desc->arch.used_vectors )
         {
-            desc->arch.used_vectors = &pdev->info.used_vectors;
+            desc->arch.used_vectors = &pdev->arch.used_vectors;
             if ( desc->arch.vector != IRQ_VECTOR_UNASSIGNED )
             {
                 int vector = desc->arch.vector;
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/asm-ia64/linux-null/asm-generic/pci-dma-compat.h
--- a/xen/include/asm-ia64/linux-null/asm-generic/pci-dma-compat.h	Mon Jan 09 15:55:00 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-/* This file is intentionally left empty. */
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/asm-ia64/linux-xen/asm/pci.h
--- a/xen/include/asm-ia64/linux-xen/asm/pci.h	Mon Jan 09 15:55:00 2012 +0100
+++ b/xen/include/asm-ia64/linux-xen/asm/pci.h	Mon Jan 09 15:59:59 2012 +0100
@@ -28,6 +28,10 @@
 
 struct pci_dev;
 
+#ifdef XEN
+struct arch_pci_dev {};
+#endif
+
 /*
  * PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct correspondence
  * between device bus addresses and CPU physical addresses.  Platforms with a hardware I/O
@@ -43,6 +47,7 @@
 extern unsigned long ia64_max_iommu_merge_mask;
 #define PCI_DMA_BUS_IS_PHYS	(ia64_max_iommu_merge_mask == ~0UL)
 
+#ifndef XEN
 static inline void
 pcibios_set_master (struct pci_dev *dev)
 {
@@ -110,7 +115,6 @@
 #define HAVE_PCI_LEGACY
 extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
 				      struct vm_area_struct *vma);
-#ifndef XEN
 extern ssize_t pci_read_legacy_io(struct kobject *kobj, char *buf, loff_t off,
 				  size_t count);
 extern ssize_t pci_write_legacy_io(struct kobject *kobj, char *buf, loff_t off,
@@ -144,6 +148,7 @@
 #define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
 #define pci_domain_nr(busdev)    (PCI_CONTROLLER(busdev)->segment)
 
+#ifndef XEN
 extern struct pci_ops pci_root_ops;
 
 static inline int pci_proc_domain(struct pci_bus *bus)
@@ -161,7 +166,6 @@
 extern void pcibios_bus_to_resource(struct pci_dev *dev,
 		struct resource *res, struct pci_bus_region *region);
 
-#ifndef XEN
 static inline struct resource *
 pcibios_select_root(struct pci_dev *pdev, struct resource *res)
 {
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/asm-x86/pci.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-x86/pci.h	Mon Jan 09 15:59:59 2012 +0100
@@ -0,0 +1,8 @@
+#ifndef __X86_PCI_H__
+#define __X86_PCI_H__
+
+struct arch_pci_dev {
+    vmask_t used_vectors;
+};
+
+#endif /* __X86_PCI_H__ */
diff -r bfbfd2006ffc -r a7c763a92ba1 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Mon Jan 09 15:55:00 2012 +0100
+++ b/xen/include/xen/pci.h	Mon Jan 09 15:59:59 2012 +0100
@@ -12,6 +12,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/irq.h>
+#include <asm/pci.h>
 
 /*
  * The PCI interface treats multi-function devices as independent
@@ -39,9 +40,6 @@
         u8 bus;
         u8 devfn;
     } physfn;
-#ifdef CONFIG_X86
-    vmask_t used_vectors;
-#endif
 };
 
 struct pci_dev {
@@ -62,6 +60,7 @@
     const u8 bus;
     const u8 devfn;
     struct pci_dev_info info;
+    struct arch_pci_dev arch;
     u64 vf_rlen[6];
 };
 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2o-00085B-UI; Sat, 14 Jan 2012 00:00:26 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2n-000852-Ie
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1326499202!52769213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31009 invoked from network); 14 Jan 2012 00:00:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:03 -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 1Rlr2l-0003E7-46
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2k-0004iY-Rb
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:22 +0000
Message-Id: <E1Rlr2k-0004iY-Rb@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:22 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: check all GPT partitions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215102 0
# Node ID ee80c2ef9400276a8dcff4f1cf58f5dc983ba1ac
# Parent  95a0e0b47e9581fa20f6a7a89471f9ae729a4b56
pygrub: check all GPT partitions

On Fedora 16 the first GPT partition is a boot partition for grub2 with
the grub2 configuration in the second partition.
Check all GPT partitions for grub configuration, not just the first.

[ Also remove now-inaccurate comment. -iwj ]

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 23998:85d7b207fabc
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 95a0e0b47e95 -r ee80c2ef9400 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Tue Jan 10 16:10:00 2012 +0000
+++ b/tools/pygrub/src/pygrub	Tue Jan 10 17:05:02 2012 +0000
@@ -77,10 +77,17 @@
 
 def get_fs_offset_gpt(file):
     fd = os.open(file, os.O_RDONLY)
-    # assume the first partition is an EFI system partition.
-    os.lseek(fd, SECTOR_SIZE * 2, 0)
+    os.lseek(fd, SECTOR_SIZE, 0)
     buf = os.read(fd, 512)
-    return struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE
+    partcount = struct.unpack("<L", buf[80:84])[0]
+    partsize = struct.unpack("<L", buf[84:88])[0]
+    i = partcount
+    offsets = []
+    while i>0:
+        buf = os.read(fd, partsize)
+        offsets.append(struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE)
+        i -= 1
+    return offsets
 
 FDISK_PART_SOLARIS=0xbf
 FDISK_PART_SOLARIS_OLD=0x82
@@ -114,7 +121,9 @@
                 continue # no solaris magic at that offset, ignore partition
 
         if type == FDISK_PART_GPT:
-            offset = get_fs_offset_gpt(file)
+            for offset in get_fs_offset_gpt(file):
+                part_offs.append(offset)
+            break
 
         # Active partition has 0x80 as the first byte.
         # If active, prepend to front of list, otherwise append to back.

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2o-00085B-UI; Sat, 14 Jan 2012 00:00:26 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2n-000852-Ie
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1326499202!52769213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31009 invoked from network); 14 Jan 2012 00:00:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:03 -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 1Rlr2l-0003E7-46
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2k-0004iY-Rb
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:22 +0000
Message-Id: <E1Rlr2k-0004iY-Rb@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:22 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: check all GPT partitions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215102 0
# Node ID ee80c2ef9400276a8dcff4f1cf58f5dc983ba1ac
# Parent  95a0e0b47e9581fa20f6a7a89471f9ae729a4b56
pygrub: check all GPT partitions

On Fedora 16 the first GPT partition is a boot partition for grub2 with
the grub2 configuration in the second partition.
Check all GPT partitions for grub configuration, not just the first.

[ Also remove now-inaccurate comment. -iwj ]

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 23998:85d7b207fabc
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 95a0e0b47e95 -r ee80c2ef9400 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Tue Jan 10 16:10:00 2012 +0000
+++ b/tools/pygrub/src/pygrub	Tue Jan 10 17:05:02 2012 +0000
@@ -77,10 +77,17 @@
 
 def get_fs_offset_gpt(file):
     fd = os.open(file, os.O_RDONLY)
-    # assume the first partition is an EFI system partition.
-    os.lseek(fd, SECTOR_SIZE * 2, 0)
+    os.lseek(fd, SECTOR_SIZE, 0)
     buf = os.read(fd, 512)
-    return struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE
+    partcount = struct.unpack("<L", buf[80:84])[0]
+    partsize = struct.unpack("<L", buf[84:88])[0]
+    i = partcount
+    offsets = []
+    while i>0:
+        buf = os.read(fd, partsize)
+        offsets.append(struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE)
+        i -= 1
+    return offsets
 
 FDISK_PART_SOLARIS=0xbf
 FDISK_PART_SOLARIS_OLD=0x82
@@ -114,7 +121,9 @@
                 continue # no solaris magic at that offset, ignore partition
 
         if type == FDISK_PART_GPT:
-            offset = get_fs_offset_gpt(file)
+            for offset in get_fs_offset_gpt(file):
+                part_offs.append(offset)
+            break
 
         # Active partition has 0x80 as the first byte.
         # If active, prepend to front of list, otherwise append to back.

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rlr2r-00085f-3N; Sat, 14 Jan 2012 00:00:29 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2q-00085O-3j
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1326499180!50543495!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20182 invoked from network); 13 Jan 2012 23:59:41 -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;
	13 Jan 2012 23:59:41 -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 1Rlr2n-0003EJ-Gn
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2n-0004ja-FU
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
Message-Id: <E1Rlr2n-0004ja-FU@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:24 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pyrgrub: cope with configurations
	with set default="${saved_entry}" line
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215307 0
# Node ID 49d73f0140772bef6a8506067741f35939adc756
# Parent  c404dbf9b3c62cadb1c621c5313531264c964dee
pyrgrub: cope with configurations with set default="${saved_entry}" line

Fedora 16 grub2 configuration file can have lines like
    set default="${saved_entry}"
and a string containing an integer is expected

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 24002:979bc34d0ad0
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r c404dbf9b3c6 -r 49d73f014077 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:22 2012 +0000
+++ b/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:27 2012 +0000
@@ -425,6 +425,8 @@
                 
             if self.commands.has_key(com):
                 if self.commands[com] is not None:
+                    if arg.strip() == "${saved_entry}":
+                        arg = "0"
                     setattr(self, self.commands[com], arg.strip())
                 else:
                     logging.info("Ignored directive %s" %(com,))

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rlr2r-00085f-3N; Sat, 14 Jan 2012 00:00:29 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2q-00085O-3j
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1326499180!50543495!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20182 invoked from network); 13 Jan 2012 23:59:41 -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;
	13 Jan 2012 23:59:41 -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 1Rlr2n-0003EJ-Gn
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2n-0004ja-FU
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
Message-Id: <E1Rlr2n-0004ja-FU@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:24 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pyrgrub: cope with configurations
	with set default="${saved_entry}" line
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215307 0
# Node ID 49d73f0140772bef6a8506067741f35939adc756
# Parent  c404dbf9b3c62cadb1c621c5313531264c964dee
pyrgrub: cope with configurations with set default="${saved_entry}" line

Fedora 16 grub2 configuration file can have lines like
    set default="${saved_entry}"
and a string containing an integer is expected

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 24002:979bc34d0ad0
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r c404dbf9b3c6 -r 49d73f014077 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:22 2012 +0000
+++ b/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:27 2012 +0000
@@ -425,6 +425,8 @@
                 
             if self.commands.has_key(com):
                 if self.commands[com] is not None:
+                    if arg.strip() == "${saved_entry}":
+                        arg = "0"
                     setattr(self, self.commands[com], arg.strip())
                 else:
                     logging.info("Ignored directive %s" %(com,))

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:37 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2w-00086b-6b; Sat, 14 Jan 2012 00:00:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2u-00085E-GV
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1326499224!8894664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3420 invoked from network); 14 Jan 2012 00:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:25 -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 1Rlr2l-0003EA-Ov
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2l-0004ip-LV
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:23 +0000
Message-Id: <E1Rlr2l-0004ip-LV@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:22 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: look in /boot/grub2 (for
	eg Fedora 16)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215278 0
# Node ID d581b9a3c726e03792dd60d8a6fb392b697f18a9
# Parent  ee80c2ef9400276a8dcff4f1cf58f5dc983ba1ac
pygrub: look in /boot/grub2 (for eg Fedora 16)

Fedora 16 puts grub configuration files in /boot/grub2/grub.cfg so
pygrub should look there as well

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 23999:138f707fa598
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ee80c2ef9400 -r d581b9a3c726 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Tue Jan 10 17:05:02 2012 +0000
+++ b/tools/pygrub/src/pygrub	Tue Jan 10 17:07:58 2012 +0000
@@ -398,7 +398,8 @@
                            ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
                             "/grub/menu.lst", "/grub/grub.conf"]) + \
                        map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
-                           ["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \
+                           ["/boot/grub/grub.cfg", "/grub/grub.cfg",
+                            "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
                        map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
                            ["/boot/isolinux/isolinux.cfg",
                             "/boot/extlinux.conf"])

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:37 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2w-00086b-6b; Sat, 14 Jan 2012 00:00:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2u-00085E-GV
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1326499224!8894664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3420 invoked from network); 14 Jan 2012 00:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:25 -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 1Rlr2l-0003EA-Ov
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2l-0004ip-LV
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:23 +0000
Message-Id: <E1Rlr2l-0004ip-LV@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:22 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: look in /boot/grub2 (for
	eg Fedora 16)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215278 0
# Node ID d581b9a3c726e03792dd60d8a6fb392b697f18a9
# Parent  ee80c2ef9400276a8dcff4f1cf58f5dc983ba1ac
pygrub: look in /boot/grub2 (for eg Fedora 16)

Fedora 16 puts grub configuration files in /boot/grub2/grub.cfg so
pygrub should look there as well

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 23999:138f707fa598
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ee80c2ef9400 -r d581b9a3c726 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Tue Jan 10 17:05:02 2012 +0000
+++ b/tools/pygrub/src/pygrub	Tue Jan 10 17:07:58 2012 +0000
@@ -398,7 +398,8 @@
                            ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
                             "/grub/menu.lst", "/grub/grub.conf"]) + \
                        map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
-                           ["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \
+                           ["/boot/grub/grub.cfg", "/grub/grub.cfg",
+                            "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
                        map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
                            ["/boot/isolinux/isolinux.cfg",
                             "/boot/extlinux.conf"])

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:39 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2r-00085a-0e; Sat, 14 Jan 2012 00:00:29 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2p-00085C-Hn
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1326499179!50543494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20164 invoked from network); 13 Jan 2012 23:59:40 -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;
	13 Jan 2012 23:59:40 -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 1Rlr2m-0003ED-Ht
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2m-0004j4-BB
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:24 +0000
Message-Id: <E1Rlr2m-0004j4-BB@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:23 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: Allow GPT partition
	references
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215297 0
# Node ID feb23d232cd92227694ad0e4696a420e1ef74b64
# Parent  d581b9a3c726e03792dd60d8a6fb392b697f18a9
pygrub: Allow GPT partition references

The grub2 configuration file in Fedora 16 can have GPT partition
references like (hd0,gpt2) so remove the "gpt" string where necessary

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 24000:65679fee0177
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d581b9a3c726 -r feb23d232cd9 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:07:58 2012 +0000
+++ b/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:17 2012 +0000
@@ -79,6 +79,8 @@
         val = val.replace("(", "").replace(")", "")
         if val[:5] == "msdos":
             val = val[5:]
+        if val[:3] == "gpt":
+            val = val[3:]
         self._part = int(val)
     part = property(get_part, set_part)
 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:39 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2r-00085a-0e; Sat, 14 Jan 2012 00:00:29 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2p-00085C-Hn
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1326499179!50543494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20164 invoked from network); 13 Jan 2012 23:59:40 -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;
	13 Jan 2012 23:59:40 -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 1Rlr2m-0003ED-Ht
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2m-0004j4-BB
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:24 +0000
Message-Id: <E1Rlr2m-0004j4-BB@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:23 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: Allow GPT partition
	references
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215297 0
# Node ID feb23d232cd92227694ad0e4696a420e1ef74b64
# Parent  d581b9a3c726e03792dd60d8a6fb392b697f18a9
pygrub: Allow GPT partition references

The grub2 configuration file in Fedora 16 can have GPT partition
references like (hd0,gpt2) so remove the "gpt" string where necessary

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 24000:65679fee0177
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d581b9a3c726 -r feb23d232cd9 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:07:58 2012 +0000
+++ b/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:17 2012 +0000
@@ -79,6 +79,8 @@
         val = val.replace("(", "").replace(")", "")
         if val[:5] == "msdos":
             val = val[5:]
+        if val[:3] == "gpt":
+            val = val[3:]
         self._part = int(val)
     part = property(get_part, set_part)
 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:43 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr31-00088D-F9; Sat, 14 Jan 2012 00:00:39 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2z-000860-C9
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1326499226!9070282!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22188 invoked from network); 14 Jan 2012 00:00:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:27 -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 1Rlr2o-0003EM-Ea
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2o-0004jq-2D
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:26 +0000
Message-Id: <E1Rlr2o-0004jq-2D@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:25 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: example grub2
	configuration file (fedora-16-with-xen.grub2)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215366 0
# Node ID 22ea8496051d4be02aba93047d92caf50c3e2639
# Parent  49d73f0140772bef6a8506067741f35939adc756
pygrub: example grub2 configuration file (fedora-16-with-xen.grub2)

Sample grub2 configuration file (some duplication removed) from Fedora 16
with a xen hypervisor installed

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 24003:c681dd5aecf3
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 49d73f014077 -r 22ea8496051d tools/pygrub/examples/fedora-16-with-xen.grub2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pygrub/examples/fedora-16-with-xen.grub2	Tue Jan 10 17:09:26 2012 +0000
@@ -0,0 +1,112 @@
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub2-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+if [ -s $prefix/grubenv ]; then
+  load_env
+fi
+set default="${saved_entry}"
+if [ "${prev_saved_entry}" ]; then
+  set saved_entry="${prev_saved_entry}"
+  save_env saved_entry
+  set prev_saved_entry=
+  save_env prev_saved_entry
+  set boot_once=true
+fi
+
+function savedefault {
+  if [ -z "${boot_once}" ]; then
+    saved_entry="${chosen}"
+    save_env saved_entry
+  fi
+}
+
+function load_video {
+  insmod vbe
+  insmod vga
+  insmod video_bochs
+  insmod video_cirrus
+}
+
+set timeout=5
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/10_linux ###
+menuentry 'Fedora Linux, with Linux 3.1.0-0.rc9.git0.0.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
+	load_video
+	set gfxpayload=keep
+	insmod gzio
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	linux	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8 
+	echo	'Loading initial ramdisk ...'
+	initrd	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+menuentry 'Fedora Linux, with Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
+	load_video
+	set gfxpayload=keep
+	insmod gzio
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	linux	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro single rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8
+	echo	'Loading initial ramdisk ...'
+	initrd	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+submenu "Xen 4.1" {
+menuentry 'Fedora Linux, with Xen 4.1 and Linux 3.1.0-0.rc9.git0.0.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os --class xen {
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Xen 4.1 ...'
+	multiboot	/xen-4.1.gz placeholder  
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	module	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 placeholder root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8 
+	echo	'Loading initial ramdisk ...'
+	module	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+menuentry 'Fedora Linux, with Xen 4.1 and Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os --class xen {
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Xen 4.1 ...'
+	multiboot	/xen-4.1.gz placeholder 
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	module	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 placeholder root=/dev/mapper/VolGroup-lv_root ro single rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8
+	echo	'Loading initial ramdisk ...'
+	module	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+}
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries.  Simply type the
+# menu entries you want to add after this comment.  Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f  $prefix/custom.cfg ]; then
+  source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
+
+### BEGIN /etc/grub.d/90_persistent ###
+### END /etc/grub.d/90_persistent ###

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:43 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr31-00088D-F9; Sat, 14 Jan 2012 00:00:39 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2z-000860-C9
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1326499226!9070282!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22188 invoked from network); 14 Jan 2012 00:00:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:27 -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 1Rlr2o-0003EM-Ea
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2o-0004jq-2D
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:26 +0000
Message-Id: <E1Rlr2o-0004jq-2D@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:25 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: example grub2
	configuration file (fedora-16-with-xen.grub2)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215366 0
# Node ID 22ea8496051d4be02aba93047d92caf50c3e2639
# Parent  49d73f0140772bef6a8506067741f35939adc756
pygrub: example grub2 configuration file (fedora-16-with-xen.grub2)

Sample grub2 configuration file (some duplication removed) from Fedora 16
with a xen hypervisor installed

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 24003:c681dd5aecf3
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 49d73f014077 -r 22ea8496051d tools/pygrub/examples/fedora-16-with-xen.grub2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pygrub/examples/fedora-16-with-xen.grub2	Tue Jan 10 17:09:26 2012 +0000
@@ -0,0 +1,112 @@
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub2-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+if [ -s $prefix/grubenv ]; then
+  load_env
+fi
+set default="${saved_entry}"
+if [ "${prev_saved_entry}" ]; then
+  set saved_entry="${prev_saved_entry}"
+  save_env saved_entry
+  set prev_saved_entry=
+  save_env prev_saved_entry
+  set boot_once=true
+fi
+
+function savedefault {
+  if [ -z "${boot_once}" ]; then
+    saved_entry="${chosen}"
+    save_env saved_entry
+  fi
+}
+
+function load_video {
+  insmod vbe
+  insmod vga
+  insmod video_bochs
+  insmod video_cirrus
+}
+
+set timeout=5
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/10_linux ###
+menuentry 'Fedora Linux, with Linux 3.1.0-0.rc9.git0.0.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
+	load_video
+	set gfxpayload=keep
+	insmod gzio
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	linux	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8 
+	echo	'Loading initial ramdisk ...'
+	initrd	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+menuentry 'Fedora Linux, with Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
+	load_video
+	set gfxpayload=keep
+	insmod gzio
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	linux	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro single rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8
+	echo	'Loading initial ramdisk ...'
+	initrd	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+submenu "Xen 4.1" {
+menuentry 'Fedora Linux, with Xen 4.1 and Linux 3.1.0-0.rc9.git0.0.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os --class xen {
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Xen 4.1 ...'
+	multiboot	/xen-4.1.gz placeholder  
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	module	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 placeholder root=/dev/mapper/VolGroup-lv_root ro rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8 
+	echo	'Loading initial ramdisk ...'
+	module	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+menuentry 'Fedora Linux, with Xen 4.1 and Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os --class xen {
+	insmod part_gpt
+	insmod ext2
+	set root='(hd0,gpt2)'
+	search --no-floppy --fs-uuid --set=root f14ea58a-c2b3-4348-8091-3ab733a2f49e
+	echo	'Loading Xen 4.1 ...'
+	multiboot	/xen-4.1.gz placeholder 
+	echo	'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
+	module	/vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 placeholder root=/dev/mapper/VolGroup-lv_root ro single rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0  KEYTABLE=uk LANG=en_US.UTF-8
+	echo	'Loading initial ramdisk ...'
+	module	/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
+}
+}
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries.  Simply type the
+# menu entries you want to add after this comment.  Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f  $prefix/custom.cfg ]; then
+  source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
+
+### BEGIN /etc/grub.d/90_persistent ###
+### END /etc/grub.d/90_persistent ###

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:45 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rlr2z-00087L-CS; Sat, 14 Jan 2012 00:00:37 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2x-00085r-CI
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1326499225!10309838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27560 invoked from network); 14 Jan 2012 00:00:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:27 -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 1Rlr2n-0003EG-09
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2m-0004jL-UT
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:24 +0000
Message-Id: <E1Rlr2m-0004jL-UT@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:24 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: cope with configurations
	with submenus
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215302 0
# Node ID c404dbf9b3c62cadb1c621c5313531264c964dee
# Parent  feb23d232cd92227694ad0e4696a420e1ef74b64
pygrub: cope with configurations with submenus

The grub2 configuration file in Fedora 16 can have one or more
menuentrys in a submenu, with configuration of the form
    submenu "Xen 4.1" {
    menuentry ... {
    ...
    }
    }
(this example occurs when the xen hypervisor is installed on the
guest)

Ignore the submenu line and the corresponding }

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 24001:152049468175
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r feb23d232cd9 -r c404dbf9b3c6 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:17 2012 +0000
+++ b/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:22 2012 +0000
@@ -370,6 +370,7 @@
         in_function = False
         img = None
         title = ""
+        menu_level=0
         for l in lines:
             l = l.strip()
             # skip blank lines
@@ -396,10 +397,18 @@
                 img = []
                 title = title_match.group(1)
                 continue
-            
+
+            if l.startswith("submenu"):
+                menu_level += 1
+                continue
+
             if l.startswith("}"):
                 if img is None:
-                    raise RuntimeError, "syntax error: closing brace without menuentry"
+                    if menu_level > 0:
+                        menu_level -= 1
+                        continue
+                    else:
+                        raise RuntimeError, "syntax error: closing brace without menuentry"
 
                 self.add_image(Grub2Image(title, img))
                 img = None

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:45 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rlr2z-00087L-CS; Sat, 14 Jan 2012 00:00:37 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2x-00085r-CI
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1326499225!10309838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27560 invoked from network); 14 Jan 2012 00:00:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:27 -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 1Rlr2n-0003EG-09
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2m-0004jL-UT
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:24 +0000
Message-Id: <E1Rlr2m-0004jL-UT@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:24 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: cope with configurations
	with submenus
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# Date 1326215302 0
# Node ID c404dbf9b3c62cadb1c621c5313531264c964dee
# Parent  feb23d232cd92227694ad0e4696a420e1ef74b64
pygrub: cope with configurations with submenus

The grub2 configuration file in Fedora 16 can have one or more
menuentrys in a submenu, with configuration of the form
    submenu "Xen 4.1" {
    menuentry ... {
    ...
    }
    }
(this example occurs when the xen hypervisor is installed on the
guest)

Ignore the submenu line and the corresponding }

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 24001:152049468175
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r feb23d232cd9 -r c404dbf9b3c6 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:17 2012 +0000
+++ b/tools/pygrub/src/GrubConf.py	Tue Jan 10 17:08:22 2012 +0000
@@ -370,6 +370,7 @@
         in_function = False
         img = None
         title = ""
+        menu_level=0
         for l in lines:
             l = l.strip()
             # skip blank lines
@@ -396,10 +397,18 @@
                 img = []
                 title = title_match.group(1)
                 continue
-            
+
+            if l.startswith("submenu"):
+                menu_level += 1
+                continue
+
             if l.startswith("}"):
                 if img is None:
-                    raise RuntimeError, "syntax error: closing brace without menuentry"
+                    if menu_level > 0:
+                        menu_level -= 1
+                        continue
+                    else:
+                        raise RuntimeError, "syntax error: closing brace without menuentry"
 
                 self.add_image(Grub2Image(title, img))
                 img = None

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:59 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2w-00086s-9C; Sat, 14 Jan 2012 00:00:34 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2u-00085K-S9
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1326499223!10825916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32115 invoked from network); 14 Jan 2012 00:00:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:26 -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 1Rlr2k-0003E3-Jn
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2g-0004hI-5p
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:21 +0000
Message-Id: <E1Rlr2g-0004hI-5p@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: fix extlinux parsing
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1326211800 0
# Node ID 95a0e0b47e9581fa20f6a7a89471f9ae729a4b56
# Parent  14dbd6be46c85254bba08476731cb68ebe3c58fd
pygrub: fix extlinux parsing

pygrub was unable to parse extlinux config files correctly, exactly
the ones like:

LABEL grsec
  KERNEL vmlinuz-3.0.10-grsec
  APPEND initrd=initramfs-3.0.10-grsec
root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
modules=sd-mod,usb-storage,ext4 xen quiet

This patch fixes it, adding a new case when parsing the "append" line,
that searches for the initrd image.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

xen-unstable changeset: 24460:ff0685e8419b
Backport-requested-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 14dbd6be46c8 -r 95a0e0b47e95 tools/pygrub/examples/alpine-linux-2.3.2.extlinux
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux	Tue Jan 10 16:10:00 2012 +0000
@@ -0,0 +1,11 @@
+DEFAULT menu.c32
+PROMPT 0
+MENU TITLE Alpine/Linux Boot Menu
+MENU HIDDEN
+MENU AUTOBOOT Alpine will be booted automatically in # seconds.
+TIMEOUT 30
+LABEL grsec
+  MENU DEFAULT
+  MENU LABEL Linux 3.0.10-grsec
+  KERNEL vmlinuz-3.0.10-grsec
+  APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet
diff -r 14dbd6be46c8 -r 95a0e0b47e95 tools/pygrub/src/ExtLinuxConf.py
--- a/tools/pygrub/src/ExtLinuxConf.py	Sun Dec 18 14:52:52 2011 +0000
+++ b/tools/pygrub/src/ExtLinuxConf.py	Tue Jan 10 16:10:00 2012 +0000
@@ -60,6 +60,13 @@
 
                 # Bypass regular self.commands handling
                 com = None
+            elif arg.find("initrd="):
+                # find initrd image in append line
+                args = arg.strip().split(" ")
+                for a in args:
+                    if a.lower().startswith("initrd="):
+                        setattr(self, "initrd", a.replace("initrd=", ""))
+                        arg = arg.replace(a, "")
 
         if com is not None and self.commands.has_key(com):
             if self.commands[com] is not None:
@@ -86,10 +93,12 @@
         self._args = args
     def get_kernel(self):
         return self._kernel
+    def set_args(self, val):
+        self._args = val
     def get_args(self):
         return self._args
     kernel = property(get_kernel, set_kernel)
-    args = property(get_args)
+    args = property(get_args, set_args)
 
     def set_initrd(self, val):
         self._initrd = (None,val)

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 14 00:00:59 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Jan 2012 00:00: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.xensource.com>)
	id 1Rlr2w-00086s-9C; Sat, 14 Jan 2012 00:00:34 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2u-00085K-S9
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1326499223!10825916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32115 invoked from network); 14 Jan 2012 00:00:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2012 00:00:26 -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 1Rlr2k-0003E3-Jn
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rlr2g-0004hI-5p
	for xen-changelog@lists.xensource.com; Sat, 14 Jan 2012 00:00:21 +0000
Message-Id: <E1Rlr2g-0004hI-5p@xenbits.xen.org>
Date: Sat, 14 Jan 2012 00:00:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] pygrub: fix extlinux parsing
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1326211800 0
# Node ID 95a0e0b47e9581fa20f6a7a89471f9ae729a4b56
# Parent  14dbd6be46c85254bba08476731cb68ebe3c58fd
pygrub: fix extlinux parsing

pygrub was unable to parse extlinux config files correctly, exactly
the ones like:

LABEL grsec
  KERNEL vmlinuz-3.0.10-grsec
  APPEND initrd=initramfs-3.0.10-grsec
root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
modules=sd-mod,usb-storage,ext4 xen quiet

This patch fixes it, adding a new case when parsing the "append" line,
that searches for the initrd image.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

xen-unstable changeset: 24460:ff0685e8419b
Backport-requested-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 14dbd6be46c8 -r 95a0e0b47e95 tools/pygrub/examples/alpine-linux-2.3.2.extlinux
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux	Tue Jan 10 16:10:00 2012 +0000
@@ -0,0 +1,11 @@
+DEFAULT menu.c32
+PROMPT 0
+MENU TITLE Alpine/Linux Boot Menu
+MENU HIDDEN
+MENU AUTOBOOT Alpine will be booted automatically in # seconds.
+TIMEOUT 30
+LABEL grsec
+  MENU DEFAULT
+  MENU LABEL Linux 3.0.10-grsec
+  KERNEL vmlinuz-3.0.10-grsec
+  APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet
diff -r 14dbd6be46c8 -r 95a0e0b47e95 tools/pygrub/src/ExtLinuxConf.py
--- a/tools/pygrub/src/ExtLinuxConf.py	Sun Dec 18 14:52:52 2011 +0000
+++ b/tools/pygrub/src/ExtLinuxConf.py	Tue Jan 10 16:10:00 2012 +0000
@@ -60,6 +60,13 @@
 
                 # Bypass regular self.commands handling
                 com = None
+            elif arg.find("initrd="):
+                # find initrd image in append line
+                args = arg.strip().split(" ")
+                for a in args:
+                    if a.lower().startswith("initrd="):
+                        setattr(self, "initrd", a.replace("initrd=", ""))
+                        arg = arg.replace(a, "")
 
         if com is not None and self.commands.has_key(com):
             if self.commands[com] is not None:
@@ -86,10 +93,12 @@
         self._args = args
     def get_kernel(self):
         return self._kernel
+    def set_args(self, val):
+        self._args = val
     def get_args(self):
         return self._args
     kernel = property(get_kernel, set_kernel)
-    args = property(get_args)
+    args = property(get_args, set_args)
 
     def set_initrd(self, val):
         self._initrd = (None,val)

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 16 09:11:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jan 2012 09: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.xensource.com>)
	id 1Rmib0-0005wg-J2; Mon, 16 Jan 2012 09:11:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rmiay-0005wT-GJ
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 09:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1326705068!11055821!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23884 invoked from network); 16 Jan 2012 09:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Jan 2012 09:11:09 -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 1Rmiaq-0002wf-Jp
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 09:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rmiaq-0000O7-DB
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 09:11:08 +0000
Message-Id: <E1Rmiaq-0000O7-DB@xenbits.xen.org>
Date: Mon, 16 Jan 2012 09:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/ucode: fix for AMD Fam15 CPUs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1326665293 0
# Node ID e29b7691fefc2e5840d80d49f78b64b6d7019f9b
# Parent  22ea8496051d4be02aba93047d92caf50c3e2639
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Backport from xen-unstable changeset 24411:ca5f588bd203 to Xen 4.1
---


diff -r 22ea8496051d -r e29b7691fefc xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Tue Jan 10 17:09:26 2012 +0000
+++ b/xen/arch/x86/microcode_amd.c	Sun Jan 15 22:08:13 2012 +0000
@@ -33,11 +33,11 @@
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
 #define UCODE_UCODE_TYPE           0x00000001
 
-#define UCODE_MAX_SIZE          (2048)
-#define DEFAULT_UCODE_DATASIZE  (896)
-#define MC_HEADER_SIZE          (sizeof(struct microcode_header_amd))
-#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
-#define DWSIZE                  (sizeof(uint32_t))
+struct mpbhdr {
+    uint32_t type;
+    uint32_t len;
+    uint8_t data[];
+};
 
 /* serialize access to the physical write */
 static DEFINE_SPINLOCK(microcode_update_lock);
@@ -65,10 +65,10 @@
     return 0;
 }
 
-static int microcode_fits(void *mc, int cpu)
+static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    struct microcode_header_amd *mc_header = mc;
+    struct microcode_header_amd *mc_header = mc_amd->mpb;
     unsigned int current_cpu_id;
     unsigned int equiv_cpu_id = 0x0;
     unsigned int i;
@@ -97,9 +97,9 @@
 
     if ( !equiv_cpu_id )
     {
-        printk(KERN_ERR "microcode: CPU%d cpu_id "
+        printk(KERN_INFO "microcode: CPU%d cpu_id "
                "not found in equivalent cpu table\n", cpu);
-        return -EINVAL;
+        return 0;
     }
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
@@ -111,14 +111,14 @@
     }
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
-        return -EINVAL;
+        return 0;
 
     printk(KERN_INFO "microcode: CPU%d found a matching microcode "
            "update with version 0x%x (current=0x%x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
 out:
-    return 0;
+    return 1;
 }
 
 static int apply_microcode(int cpu)
@@ -127,16 +127,21 @@
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     uint32_t rev;
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
+    struct microcode_header_amd *hdr;
 
     /* We should bind the task to the CPU */
     BUG_ON(raw_smp_processor_id() != cpu);
 
     if ( mc_amd == NULL )
-        return -EINVAL;
+       return -EINVAL;
+
+    hdr = mc_amd->mpb;
+    if ( hdr == NULL )
+       return -EINVAL;
 
     spin_lock_irqsave(&microcode_update_lock, flags);
 
-    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)&mc_amd->hdr.data_code);
+    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
     rdmsrl(MSR_AMD_PATCHLEVEL, rev);
@@ -144,61 +149,67 @@
     spin_unlock_irqrestore(&microcode_update_lock, flags);
 
     /* check current patch id and patch's id for match */
-    if ( rev != mc_amd->hdr.patch_id )
+    if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
                "0x%x to 0x%x failed\n", cpu,
-               mc_amd->hdr.patch_id, rev);
+               hdr->patch_id, rev);
         return -EIO;
     }
 
     printk("microcode: CPU%d updated from revision "
            "0x%x to 0x%x \n",
-           cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
+           cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
 
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
-                                         size_t size, unsigned long *offset)
+static int get_next_ucode_from_buffer_amd(struct microcode_amd *mc_amd,
+                                         const void *buf, size_t bufsize,
+                                         unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
-    size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
+    const struct mpbhdr *mpbuf;
 
     off = *offset;
 
     /* No more data */
-    if ( off >= size )
+    if ( off >= bufsize )
         return 1;
 
-    if ( bufp[off] != UCODE_UCODE_TYPE )
+    mpbuf = (const struct mpbhdr *)&bufp[off];
+    if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
         printk(KERN_ERR "microcode: error! "
                "Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
+    printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n",
+           bufsize, mpbuf->len, off);
 
-    total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
-
-    printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
-           (unsigned long)size, total_size, off);
-
-    if ( (off + total_size) > size )
+    if ( (off + mpbuf->len) > bufsize )
     {
         printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
         return -EINVAL;
     }
 
-    memset(mc, 0, UCODE_MAX_SIZE);
-    memcpy(mc, (const void *)(&bufp[off + 8]), total_size);
+    if (mc_amd->mpb_size < mpbuf->len) {
+        if (mc_amd->mpb) {
+            xfree(mc_amd->mpb);
+            mc_amd->mpb_size = 0;
+        }
+        mc_amd->mpb = xmalloc_bytes(mpbuf->len);
+        if (mc_amd->mpb == NULL)
+            return -ENOMEM;
+        mc_amd->mpb_size = mpbuf->len;
+    }
+    memcpy(mc_amd->mpb, mpbuf->data, mpbuf->len);
 
-    *offset = off + total_size + 8;
+    *offset = off + mpbuf->len + 8;
 
     return 0;
 }
@@ -253,7 +264,7 @@
     int error = 0;
     int ret;
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    void *mc;
+    struct microcode_amd *mc_amd, *mc_old;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -274,8 +285,8 @@
         return -EINVAL;
     }
 
-    mc = xmalloc_bytes(UCODE_MAX_SIZE);
-    if ( mc == NULL )
+    mc_amd = xmalloc(struct microcode_amd);
+    if ( mc_amd == NULL )
     {
         printk(KERN_ERR "microcode: error! "
                "Can not allocate memory for microcode patch\n");
@@ -283,32 +294,37 @@
         goto out;
     }
 
+    mc_old = uci->mc.mc_amd;
     /* implicitely validates uci->mc.mc_valid */
-    uci->mc.mc_amd = mc;
+    uci->mc.mc_amd = mc_amd;
 
     /*
      * It's possible the data file has multiple matching ucode,
      * lets keep searching till the latest version
      */
-    while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
+    mc_amd->mpb = NULL;
+    mc_amd->mpb_size = 0;
+    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, size,
+                                                  &offset)) == 0)
     {
-        error = microcode_fits(mc, cpu);
-        if (error != 0)
+        error = microcode_fits(mc_amd, cpu);
+        if (error <= 0)
             continue;
 
         error = apply_microcode(cpu);
-        if (error == 0)
+        if (error == 0) {
+            error = 1;
             break;
+        }
     }
 
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if (error) {
-        xfree(mc);
-        mc = NULL;
+    if (error == 0) {
+        xfree(mc_old);
+        return 0;
     }
-    uci->mc.mc_amd = mc;
 
 out:
     xfree(equiv_cpu_table);
diff -r 22ea8496051d -r e29b7691fefc xen/include/asm-x86/microcode.h
--- a/xen/include/asm-x86/microcode.h	Tue Jan 10 17:09:26 2012 +0000
+++ b/xen/include/asm-x86/microcode.h	Sun Jan 15 22:08:13 2012 +0000
@@ -71,8 +71,8 @@
 } __attribute__((packed));
 
 struct microcode_amd {
-    struct microcode_header_amd hdr;
-    unsigned int mpb[0];
+    void *mpb;
+    size_t mpb_size;
 };
 
 struct cpu_signature {

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 16 09:11:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jan 2012 09: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.xensource.com>)
	id 1Rmib0-0005wg-J2; Mon, 16 Jan 2012 09:11:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rmiay-0005wT-GJ
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 09:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1326705068!11055821!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23884 invoked from network); 16 Jan 2012 09:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Jan 2012 09:11:09 -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 1Rmiaq-0002wf-Jp
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 09:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rmiaq-0000O7-DB
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 09:11:08 +0000
Message-Id: <E1Rmiaq-0000O7-DB@xenbits.xen.org>
Date: Mon, 16 Jan 2012 09:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/ucode: fix for AMD Fam15 CPUs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1326665293 0
# Node ID e29b7691fefc2e5840d80d49f78b64b6d7019f9b
# Parent  22ea8496051d4be02aba93047d92caf50c3e2639
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Backport from xen-unstable changeset 24411:ca5f588bd203 to Xen 4.1
---


diff -r 22ea8496051d -r e29b7691fefc xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Tue Jan 10 17:09:26 2012 +0000
+++ b/xen/arch/x86/microcode_amd.c	Sun Jan 15 22:08:13 2012 +0000
@@ -33,11 +33,11 @@
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
 #define UCODE_UCODE_TYPE           0x00000001
 
-#define UCODE_MAX_SIZE          (2048)
-#define DEFAULT_UCODE_DATASIZE  (896)
-#define MC_HEADER_SIZE          (sizeof(struct microcode_header_amd))
-#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
-#define DWSIZE                  (sizeof(uint32_t))
+struct mpbhdr {
+    uint32_t type;
+    uint32_t len;
+    uint8_t data[];
+};
 
 /* serialize access to the physical write */
 static DEFINE_SPINLOCK(microcode_update_lock);
@@ -65,10 +65,10 @@
     return 0;
 }
 
-static int microcode_fits(void *mc, int cpu)
+static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    struct microcode_header_amd *mc_header = mc;
+    struct microcode_header_amd *mc_header = mc_amd->mpb;
     unsigned int current_cpu_id;
     unsigned int equiv_cpu_id = 0x0;
     unsigned int i;
@@ -97,9 +97,9 @@
 
     if ( !equiv_cpu_id )
     {
-        printk(KERN_ERR "microcode: CPU%d cpu_id "
+        printk(KERN_INFO "microcode: CPU%d cpu_id "
                "not found in equivalent cpu table\n", cpu);
-        return -EINVAL;
+        return 0;
     }
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
@@ -111,14 +111,14 @@
     }
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
-        return -EINVAL;
+        return 0;
 
     printk(KERN_INFO "microcode: CPU%d found a matching microcode "
            "update with version 0x%x (current=0x%x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
 out:
-    return 0;
+    return 1;
 }
 
 static int apply_microcode(int cpu)
@@ -127,16 +127,21 @@
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     uint32_t rev;
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
+    struct microcode_header_amd *hdr;
 
     /* We should bind the task to the CPU */
     BUG_ON(raw_smp_processor_id() != cpu);
 
     if ( mc_amd == NULL )
-        return -EINVAL;
+       return -EINVAL;
+
+    hdr = mc_amd->mpb;
+    if ( hdr == NULL )
+       return -EINVAL;
 
     spin_lock_irqsave(&microcode_update_lock, flags);
 
-    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)&mc_amd->hdr.data_code);
+    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
     rdmsrl(MSR_AMD_PATCHLEVEL, rev);
@@ -144,61 +149,67 @@
     spin_unlock_irqrestore(&microcode_update_lock, flags);
 
     /* check current patch id and patch's id for match */
-    if ( rev != mc_amd->hdr.patch_id )
+    if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
                "0x%x to 0x%x failed\n", cpu,
-               mc_amd->hdr.patch_id, rev);
+               hdr->patch_id, rev);
         return -EIO;
     }
 
     printk("microcode: CPU%d updated from revision "
            "0x%x to 0x%x \n",
-           cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
+           cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
 
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
-                                         size_t size, unsigned long *offset)
+static int get_next_ucode_from_buffer_amd(struct microcode_amd *mc_amd,
+                                         const void *buf, size_t bufsize,
+                                         unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
-    size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
+    const struct mpbhdr *mpbuf;
 
     off = *offset;
 
     /* No more data */
-    if ( off >= size )
+    if ( off >= bufsize )
         return 1;
 
-    if ( bufp[off] != UCODE_UCODE_TYPE )
+    mpbuf = (const struct mpbhdr *)&bufp[off];
+    if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
         printk(KERN_ERR "microcode: error! "
                "Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
+    printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n",
+           bufsize, mpbuf->len, off);
 
-    total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
-
-    printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
-           (unsigned long)size, total_size, off);
-
-    if ( (off + total_size) > size )
+    if ( (off + mpbuf->len) > bufsize )
     {
         printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
         return -EINVAL;
     }
 
-    memset(mc, 0, UCODE_MAX_SIZE);
-    memcpy(mc, (const void *)(&bufp[off + 8]), total_size);
+    if (mc_amd->mpb_size < mpbuf->len) {
+        if (mc_amd->mpb) {
+            xfree(mc_amd->mpb);
+            mc_amd->mpb_size = 0;
+        }
+        mc_amd->mpb = xmalloc_bytes(mpbuf->len);
+        if (mc_amd->mpb == NULL)
+            return -ENOMEM;
+        mc_amd->mpb_size = mpbuf->len;
+    }
+    memcpy(mc_amd->mpb, mpbuf->data, mpbuf->len);
 
-    *offset = off + total_size + 8;
+    *offset = off + mpbuf->len + 8;
 
     return 0;
 }
@@ -253,7 +264,7 @@
     int error = 0;
     int ret;
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    void *mc;
+    struct microcode_amd *mc_amd, *mc_old;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -274,8 +285,8 @@
         return -EINVAL;
     }
 
-    mc = xmalloc_bytes(UCODE_MAX_SIZE);
-    if ( mc == NULL )
+    mc_amd = xmalloc(struct microcode_amd);
+    if ( mc_amd == NULL )
     {
         printk(KERN_ERR "microcode: error! "
                "Can not allocate memory for microcode patch\n");
@@ -283,32 +294,37 @@
         goto out;
     }
 
+    mc_old = uci->mc.mc_amd;
     /* implicitely validates uci->mc.mc_valid */
-    uci->mc.mc_amd = mc;
+    uci->mc.mc_amd = mc_amd;
 
     /*
      * It's possible the data file has multiple matching ucode,
      * lets keep searching till the latest version
      */
-    while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
+    mc_amd->mpb = NULL;
+    mc_amd->mpb_size = 0;
+    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, size,
+                                                  &offset)) == 0)
     {
-        error = microcode_fits(mc, cpu);
-        if (error != 0)
+        error = microcode_fits(mc_amd, cpu);
+        if (error <= 0)
             continue;
 
         error = apply_microcode(cpu);
-        if (error == 0)
+        if (error == 0) {
+            error = 1;
             break;
+        }
     }
 
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if (error) {
-        xfree(mc);
-        mc = NULL;
+    if (error == 0) {
+        xfree(mc_old);
+        return 0;
     }
-    uci->mc.mc_amd = mc;
 
 out:
     xfree(equiv_cpu_table);
diff -r 22ea8496051d -r e29b7691fefc xen/include/asm-x86/microcode.h
--- a/xen/include/asm-x86/microcode.h	Tue Jan 10 17:09:26 2012 +0000
+++ b/xen/include/asm-x86/microcode.h	Sun Jan 15 22:08:13 2012 +0000
@@ -71,8 +71,8 @@
 } __attribute__((packed));
 
 struct microcode_amd {
-    struct microcode_header_amd hdr;
-    unsigned int mpb[0];
+    void *mpb;
+    size_t mpb_size;
 };
 
 struct cpu_signature {

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 16 17:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jan 2012 17:44: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.xensource.com>)
	id 1RmqbS-0002LH-JL; Mon, 16 Jan 2012 17:44:18 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RmqbQ-0002Kp-Qo
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 17:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1326735848!9309241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13980 invoked from network); 16 Jan 2012 17:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Jan 2012 17:44:09 -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 1RmqbI-0000tX-29
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 17:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RmqbH-0005J0-PT
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 17:44:07 +0000
Message-Id: <E1RmqbH-0005J0-PT@xenbits.xen.org>
Date: Mon, 16 Jan 2012 17:44:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/ucode: fix for AMD Fam15 CPUs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1326665334 0
# Node ID d5b26918cd94c1d4dbc931d9761ffd9e652ed3c0
# Parent  5d372b8bccefea17a57a887f5828a57ee6adf2b5
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Backport from xen-unstable changeset 24411:ca5f588bd203 to Xen 4.0
---


diff -r 5d372b8bccef -r d5b26918cd94 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Sun Dec 18 14:51:04 2011 +0000
+++ b/xen/arch/x86/microcode_amd.c	Sun Jan 15 22:08:54 2012 +0000
@@ -33,11 +33,11 @@
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
 #define UCODE_UCODE_TYPE           0x00000001
 
-#define UCODE_MAX_SIZE          (2048)
-#define DEFAULT_UCODE_DATASIZE  (896)
-#define MC_HEADER_SIZE          (sizeof(struct microcode_header_amd))
-#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
-#define DWSIZE                  (sizeof(uint32_t))
+struct mpbhdr {
+    uint32_t type;
+    uint32_t len;
+    uint8_t data[];
+};
 
 /* serialize access to the physical write */
 static DEFINE_SPINLOCK(microcode_update_lock);
@@ -66,10 +66,10 @@
     return 0;
 }
 
-static int microcode_fits(void *mc, int cpu)
+static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    struct microcode_header_amd *mc_header = mc;
+    struct microcode_header_amd *mc_header = mc_amd->mpb;
     unsigned int current_cpu_id;
     unsigned int equiv_cpu_id = 0x0;
     unsigned int i;
@@ -98,9 +98,9 @@
 
     if ( !equiv_cpu_id )
     {
-        printk(KERN_ERR "microcode: CPU%d cpu_id "
+        printk(KERN_INFO "microcode: CPU%d cpu_id "
                "not found in equivalent cpu table\n", cpu);
-        return -EINVAL;
+        return 0;
     }
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
@@ -112,14 +112,14 @@
     }
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
-        return -EINVAL;
+        return 0;
 
     printk(KERN_INFO "microcode: CPU%d found a matching microcode "
            "update with version 0x%x (current=0x%x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
 out:
-    return 0;
+    return 1;
 }
 
 static int apply_microcode(int cpu)
@@ -128,16 +128,21 @@
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     uint32_t rev, dummy;
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
+    struct microcode_header_amd *hdr;
 
     /* We should bind the task to the CPU */
     BUG_ON(raw_smp_processor_id() != cpu);
 
     if ( mc_amd == NULL )
-        return -EINVAL;
+       return -EINVAL;
+
+    hdr = mc_amd->mpb;
+    if ( hdr == NULL )
+       return -EINVAL;
 
     spin_lock_irqsave(&microcode_update_lock, flags);
 
-    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)&mc_amd->hdr.data_code);
+    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
     rdmsr(MSR_AMD_PATCHLEVEL, rev, dummy);
@@ -145,61 +150,67 @@
     spin_unlock_irqrestore(&microcode_update_lock, flags);
 
     /* check current patch id and patch's id for match */
-    if ( rev != mc_amd->hdr.patch_id )
+    if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
                "0x%x to 0x%x failed\n", cpu,
-               mc_amd->hdr.patch_id, rev);
+               hdr->patch_id, rev);
         return -EIO;
     }
 
     printk("microcode: CPU%d updated from revision "
            "0x%x to 0x%x \n",
-           cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
+           cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
 
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
-                                         size_t size, unsigned long *offset)
+static int get_next_ucode_from_buffer_amd(struct microcode_amd *mc_amd,
+                                         const void *buf, size_t bufsize,
+                                         unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
-    size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
+    const struct mpbhdr *mpbuf;
 
     off = *offset;
 
     /* No more data */
-    if ( off >= size )
+    if ( off >= bufsize )
         return 1;
 
-    if ( bufp[off] != UCODE_UCODE_TYPE )
+    mpbuf = (const struct mpbhdr *)&bufp[off];
+    if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
         printk(KERN_ERR "microcode: error! "
                "Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
+    printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n",
+           bufsize, mpbuf->len, off);
 
-    total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
-
-    printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
-           (unsigned long)size, total_size, off);
-
-    if ( (off + total_size) > size )
+    if ( (off + mpbuf->len) > bufsize )
     {
         printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
         return -EINVAL;
     }
 
-    memset(mc, 0, UCODE_MAX_SIZE);
-    memcpy(mc, (const void *)(&bufp[off + 8]), total_size);
+    if (mc_amd->mpb_size < mpbuf->len) {
+        if (mc_amd->mpb) {
+            xfree(mc_amd->mpb);
+            mc_amd->mpb_size = 0;
+        }
+        mc_amd->mpb = xmalloc_bytes(mpbuf->len);
+        if (mc_amd->mpb == NULL)
+            return -ENOMEM;
+        mc_amd->mpb_size = mpbuf->len;
+    }
+    memcpy(mc_amd->mpb, mpbuf->data, mpbuf->len);
 
-    *offset = off + total_size + 8;
+    *offset = off + mpbuf->len + 8;
 
     return 0;
 }
@@ -254,7 +265,7 @@
     int error = 0;
     int ret;
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    void *mc;
+    struct microcode_amd *mc_amd, *mc_old;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -275,8 +286,8 @@
         return -EINVAL;
     }
 
-    mc = xmalloc_bytes(UCODE_MAX_SIZE);
-    if ( mc == NULL )
+    mc_amd = xmalloc(struct microcode_amd);
+    if ( mc_amd == NULL )
     {
         printk(KERN_ERR "microcode: error! "
                "Can not allocate memory for microcode patch\n");
@@ -284,32 +295,37 @@
         goto out;
     }
 
+    mc_old = uci->mc.mc_amd;
     /* implicitely validates uci->mc.mc_valid */
-    uci->mc.mc_amd = mc;
+    uci->mc.mc_amd = mc_amd;
 
     /*
      * It's possible the data file has multiple matching ucode,
      * lets keep searching till the latest version
      */
-    while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
+    mc_amd->mpb = NULL;
+    mc_amd->mpb_size = 0;
+    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, size,
+                                                  &offset)) == 0)
     {
-        error = microcode_fits(mc, cpu);
-        if (error != 0)
+        error = microcode_fits(mc_amd, cpu);
+        if (error <= 0)
             continue;
 
         error = apply_microcode(cpu);
-        if (error == 0)
+        if (error == 0) {
+            error = 1;
             break;
+        }
     }
 
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if (error) {
-        xfree(mc);
-        mc = NULL;
+    if (error == 0) {
+        xfree(mc_old);
+        return 0;
     }
-    uci->mc.mc_amd = mc;
 
 out:
     xfree(equiv_cpu_table);
diff -r 5d372b8bccef -r d5b26918cd94 xen/include/asm-x86/microcode.h
--- a/xen/include/asm-x86/microcode.h	Sun Dec 18 14:51:04 2011 +0000
+++ b/xen/include/asm-x86/microcode.h	Sun Jan 15 22:08:54 2012 +0000
@@ -71,8 +71,8 @@
 } __attribute__((packed));
 
 struct microcode_amd {
-    struct microcode_header_amd hdr;
-    unsigned int mpb[0];
+    void *mpb;
+    size_t mpb_size;
 };
 
 struct cpu_signature {

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 16 17:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jan 2012 17:44: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.xensource.com>)
	id 1RmqbS-0002LH-JL; Mon, 16 Jan 2012 17:44:18 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RmqbQ-0002Kp-Qo
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 17:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1326735848!9309241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13980 invoked from network); 16 Jan 2012 17:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Jan 2012 17:44:09 -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 1RmqbI-0000tX-29
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 17:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RmqbH-0005J0-PT
	for xen-changelog@lists.xensource.com; Mon, 16 Jan 2012 17:44:07 +0000
Message-Id: <E1RmqbH-0005J0-PT@xenbits.xen.org>
Date: Mon, 16 Jan 2012 17:44:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/ucode: fix for AMD Fam15 CPUs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1326665334 0
# Node ID d5b26918cd94c1d4dbc931d9761ffd9e652ed3c0
# Parent  5d372b8bccefea17a57a887f5828a57ee6adf2b5
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Backport from xen-unstable changeset 24411:ca5f588bd203 to Xen 4.0
---


diff -r 5d372b8bccef -r d5b26918cd94 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Sun Dec 18 14:51:04 2011 +0000
+++ b/xen/arch/x86/microcode_amd.c	Sun Jan 15 22:08:54 2012 +0000
@@ -33,11 +33,11 @@
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
 #define UCODE_UCODE_TYPE           0x00000001
 
-#define UCODE_MAX_SIZE          (2048)
-#define DEFAULT_UCODE_DATASIZE  (896)
-#define MC_HEADER_SIZE          (sizeof(struct microcode_header_amd))
-#define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
-#define DWSIZE                  (sizeof(uint32_t))
+struct mpbhdr {
+    uint32_t type;
+    uint32_t len;
+    uint8_t data[];
+};
 
 /* serialize access to the physical write */
 static DEFINE_SPINLOCK(microcode_update_lock);
@@ -66,10 +66,10 @@
     return 0;
 }
 
-static int microcode_fits(void *mc, int cpu)
+static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    struct microcode_header_amd *mc_header = mc;
+    struct microcode_header_amd *mc_header = mc_amd->mpb;
     unsigned int current_cpu_id;
     unsigned int equiv_cpu_id = 0x0;
     unsigned int i;
@@ -98,9 +98,9 @@
 
     if ( !equiv_cpu_id )
     {
-        printk(KERN_ERR "microcode: CPU%d cpu_id "
+        printk(KERN_INFO "microcode: CPU%d cpu_id "
                "not found in equivalent cpu table\n", cpu);
-        return -EINVAL;
+        return 0;
     }
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
@@ -112,14 +112,14 @@
     }
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
-        return -EINVAL;
+        return 0;
 
     printk(KERN_INFO "microcode: CPU%d found a matching microcode "
            "update with version 0x%x (current=0x%x)\n",
            cpu, mc_header->patch_id, uci->cpu_sig.rev);
 
 out:
-    return 0;
+    return 1;
 }
 
 static int apply_microcode(int cpu)
@@ -128,16 +128,21 @@
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     uint32_t rev, dummy;
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
+    struct microcode_header_amd *hdr;
 
     /* We should bind the task to the CPU */
     BUG_ON(raw_smp_processor_id() != cpu);
 
     if ( mc_amd == NULL )
-        return -EINVAL;
+       return -EINVAL;
+
+    hdr = mc_amd->mpb;
+    if ( hdr == NULL )
+       return -EINVAL;
 
     spin_lock_irqsave(&microcode_update_lock, flags);
 
-    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)&mc_amd->hdr.data_code);
+    wrmsrl(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
     rdmsr(MSR_AMD_PATCHLEVEL, rev, dummy);
@@ -145,61 +150,67 @@
     spin_unlock_irqrestore(&microcode_update_lock, flags);
 
     /* check current patch id and patch's id for match */
-    if ( rev != mc_amd->hdr.patch_id )
+    if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
                "0x%x to 0x%x failed\n", cpu,
-               mc_amd->hdr.patch_id, rev);
+               hdr->patch_id, rev);
         return -EIO;
     }
 
     printk("microcode: CPU%d updated from revision "
            "0x%x to 0x%x \n",
-           cpu, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
+           cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
 
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
-                                         size_t size, unsigned long *offset)
+static int get_next_ucode_from_buffer_amd(struct microcode_amd *mc_amd,
+                                         const void *buf, size_t bufsize,
+                                         unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
-    size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
+    const struct mpbhdr *mpbuf;
 
     off = *offset;
 
     /* No more data */
-    if ( off >= size )
+    if ( off >= bufsize )
         return 1;
 
-    if ( bufp[off] != UCODE_UCODE_TYPE )
+    mpbuf = (const struct mpbhdr *)&bufp[off];
+    if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
         printk(KERN_ERR "microcode: error! "
                "Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
+    printk(KERN_INFO "microcode: size %lu, total_size %u, offset %ld\n",
+           bufsize, mpbuf->len, off);
 
-    total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
-
-    printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
-           (unsigned long)size, total_size, off);
-
-    if ( (off + total_size) > size )
+    if ( (off + mpbuf->len) > bufsize )
     {
         printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
         return -EINVAL;
     }
 
-    memset(mc, 0, UCODE_MAX_SIZE);
-    memcpy(mc, (const void *)(&bufp[off + 8]), total_size);
+    if (mc_amd->mpb_size < mpbuf->len) {
+        if (mc_amd->mpb) {
+            xfree(mc_amd->mpb);
+            mc_amd->mpb_size = 0;
+        }
+        mc_amd->mpb = xmalloc_bytes(mpbuf->len);
+        if (mc_amd->mpb == NULL)
+            return -ENOMEM;
+        mc_amd->mpb_size = mpbuf->len;
+    }
+    memcpy(mc_amd->mpb, mpbuf->data, mpbuf->len);
 
-    *offset = off + total_size + 8;
+    *offset = off + mpbuf->len + 8;
 
     return 0;
 }
@@ -254,7 +265,7 @@
     int error = 0;
     int ret;
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
-    void *mc;
+    struct microcode_amd *mc_amd, *mc_old;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -275,8 +286,8 @@
         return -EINVAL;
     }
 
-    mc = xmalloc_bytes(UCODE_MAX_SIZE);
-    if ( mc == NULL )
+    mc_amd = xmalloc(struct microcode_amd);
+    if ( mc_amd == NULL )
     {
         printk(KERN_ERR "microcode: error! "
                "Can not allocate memory for microcode patch\n");
@@ -284,32 +295,37 @@
         goto out;
     }
 
+    mc_old = uci->mc.mc_amd;
     /* implicitely validates uci->mc.mc_valid */
-    uci->mc.mc_amd = mc;
+    uci->mc.mc_amd = mc_amd;
 
     /*
      * It's possible the data file has multiple matching ucode,
      * lets keep searching till the latest version
      */
-    while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
+    mc_amd->mpb = NULL;
+    mc_amd->mpb_size = 0;
+    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, size,
+                                                  &offset)) == 0)
     {
-        error = microcode_fits(mc, cpu);
-        if (error != 0)
+        error = microcode_fits(mc_amd, cpu);
+        if (error <= 0)
             continue;
 
         error = apply_microcode(cpu);
-        if (error == 0)
+        if (error == 0) {
+            error = 1;
             break;
+        }
     }
 
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if (error) {
-        xfree(mc);
-        mc = NULL;
+    if (error == 0) {
+        xfree(mc_old);
+        return 0;
     }
-    uci->mc.mc_amd = mc;
 
 out:
     xfree(equiv_cpu_table);
diff -r 5d372b8bccef -r d5b26918cd94 xen/include/asm-x86/microcode.h
--- a/xen/include/asm-x86/microcode.h	Sun Dec 18 14:51:04 2011 +0000
+++ b/xen/include/asm-x86/microcode.h	Sun Jan 15 22:08:54 2012 +0000
@@ -71,8 +71,8 @@
 } __attribute__((packed));
 
 struct microcode_amd {
-    struct microcode_header_amd hdr;
-    unsigned int mpb[0];
+    void *mpb;
+    size_t mpb_size;
 };
 
 struct cpu_signature {

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01: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.xensource.com>)
	id 1RnKk6-0002Pn-T5; Wed, 18 Jan 2012 01:55:14 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk5-0002Ph-Pg
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1326851654!57338462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21572 invoked from network); 18 Jan 2012 01:54:15 -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;
	18 Jan 2012 01:54:15 -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 1RnKk2-00085B-V3
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk2-0002Qi-GZ
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:10 +0000
Message-Id: <E1RnKk2-0002Qi-GZ@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: Remove timeouts from
	INIT-SIPI-SIPI sequence when using x2apic.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <Tim.Deegan@citrix.com>
# Date 1326799837 0
# Node ID 2fb706161c099593eba7050c5262f7da3dd8b6f3
# Parent  e29b7691fefc2e5840d80d49f78b64b6d7019f9b
x86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic.

Some of the timeouts are pointless since they're waiting for the ICR
to ack the IPI delivery and that doesn't happen on x2apic.
The others should be benign (and are suggested in the SDM) but
removing them makes AP bringup much more reliable on some test boxes.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23724:b3434f24b082
xen-unstable date:        Tue Jul 19 14:13:01 2011 +0100

X86: Add a delay between INIT & SIPIs for tboot AP bring-up in X2APIC case

Without this delay, Xen could not bring APs up while working with
TXT/tboot, because tboot needs some time in APs to handle INIT before
becoming ready for receiving SIPIs (this delay was removed as part of
c/s 23724 by Tim Deegan).

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24447:a7b2610b8e5c
xen-unstable date:        Thu Dec 29 10:07:54 2011 +0000
---


diff -r e29b7691fefc -r 2fb706161c09 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Sun Jan 15 22:08:13 2012 +0000
+++ b/xen/arch/x86/smpboot.c	Tue Jan 17 11:30:37 2012 +0000
@@ -42,6 +42,7 @@
 #include <asm/msr.h>
 #include <asm/mtrr.h>
 #include <asm/time.h>
+#include <asm/tboot.h>
 #include <mach_apic.h>
 #include <mach_wakecpu.h>
 #include <smpboot_hooks.h>
@@ -445,29 +446,42 @@
     apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT,
                    phys_apicid);
 
-    Dprintk("Waiting for send to finish...\n");
-    timeout = 0;
-    do {
-        Dprintk("+");
-        udelay(100);
-        if ( !x2apic_enabled )
+    if ( !x2apic_enabled )
+    {
+        Dprintk("Waiting for send to finish...\n");
+        timeout = 0;
+        do {
+            Dprintk("+");
+            udelay(100);
             send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
-    } while ( send_status && (timeout++ < 1000) );
+        } while ( send_status && (timeout++ < 1000) );
 
-    mdelay(10);
+        mdelay(10);
 
-    Dprintk("Deasserting INIT.\n");
+        Dprintk("Deasserting INIT.\n");
 
-    apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid);
+        apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid);
 
-    Dprintk("Waiting for send to finish...\n");
-    timeout = 0;
-    do {
-        Dprintk("+");
-        udelay(100);
-        if ( !x2apic_enabled )
+        Dprintk("Waiting for send to finish...\n");
+        timeout = 0;
+        do {
+            Dprintk("+");
+            udelay(100);
             send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
-    } while ( send_status && (timeout++ < 1000) );
+        } while ( send_status && (timeout++ < 1000) );
+    }
+    else if ( tboot_in_measured_env() )
+    {
+        /*
+         * With tboot AP is actually spinning in a mini-guest before 
+         * receiving INIT. Upon receiving INIT ipi, AP need time to VMExit, 
+         * update VMCS to tracking SIPIs and VMResume.
+         *
+         * While AP is in root mode handling the INIT the CPU will drop
+         * any SIPIs
+         */
+        udelay(10);
+    }
 
     /*
      * Should we send STARTUP IPIs ?
@@ -496,22 +510,24 @@
          */
         apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12), phys_apicid);
 
-        /* Give the other CPU some time to accept the IPI. */
-        udelay(300);
+        if ( !x2apic_enabled )
+        {
+            /* Give the other CPU some time to accept the IPI. */
+            udelay(300);
 
-        Dprintk("Startup point 1.\n");
+            Dprintk("Startup point 1.\n");
 
-        Dprintk("Waiting for send to finish...\n");
-        timeout = 0;
-        do {
-            Dprintk("+");
-            udelay(100);
-            if ( !x2apic_enabled )
-            send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
-        } while ( send_status && (timeout++ < 1000) );
+            Dprintk("Waiting for send to finish...\n");
+            timeout = 0;
+            do {
+                Dprintk("+");
+                udelay(100);
+                send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
+            } while ( send_status && (timeout++ < 1000) );
 
-        /* Give the other CPU some time to accept the IPI. */
-        udelay(200);
+            /* Give the other CPU some time to accept the IPI. */
+            udelay(200);
+        }
 
         /* Due to the Pentium erratum 3AP. */
         if ( maxlvt > 3 )

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01: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.xensource.com>)
	id 1RnKk6-0002Pn-T5; Wed, 18 Jan 2012 01:55:14 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk5-0002Ph-Pg
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1326851654!57338462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21572 invoked from network); 18 Jan 2012 01:54:15 -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;
	18 Jan 2012 01:54:15 -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 1RnKk2-00085B-V3
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk2-0002Qi-GZ
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:10 +0000
Message-Id: <E1RnKk2-0002Qi-GZ@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: Remove timeouts from
	INIT-SIPI-SIPI sequence when using x2apic.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <Tim.Deegan@citrix.com>
# Date 1326799837 0
# Node ID 2fb706161c099593eba7050c5262f7da3dd8b6f3
# Parent  e29b7691fefc2e5840d80d49f78b64b6d7019f9b
x86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic.

Some of the timeouts are pointless since they're waiting for the ICR
to ack the IPI delivery and that doesn't happen on x2apic.
The others should be benign (and are suggested in the SDM) but
removing them makes AP bringup much more reliable on some test boxes.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23724:b3434f24b082
xen-unstable date:        Tue Jul 19 14:13:01 2011 +0100

X86: Add a delay between INIT & SIPIs for tboot AP bring-up in X2APIC case

Without this delay, Xen could not bring APs up while working with
TXT/tboot, because tboot needs some time in APs to handle INIT before
becoming ready for receiving SIPIs (this delay was removed as part of
c/s 23724 by Tim Deegan).

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24447:a7b2610b8e5c
xen-unstable date:        Thu Dec 29 10:07:54 2011 +0000
---


diff -r e29b7691fefc -r 2fb706161c09 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Sun Jan 15 22:08:13 2012 +0000
+++ b/xen/arch/x86/smpboot.c	Tue Jan 17 11:30:37 2012 +0000
@@ -42,6 +42,7 @@
 #include <asm/msr.h>
 #include <asm/mtrr.h>
 #include <asm/time.h>
+#include <asm/tboot.h>
 #include <mach_apic.h>
 #include <mach_wakecpu.h>
 #include <smpboot_hooks.h>
@@ -445,29 +446,42 @@
     apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT,
                    phys_apicid);
 
-    Dprintk("Waiting for send to finish...\n");
-    timeout = 0;
-    do {
-        Dprintk("+");
-        udelay(100);
-        if ( !x2apic_enabled )
+    if ( !x2apic_enabled )
+    {
+        Dprintk("Waiting for send to finish...\n");
+        timeout = 0;
+        do {
+            Dprintk("+");
+            udelay(100);
             send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
-    } while ( send_status && (timeout++ < 1000) );
+        } while ( send_status && (timeout++ < 1000) );
 
-    mdelay(10);
+        mdelay(10);
 
-    Dprintk("Deasserting INIT.\n");
+        Dprintk("Deasserting INIT.\n");
 
-    apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid);
+        apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid);
 
-    Dprintk("Waiting for send to finish...\n");
-    timeout = 0;
-    do {
-        Dprintk("+");
-        udelay(100);
-        if ( !x2apic_enabled )
+        Dprintk("Waiting for send to finish...\n");
+        timeout = 0;
+        do {
+            Dprintk("+");
+            udelay(100);
             send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
-    } while ( send_status && (timeout++ < 1000) );
+        } while ( send_status && (timeout++ < 1000) );
+    }
+    else if ( tboot_in_measured_env() )
+    {
+        /*
+         * With tboot AP is actually spinning in a mini-guest before 
+         * receiving INIT. Upon receiving INIT ipi, AP need time to VMExit, 
+         * update VMCS to tracking SIPIs and VMResume.
+         *
+         * While AP is in root mode handling the INIT the CPU will drop
+         * any SIPIs
+         */
+        udelay(10);
+    }
 
     /*
      * Should we send STARTUP IPIs ?
@@ -496,22 +510,24 @@
          */
         apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12), phys_apicid);
 
-        /* Give the other CPU some time to accept the IPI. */
-        udelay(300);
+        if ( !x2apic_enabled )
+        {
+            /* Give the other CPU some time to accept the IPI. */
+            udelay(300);
 
-        Dprintk("Startup point 1.\n");
+            Dprintk("Startup point 1.\n");
 
-        Dprintk("Waiting for send to finish...\n");
-        timeout = 0;
-        do {
-            Dprintk("+");
-            udelay(100);
-            if ( !x2apic_enabled )
-            send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
-        } while ( send_status && (timeout++ < 1000) );
+            Dprintk("Waiting for send to finish...\n");
+            timeout = 0;
+            do {
+                Dprintk("+");
+                udelay(100);
+                send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
+            } while ( send_status && (timeout++ < 1000) );
 
-        /* Give the other CPU some time to accept the IPI. */
-        udelay(200);
+            /* Give the other CPU some time to accept the IPI. */
+            udelay(200);
+        }
 
         /* Due to the Pentium erratum 3AP. */
         if ( maxlvt > 3 )

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01:55: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.xensource.com>)
	id 1RnKkD-0002QQ-Vs; Wed, 18 Jan 2012 01:55:21 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKkC-0002Ps-Gd
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1326851712!11263886!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21499 invoked from network); 18 Jan 2012 01:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 01:55:13 -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 1RnKk3-00085E-R5
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk3-0002RG-D1
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:11 +0000
Message-Id: <E1RnKk3-0002RG-D1@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/vIRQ: IRR and TMR race
	condition bug fix
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Yongan Liu <Liuyongan@huawei.com>
# Date 1326799888 0
# Node ID c358c4213d23212d39a0b95501d843580a66435a
# Parent  2fb706161c099593eba7050c5262f7da3dd8b6f3
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24453:02b92d035f64
xen-unstable date:        Thu Jan 05 09:29:59 2012 +0100
---


diff -r 2fb706161c09 -r c358c4213d23 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Tue Jan 17 11:30:37 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Tue Jan 17 11:31:28 2012 +0000
@@ -142,14 +142,11 @@
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
-    int ret;
-
-    ret = !vlapic_test_and_set_irr(vec, vlapic);
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return ret;
+    return !vlapic_test_and_set_irr(vec, vlapic);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01:55: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.xensource.com>)
	id 1RnKkD-0002QQ-Vs; Wed, 18 Jan 2012 01:55:21 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKkC-0002Ps-Gd
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1326851712!11263886!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21499 invoked from network); 18 Jan 2012 01:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 01:55:13 -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 1RnKk3-00085E-R5
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk3-0002RG-D1
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:11 +0000
Message-Id: <E1RnKk3-0002RG-D1@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/vIRQ: IRR and TMR race
	condition bug fix
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Yongan Liu <Liuyongan@huawei.com>
# Date 1326799888 0
# Node ID c358c4213d23212d39a0b95501d843580a66435a
# Parent  2fb706161c099593eba7050c5262f7da3dd8b6f3
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24453:02b92d035f64
xen-unstable date:        Thu Jan 05 09:29:59 2012 +0100
---


diff -r 2fb706161c09 -r c358c4213d23 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Tue Jan 17 11:30:37 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Tue Jan 17 11:31:28 2012 +0000
@@ -142,14 +142,11 @@
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
-    int ret;
-
-    ret = !vlapic_test_and_set_irr(vec, vlapic);
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return ret;
+    return !vlapic_test_and_set_irr(vec, vlapic);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01:55: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.xensource.com>)
	id 1RnKkE-0002QW-21; Wed, 18 Jan 2012 01:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKkC-0002Pt-MY
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1326851713!12818527!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28313 invoked from network); 18 Jan 2012 01:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 01:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-00085H-Lj
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-0002Rl-8A
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Message-Id: <E1RnKk4-0002Rl-8A@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: emulate lea with two
	register operands correctly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1326799924 0
# Node ID a5a9479b07ccd31b342e6f222903e1686f5979d3
# Parent  c358c4213d23212d39a0b95501d843580a66435a
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24456:03781de56c31
xen-unstable date:        Thu Jan 05 15:47:16 2012 +0000
---


diff -r c358c4213d23 -r a5a9479b07cc xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:31:28 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:32:04 2012 +0000
@@ -2056,6 +2056,7 @@
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01:55: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.xensource.com>)
	id 1RnKkE-0002QW-21; Wed, 18 Jan 2012 01:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKkC-0002Pt-MY
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1326851713!12818527!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28313 invoked from network); 18 Jan 2012 01:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 01:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-00085H-Lj
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-0002Rl-8A
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Message-Id: <E1RnKk4-0002Rl-8A@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: emulate lea with two
	register operands correctly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1326799924 0
# Node ID a5a9479b07ccd31b342e6f222903e1686f5979d3
# Parent  c358c4213d23212d39a0b95501d843580a66435a
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24456:03781de56c31
xen-unstable date:        Thu Jan 05 15:47:16 2012 +0000
---


diff -r c358c4213d23 -r a5a9479b07cc xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:31:28 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:32:04 2012 +0000
@@ -2056,6 +2056,7 @@
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01:55: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.xensource.com>)
	id 1RnKkF-0002Qu-4r; Wed, 18 Jan 2012 01:55:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKkD-0002Pu-1l
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1326851713!11483345!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23970 invoked from network); 18 Jan 2012 01:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 01:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-00085J-Ti
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-0002SE-PC
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Message-Id: <E1RnKk4-0002SE-PC@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] VMX: print Pause Loop Exiting
	disabled message just once
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326799966 0
# Node ID 27e959546916b9fab304ba3885d51c79442a27b3
# Parent  a5a9479b07ccd31b342e6f222903e1686f5979d3
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24465:5b2676ac1321
xen-unstable date:        Mon Jan 09 16:01:44 2012 +0100
---


diff -r a5a9479b07cc -r 27e959546916 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:32:04 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:32:46 2012 +0000
@@ -246,7 +246,8 @@
     if ( (_vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING) &&
           ple_gap == 0 )
     {
-        printk("Disable Pause-Loop Exiting.\n");
+        if ( !vmx_pin_based_exec_control )
+            printk(XENLOG_INFO "Disable Pause-Loop Exiting.\n");
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 01:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 01:55: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.xensource.com>)
	id 1RnKkF-0002Qu-4r; Wed, 18 Jan 2012 01:55:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKkD-0002Pu-1l
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1326851713!11483345!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23970 invoked from network); 18 Jan 2012 01:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 01:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-00085J-Ti
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnKk4-0002SE-PC
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 01:55:12 +0000
Message-Id: <E1RnKk4-0002SE-PC@xenbits.xen.org>
Date: Wed, 18 Jan 2012 01:55:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] VMX: print Pause Loop Exiting
	disabled message just once
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326799966 0
# Node ID 27e959546916b9fab304ba3885d51c79442a27b3
# Parent  a5a9479b07ccd31b342e6f222903e1686f5979d3
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24465:5b2676ac1321
xen-unstable date:        Mon Jan 09 16:01:44 2012 +0100
---


diff -r a5a9479b07cc -r 27e959546916 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:32:04 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:32:46 2012 +0000
@@ -246,7 +246,8 @@
     if ( (_vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING) &&
           ple_gap == 0 )
     {
-        printk("Disable Pause-Loop Exiting.\n");
+        if ( !vmx_pin_based_exec_control )
+            printk(XENLOG_INFO "Disable Pause-Loop Exiting.\n");
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 16:33:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 16:33: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.xensource.com>)
	id 1RnYRp-0006fg-I1; Wed, 18 Jan 2012 16:33:17 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRo-0006f9-3r
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1326904389!8937795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19305 invoked from network); 18 Jan 2012 16:33:10 -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;
	18 Jan 2012 16:33:10 -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 1RnYRg-0002S7-Kh
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRg-0006u1-52
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:08 +0000
Message-Id: <E1RnYRg-0006u1-52@xenbits.xen.org>
Date: Wed, 18 Jan 2012 16:33:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/vIRQ: IRR and TMR race
	condition bug fix
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Yongan Liu <Liuyongan@huawei.com>
# Date 1326800083 0
# Node ID 3f7117070ba1ed15e2a660dcc79e1a2bfe8e82fb
# Parent  d5b26918cd94c1d4dbc931d9761ffd9e652ed3c0
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24453:02b92d035f64
xen-unstable date:        Thu Jan 05 09:29:59 2012 +0100
---


diff -r d5b26918cd94 -r 3f7117070ba1 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Sun Jan 15 22:08:54 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Tue Jan 17 11:34:43 2012 +0000
@@ -131,14 +131,11 @@
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
-    int ret;
-
-    ret = !vlapic_test_and_set_irr(vec, vlapic);
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return ret;
+    return !vlapic_test_and_set_irr(vec, vlapic);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 16:33:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 16:33: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.xensource.com>)
	id 1RnYRp-0006fg-I1; Wed, 18 Jan 2012 16:33:17 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRo-0006f9-3r
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1326904389!8937795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19305 invoked from network); 18 Jan 2012 16:33:10 -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;
	18 Jan 2012 16:33:10 -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 1RnYRg-0002S7-Kh
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRg-0006u1-52
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:08 +0000
Message-Id: <E1RnYRg-0006u1-52@xenbits.xen.org>
Date: Wed, 18 Jan 2012 16:33:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/vIRQ: IRR and TMR race
	condition bug fix
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Yongan Liu <Liuyongan@huawei.com>
# Date 1326800083 0
# Node ID 3f7117070ba1ed15e2a660dcc79e1a2bfe8e82fb
# Parent  d5b26918cd94c1d4dbc931d9761ffd9e652ed3c0
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24453:02b92d035f64
xen-unstable date:        Thu Jan 05 09:29:59 2012 +0100
---


diff -r d5b26918cd94 -r 3f7117070ba1 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Sun Jan 15 22:08:54 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Tue Jan 17 11:34:43 2012 +0000
@@ -131,14 +131,11 @@
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
-    int ret;
-
-    ret = !vlapic_test_and_set_irr(vec, vlapic);
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return ret;
+    return !vlapic_test_and_set_irr(vec, vlapic);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 16:33:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 16:33: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.xensource.com>)
	id 1RnYRq-0006fv-Mt; Wed, 18 Jan 2012 16:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRo-0006fC-L0
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1326904389!11440599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24888 invoked from network); 18 Jan 2012 16:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 16:33:10 -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 1RnYRh-0002SD-G2
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRh-0006uu-6t
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:09 +0000
Message-Id: <E1RnYRh-0006uu-6t@xenbits.xen.org>
Date: Wed, 18 Jan 2012 16:33:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] VMX: print Pause Loop Exiting
	disabled message just once
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326800130 0
# Node ID 271e30252c16d7e07f8e82301c4a776e35712a6c
# Parent  75007e524cd8e8065a179b6cc7e652d0a4cf1eec
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24465:5b2676ac1321
xen-unstable date:        Mon Jan 09 16:01:44 2012 +0100
---


diff -r 75007e524cd8 -r 271e30252c16 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:35:03 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:35:30 2012 +0000
@@ -226,7 +226,8 @@
     if ( (_vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING) &&
           ple_gap == 0 )
     {
-        printk("Disable Pause-Loop Exiting.\n");
+        if ( !vmx_pin_based_exec_control )
+            printk(XENLOG_INFO "Disable Pause-Loop Exiting.\n");
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 16:33:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 16:33: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.xensource.com>)
	id 1RnYRq-0006fv-Mt; Wed, 18 Jan 2012 16:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRo-0006fC-L0
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1326904389!11440599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24888 invoked from network); 18 Jan 2012 16:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 16:33:10 -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 1RnYRh-0002SD-G2
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRh-0006uu-6t
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:09 +0000
Message-Id: <E1RnYRh-0006uu-6t@xenbits.xen.org>
Date: Wed, 18 Jan 2012 16:33:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] VMX: print Pause Loop Exiting
	disabled message just once
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326800130 0
# Node ID 271e30252c16d7e07f8e82301c4a776e35712a6c
# Parent  75007e524cd8e8065a179b6cc7e652d0a4cf1eec
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24465:5b2676ac1321
xen-unstable date:        Mon Jan 09 16:01:44 2012 +0100
---


diff -r 75007e524cd8 -r 271e30252c16 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:35:03 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Tue Jan 17 11:35:30 2012 +0000
@@ -226,7 +226,8 @@
     if ( (_vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING) &&
           ple_gap == 0 )
     {
-        printk("Disable Pause-Loop Exiting.\n");
+        if ( !vmx_pin_based_exec_control )
+            printk(XENLOG_INFO "Disable Pause-Loop Exiting.\n");
         _vmx_secondary_exec_control &= ~ SECONDARY_EXEC_PAUSE_LOOP_EXITING;
     }
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 16:33:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 16:33: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.xensource.com>)
	id 1RnYRq-0006fq-Kb; Wed, 18 Jan 2012 16:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRo-0006fB-Ev
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1326904389!4117166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8180 invoked from network); 18 Jan 2012 16:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 16:33:10 -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 1RnYRh-0002S9-1B
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRg-0006uU-Nr
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:08 +0000
Message-Id: <E1RnYRg-0006uU-Nr@xenbits.xen.org>
Date: Wed, 18 Jan 2012 16:33:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86: emulate lea with two
	register operands correctly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1326800103 0
# Node ID 75007e524cd8e8065a179b6cc7e652d0a4cf1eec
# Parent  3f7117070ba1ed15e2a660dcc79e1a2bfe8e82fb
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24456:03781de56c31
xen-unstable date:        Thu Jan 05 15:47:16 2012 +0000
---


diff -r 3f7117070ba1 -r 75007e524cd8 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:34:43 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:35:03 2012 +0000
@@ -2056,6 +2056,7 @@
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 18 16:33:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jan 2012 16:33: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.xensource.com>)
	id 1RnYRq-0006fq-Kb; Wed, 18 Jan 2012 16:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRo-0006fB-Ev
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1326904389!4117166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8180 invoked from network); 18 Jan 2012 16:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jan 2012 16:33:10 -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 1RnYRh-0002S9-1B
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnYRg-0006uU-Nr
	for xen-changelog@lists.xensource.com; Wed, 18 Jan 2012 16:33:08 +0000
Message-Id: <E1RnYRg-0006uU-Nr@xenbits.xen.org>
Date: Wed, 18 Jan 2012 16:33:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86: emulate lea with two
	register operands correctly
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1326800103 0
# Node ID 75007e524cd8e8065a179b6cc7e652d0a4cf1eec
# Parent  3f7117070ba1ed15e2a660dcc79e1a2bfe8e82fb
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24456:03781de56c31
xen-unstable date:        Thu Jan 05 15:47:16 2012 +0000
---


diff -r 3f7117070ba1 -r 75007e524cd8 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:34:43 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Jan 17 11:35:03 2012 +0000
@@ -2056,6 +2056,7 @@
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 12:33:14 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 12: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.xensource.com>)
	id 1RnrAy-0004v5-FE; Thu, 19 Jan 2012 12:33:08 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAw-0004ur-OB
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1326976349!49074920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30999 invoked from network); 19 Jan 2012 12:32:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 12:32:30 -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 1RnrAu-0000ag-Cm
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAu-0005UH-5p
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Message-Id: <E1RnrAu-0005UH-5p@xenbits.xen.org>
Date: Thu, 19 Jan 2012 12:33: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] gntdev: remove bogus and broken
	try_module_get()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326975813 -3600
# Node ID 730ae04c66c27ae888746cb9be1d93fa14399496
# Parent  c3d7beacd036903e397da7cbbabbebcd59f56650
gntdev: remove bogus and broken try_module_get()

Its return value wasn't checked, it wasn't undone in the error path,
and it was redundnant (the caller being responsible for doing this).

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


diff -r c3d7beacd036 -r 730ae04c66c2 drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c	Mon Jan 09 10:54:20 2012 +0100
+++ b/drivers/xen/gntdev/gntdev.c	Thu Jan 19 13:23:33 2012 +0100
@@ -427,8 +427,6 @@
 {
 	gntdev_file_private_data_t *private_data;
 
-	try_module_get(THIS_MODULE);
-
 	/* Allocate space for the per-instance private data. */
 	private_data = kmalloc(sizeof(*private_data), GFP_KERNEL);
 	if (!private_data)
@@ -467,7 +465,6 @@
 			kfree(private_data->free_list);
 		kfree(private_data);
 	}
-	module_put(THIS_MODULE);
 	return 0;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 12:33:14 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 12: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.xensource.com>)
	id 1RnrAy-0004v5-FE; Thu, 19 Jan 2012 12:33:08 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAw-0004ur-OB
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1326976349!49074920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30999 invoked from network); 19 Jan 2012 12:32:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 12:32:30 -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 1RnrAu-0000ag-Cm
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAu-0005UH-5p
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Message-Id: <E1RnrAu-0005UH-5p@xenbits.xen.org>
Date: Thu, 19 Jan 2012 12:33: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] gntdev: remove bogus and broken
	try_module_get()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326975813 -3600
# Node ID 730ae04c66c27ae888746cb9be1d93fa14399496
# Parent  c3d7beacd036903e397da7cbbabbebcd59f56650
gntdev: remove bogus and broken try_module_get()

Its return value wasn't checked, it wasn't undone in the error path,
and it was redundnant (the caller being responsible for doing this).

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


diff -r c3d7beacd036 -r 730ae04c66c2 drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c	Mon Jan 09 10:54:20 2012 +0100
+++ b/drivers/xen/gntdev/gntdev.c	Thu Jan 19 13:23:33 2012 +0100
@@ -427,8 +427,6 @@
 {
 	gntdev_file_private_data_t *private_data;
 
-	try_module_get(THIS_MODULE);
-
 	/* Allocate space for the per-instance private data. */
 	private_data = kmalloc(sizeof(*private_data), GFP_KERNEL);
 	if (!private_data)
@@ -467,7 +465,6 @@
 			kfree(private_data->free_list);
 		kfree(private_data);
 	}
-	module_put(THIS_MODULE);
 	return 0;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 12:33:16 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 12:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RnrB1-0004vm-I2; Thu, 19 Jan 2012 12:33:11 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrB0-0004us-1t
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1326976333!53226171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 706 invoked from network); 19 Jan 2012 12:32:14 -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 Jan 2012 12:32:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAu-0000aj-Nx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAu-0005Ui-JW
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Message-Id: <E1RnrAu-0005Ui-JW@xenbits.xen.org>
Date: Thu, 19 Jan 2012 12:33:04 +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] i386: don't select X86_UP_{,
	IO}APIC
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326975863 -3600
# Node ID 348f3f385b3bfbd5fe9d5e2acc30481573c5d1fa
# Parent  730ae04c66c27ae888746cb9be1d93fa14399496
i386: don't select X86_UP_{,IO}APIC

This was introduced while converting the Linux tree to sub-arch layout
(8706:fd9b2c1bb577), albeit that change was completely unrelated to the
subject of that c/s, and not explained either.

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


diff -r 730ae04c66c2 -r 348f3f385b3b arch/i386/Kconfig
--- a/arch/i386/Kconfig	Thu Jan 19 13:23:33 2012 +0100
+++ b/arch/i386/Kconfig	Thu Jan 19 13:24:23 2012 +0100
@@ -108,8 +108,6 @@
 	bool "Xen-compatible"
 	select XEN
 	select X86_PAE
-	select X86_UP_APIC if !SMP && XEN_PRIVILEGED_GUEST
-	select X86_UP_IOAPIC if !SMP && XEN_PRIVILEGED_GUEST
 	select SWIOTLB
 	help
 	  Choose this option if you plan to run this kernel on top of the

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 12:33:16 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 12:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RnrB1-0004vm-I2; Thu, 19 Jan 2012 12:33:11 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrB0-0004us-1t
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1326976333!53226171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 706 invoked from network); 19 Jan 2012 12:32:14 -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 Jan 2012 12:32:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAu-0000aj-Nx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnrAu-0005Ui-JW
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 12:33:04 +0000
Message-Id: <E1RnrAu-0005Ui-JW@xenbits.xen.org>
Date: Thu, 19 Jan 2012 12:33:04 +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] i386: don't select X86_UP_{,
	IO}APIC
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326975863 -3600
# Node ID 348f3f385b3bfbd5fe9d5e2acc30481573c5d1fa
# Parent  730ae04c66c27ae888746cb9be1d93fa14399496
i386: don't select X86_UP_{,IO}APIC

This was introduced while converting the Linux tree to sub-arch layout
(8706:fd9b2c1bb577), albeit that change was completely unrelated to the
subject of that c/s, and not explained either.

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


diff -r 730ae04c66c2 -r 348f3f385b3b arch/i386/Kconfig
--- a/arch/i386/Kconfig	Thu Jan 19 13:23:33 2012 +0100
+++ b/arch/i386/Kconfig	Thu Jan 19 13:24:23 2012 +0100
@@ -108,8 +108,6 @@
 	bool "Xen-compatible"
 	select XEN
 	select X86_PAE
-	select X86_UP_APIC if !SMP && XEN_PRIVILEGED_GUEST
-	select X86_UP_IOAPIC if !SMP && XEN_PRIVILEGED_GUEST
 	select SWIOTLB
 	help
 	  Choose this option if you plan to run this kernel on top of the

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx1-0000YH-V7; Thu, 19 Jan 2012 21:55:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000XX-BM
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327009986!49302970!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11032 invoked from network); 19 Jan 2012 21:53:07 -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;
	19 Jan 2012 21:53:07 -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 1Rnzwx-0007QC-M6
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwx-0000cT-L1
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Message-Id: <E1Rnzwx-0000cT-L1@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xl.pod.1: introduction to FLASK
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1326211986 0
# Node ID 3a79842d4845f55214042edc4885519258fdb335
# Parent  ef99b8571a6fe4e53fb9df4da2833f8f5a5b4ec7
docs: xl.pod.1: introduction to FLASK

Add a simple introduction to FLASK to the xl man page, at the beginning
of the FLASK chapter. Link to the xsm-flask.txt document.
Currently FLASK, TMEM and PCI PASS-THROUGH are defined as =head2 so they
look like sub-chapters of VIRTUAL DEVICE COMMANDS. Make them =head1.

Based on a text written by Daniel De Graaf.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ef99b8571a6f -r 3a79842d4845 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Jan 05 19:40:40 2012 +0100
+++ b/docs/man/xl.pod.1	Tue Jan 10 16:13:06 2012 +0000
@@ -906,7 +906,7 @@
 
 =back
 
-=head2 PCI PASS-THROUGH
+=head1 PCI PASS-THROUGH
 
 =over 4
 
@@ -929,7 +929,7 @@
 
 =back
 
-=head2 TMEM
+=head1 TMEM
 
 =over 4
 
@@ -995,7 +995,20 @@
 
 =back
 
-=head2 FLASK
+=head1 FLASK
+
+B<FLASK> is a security framework that defines a mandatory access control policy
+providing fine-grained controls over Xen domains, allowing the policy writer
+to define what interactions between domains, devices, and the hypervisor are
+permitted. Some example of what you can do using XSM/FLASK:
+ - Prevent two domains from communicating via event channels or grants
+ - Control which domains can use device passthrough (and which devices)
+ - Restrict or audit operations performed by privileged domains
+ - Prevent a privileged domain from arbitrarily mapping pages from other
+   domains.
+
+You can find more details on how to use FLASK and an example security
+policy here: L<http://xenbits.xen.org/docs/unstable/misc/xsm-flask.txt>
 
 =over 4
 
@@ -1039,6 +1052,7 @@
 
 L<http://xenbits.xen.org/docs/unstable/misc/xl-network-configuration.html>
 L<http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt>
+L<http://xenbits.xen.org/docs/unstable/misc/xsm-flask.txt>
 
 =head1 BUGS
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx1-0000YH-V7; Thu, 19 Jan 2012 21:55:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000XX-BM
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327009986!49302970!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11032 invoked from network); 19 Jan 2012 21:53:07 -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;
	19 Jan 2012 21:53:07 -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 1Rnzwx-0007QC-M6
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwx-0000cT-L1
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Message-Id: <E1Rnzwx-0000cT-L1@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xl.pod.1: introduction to FLASK
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1326211986 0
# Node ID 3a79842d4845f55214042edc4885519258fdb335
# Parent  ef99b8571a6fe4e53fb9df4da2833f8f5a5b4ec7
docs: xl.pod.1: introduction to FLASK

Add a simple introduction to FLASK to the xl man page, at the beginning
of the FLASK chapter. Link to the xsm-flask.txt document.
Currently FLASK, TMEM and PCI PASS-THROUGH are defined as =head2 so they
look like sub-chapters of VIRTUAL DEVICE COMMANDS. Make them =head1.

Based on a text written by Daniel De Graaf.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ef99b8571a6f -r 3a79842d4845 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Jan 05 19:40:40 2012 +0100
+++ b/docs/man/xl.pod.1	Tue Jan 10 16:13:06 2012 +0000
@@ -906,7 +906,7 @@
 
 =back
 
-=head2 PCI PASS-THROUGH
+=head1 PCI PASS-THROUGH
 
 =over 4
 
@@ -929,7 +929,7 @@
 
 =back
 
-=head2 TMEM
+=head1 TMEM
 
 =over 4
 
@@ -995,7 +995,20 @@
 
 =back
 
-=head2 FLASK
+=head1 FLASK
+
+B<FLASK> is a security framework that defines a mandatory access control policy
+providing fine-grained controls over Xen domains, allowing the policy writer
+to define what interactions between domains, devices, and the hypervisor are
+permitted. Some example of what you can do using XSM/FLASK:
+ - Prevent two domains from communicating via event channels or grants
+ - Control which domains can use device passthrough (and which devices)
+ - Restrict or audit operations performed by privileged domains
+ - Prevent a privileged domain from arbitrarily mapping pages from other
+   domains.
+
+You can find more details on how to use FLASK and an example security
+policy here: L<http://xenbits.xen.org/docs/unstable/misc/xsm-flask.txt>
 
 =over 4
 
@@ -1039,6 +1052,7 @@
 
 L<http://xenbits.xen.org/docs/unstable/misc/xl-network-configuration.html>
 L<http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt>
+L<http://xenbits.xen.org/docs/unstable/misc/xsm-flask.txt>
 
 =head1 BUGS
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx2-0000YP-1N; Thu, 19 Jan 2012 21:55:20 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000X3-Gl
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1327010110!7919240!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26778 invoked from network); 19 Jan 2012 21:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:11 -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 1Rnzws-0007Pi-G3
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzws-0000a0-9S
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:10 +0000
Message-Id: <E1Rnzws-0000a0-9S@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Open code rw and ro node
	creation.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1324047253 0
# Node ID ef2264bbebe1d14666f3c61ca3cf4f1dd16a21b2
# Parent  9be0e68ae45fcc21e32585d9f0596554a0fff27a
libxl: Open code rw and ro node creation.

Use a new libxl__xs_mkdir() to do this and also clean up extraneous
node creation while in the neighbourhood. Checking 'xenstore-ls -fp'
output before and after shows that, as well as the disappearance of
error, drivers, messages and domid, the following perms change is also
present:

-device/suspend = ""   (ndomU)
+device/suspend = ""   (n0,rdomU)

I believe the new perms are more desirable than the old ones.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 9be0e68ae45f -r ef2264bbebe1 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
@@ -320,11 +320,8 @@
   * on exit (even error exit), domid may be valid and refer to a domain */
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    int flags, ret, i, rc;
+    int flags, ret, rc;
     char *uuid_string;
-    char *rw_paths[] = { "control/shutdown", "device", "device/suspend/event-channel" , "data"};
-    char *ro_paths[] = { "cpu", "memory", "device", "error", "drivers",
-                         "control", "attr", "messages" };
     char *dom_path, *vm_path, *libxl_path;
     struct xs_permissions roperm[2];
     struct xs_permissions rwperm[1];
@@ -384,6 +381,7 @@
         rc = ERROR_FAIL;
         goto out;
     }
+
     noperm[0].id = 0;
     noperm[0].perms = XS_PERM_NONE;
 
@@ -391,6 +389,7 @@
     roperm[0].perms = XS_PERM_NONE;
     roperm[1].id = *domid;
     roperm[1].perms = XS_PERM_READ;
+
     rwperm[0].id = *domid;
     rwperm[0].perms = XS_PERM_NONE;
 
@@ -398,32 +397,42 @@
     t = xs_transaction_start(ctx->xsh);
 
     xs_rm(ctx->xsh, t, dom_path);
-    xs_mkdir(ctx->xsh, t, dom_path);
-    xs_set_permissions(ctx->xsh, t, dom_path, roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t, dom_path, roperm, ARRAY_SIZE(roperm));
+
 
     xs_rm(ctx->xsh, t, vm_path);
-    xs_mkdir(ctx->xsh, t, vm_path);
-    xs_set_permissions(ctx->xsh, t, vm_path, roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
     xs_rm(ctx->xsh, t, libxl_path);
-    xs_mkdir(ctx->xsh, t, libxl_path);
-    xs_set_permissions(ctx->xsh, t, libxl_path, noperm, ARRAY_SIZE(noperm));
+    libxl__xs_mkdir(gc, t, libxl_path, noperm, ARRAY_SIZE(noperm));
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vm", dom_path), vm_path, strlen(vm_path));
     rc = libxl__domain_rename(gc, *domid, 0, info->name, t);
     if (rc)
         goto out;
 
-    for (i = 0; i < ARRAY_SIZE(rw_paths); i++) {
-        char *path = libxl__sprintf(gc, "%s/%s", dom_path, rw_paths[i]);
-        xs_mkdir(ctx->xsh, t, path);
-        xs_set_permissions(ctx->xsh, t, path, rwperm, ARRAY_SIZE(rwperm));
-    }
-    for (i = 0; i < ARRAY_SIZE(ro_paths); i++) {
-        char *path = libxl__sprintf(gc, "%s/%s", dom_path, ro_paths[i]);
-        xs_mkdir(ctx->xsh, t, path);
-        xs_set_permissions(ctx->xsh, t, path, roperm, ARRAY_SIZE(roperm));
-    }
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/cpu", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/memory", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/device", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/control", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/control/shutdown", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/device/suspend/event-channel", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/data", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
diff -r 9be0e68ae45f -r ef2264bbebe1 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Dec 16 14:54:13 2011 +0000
@@ -206,6 +206,9 @@
 _hidden char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t,
                                    const char *path, unsigned int *nb);
    /* On error: returns NULL, sets errno (no logging) */
+_hidden bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
+                             const char *path, struct xs_permissions *perms,
+			     unsigned int num_perms);
 
 _hidden char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid);
 
diff -r 9be0e68ae45f -r ef2264bbebe1 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/libxl/libxl_xshelp.c	Fri Dec 16 14:54:13 2011 +0000
@@ -122,6 +122,16 @@
     return ret;
 }
 
+bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
+                     const char *path, struct xs_permissions *perms,
+			         unsigned int num_perms)
+{
+    libxl_ctx *ctx = libxl__gc_owner(gc);
+    if (!xs_mkdir(ctx->xsh, t, path))
+        return false;
+    return xs_set_permissions(ctx->xsh, t, path, perms, num_perms);
+}
+
 char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx2-0000YP-1N; Thu, 19 Jan 2012 21:55:20 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000X3-Gl
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1327010110!7919240!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26778 invoked from network); 19 Jan 2012 21:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:11 -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 1Rnzws-0007Pi-G3
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzws-0000a0-9S
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:10 +0000
Message-Id: <E1Rnzws-0000a0-9S@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Open code rw and ro node
	creation.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1324047253 0
# Node ID ef2264bbebe1d14666f3c61ca3cf4f1dd16a21b2
# Parent  9be0e68ae45fcc21e32585d9f0596554a0fff27a
libxl: Open code rw and ro node creation.

Use a new libxl__xs_mkdir() to do this and also clean up extraneous
node creation while in the neighbourhood. Checking 'xenstore-ls -fp'
output before and after shows that, as well as the disappearance of
error, drivers, messages and domid, the following perms change is also
present:

-device/suspend = ""   (ndomU)
+device/suspend = ""   (n0,rdomU)

I believe the new perms are more desirable than the old ones.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 9be0e68ae45f -r ef2264bbebe1 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
@@ -320,11 +320,8 @@
   * on exit (even error exit), domid may be valid and refer to a domain */
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    int flags, ret, i, rc;
+    int flags, ret, rc;
     char *uuid_string;
-    char *rw_paths[] = { "control/shutdown", "device", "device/suspend/event-channel" , "data"};
-    char *ro_paths[] = { "cpu", "memory", "device", "error", "drivers",
-                         "control", "attr", "messages" };
     char *dom_path, *vm_path, *libxl_path;
     struct xs_permissions roperm[2];
     struct xs_permissions rwperm[1];
@@ -384,6 +381,7 @@
         rc = ERROR_FAIL;
         goto out;
     }
+
     noperm[0].id = 0;
     noperm[0].perms = XS_PERM_NONE;
 
@@ -391,6 +389,7 @@
     roperm[0].perms = XS_PERM_NONE;
     roperm[1].id = *domid;
     roperm[1].perms = XS_PERM_READ;
+
     rwperm[0].id = *domid;
     rwperm[0].perms = XS_PERM_NONE;
 
@@ -398,32 +397,42 @@
     t = xs_transaction_start(ctx->xsh);
 
     xs_rm(ctx->xsh, t, dom_path);
-    xs_mkdir(ctx->xsh, t, dom_path);
-    xs_set_permissions(ctx->xsh, t, dom_path, roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t, dom_path, roperm, ARRAY_SIZE(roperm));
+
 
     xs_rm(ctx->xsh, t, vm_path);
-    xs_mkdir(ctx->xsh, t, vm_path);
-    xs_set_permissions(ctx->xsh, t, vm_path, roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
     xs_rm(ctx->xsh, t, libxl_path);
-    xs_mkdir(ctx->xsh, t, libxl_path);
-    xs_set_permissions(ctx->xsh, t, libxl_path, noperm, ARRAY_SIZE(noperm));
+    libxl__xs_mkdir(gc, t, libxl_path, noperm, ARRAY_SIZE(noperm));
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vm", dom_path), vm_path, strlen(vm_path));
     rc = libxl__domain_rename(gc, *domid, 0, info->name, t);
     if (rc)
         goto out;
 
-    for (i = 0; i < ARRAY_SIZE(rw_paths); i++) {
-        char *path = libxl__sprintf(gc, "%s/%s", dom_path, rw_paths[i]);
-        xs_mkdir(ctx->xsh, t, path);
-        xs_set_permissions(ctx->xsh, t, path, rwperm, ARRAY_SIZE(rwperm));
-    }
-    for (i = 0; i < ARRAY_SIZE(ro_paths); i++) {
-        char *path = libxl__sprintf(gc, "%s/%s", dom_path, ro_paths[i]);
-        xs_mkdir(ctx->xsh, t, path);
-        xs_set_permissions(ctx->xsh, t, path, roperm, ARRAY_SIZE(roperm));
-    }
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/cpu", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/memory", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/device", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/control", dom_path),
+                    roperm, ARRAY_SIZE(roperm));
+
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/control/shutdown", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/device/suspend/event-channel", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mkdir(gc, t,
+                    libxl__sprintf(gc, "%s/data", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
diff -r 9be0e68ae45f -r ef2264bbebe1 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Dec 16 14:54:13 2011 +0000
@@ -206,6 +206,9 @@
 _hidden char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t,
                                    const char *path, unsigned int *nb);
    /* On error: returns NULL, sets errno (no logging) */
+_hidden bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
+                             const char *path, struct xs_permissions *perms,
+			     unsigned int num_perms);
 
 _hidden char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid);
 
diff -r 9be0e68ae45f -r ef2264bbebe1 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/libxl/libxl_xshelp.c	Fri Dec 16 14:54:13 2011 +0000
@@ -122,6 +122,16 @@
     return ret;
 }
 
+bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
+                     const char *path, struct xs_permissions *perms,
+			         unsigned int num_perms)
+{
+    libxl_ctx *ctx = libxl__gc_owner(gc);
+    if (!xs_mkdir(ctx->xsh, t, path))
+        return false;
+    return xs_set_permissions(ctx->xsh, t, path, perms, num_perms);
+}
+
 char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx1-0000YB-SX; Thu, 19 Jan 2012 21:55:19 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000X1-7Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327010110!11670748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17343 invoked from network); 19 Jan 2012 21:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:11 -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 1Rnzwr-0007Pf-Rc
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwr-0000Zk-NE
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Message-Id: <E1Rnzwr-0000Zk-NE@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add correct const-ness to memshr
	tool functions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326209888 0
# Node ID 9be0e68ae45fcc21e32585d9f0596554a0fff27a
# Parent  cfbab2c7c3cc864fcc8a3f78d9745b54fe0d624a
Add correct const-ness to memshr tool functions

This patch addresses some of the compile and link issues with the memshr
module.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/blktap2/drivers/Makefile
--- a/tools/blktap2/drivers/Makefile	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/blktap2/drivers/Makefile	Tue Jan 10 15:38:08 2012 +0000
@@ -43,7 +43,7 @@
 MEMSHRLIBS :=
 ifeq ($(CONFIG_Linux), __fixme__)
 CFLAGS += -DMEMSHR
-MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
+MEMSHRLIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl $(MEMSHR_DIR)/libmemshr.a
 endif
 
 ifeq ($(VHD_STATIC),y)
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/blktap2/drivers/tapdisk.h
--- a/tools/blktap2/drivers/tapdisk.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk.h	Tue Jan 10 15:38:08 2012 +0000
@@ -64,6 +64,10 @@
 #include "tapdisk-log.h"
 #include "tapdisk-utils.h"
 
+#ifdef MEMSHR
+#include "memshr.h"
+#endif
+
 #define DPRINTF(_f, _a...)           syslog(LOG_INFO, _f, ##_a)
 #define EPRINTF(_f, _a...)           syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a)
 #define PERROR(_f, _a...)            EPRINTF(_f ": %s", ##_a, strerror(errno))
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/interface.c
--- a/tools/memshr/interface.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/interface.c	Tue Jan 10 15:38:08 2012 +0000
@@ -123,7 +123,7 @@
     vbd_info.enabled = 1;
 }
 
-uint16_t memshr_vbd_image_get(char* file)
+uint16_t memshr_vbd_image_get(const char* file)
 {
     uint16_t id;
 
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/memshr.h
--- a/tools/memshr/memshr.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/memshr.h	Tue Jan 10 15:38:08 2012 +0000
@@ -28,7 +28,7 @@
 extern void memshr_set_domid(int domid);
 extern void memshr_daemon_initialize(void);
 extern void memshr_vbd_initialize(void);
-extern uint16_t memshr_vbd_image_get(char* file);
+extern uint16_t memshr_vbd_image_get(const char* file);
 extern void memshr_vbd_image_put(uint16_t memshr_id);
 extern int memshr_vbd_issue_ro_request(char *buf,
                                        grant_ref_t gref,
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/shm.c
--- a/tools/memshr/shm.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/shm.c	Tue Jan 10 15:38:08 2012 +0000
@@ -187,7 +187,7 @@
     return h;
 } 
 
-uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs)
+uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs)
 {
     vbd_image_info_t *img, *next_img;
     int i, img_id;
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/shm.h
--- a/tools/memshr/shm.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/shm.h	Tue Jan 10 15:38:08 2012 +0000
@@ -44,7 +44,7 @@
 shared_memshr_info_t * shm_shared_info_open(int unlink);
 struct fgprtshr_hash * shm_fgprtshr_hash_open(int unlink);
 struct blockshr_hash * shm_blockshr_hash_open(int unlink);
-uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs);
+uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs);
 void     shm_vbd_image_put(uint16_t memshr_id, vbd_image_info_t *vbd_imgs);
 
 #endif /* __SHM_H__ */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx1-0000YB-SX; Thu, 19 Jan 2012 21:55:19 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000X1-7Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327010110!11670748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17343 invoked from network); 19 Jan 2012 21:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:11 -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 1Rnzwr-0007Pf-Rc
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwr-0000Zk-NE
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Message-Id: <E1Rnzwr-0000Zk-NE@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add correct const-ness to memshr
	tool functions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326209888 0
# Node ID 9be0e68ae45fcc21e32585d9f0596554a0fff27a
# Parent  cfbab2c7c3cc864fcc8a3f78d9745b54fe0d624a
Add correct const-ness to memshr tool functions

This patch addresses some of the compile and link issues with the memshr
module.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/blktap2/drivers/Makefile
--- a/tools/blktap2/drivers/Makefile	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/blktap2/drivers/Makefile	Tue Jan 10 15:38:08 2012 +0000
@@ -43,7 +43,7 @@
 MEMSHRLIBS :=
 ifeq ($(CONFIG_Linux), __fixme__)
 CFLAGS += -DMEMSHR
-MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
+MEMSHRLIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl $(MEMSHR_DIR)/libmemshr.a
 endif
 
 ifeq ($(VHD_STATIC),y)
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/blktap2/drivers/tapdisk.h
--- a/tools/blktap2/drivers/tapdisk.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk.h	Tue Jan 10 15:38:08 2012 +0000
@@ -64,6 +64,10 @@
 #include "tapdisk-log.h"
 #include "tapdisk-utils.h"
 
+#ifdef MEMSHR
+#include "memshr.h"
+#endif
+
 #define DPRINTF(_f, _a...)           syslog(LOG_INFO, _f, ##_a)
 #define EPRINTF(_f, _a...)           syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a)
 #define PERROR(_f, _a...)            EPRINTF(_f ": %s", ##_a, strerror(errno))
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/interface.c
--- a/tools/memshr/interface.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/interface.c	Tue Jan 10 15:38:08 2012 +0000
@@ -123,7 +123,7 @@
     vbd_info.enabled = 1;
 }
 
-uint16_t memshr_vbd_image_get(char* file)
+uint16_t memshr_vbd_image_get(const char* file)
 {
     uint16_t id;
 
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/memshr.h
--- a/tools/memshr/memshr.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/memshr.h	Tue Jan 10 15:38:08 2012 +0000
@@ -28,7 +28,7 @@
 extern void memshr_set_domid(int domid);
 extern void memshr_daemon_initialize(void);
 extern void memshr_vbd_initialize(void);
-extern uint16_t memshr_vbd_image_get(char* file);
+extern uint16_t memshr_vbd_image_get(const char* file);
 extern void memshr_vbd_image_put(uint16_t memshr_id);
 extern int memshr_vbd_issue_ro_request(char *buf,
                                        grant_ref_t gref,
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/shm.c
--- a/tools/memshr/shm.c	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/shm.c	Tue Jan 10 15:38:08 2012 +0000
@@ -187,7 +187,7 @@
     return h;
 } 
 
-uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs)
+uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs)
 {
     vbd_image_info_t *img, *next_img;
     int i, img_id;
diff -r cfbab2c7c3cc -r 9be0e68ae45f tools/memshr/shm.h
--- a/tools/memshr/shm.h	Tue Jan 10 15:38:08 2012 +0000
+++ b/tools/memshr/shm.h	Tue Jan 10 15:38:08 2012 +0000
@@ -44,7 +44,7 @@
 shared_memshr_info_t * shm_shared_info_open(int unlink);
 struct fgprtshr_hash * shm_fgprtshr_hash_open(int unlink);
 struct blockshr_hash * shm_blockshr_hash_open(int unlink);
-uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs);
+uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs);
 void     shm_vbd_image_put(uint16_t memshr_id, vbd_image_info_t *vbd_imgs);
 
 #endif /* __SHM_H__ */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx0-0000Xq-NS; Thu, 19 Jan 2012 21:55:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwz-0000Ww-IK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1327010069!56707824!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5543 invoked from network); 19 Jan 2012 21:54:30 -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;
	19 Jan 2012 21:54:30 -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 1Rnzwr-0007Pc-GL
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwr-0000ZU-6w
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Message-Id: <E1Rnzwr-0000ZU-6w@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix types used in xc_memshr_*
	functions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326209888 0
# Node ID cfbab2c7c3cc864fcc8a3f78d9745b54fe0d624a
# Parent  fc78d16447b49491c560c99491a9ce47cad5765f
Fix types used in xc_memshr_* functions

Currently the memshr functions use uint32_t for the domid.  This actually leads
to a funny domid_t -> uint32_t -> domid_t sequence of casts.  This patch
updates the API functions to be domid_t in the first place.

No tools need to be modified with this patch, the casts were implicit.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fc78d16447b4 -r cfbab2c7c3cc tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Tue Jan 10 15:35:01 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Tue Jan 10 15:38:08 2012 +0000
@@ -26,7 +26,7 @@
 #include <xen/grant_table.h>
 
 int xc_memshr_control(xc_interface *xch,
-                      uint32_t domid,
+                      domid_t domid,
                       int enable)
 {
     DECLARE_DOMCTL;
@@ -34,7 +34,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL;
     op->u.enable = enable;
@@ -43,7 +43,7 @@
 }
 
 int xc_memshr_nominate_gfn(xc_interface *xch,
-                           uint32_t domid,
+                           domid_t domid,
                            unsigned long gfn,
                            uint64_t *handle)
 {
@@ -53,7 +53,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GFN;
     op->u.nominate.u.gfn = gfn;
@@ -65,7 +65,7 @@
 }
 
 int xc_memshr_nominate_gref(xc_interface *xch,
-                            uint32_t domid,
+                            domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle)
 {
@@ -75,7 +75,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GREF;
     op->u.nominate.u.grant_ref = gref;
@@ -105,14 +105,14 @@
 }
 
 int xc_memshr_domain_resume(xc_interface *xch,
-                            uint32_t domid)
+                            domid_t domid)
 {
     DECLARE_DOMCTL;
     struct xen_domctl_mem_sharing_op *op;
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME;
 
@@ -120,7 +120,7 @@
 }
 
 int xc_memshr_debug_gfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long gfn)
 {
     DECLARE_DOMCTL;
@@ -128,7 +128,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN;
     op->u.debug.u.gfn = gfn;
@@ -137,7 +137,7 @@
 }
 
 int xc_memshr_debug_mfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long mfn)
 {
     DECLARE_DOMCTL;
@@ -145,7 +145,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN;
     op->u.debug.u.mfn = mfn;
@@ -154,7 +154,7 @@
 }
 
 int xc_memshr_debug_gref(xc_interface *xch,
-                         uint32_t domid,
+                         domid_t domid,
                          grant_ref_t gref)
 {
     DECLARE_DOMCTL;
@@ -162,7 +162,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF;
     op->u.debug.u.gref = gref;
diff -r fc78d16447b4 -r cfbab2c7c3cc tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Jan 10 15:35:01 2012 +0000
+++ b/tools/libxc/xenctrl.h	Tue Jan 10 15:38:08 2012 +0000
@@ -1880,29 +1880,29 @@
  * memshr operations
  */
 int xc_memshr_control(xc_interface *xch,
-                      uint32_t domid,
+                      domid_t domid,
                       int enable);
 int xc_memshr_nominate_gfn(xc_interface *xch,
-                           uint32_t domid,
+                           domid_t domid,
                            unsigned long gfn,
                            uint64_t *handle);
 int xc_memshr_nominate_gref(xc_interface *xch,
-                            uint32_t domid,
+                            domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle);
 int xc_memshr_share(xc_interface *xch,
                     uint64_t source_handle,
                     uint64_t client_handle);
 int xc_memshr_domain_resume(xc_interface *xch,
-                            uint32_t domid);
+                            domid_t domid);
 int xc_memshr_debug_gfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long gfn);
 int xc_memshr_debug_mfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long mfn);
 int xc_memshr_debug_gref(xc_interface *xch,
-                         uint32_t domid,
+                         domid_t domid,
                          grant_ref_t gref);
 
 int xc_flask_load(xc_interface *xc_handle, char *buf, uint32_t size);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx0-0000Xq-NS; Thu, 19 Jan 2012 21:55:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwz-0000Ww-IK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1327010069!56707824!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5543 invoked from network); 19 Jan 2012 21:54:30 -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;
	19 Jan 2012 21:54:30 -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 1Rnzwr-0007Pc-GL
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwr-0000ZU-6w
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:09 +0000
Message-Id: <E1Rnzwr-0000ZU-6w@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix types used in xc_memshr_*
	functions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326209888 0
# Node ID cfbab2c7c3cc864fcc8a3f78d9745b54fe0d624a
# Parent  fc78d16447b49491c560c99491a9ce47cad5765f
Fix types used in xc_memshr_* functions

Currently the memshr functions use uint32_t for the domid.  This actually leads
to a funny domid_t -> uint32_t -> domid_t sequence of casts.  This patch
updates the API functions to be domid_t in the first place.

No tools need to be modified with this patch, the casts were implicit.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fc78d16447b4 -r cfbab2c7c3cc tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Tue Jan 10 15:35:01 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Tue Jan 10 15:38:08 2012 +0000
@@ -26,7 +26,7 @@
 #include <xen/grant_table.h>
 
 int xc_memshr_control(xc_interface *xch,
-                      uint32_t domid,
+                      domid_t domid,
                       int enable)
 {
     DECLARE_DOMCTL;
@@ -34,7 +34,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL;
     op->u.enable = enable;
@@ -43,7 +43,7 @@
 }
 
 int xc_memshr_nominate_gfn(xc_interface *xch,
-                           uint32_t domid,
+                           domid_t domid,
                            unsigned long gfn,
                            uint64_t *handle)
 {
@@ -53,7 +53,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GFN;
     op->u.nominate.u.gfn = gfn;
@@ -65,7 +65,7 @@
 }
 
 int xc_memshr_nominate_gref(xc_interface *xch,
-                            uint32_t domid,
+                            domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle)
 {
@@ -75,7 +75,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GREF;
     op->u.nominate.u.grant_ref = gref;
@@ -105,14 +105,14 @@
 }
 
 int xc_memshr_domain_resume(xc_interface *xch,
-                            uint32_t domid)
+                            domid_t domid)
 {
     DECLARE_DOMCTL;
     struct xen_domctl_mem_sharing_op *op;
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME;
 
@@ -120,7 +120,7 @@
 }
 
 int xc_memshr_debug_gfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long gfn)
 {
     DECLARE_DOMCTL;
@@ -128,7 +128,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN;
     op->u.debug.u.gfn = gfn;
@@ -137,7 +137,7 @@
 }
 
 int xc_memshr_debug_mfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long mfn)
 {
     DECLARE_DOMCTL;
@@ -145,7 +145,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN;
     op->u.debug.u.mfn = mfn;
@@ -154,7 +154,7 @@
 }
 
 int xc_memshr_debug_gref(xc_interface *xch,
-                         uint32_t domid,
+                         domid_t domid,
                          grant_ref_t gref)
 {
     DECLARE_DOMCTL;
@@ -162,7 +162,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF;
     op->u.debug.u.gref = gref;
diff -r fc78d16447b4 -r cfbab2c7c3cc tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue Jan 10 15:35:01 2012 +0000
+++ b/tools/libxc/xenctrl.h	Tue Jan 10 15:38:08 2012 +0000
@@ -1880,29 +1880,29 @@
  * memshr operations
  */
 int xc_memshr_control(xc_interface *xch,
-                      uint32_t domid,
+                      domid_t domid,
                       int enable);
 int xc_memshr_nominate_gfn(xc_interface *xch,
-                           uint32_t domid,
+                           domid_t domid,
                            unsigned long gfn,
                            uint64_t *handle);
 int xc_memshr_nominate_gref(xc_interface *xch,
-                            uint32_t domid,
+                            domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle);
 int xc_memshr_share(xc_interface *xch,
                     uint64_t source_handle,
                     uint64_t client_handle);
 int xc_memshr_domain_resume(xc_interface *xch,
-                            uint32_t domid);
+                            domid_t domid);
 int xc_memshr_debug_gfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long gfn);
 int xc_memshr_debug_mfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long mfn);
 int xc_memshr_debug_gref(xc_interface *xch,
-                         uint32_t domid,
+                         domid_t domid,
                          grant_ref_t gref);
 
 int xc_flask_load(xc_interface *xc_handle, char *buf, uint32_t size);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzwy-0000XF-I0; Thu, 19 Jan 2012 21:55:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwx-0000X5-8C
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1327010060!53301953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18405 invoked from network); 19 Jan 2012 21:54:21 -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 Jan 2012 21:54:21 -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 1Rnzwt-0007Po-NF
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwt-0000aV-JM
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:11 +0000
Message-Id: <E1Rnzwt-0000aV-JM@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: VM generation ID save/restore
	and migrate.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1324047254 0
# Node ID 3c4c5df2cd0e6976aace47275cea070dd8f1295b
# Parent  92630d4b093eca22fdaf4b8b7a02a858a086cad7
tools: VM generation ID save/restore and migrate.

Add code to track the address of the VM generation ID buffer across a
save/restore or migrate, and increment it as necessary.
The address of the buffer is written into xenstore by hvmloader at
boot time. It must be read from xenstore by the caller of
xc_domain_save() and then written back again by the caller of
xc_domain_restore().

Note that the changes to xc_save.c and xc_restore.c are merely
sufficient for them to build.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/ia64/xc_ia64_linux_restore.c
--- a/tools/libxc/ia64/xc_ia64_linux_restore.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/ia64/xc_ia64_linux_restore.c	Fri Dec 16 14:54:14 2011 +0000
@@ -548,7 +548,9 @@
 xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                   unsigned int store_evtchn, unsigned long *store_mfn,
                   unsigned int console_evtchn, unsigned long *console_mfn,
-                  unsigned int hvm, unsigned int pae, int superpages)
+                  unsigned int hvm, unsigned int pae, int superpages,
+                  int no_incr_generationid,
+                  unsigned long *vm_generationid_addr)
 {
     DECLARE_DOMCTL;
     int rc = 1;
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/ia64/xc_ia64_linux_save.c
--- a/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Dec 16 14:54:14 2011 +0000
@@ -382,7 +382,8 @@
 int
 xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
                uint32_t max_factor, uint32_t flags,
-               struct save_callbacks* callbacks, int hvm)
+               struct save_callbacks* callbacks, int hvm,
+               unsigned long vm_generationid_addr)
 {
     DECLARE_DOMCTL;
     xc_dominfo_t info;
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Dec 16 14:54:14 2011 +0000
@@ -681,6 +681,7 @@
     uint64_t console_pfn;
     uint64_t acpi_ioport_location;
     uint64_t viridian;
+    uint64_t vm_generationid_addr;
 } pagebuf_t;
 
 static int pagebuf_init(pagebuf_t* buf)
@@ -860,6 +861,17 @@
         }
         return compbuf_size;
 
+    case XC_SAVE_ID_HVM_GENERATION_ID_ADDR:
+        /* Skip padding 4 bytes then read the generation id buffer location. */
+        if ( RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint64_t)) )
+        {
+            PERROR("error read the generation id buffer location");
+            return -1;
+        }
+        DPRINTF("read generation id buffer address");
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
     default:
         if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
             ERROR("Max batch size exceeded (%d). Giving up.", count);
@@ -1248,7 +1260,9 @@
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       unsigned int store_evtchn, unsigned long *store_mfn,
                       unsigned int console_evtchn, unsigned long *console_mfn,
-                      unsigned int hvm, unsigned int pae, int superpages)
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int no_incr_generationid,
+                      unsigned long *vm_generationid_addr)
 {
     DECLARE_DOMCTL;
     int rc = 1, frc, i, j, n, m, pae_extended_cr3 = 0, ext_vcpucontext = 0;
@@ -1449,6 +1463,39 @@
                 xc_set_hvm_param(xch, dom, HVM_PARAM_VM86_TSS, pagebuf.vm86_tss);
             if ( pagebuf.console_pfn )
                 console_pfn = pagebuf.console_pfn;
+            if ( pagebuf.vm_generationid_addr ) {
+                if ( !no_incr_generationid ) {
+                    unsigned int offset;
+                    unsigned char *buf;
+                    unsigned long long generationid;
+
+                    /*
+                     * Map the VM generation id buffer and inject the new value.
+                     */
+
+                    pfn = pagebuf.vm_generationid_addr >> PAGE_SHIFT;
+                    offset = pagebuf.vm_generationid_addr & (PAGE_SIZE - 1);
+                
+                    if ( (pfn >= dinfo->p2m_size) ||
+                         (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
+                    {
+                        ERROR("generation id buffer frame is bad");
+                        goto out;
+                    }
+
+                    mfn = ctx->p2m[pfn];
+                    buf = xc_map_foreign_range(xch, dom, PAGE_SIZE,
+                                               PROT_READ | PROT_WRITE, mfn);
+
+                    generationid = *(unsigned long long *)(buf + offset);
+                    *(unsigned long long *)(buf + offset) = generationid + 1;
+
+                    munmap(buf, PAGE_SIZE);
+                }
+
+                *vm_generationid_addr = pagebuf.vm_generationid_addr;
+            }
+
             break;  /* our work here is done */
         }
 
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xc_domain_save.c	Fri Dec 16 14:54:14 2011 +0000
@@ -804,7 +804,8 @@
 
 int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
                    uint32_t max_factor, uint32_t flags,
-                   struct save_callbacks* callbacks, int hvm)
+                   struct save_callbacks* callbacks, int hvm,
+                   unsigned long vm_generationid_addr)
 {
     xc_dominfo_t info;
     DECLARE_DOMCTL;
@@ -1616,6 +1617,16 @@
             uint64_t data;
         } chunk = { 0, };
 
+        chunk.id = XC_SAVE_ID_HVM_GENERATION_ID_ADDR;
+        chunk.data = vm_generationid_addr;
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the generation id buffer location for guest");
+            goto out;
+        }
+
         chunk.id = XC_SAVE_ID_HVM_IDENT_PT;
         chunk.data = 0;
         xc_get_hvm_param(xch, dom, HVM_PARAM_IDENT_PT,
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xenguest.h	Fri Dec 16 14:54:14 2011 +0000
@@ -58,7 +58,8 @@
  */
 int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
                    uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
-                   struct save_callbacks* callbacks, int hvm);
+                   struct save_callbacks* callbacks, int hvm,
+                   unsigned long vm_generationid_addr);
 
 
 /**
@@ -72,12 +73,16 @@
  * @parm hvm non-zero if this is a HVM restore
  * @parm pae non-zero if this HVM domain has PAE support enabled
  * @parm superpages non-zero to allocate guest memory with superpages
+ * @parm no_incr_generationid non-zero if generation id is NOT to be incremented
+ * @parm vm_generationid_addr returned with the address of the generation id buffer
  * @return 0 on success, -1 on failure
  */
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       unsigned int store_evtchn, unsigned long *store_mfn,
                       unsigned int console_evtchn, unsigned long *console_mfn,
-                      unsigned int hvm, unsigned int pae, int superpages);
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int no_incr_generationid,
+		      unsigned long *vm_generationid_addr);
 /**
  * xc_domain_restore writes a file to disk that contains the device
  * model saved state.
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xg_save_restore.h	Fri Dec 16 14:54:14 2011 +0000
@@ -253,6 +253,7 @@
 #define XC_SAVE_ID_HVM_VIRIDIAN       -11
 #define XC_SAVE_ID_COMPRESSED_DATA    -12 /* Marker to indicate arrival of compressed data */
 #define XC_SAVE_ID_ENABLE_COMPRESSION -13 /* Marker to enable compression logic at receiver side */
+#define XC_SAVE_ID_HVM_GENERATION_ID_ADDR -14
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Dec 16 14:54:14 2011 +0000
@@ -99,6 +99,7 @@
         b_info->u.hvm.vpt_align = 1;
         b_info->u.hvm.timer_mode = 1;
         b_info->u.hvm.nested_hvm = 0;
+        b_info->u.hvm.no_incr_generationid = 0;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 8 * 1024;
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_dom.c	Fri Dec 16 14:54:14 2011 +0000
@@ -106,6 +106,7 @@
 
     state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid, 0);
     state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, 0);
+    state->vm_generationid_addr = 0;
     return 0;
 }
 
@@ -117,7 +118,7 @@
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *dom_path, *vm_path;
     xs_transaction_t t;
-    char **ents;
+    char **ents, **hvm_ents;
     int i;
 
     libxl_cpuid_apply_policy(ctx, domid);
@@ -143,6 +144,13 @@
                             ? "offline" : "online";
     }
 
+    hvm_ents = NULL;
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        hvm_ents = libxl__calloc(gc, 3, sizeof(char *));
+        hvm_ents[0] = "hvmloader/generation-id-address";
+        hvm_ents[1] = libxl__sprintf(gc, "0x%lx", state->vm_generationid_addr);
+    }
+
     dom_path = libxl__xs_get_dompath(gc, domid);
     if (!dom_path) {
         return ERROR_FAIL;
@@ -153,6 +161,9 @@
     t = xs_transaction_start(ctx->xsh);
 
     libxl__xs_writev(gc, t, dom_path, ents);
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+        libxl__xs_writev(gc, t, dom_path, hvm_ents);
+
     libxl__xs_writev(gc, t, dom_path, local_ents);
     libxl__xs_writev(gc, t, vm_path, vms_ents);
 
@@ -356,16 +367,19 @@
     /* read signature */
     int rc;
     int hvm, pae, superpages;
+    int no_incr_generationid;
     switch (info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         hvm = 1;
         superpages = 1;
         pae = info->u.hvm.pae;
+        no_incr_generationid = info->u.hvm.no_incr_generationid;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
         superpages = 0;
         pae = 1;
+        no_incr_generationid = 0;
         break;
     default:
         return ERROR_INVAL;
@@ -373,7 +387,8 @@
     rc = xc_domain_restore(ctx->xch, fd, domid,
                            state->store_port, &state->store_mfn,
                            state->console_port, &state->console_mfn,
-                           hvm, pae, superpages);
+                           hvm, pae, superpages, no_incr_generationid,
+                           &state->vm_generationid_addr);
     if ( rc ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "restoring domain");
         return ERROR_FAIL;
@@ -538,12 +553,23 @@
     struct save_callbacks callbacks;
     struct suspendinfo si;
     int hvm, rc = ERROR_FAIL;
+    unsigned long vm_generationid_addr;
 
     switch (type) {
-    case LIBXL_DOMAIN_TYPE_HVM:
+    case LIBXL_DOMAIN_TYPE_HVM: {
+        char *path;
+        char *addr;
+
+        path = libxl__sprintf(gc, "%s/hvmloader/generation-id-address",
+                              libxl__xs_get_dompath(gc, domid));
+        addr = libxl__xs_read(gc, XBT_NULL, path);
+
+        vm_generationid_addr = (addr) ? strtoul(addr, NULL, 0) : 0;
         hvm = 1;
         break;
+    }
     case LIBXL_DOMAIN_TYPE_PV:
+        vm_generationid_addr = 0;
         hvm = 0;
         break;
     default:
@@ -581,7 +607,8 @@
     callbacks.switch_qemu_logdirty = libxl__domain_suspend_common_switch_qemu_logdirty;
     callbacks.data = &si;
 
-    rc = xc_domain_save(ctx->xch, fd, domid, 0, 0, flags, &callbacks, hvm);
+    rc = xc_domain_save(ctx->xch, fd, domid, 0, 0, flags, &callbacks,
+                        hvm, vm_generationid_addr);
     if ( rc ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "saving domain: %s",
                          si.guest_responded ?
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Dec 16 14:54:14 2011 +0000
@@ -223,6 +223,7 @@
 
     uint32_t console_port;
     unsigned long console_mfn;
+    unsigned long vm_generationid_addr;
 } libxl__domain_build_state;
 
 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Fri Dec 16 14:54:14 2011 +0000
@@ -184,6 +184,7 @@
                                        ("vpt_align", bool),
                                        ("timer_mode", integer),
                                        ("nested_hvm", bool),
+                                       ("no_incr_generationid", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Dec 16 14:54:14 2011 +0000
@@ -360,6 +360,8 @@
         printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
         printf("\t\t\t(timer_mode %d)\n", b_info->u.hvm.timer_mode);
         printf("\t\t\t(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
+        printf("\t\t\t(no_incr_generationid %d)\n",
+                    b_info->u.hvm.no_incr_generationid);
 
         printf("\t\t\t(device_model %s)\n", dm_info->device_model ? : "default");
         printf("\t\t\t(videoram %d)\n", dm_info->videoram);
@@ -1364,6 +1366,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
+    int no_incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info, libxl_device_model_info *dm_info)
@@ -1577,6 +1580,8 @@
         }
     }
 
+    d_config.b_info.u.hvm.no_incr_generationid = dom_info->no_incr_generationid;
+
     if (debug || dom_info->dryrun)
         printf_info(-1, &d_config, &d_config.dm_info);
 
@@ -2817,6 +2822,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
+    dom_info.no_incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c	Fri Dec 16 14:54:14 2011 +0000
@@ -175,6 +175,7 @@
 {
     int hvm, rc;
     int flags = XCFLAGS_LIVE;
+    unsigned long vm_generationid_addr;
 
     if (!s->domid) {
        s->errstr = "checkpoint state not opened";
@@ -185,16 +186,28 @@
 
     hvm = s->domtype > dt_pv;
     if (hvm) {
+       char path[128];
+       char *addr;
+
+       sprintf(path, "/local/domain/%u/hvmloader/generation-id-address", s->domid);
+       addr = xs_read(s->xsh, XBT_NULL, path, NULL);
+
+       vm_generationid_addr = (addr) ? strtoul(addr, NULL, 0) : 0;
+       free(addr);
+
        flags |= XCFLAGS_HVM;
        if (switch_qemu_logdirty(s, 1))
            return -1;
+    } else {
+       vm_generationid_addr = 0;
     }
     if (remus_flags & CHECKPOINT_FLAGS_COMPRESSION)
       flags |= XCFLAGS_CHECKPOINT_COMPRESS;
 
     callbacks->switch_qemu_logdirty = noop_switch_logdirty;
 
-    rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm);
+    rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm,
+                        vm_generationid_addr);
 
     if (hvm)
        switch_qemu_logdirty(s, 0);
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/xcutils/xc_restore.c
--- a/tools/xcutils/xc_restore.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/xcutils/xc_restore.c	Fri Dec 16 14:54:14 2011 +0000
@@ -46,7 +46,8 @@
 	    superpages = !!hvm;
 
     ret = xc_domain_restore(xch, io_fd, domid, store_evtchn, &store_mfn,
-                            console_evtchn, &console_mfn, hvm, pae, superpages);
+                            console_evtchn, &console_mfn, hvm, pae, superpages,
+                            0, NULL);
 
     if ( ret == 0 )
     {
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/xcutils/xc_save.c	Fri Dec 16 14:54:14 2011 +0000
@@ -208,7 +208,7 @@
     callbacks.suspend = suspend;
     callbacks.switch_qemu_logdirty = switch_qemu_logdirty;
     ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags, 
-                         &callbacks, !!(si.flags & XCFLAGS_HVM));
+                         &callbacks, !!(si.flags & XCFLAGS_HVM), 0);
 
     if (si.suspend_evtchn > 0)
 	 xc_suspend_evtchn_release(si.xch, si.xce, si.domid, si.suspend_evtchn);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzwy-0000XF-I0; Thu, 19 Jan 2012 21:55:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwx-0000X5-8C
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1327010060!53301953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18405 invoked from network); 19 Jan 2012 21:54:21 -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 Jan 2012 21:54:21 -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 1Rnzwt-0007Po-NF
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwt-0000aV-JM
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:11 +0000
Message-Id: <E1Rnzwt-0000aV-JM@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: VM generation ID save/restore
	and migrate.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1324047254 0
# Node ID 3c4c5df2cd0e6976aace47275cea070dd8f1295b
# Parent  92630d4b093eca22fdaf4b8b7a02a858a086cad7
tools: VM generation ID save/restore and migrate.

Add code to track the address of the VM generation ID buffer across a
save/restore or migrate, and increment it as necessary.
The address of the buffer is written into xenstore by hvmloader at
boot time. It must be read from xenstore by the caller of
xc_domain_save() and then written back again by the caller of
xc_domain_restore().

Note that the changes to xc_save.c and xc_restore.c are merely
sufficient for them to build.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/ia64/xc_ia64_linux_restore.c
--- a/tools/libxc/ia64/xc_ia64_linux_restore.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/ia64/xc_ia64_linux_restore.c	Fri Dec 16 14:54:14 2011 +0000
@@ -548,7 +548,9 @@
 xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                   unsigned int store_evtchn, unsigned long *store_mfn,
                   unsigned int console_evtchn, unsigned long *console_mfn,
-                  unsigned int hvm, unsigned int pae, int superpages)
+                  unsigned int hvm, unsigned int pae, int superpages,
+                  int no_incr_generationid,
+                  unsigned long *vm_generationid_addr)
 {
     DECLARE_DOMCTL;
     int rc = 1;
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/ia64/xc_ia64_linux_save.c
--- a/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Dec 16 14:54:14 2011 +0000
@@ -382,7 +382,8 @@
 int
 xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
                uint32_t max_factor, uint32_t flags,
-               struct save_callbacks* callbacks, int hvm)
+               struct save_callbacks* callbacks, int hvm,
+               unsigned long vm_generationid_addr)
 {
     DECLARE_DOMCTL;
     xc_dominfo_t info;
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Dec 16 14:54:14 2011 +0000
@@ -681,6 +681,7 @@
     uint64_t console_pfn;
     uint64_t acpi_ioport_location;
     uint64_t viridian;
+    uint64_t vm_generationid_addr;
 } pagebuf_t;
 
 static int pagebuf_init(pagebuf_t* buf)
@@ -860,6 +861,17 @@
         }
         return compbuf_size;
 
+    case XC_SAVE_ID_HVM_GENERATION_ID_ADDR:
+        /* Skip padding 4 bytes then read the generation id buffer location. */
+        if ( RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->vm_generationid_addr, sizeof(uint64_t)) )
+        {
+            PERROR("error read the generation id buffer location");
+            return -1;
+        }
+        DPRINTF("read generation id buffer address");
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
     default:
         if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
             ERROR("Max batch size exceeded (%d). Giving up.", count);
@@ -1248,7 +1260,9 @@
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       unsigned int store_evtchn, unsigned long *store_mfn,
                       unsigned int console_evtchn, unsigned long *console_mfn,
-                      unsigned int hvm, unsigned int pae, int superpages)
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int no_incr_generationid,
+                      unsigned long *vm_generationid_addr)
 {
     DECLARE_DOMCTL;
     int rc = 1, frc, i, j, n, m, pae_extended_cr3 = 0, ext_vcpucontext = 0;
@@ -1449,6 +1463,39 @@
                 xc_set_hvm_param(xch, dom, HVM_PARAM_VM86_TSS, pagebuf.vm86_tss);
             if ( pagebuf.console_pfn )
                 console_pfn = pagebuf.console_pfn;
+            if ( pagebuf.vm_generationid_addr ) {
+                if ( !no_incr_generationid ) {
+                    unsigned int offset;
+                    unsigned char *buf;
+                    unsigned long long generationid;
+
+                    /*
+                     * Map the VM generation id buffer and inject the new value.
+                     */
+
+                    pfn = pagebuf.vm_generationid_addr >> PAGE_SHIFT;
+                    offset = pagebuf.vm_generationid_addr & (PAGE_SIZE - 1);
+                
+                    if ( (pfn >= dinfo->p2m_size) ||
+                         (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB) )
+                    {
+                        ERROR("generation id buffer frame is bad");
+                        goto out;
+                    }
+
+                    mfn = ctx->p2m[pfn];
+                    buf = xc_map_foreign_range(xch, dom, PAGE_SIZE,
+                                               PROT_READ | PROT_WRITE, mfn);
+
+                    generationid = *(unsigned long long *)(buf + offset);
+                    *(unsigned long long *)(buf + offset) = generationid + 1;
+
+                    munmap(buf, PAGE_SIZE);
+                }
+
+                *vm_generationid_addr = pagebuf.vm_generationid_addr;
+            }
+
             break;  /* our work here is done */
         }
 
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xc_domain_save.c	Fri Dec 16 14:54:14 2011 +0000
@@ -804,7 +804,8 @@
 
 int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
                    uint32_t max_factor, uint32_t flags,
-                   struct save_callbacks* callbacks, int hvm)
+                   struct save_callbacks* callbacks, int hvm,
+                   unsigned long vm_generationid_addr)
 {
     xc_dominfo_t info;
     DECLARE_DOMCTL;
@@ -1616,6 +1617,16 @@
             uint64_t data;
         } chunk = { 0, };
 
+        chunk.id = XC_SAVE_ID_HVM_GENERATION_ID_ADDR;
+        chunk.data = vm_generationid_addr;
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the generation id buffer location for guest");
+            goto out;
+        }
+
         chunk.id = XC_SAVE_ID_HVM_IDENT_PT;
         chunk.data = 0;
         xc_get_hvm_param(xch, dom, HVM_PARAM_IDENT_PT,
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xenguest.h	Fri Dec 16 14:54:14 2011 +0000
@@ -58,7 +58,8 @@
  */
 int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
                    uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
-                   struct save_callbacks* callbacks, int hvm);
+                   struct save_callbacks* callbacks, int hvm,
+                   unsigned long vm_generationid_addr);
 
 
 /**
@@ -72,12 +73,16 @@
  * @parm hvm non-zero if this is a HVM restore
  * @parm pae non-zero if this HVM domain has PAE support enabled
  * @parm superpages non-zero to allocate guest memory with superpages
+ * @parm no_incr_generationid non-zero if generation id is NOT to be incremented
+ * @parm vm_generationid_addr returned with the address of the generation id buffer
  * @return 0 on success, -1 on failure
  */
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       unsigned int store_evtchn, unsigned long *store_mfn,
                       unsigned int console_evtchn, unsigned long *console_mfn,
-                      unsigned int hvm, unsigned int pae, int superpages);
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int no_incr_generationid,
+		      unsigned long *vm_generationid_addr);
 /**
  * xc_domain_restore writes a file to disk that contains the device
  * model saved state.
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxc/xg_save_restore.h	Fri Dec 16 14:54:14 2011 +0000
@@ -253,6 +253,7 @@
 #define XC_SAVE_ID_HVM_VIRIDIAN       -11
 #define XC_SAVE_ID_COMPRESSED_DATA    -12 /* Marker to indicate arrival of compressed data */
 #define XC_SAVE_ID_ENABLE_COMPRESSION -13 /* Marker to enable compression logic at receiver side */
+#define XC_SAVE_ID_HVM_GENERATION_ID_ADDR -14
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Dec 16 14:54:14 2011 +0000
@@ -99,6 +99,7 @@
         b_info->u.hvm.vpt_align = 1;
         b_info->u.hvm.timer_mode = 1;
         b_info->u.hvm.nested_hvm = 0;
+        b_info->u.hvm.no_incr_generationid = 0;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 8 * 1024;
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_dom.c	Fri Dec 16 14:54:14 2011 +0000
@@ -106,6 +106,7 @@
 
     state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid, 0);
     state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, 0);
+    state->vm_generationid_addr = 0;
     return 0;
 }
 
@@ -117,7 +118,7 @@
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *dom_path, *vm_path;
     xs_transaction_t t;
-    char **ents;
+    char **ents, **hvm_ents;
     int i;
 
     libxl_cpuid_apply_policy(ctx, domid);
@@ -143,6 +144,13 @@
                             ? "offline" : "online";
     }
 
+    hvm_ents = NULL;
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        hvm_ents = libxl__calloc(gc, 3, sizeof(char *));
+        hvm_ents[0] = "hvmloader/generation-id-address";
+        hvm_ents[1] = libxl__sprintf(gc, "0x%lx", state->vm_generationid_addr);
+    }
+
     dom_path = libxl__xs_get_dompath(gc, domid);
     if (!dom_path) {
         return ERROR_FAIL;
@@ -153,6 +161,9 @@
     t = xs_transaction_start(ctx->xsh);
 
     libxl__xs_writev(gc, t, dom_path, ents);
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+        libxl__xs_writev(gc, t, dom_path, hvm_ents);
+
     libxl__xs_writev(gc, t, dom_path, local_ents);
     libxl__xs_writev(gc, t, vm_path, vms_ents);
 
@@ -356,16 +367,19 @@
     /* read signature */
     int rc;
     int hvm, pae, superpages;
+    int no_incr_generationid;
     switch (info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         hvm = 1;
         superpages = 1;
         pae = info->u.hvm.pae;
+        no_incr_generationid = info->u.hvm.no_incr_generationid;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
         superpages = 0;
         pae = 1;
+        no_incr_generationid = 0;
         break;
     default:
         return ERROR_INVAL;
@@ -373,7 +387,8 @@
     rc = xc_domain_restore(ctx->xch, fd, domid,
                            state->store_port, &state->store_mfn,
                            state->console_port, &state->console_mfn,
-                           hvm, pae, superpages);
+                           hvm, pae, superpages, no_incr_generationid,
+                           &state->vm_generationid_addr);
     if ( rc ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "restoring domain");
         return ERROR_FAIL;
@@ -538,12 +553,23 @@
     struct save_callbacks callbacks;
     struct suspendinfo si;
     int hvm, rc = ERROR_FAIL;
+    unsigned long vm_generationid_addr;
 
     switch (type) {
-    case LIBXL_DOMAIN_TYPE_HVM:
+    case LIBXL_DOMAIN_TYPE_HVM: {
+        char *path;
+        char *addr;
+
+        path = libxl__sprintf(gc, "%s/hvmloader/generation-id-address",
+                              libxl__xs_get_dompath(gc, domid));
+        addr = libxl__xs_read(gc, XBT_NULL, path);
+
+        vm_generationid_addr = (addr) ? strtoul(addr, NULL, 0) : 0;
         hvm = 1;
         break;
+    }
     case LIBXL_DOMAIN_TYPE_PV:
+        vm_generationid_addr = 0;
         hvm = 0;
         break;
     default:
@@ -581,7 +607,8 @@
     callbacks.switch_qemu_logdirty = libxl__domain_suspend_common_switch_qemu_logdirty;
     callbacks.data = &si;
 
-    rc = xc_domain_save(ctx->xch, fd, domid, 0, 0, flags, &callbacks, hvm);
+    rc = xc_domain_save(ctx->xch, fd, domid, 0, 0, flags, &callbacks,
+                        hvm, vm_generationid_addr);
     if ( rc ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "saving domain: %s",
                          si.guest_responded ?
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Dec 16 14:54:14 2011 +0000
@@ -223,6 +223,7 @@
 
     uint32_t console_port;
     unsigned long console_mfn;
+    unsigned long vm_generationid_addr;
 } libxl__domain_build_state;
 
 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_types.idl	Fri Dec 16 14:54:14 2011 +0000
@@ -184,6 +184,7 @@
                                        ("vpt_align", bool),
                                        ("timer_mode", integer),
                                        ("nested_hvm", bool),
+                                       ("no_incr_generationid", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Fri Dec 16 14:54:14 2011 +0000
@@ -360,6 +360,8 @@
         printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
         printf("\t\t\t(timer_mode %d)\n", b_info->u.hvm.timer_mode);
         printf("\t\t\t(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
+        printf("\t\t\t(no_incr_generationid %d)\n",
+                    b_info->u.hvm.no_incr_generationid);
 
         printf("\t\t\t(device_model %s)\n", dm_info->device_model ? : "default");
         printf("\t\t\t(videoram %d)\n", dm_info->videoram);
@@ -1364,6 +1366,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
+    int no_incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info, libxl_device_model_info *dm_info)
@@ -1577,6 +1580,8 @@
         }
     }
 
+    d_config.b_info.u.hvm.no_incr_generationid = dom_info->no_incr_generationid;
+
     if (debug || dom_info->dryrun)
         printf_info(-1, &d_config, &d_config.dm_info);
 
@@ -2817,6 +2822,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
+    dom_info.no_incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c	Fri Dec 16 14:54:14 2011 +0000
@@ -175,6 +175,7 @@
 {
     int hvm, rc;
     int flags = XCFLAGS_LIVE;
+    unsigned long vm_generationid_addr;
 
     if (!s->domid) {
        s->errstr = "checkpoint state not opened";
@@ -185,16 +186,28 @@
 
     hvm = s->domtype > dt_pv;
     if (hvm) {
+       char path[128];
+       char *addr;
+
+       sprintf(path, "/local/domain/%u/hvmloader/generation-id-address", s->domid);
+       addr = xs_read(s->xsh, XBT_NULL, path, NULL);
+
+       vm_generationid_addr = (addr) ? strtoul(addr, NULL, 0) : 0;
+       free(addr);
+
        flags |= XCFLAGS_HVM;
        if (switch_qemu_logdirty(s, 1))
            return -1;
+    } else {
+       vm_generationid_addr = 0;
     }
     if (remus_flags & CHECKPOINT_FLAGS_COMPRESSION)
       flags |= XCFLAGS_CHECKPOINT_COMPRESS;
 
     callbacks->switch_qemu_logdirty = noop_switch_logdirty;
 
-    rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm);
+    rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm,
+                        vm_generationid_addr);
 
     if (hvm)
        switch_qemu_logdirty(s, 0);
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/xcutils/xc_restore.c
--- a/tools/xcutils/xc_restore.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/xcutils/xc_restore.c	Fri Dec 16 14:54:14 2011 +0000
@@ -46,7 +46,8 @@
 	    superpages = !!hvm;
 
     ret = xc_domain_restore(xch, io_fd, domid, store_evtchn, &store_mfn,
-                            console_evtchn, &console_mfn, hvm, pae, superpages);
+                            console_evtchn, &console_mfn, hvm, pae, superpages,
+                            0, NULL);
 
     if ( ret == 0 )
     {
diff -r 92630d4b093e -r 3c4c5df2cd0e tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/xcutils/xc_save.c	Fri Dec 16 14:54:14 2011 +0000
@@ -208,7 +208,7 @@
     callbacks.suspend = suspend;
     callbacks.switch_qemu_logdirty = switch_qemu_logdirty;
     ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags, 
-                         &callbacks, !!(si.flags & XCFLAGS_HVM));
+                         &callbacks, !!(si.flags & XCFLAGS_HVM), 0);
 
     if (si.suspend_evtchn > 0)
 	 xc_suspend_evtchn_release(si.xch, si.xce, si.domid, si.suspend_evtchn);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx4-0000ZL-6t; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000YS-Gj
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327010098!63195596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7798 invoked from network); 19 Jan 2012 21:54:59 -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;
	19 Jan 2012 21:54:59 -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 1Rnzx0-0007QR-4H
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000dg-3A
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Message-Id: <E1Rnzx0-0000dg-3A@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: add a new SMP bring up way for
	tboot case
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei, Gang <gang.wei@intel.com>
# Date 1326274485 -3600
# Node ID 9cdcedc133e5227c635dbb00bd4779015311107a
# Parent  da99d818b0070a751ee60f4abff98eeb0e08f8a6
x86: add a new SMP bring up way for tboot case

From: Wei, Gang <gang.wei@intel.com>

tboot may be trying to put APs waiting in MWAIT loops before launching
Xen. Xen could check the new flag field in v6 tboot shared page for the
hint. If TB_FLAG_AP_WAKE_SUPPORT bit in flag field is set, Xen BSP have
to write the monitored memory(g_tboot_shared->ap_wake_trigger) to bring
APs out of MWAIT loops. The sipi vector should be written in
g_tboot_shared->ap_wake_addr before waking up APs.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r da99d818b007 -r 9cdcedc133e5 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Mon Jan 09 17:07:32 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Wed Jan 11 10:34:45 2012 +0100
@@ -555,8 +555,7 @@
 
 static int do_boot_cpu(int apicid, int cpu)
 {
-    unsigned long boot_error;
-    int timeout, rc = 0;
+    int timeout, boot_error = 0, rc = 0;
     unsigned long start_eip;
 
     /*
@@ -586,7 +585,8 @@
     smpboot_setup_warm_reset_vector(start_eip);
 
     /* Starting actual IPI sequence... */
-    boot_error = wakeup_secondary_cpu(apicid, start_eip);
+    if ( !tboot_in_measured_env() || tboot_wake_ap(apicid, start_eip) )
+        boot_error = wakeup_secondary_cpu(apicid, start_eip);
 
     if ( !boot_error )
     {
diff -r da99d818b007 -r 9cdcedc133e5 xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Mon Jan 09 17:07:32 2012 +0100
+++ b/xen/arch/x86/tboot.c	Wed Jan 11 10:34:45 2012 +0100
@@ -123,6 +123,8 @@
     printk("  shutdown_entry: 0x%08x\n", tboot_shared->shutdown_entry);
     printk("  tboot_base: 0x%08x\n", tboot_shared->tboot_base);
     printk("  tboot_size: 0x%x\n", tboot_shared->tboot_size);
+    if ( tboot_shared->version >= 6 )
+        printk("  flags: 0x%08x\n", tboot_shared->flags);
 
     /* these will be needed by tboot_protect_mem_regions() and/or
        tboot_parse_dmar_table(), so get them now */
@@ -529,6 +531,18 @@
     panic("Memory integrity was lost on resume (%d)\n", error);
 }
 
+int tboot_wake_ap(int apicid, unsigned long sipi_vec)
+{
+    if ( g_tboot_shared->version >= 6 &&
+         (g_tboot_shared->flags & TB_FLAG_AP_WAKE_SUPPORT) )
+    {
+        g_tboot_shared->ap_wake_addr = sipi_vec;
+        g_tboot_shared->ap_wake_trigger = apicid;
+        return 0;
+    }
+    return 1;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r da99d818b007 -r 9cdcedc133e5 xen/include/asm-x86/tboot.h
--- a/xen/include/asm-x86/tboot.h	Mon Jan 09 17:07:32 2012 +0100
+++ b/xen/include/asm-x86/tboot.h	Wed Jan 11 10:34:45 2012 +0100
@@ -85,7 +85,7 @@
 typedef struct __packed {
     /* version 3+ fields: */
     uuid_t    uuid;              /* {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} */
-    uint32_t  version;           /* Version number; currently supports 0.4 */
+    uint32_t  version;           /* Version number; currently supports 0.6 */
     uint32_t  log_addr;          /* physical addr of tb_log_t log */
     uint32_t  shutdown_entry;    /* entry point for tboot shutdown */
     uint32_t  shutdown_type;     /* type of shutdown (TB_SHUTDOWN_*) */
@@ -99,6 +99,13 @@
     /* version 4+ fields: */
                                  /* populated by tboot; will be encrypted */
     uint8_t   s3_key[TB_KEY_SIZE];
+    /* version 5+ fields: */
+    uint8_t   reserved_align[3]; /* used to 4byte-align num_in_wfs */
+    uint32_t  num_in_wfs;        /* number of processors in wait-for-SIPI */
+    /* version 6+ fields: */
+    uint32_t  flags;
+    uint64_t  ap_wake_addr;      /* phys addr of kernel/VMM SIPI vector */
+    uint32_t  ap_wake_trigger;   /* kernel/VMM writes APIC ID to wake AP */
 } tboot_shared_t;
 
 #define TB_SHUTDOWN_REBOOT      0
@@ -107,6 +114,9 @@
 #define TB_SHUTDOWN_S3          3
 #define TB_SHUTDOWN_HALT        4
 
+#define TB_FLAG_AP_WAKE_SUPPORT   0x00000001  /* kernel/VMM use INIT-SIPI-SIPI
+                                                 if clear, ap_wake_* if set */
+
 /* {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} */
 #define TBOOT_SHARED_UUID    { 0x663c8dff, 0xe8b3, 0x4b82, 0xaabf, \
                                { 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8 } };
@@ -120,6 +130,7 @@
 int tboot_parse_dmar_table(acpi_table_handler dmar_handler);
 int tboot_s3_resume(void);
 void tboot_s3_error(int error);
+int tboot_wake_ap(int apicid, unsigned long sipi_vec);
 
 #endif /* __TBOOT_H__ */
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx4-0000ZL-6t; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000YS-Gj
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327010098!63195596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7798 invoked from network); 19 Jan 2012 21:54:59 -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;
	19 Jan 2012 21:54:59 -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 1Rnzx0-0007QR-4H
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000dg-3A
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Message-Id: <E1Rnzx0-0000dg-3A@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: add a new SMP bring up way for
	tboot case
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei, Gang <gang.wei@intel.com>
# Date 1326274485 -3600
# Node ID 9cdcedc133e5227c635dbb00bd4779015311107a
# Parent  da99d818b0070a751ee60f4abff98eeb0e08f8a6
x86: add a new SMP bring up way for tboot case

From: Wei, Gang <gang.wei@intel.com>

tboot may be trying to put APs waiting in MWAIT loops before launching
Xen. Xen could check the new flag field in v6 tboot shared page for the
hint. If TB_FLAG_AP_WAKE_SUPPORT bit in flag field is set, Xen BSP have
to write the monitored memory(g_tboot_shared->ap_wake_trigger) to bring
APs out of MWAIT loops. The sipi vector should be written in
g_tboot_shared->ap_wake_addr before waking up APs.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r da99d818b007 -r 9cdcedc133e5 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Mon Jan 09 17:07:32 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Wed Jan 11 10:34:45 2012 +0100
@@ -555,8 +555,7 @@
 
 static int do_boot_cpu(int apicid, int cpu)
 {
-    unsigned long boot_error;
-    int timeout, rc = 0;
+    int timeout, boot_error = 0, rc = 0;
     unsigned long start_eip;
 
     /*
@@ -586,7 +585,8 @@
     smpboot_setup_warm_reset_vector(start_eip);
 
     /* Starting actual IPI sequence... */
-    boot_error = wakeup_secondary_cpu(apicid, start_eip);
+    if ( !tboot_in_measured_env() || tboot_wake_ap(apicid, start_eip) )
+        boot_error = wakeup_secondary_cpu(apicid, start_eip);
 
     if ( !boot_error )
     {
diff -r da99d818b007 -r 9cdcedc133e5 xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Mon Jan 09 17:07:32 2012 +0100
+++ b/xen/arch/x86/tboot.c	Wed Jan 11 10:34:45 2012 +0100
@@ -123,6 +123,8 @@
     printk("  shutdown_entry: 0x%08x\n", tboot_shared->shutdown_entry);
     printk("  tboot_base: 0x%08x\n", tboot_shared->tboot_base);
     printk("  tboot_size: 0x%x\n", tboot_shared->tboot_size);
+    if ( tboot_shared->version >= 6 )
+        printk("  flags: 0x%08x\n", tboot_shared->flags);
 
     /* these will be needed by tboot_protect_mem_regions() and/or
        tboot_parse_dmar_table(), so get them now */
@@ -529,6 +531,18 @@
     panic("Memory integrity was lost on resume (%d)\n", error);
 }
 
+int tboot_wake_ap(int apicid, unsigned long sipi_vec)
+{
+    if ( g_tboot_shared->version >= 6 &&
+         (g_tboot_shared->flags & TB_FLAG_AP_WAKE_SUPPORT) )
+    {
+        g_tboot_shared->ap_wake_addr = sipi_vec;
+        g_tboot_shared->ap_wake_trigger = apicid;
+        return 0;
+    }
+    return 1;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r da99d818b007 -r 9cdcedc133e5 xen/include/asm-x86/tboot.h
--- a/xen/include/asm-x86/tboot.h	Mon Jan 09 17:07:32 2012 +0100
+++ b/xen/include/asm-x86/tboot.h	Wed Jan 11 10:34:45 2012 +0100
@@ -85,7 +85,7 @@
 typedef struct __packed {
     /* version 3+ fields: */
     uuid_t    uuid;              /* {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} */
-    uint32_t  version;           /* Version number; currently supports 0.4 */
+    uint32_t  version;           /* Version number; currently supports 0.6 */
     uint32_t  log_addr;          /* physical addr of tb_log_t log */
     uint32_t  shutdown_entry;    /* entry point for tboot shutdown */
     uint32_t  shutdown_type;     /* type of shutdown (TB_SHUTDOWN_*) */
@@ -99,6 +99,13 @@
     /* version 4+ fields: */
                                  /* populated by tboot; will be encrypted */
     uint8_t   s3_key[TB_KEY_SIZE];
+    /* version 5+ fields: */
+    uint8_t   reserved_align[3]; /* used to 4byte-align num_in_wfs */
+    uint32_t  num_in_wfs;        /* number of processors in wait-for-SIPI */
+    /* version 6+ fields: */
+    uint32_t  flags;
+    uint64_t  ap_wake_addr;      /* phys addr of kernel/VMM SIPI vector */
+    uint32_t  ap_wake_trigger;   /* kernel/VMM writes APIC ID to wake AP */
 } tboot_shared_t;
 
 #define TB_SHUTDOWN_REBOOT      0
@@ -107,6 +114,9 @@
 #define TB_SHUTDOWN_S3          3
 #define TB_SHUTDOWN_HALT        4
 
+#define TB_FLAG_AP_WAKE_SUPPORT   0x00000001  /* kernel/VMM use INIT-SIPI-SIPI
+                                                 if clear, ap_wake_* if set */
+
 /* {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} */
 #define TBOOT_SHARED_UUID    { 0x663c8dff, 0xe8b3, 0x4b82, 0xaabf, \
                                { 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8 } };
@@ -120,6 +130,7 @@
 int tboot_parse_dmar_table(acpi_table_handler dmar_handler);
 int tboot_s3_resume(void);
 void tboot_s3_error(int error);
+int tboot_wake_ap(int apicid, unsigned long sipi_vec);
 
 #endif /* __TBOOT_H__ */
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx0-0000Xl-Kl; Thu, 19 Jan 2012 21:55:18 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwy-0000Wt-Sc
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1327010109!9841594!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11322 invoked from network); 19 Jan 2012 21:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:10 -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 1Rnzwq-0007PZ-SC
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwq-0000ZE-Kj
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:08 +0000
Message-Id: <E1Rnzwq-0000ZE-Kj@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: Only retry mapping pages when
	ENOENT is returned
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326209701 0
# Node ID fc78d16447b49491c560c99491a9ce47cad5765f
# Parent  5b2676ac13218951698c49fa0350f2ac48220f3d
libxc: Only retry mapping pages when ENOENT is returned

If the return value from the ioctl() is not ENOENT, it's possible that err[i]
will not be updated and libxc will just loop forever.  Although it's unlikely
that err[i] would not be updated after the ioctl() gets through at least once,
it's better to be defensive.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 5b2676ac1321 -r fc78d16447b4 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Mon Jan 09 16:01:44 2012 +0100
+++ b/tools/libxc/xc_linux_osdep.c	Tue Jan 10 15:35:01 2012 +0000
@@ -232,7 +232,7 @@
             do {
                 usleep(100);
                 rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-            } while ( rc < 0 && err[i] == -ENOENT );
+            } while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT );
         }
     }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx0-0000Xl-Kl; Thu, 19 Jan 2012 21:55:18 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwy-0000Wt-Sc
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1327010109!9841594!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11322 invoked from network); 19 Jan 2012 21:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:10 -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 1Rnzwq-0007PZ-SC
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwq-0000ZE-Kj
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:08 +0000
Message-Id: <E1Rnzwq-0000ZE-Kj@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: Only retry mapping pages when
	ENOENT is returned
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326209701 0
# Node ID fc78d16447b49491c560c99491a9ce47cad5765f
# Parent  5b2676ac13218951698c49fa0350f2ac48220f3d
libxc: Only retry mapping pages when ENOENT is returned

If the return value from the ioctl() is not ENOENT, it's possible that err[i]
will not be updated and libxc will just loop forever.  Although it's unlikely
that err[i] would not be updated after the ioctl() gets through at least once,
it's better to be defensive.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 5b2676ac1321 -r fc78d16447b4 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Mon Jan 09 16:01:44 2012 +0100
+++ b/tools/libxc/xc_linux_osdep.c	Tue Jan 10 15:35:01 2012 +0000
@@ -232,7 +232,7 @@
             do {
                 usleep(100);
                 rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-            } while ( rc < 0 && err[i] == -ENOENT );
+            } while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT );
         }
     }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx4-0000Zb-9R; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000X7-SK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327010112!11630888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17451 invoked from network); 19 Jan 2012 21:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:13 -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 1Rnzwu-0007Pr-6e
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwu-0000ak-5U
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Message-Id: <E1Rnzwu-0000ak-5U@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap: remove local definitions and
	include byteswap.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID 9899992a9e662fe418346249057deb52cbbdb4b5
# Parent  3c4c5df2cd0e6976aace47275cea070dd8f1295b
blktap: remove local definitions and include byteswap.h

Use the same approach as tools/blktap2/include/libvhd.h, remove local
definitions of bswap* and include byteswap.h. Also remove the
HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
defined by QEMU).

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 3c4c5df2cd0e -r 9899992a9e66 tools/blktap/drivers/bswap.h
--- a/tools/blktap/drivers/bswap.h	Fri Dec 16 14:54:14 2011 +0000
+++ b/tools/blktap/drivers/bswap.h	Tue Dec 20 08:31:40 2011 +0100
@@ -13,45 +13,9 @@
 #define bswap_16(x) swap16(x)
 #define bswap_32(x) swap32(x)
 #define bswap_64(x) swap64(x)
-#else
+#elif defined(__linux__)
 
-#ifdef HAVE_BYTESWAP_H
 #include <byteswap.h>
-#else
-
-#define bswap_16(x) \
-({ \
-	uint16_t __x = (x); \
-	((uint16_t)( \
-		(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
-		(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
-})
-
-#define bswap_32(x) \
-({ \
-	uint32_t __x = (x); \
-	((uint32_t)( \
-		(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
-		(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) <<  8) | \
-		(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >>  8) | \
-		(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
-})
-
-#define bswap_64(x) \
-({ \
-	uint64_t __x = (x); \
-	((uint64_t)( \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) <<  8) | \
-	        (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >>  8) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
-})
-
-#endif /* !HAVE_BYTESWAP_H */
 
 static inline uint16_t bswap16(uint16_t x)
 {

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1Rnzx4-0000Zb-9R; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000X7-SK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327010112!11630888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17451 invoked from network); 19 Jan 2012 21:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:13 -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 1Rnzwu-0007Pr-6e
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwu-0000ak-5U
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Message-Id: <E1Rnzwu-0000ak-5U@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap: remove local definitions and
	include byteswap.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID 9899992a9e662fe418346249057deb52cbbdb4b5
# Parent  3c4c5df2cd0e6976aace47275cea070dd8f1295b
blktap: remove local definitions and include byteswap.h

Use the same approach as tools/blktap2/include/libvhd.h, remove local
definitions of bswap* and include byteswap.h. Also remove the
HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
defined by QEMU).

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 3c4c5df2cd0e -r 9899992a9e66 tools/blktap/drivers/bswap.h
--- a/tools/blktap/drivers/bswap.h	Fri Dec 16 14:54:14 2011 +0000
+++ b/tools/blktap/drivers/bswap.h	Tue Dec 20 08:31:40 2011 +0100
@@ -13,45 +13,9 @@
 #define bswap_16(x) swap16(x)
 #define bswap_32(x) swap32(x)
 #define bswap_64(x) swap64(x)
-#else
+#elif defined(__linux__)
 
-#ifdef HAVE_BYTESWAP_H
 #include <byteswap.h>
-#else
-
-#define bswap_16(x) \
-({ \
-	uint16_t __x = (x); \
-	((uint16_t)( \
-		(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
-		(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
-})
-
-#define bswap_32(x) \
-({ \
-	uint32_t __x = (x); \
-	((uint32_t)( \
-		(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
-		(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) <<  8) | \
-		(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >>  8) | \
-		(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
-})
-
-#define bswap_64(x) \
-({ \
-	uint64_t __x = (x); \
-	((uint64_t)( \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) <<  8) | \
-	        (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >>  8) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
-})
-
-#endif /* !HAVE_BYTESWAP_H */
 
 static inline uint16_t bswap16(uint16_t x)
 {

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx4-0000Zr-GC; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000X8-7T
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1327010113!9898676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6705 invoked from network); 19 Jan 2012 21:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwu-0007Pu-RN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwu-0000b1-Lr
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Message-Id: <E1Rnzwu-0000b1-Lr@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap2: remove local definitions
	and include byteswap.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID 1e3fa01b0c9e691e60862a19d1d8bd931c6e4d7d
# Parent  9899992a9e662fe418346249057deb52cbbdb4b5
blktap2: remove local definitions and include byteswap.h

Use the same approach as tools/blktap2/include/libvhd.h, remove local
definitions of bswap* and include byteswap.h. Also remove the
HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
defined by QEMU).

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 9899992a9e66 -r 1e3fa01b0c9e tools/blktap2/drivers/bswap.h
--- a/tools/blktap2/drivers/bswap.h	Tue Dec 20 08:31:40 2011 +0100
+++ b/tools/blktap2/drivers/bswap.h	Tue Dec 20 08:31:40 2011 +0100
@@ -13,45 +13,10 @@
 #define bswap_16(x) swap16(x)
 #define bswap_32(x) swap32(x)
 #define bswap_64(x) swap64(x)
-#else
+#elif defined(__linux__)
 
-#ifdef HAVE_BYTESWAP_H
+#include <endian.h>
 #include <byteswap.h>
-#else
-
-#define bswap_16(x) \
-({ \
-	uint16_t __x = (x); \
-	((uint16_t)( \
-		(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
-		(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
-})
-
-#define bswap_32(x) \
-({ \
-	uint32_t __x = (x); \
-	((uint32_t)( \
-		(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
-		(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) <<  8) | \
-		(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >>  8) | \
-		(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
-})
-
-#define bswap_64(x) \
-({ \
-	uint64_t __x = (x); \
-	((uint64_t)( \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) <<  8) | \
-	        (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >>  8) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
-})
-
-#endif /* !HAVE_BYTESWAP_H */
 
 static inline uint16_t bswap16(uint16_t x)
 {

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx4-0000Zr-GC; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000X8-7T
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1327010113!9898676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6705 invoked from network); 19 Jan 2012 21:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwu-0007Pu-RN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwu-0000b1-Lr
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:12 +0000
Message-Id: <E1Rnzwu-0000b1-Lr@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap2: remove local definitions
	and include byteswap.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID 1e3fa01b0c9e691e60862a19d1d8bd931c6e4d7d
# Parent  9899992a9e662fe418346249057deb52cbbdb4b5
blktap2: remove local definitions and include byteswap.h

Use the same approach as tools/blktap2/include/libvhd.h, remove local
definitions of bswap* and include byteswap.h. Also remove the
HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
defined by QEMU).

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 9899992a9e66 -r 1e3fa01b0c9e tools/blktap2/drivers/bswap.h
--- a/tools/blktap2/drivers/bswap.h	Tue Dec 20 08:31:40 2011 +0100
+++ b/tools/blktap2/drivers/bswap.h	Tue Dec 20 08:31:40 2011 +0100
@@ -13,45 +13,10 @@
 #define bswap_16(x) swap16(x)
 #define bswap_32(x) swap32(x)
 #define bswap_64(x) swap64(x)
-#else
+#elif defined(__linux__)
 
-#ifdef HAVE_BYTESWAP_H
+#include <endian.h>
 #include <byteswap.h>
-#else
-
-#define bswap_16(x) \
-({ \
-	uint16_t __x = (x); \
-	((uint16_t)( \
-		(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
-		(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
-})
-
-#define bswap_32(x) \
-({ \
-	uint32_t __x = (x); \
-	((uint32_t)( \
-		(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
-		(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) <<  8) | \
-		(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >>  8) | \
-		(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
-})
-
-#define bswap_64(x) \
-({ \
-	uint64_t __x = (x); \
-	((uint64_t)( \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) <<  8) | \
-	        (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >>  8) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
-		(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
-})
-
-#endif /* !HAVE_BYTESWAP_H */
 
 static inline uint16_t bswap16(uint16_t x)
 {

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx3-0000Yu-4C; Thu, 19 Jan 2012 21:55:21 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx1-0000X4-S8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1327010111!8489808!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20328 invoked from network); 19 Jan 2012 21:55:12 -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;
	19 Jan 2012 21:55:12 -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 1Rnzwt-0007Pl-5Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzws-0000aF-T8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:10 +0000
Message-Id: <E1Rnzws-0000aF-T8@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Add hvm specific ro and rw
	nodes.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1324047253 0
# Node ID 92630d4b093eca22fdaf4b8b7a02a858a086cad7
# Parent  ef2264bbebe1d14666f3c61ca3cf4f1dd16a21b2
libxl: Add hvm specific ro and rw nodes.

The hvmloader node was created by libxl__create_device_model() but it
needs to be moved earlier so that it can parent the new rw
generation-id-address node.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ef2264bbebe1 -r 92630d4b093e tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
@@ -423,6 +423,10 @@
     libxl__xs_mkdir(gc, t,
                     libxl__sprintf(gc, "%s/control", dom_path),
                     roperm, ARRAY_SIZE(roperm));
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+        libxl__xs_mkdir(gc, t,
+                        libxl__sprintf(gc, "%s/hvmloader", dom_path),
+                        roperm, ARRAY_SIZE(roperm));
 
     libxl__xs_mkdir(gc, t,
                     libxl__sprintf(gc, "%s/control/shutdown", dom_path),
@@ -433,6 +437,10 @@
     libxl__xs_mkdir(gc, t,
                     libxl__sprintf(gc, "%s/data", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+        libxl__xs_mkdir(gc, t,
+            libxl__sprintf(gc, "%s/hvmloader/generation-id-address", dom_path),
+                        rwperm, ARRAY_SIZE(rwperm));
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
diff -r ef2264bbebe1 -r 92630d4b093e tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_dm.c	Fri Dec 16 14:54:13 2011 +0000
@@ -827,10 +827,10 @@
         goto out;
     }
 
-    path = libxl__sprintf(gc, "/local/domain/%d/hvmloader", info->domid);
-    xs_mkdir(ctx->xsh, XBT_NULL, path);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/bios", path),
+    path = xs_get_domain_path(ctx->xsh, info->domid);
+    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path),
                     "%s", libxl__domain_bios(gc, info));
+    free(path);
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx3-0000Yu-4C; Thu, 19 Jan 2012 21:55:21 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx1-0000X4-S8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1327010111!8489808!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20328 invoked from network); 19 Jan 2012 21:55:12 -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;
	19 Jan 2012 21:55:12 -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 1Rnzwt-0007Pl-5Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzws-0000aF-T8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:10 +0000
Message-Id: <E1Rnzws-0000aF-T8@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Add hvm specific ro and rw
	nodes.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1324047253 0
# Node ID 92630d4b093eca22fdaf4b8b7a02a858a086cad7
# Parent  ef2264bbebe1d14666f3c61ca3cf4f1dd16a21b2
libxl: Add hvm specific ro and rw nodes.

The hvmloader node was created by libxl__create_device_model() but it
needs to be moved earlier so that it can parent the new rw
generation-id-address node.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ef2264bbebe1 -r 92630d4b093e tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Dec 16 14:54:13 2011 +0000
@@ -423,6 +423,10 @@
     libxl__xs_mkdir(gc, t,
                     libxl__sprintf(gc, "%s/control", dom_path),
                     roperm, ARRAY_SIZE(roperm));
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+        libxl__xs_mkdir(gc, t,
+                        libxl__sprintf(gc, "%s/hvmloader", dom_path),
+                        roperm, ARRAY_SIZE(roperm));
 
     libxl__xs_mkdir(gc, t,
                     libxl__sprintf(gc, "%s/control/shutdown", dom_path),
@@ -433,6 +437,10 @@
     libxl__xs_mkdir(gc, t,
                     libxl__sprintf(gc, "%s/data", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
+    if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+        libxl__xs_mkdir(gc, t,
+            libxl__sprintf(gc, "%s/hvmloader/generation-id-address", dom_path),
+                        rwperm, ARRAY_SIZE(rwperm));
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
diff -r ef2264bbebe1 -r 92630d4b093e tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Dec 16 14:54:13 2011 +0000
+++ b/tools/libxl/libxl_dm.c	Fri Dec 16 14:54:13 2011 +0000
@@ -827,10 +827,10 @@
         goto out;
     }
 
-    path = libxl__sprintf(gc, "/local/domain/%d/hvmloader", info->domid);
-    xs_mkdir(ctx->xsh, XBT_NULL, path);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/bios", path),
+    path = xs_get_domain_path(ctx->xsh, info->domid);
+    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path),
                     "%s", libxl__domain_bios(gc, info));
+    free(path);
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx4-0000Zy-Im; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000XD-DW
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327010113!11550889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32622 invoked from network); 19 Jan 2012 21:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwv-0007Px-9q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwv-0000bG-5W
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Message-Id: <E1Rnzwv-0000bG-5W@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: detect if libiconv is present
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID 7bc8cf556c0c59d691e238130124f6af2377ceb8
# Parent  1e3fa01b0c9e691e60862a19d1d8bd931c6e4d7d
build: detect if libiconv is present

Detect if libiconv is present in the system, since we will have to
link against it when using iconv.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 1e3fa01b0c9e -r 7bc8cf556c0c Config.mk
--- a/Config.mk	Tue Dec 20 08:31:40 2011 +0100
+++ b/Config.mk	Tue Dec 20 08:31:40 2011 +0100
@@ -181,6 +181,11 @@
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
+CONFIG_LIBICONV   := $(shell export OS="`uname -s`"; \
+                       export CHECK_LIB="$(CHECK_LIB)"; \
+                       . $(XEN_ROOT)/tools/check/funcs.sh; \
+                       has_lib libiconv.so && echo 'y' || echo 'n')
+
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
 FLASK_ENABLE ?= $(XSM_ENABLE)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx4-0000Zy-Im; Thu, 19 Jan 2012 21:55:22 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000XD-DW
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327010113!11550889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32622 invoked from network); 19 Jan 2012 21:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwv-0007Px-9q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwv-0000bG-5W
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Message-Id: <E1Rnzwv-0000bG-5W@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: detect if libiconv is present
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID 7bc8cf556c0c59d691e238130124f6af2377ceb8
# Parent  1e3fa01b0c9e691e60862a19d1d8bd931c6e4d7d
build: detect if libiconv is present

Detect if libiconv is present in the system, since we will have to
link against it when using iconv.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 1e3fa01b0c9e -r 7bc8cf556c0c Config.mk
--- a/Config.mk	Tue Dec 20 08:31:40 2011 +0100
+++ b/Config.mk	Tue Dec 20 08:31:40 2011 +0100
@@ -181,6 +181,11 @@
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
+CONFIG_LIBICONV   := $(shell export OS="`uname -s`"; \
+                       export CHECK_LIB="$(CHECK_LIB)"; \
+                       . $(XEN_ROOT)/tools/check/funcs.sh; \
+                       has_lib libiconv.so && echo 'y' || echo 'n')
+
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
 FLASK_ENABLE ?= $(XSM_ENABLE)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx6-0000dS-Ob; Thu, 19 Jan 2012 21:55:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000XS-06
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1327010115!9693696!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5006 invoked from network); 19 Jan 2012 21:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:16 -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 1Rnzwv-0007Q0-Pp
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwv-0000bV-LT
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Message-Id: <E1Rnzwv-0000bV-LT@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap2/vhd: add -liconv when
	linking if using libiconv
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID e8f705bc9e59d30f264e3a868ad9ba59f39cfbf1
# Parent  7bc8cf556c0c59d691e238130124f6af2377ceb8
blktap2/vhd: add -liconv when linking if using libiconv

If libiconv is detected on the system add -liconv when linking the
libvhd library.

If -liconv is not added when compiling libvhd with libiconv the
following error occours when linking vhd-util and vhd-update:

gcc     -o vhd-util vhd-util.o -Llib -lvhd
lib/libvhd.so: undefined reference to `libiconv_open'
lib/libvhd.so: undefined reference to `libiconv_close'
lib/libvhd.so: undefined reference to `libiconv'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7bc8cf556c0c -r e8f705bc9e59 tools/blktap2/vhd/lib/Makefile
--- a/tools/blktap2/vhd/lib/Makefile	Tue Dec 20 08:31:40 2011 +0100
+++ b/tools/blktap2/vhd/lib/Makefile	Tue Dec 20 08:31:40 2011 +0100
@@ -23,6 +23,10 @@
 LIBS            := -luuid
 endif
 
+ifeq ($(CONFIG_LIBICONV),y)
+LIBS            += -liconv
+endif
+
 LIB-SRCS        := libvhd.c
 LIB-SRCS        += libvhd-journal.c
 LIB-SRCS        += vhd-util-coalesce.c

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx6-0000dS-Ob; Thu, 19 Jan 2012 21:55:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000XS-06
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1327010115!9693696!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5006 invoked from network); 19 Jan 2012 21:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:16 -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 1Rnzwv-0007Q0-Pp
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwv-0000bV-LT
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:13 +0000
Message-Id: <E1Rnzwv-0000bV-LT@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap2/vhd: add -liconv when
	linking if using libiconv
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1324366300 -3600
# Node ID e8f705bc9e59d30f264e3a868ad9ba59f39cfbf1
# Parent  7bc8cf556c0c59d691e238130124f6af2377ceb8
blktap2/vhd: add -liconv when linking if using libiconv

If libiconv is detected on the system add -liconv when linking the
libvhd library.

If -liconv is not added when compiling libvhd with libiconv the
following error occours when linking vhd-util and vhd-update:

gcc     -o vhd-util vhd-util.o -Llib -lvhd
lib/libvhd.so: undefined reference to `libiconv_open'
lib/libvhd.so: undefined reference to `libiconv_close'
lib/libvhd.so: undefined reference to `libiconv'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7bc8cf556c0c -r e8f705bc9e59 tools/blktap2/vhd/lib/Makefile
--- a/tools/blktap2/vhd/lib/Makefile	Tue Dec 20 08:31:40 2011 +0100
+++ b/tools/blktap2/vhd/lib/Makefile	Tue Dec 20 08:31:40 2011 +0100
@@ -23,6 +23,10 @@
 LIBS            := -luuid
 endif
 
+ifeq ($(CONFIG_LIBICONV),y)
+LIBS            += -liconv
+endif
+
 LIB-SRCS        := libvhd.c
 LIB-SRCS        += libvhd-journal.c
 LIB-SRCS        += vhd-util-coalesce.c

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx7-0000e4-2n; Thu, 19 Jan 2012 21:55:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000bN-Tu
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1327010100!49501226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3147 invoked from network); 19 Jan 2012 21:55:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:01 -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 1Rnzx3-0007Qj-A6
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000f9-8Y
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Message-Id: <E1Rnzx3-0000f9-8Y@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Refactoring iommu ring
	buffer definition
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372537 -3600
# Node ID d59816959ac09deb033c966c5d170a482472104a
# Parent  8d2fa20dd3f37e5f2c670f2b0cd56649fcea8000
amd iommu: Refactoring iommu ring buffer definition

Introduce struct ring_buffer to represent iommu cmd buffer, event log and ppr log

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 8d2fa20dd3f3 -r d59816959ac0 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:45:47 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:48:57 2012 +0100
@@ -29,7 +29,7 @@
     u32 tail, head, *cmd_buffer;
     int i;
 
-    tail = iommu->cmd_buffer_tail;
+    tail = iommu->cmd_buffer.tail;
     if ( ++tail == iommu->cmd_buffer.entries )
         tail = 0;
 
@@ -40,13 +40,13 @@
     if ( head != tail )
     {
         cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
-                             (iommu->cmd_buffer_tail *
+                             (iommu->cmd_buffer.tail *
                              IOMMU_CMD_BUFFER_ENTRY_SIZE));
 
         for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
             cmd_buffer[i] = cmd[i];
 
-        iommu->cmd_buffer_tail = tail;
+        iommu->cmd_buffer.tail = tail;
         return 1;
     }
 
@@ -57,7 +57,7 @@
 {
     u32 tail;
 
-    set_field_in_reg_u32(iommu->cmd_buffer_tail, 0,
+    set_field_in_reg_u32(iommu->cmd_buffer.tail, 0,
                          IOMMU_CMD_BUFFER_TAIL_MASK,
                          IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
     writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
diff -r 8d2fa20dd3f3 -r d59816959ac0 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:45:47 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:48:57 2012 +0100
@@ -294,20 +294,20 @@
                                   IOMMU_EVENT_LOG_TAIL_MASK,
                                   IOMMU_EVENT_LOG_TAIL_SHIFT);
 
-    while ( tail != iommu->event_log_head )
+    while ( tail != iommu->event_log.head )
     {
         /* read event log entry */
         event_log = (u32 *)(iommu->event_log.buffer +
-                           (iommu->event_log_head *
+                           (iommu->event_log.head *
                            IOMMU_EVENT_LOG_ENTRY_SIZE));
 
         parse_event_log_entry(iommu, event_log);
 
-        if ( ++iommu->event_log_head == iommu->event_log.entries )
-            iommu->event_log_head = 0;
+        if ( ++iommu->event_log.head == iommu->event_log.entries )
+            iommu->event_log.head = 0;
 
         /* update head pointer */
-        set_field_in_reg_u32(iommu->event_log_head, 0,
+        set_field_in_reg_u32(iommu->event_log.head, 0,
                              IOMMU_EVENT_LOG_HEAD_MASK,
                              IOMMU_EVENT_LOG_HEAD_SHIFT, &head);
         writel(head, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
@@ -346,7 +346,7 @@
     writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
 
     /*reset event log base address */
-    iommu->event_log_head = 0;
+    iommu->event_log.head = 0;
 
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
 }
@@ -605,71 +605,82 @@
 
 }
 
-static void __init deallocate_iommu_table_struct(
-    struct table_struct *table)
+static void __init deallocate_buffer(void *buf, uint32_t sz)
 {
     int order = 0;
-    if ( table->buffer )
+    if ( buf )
     {
-        order = get_order_from_bytes(table->alloc_size);
-        __free_amd_iommu_tables(table->buffer, order);
-        table->buffer = NULL;
+        order = get_order_from_bytes(sz);
+        __free_amd_iommu_tables(buf, order);
     }
 }
 
-static int __init allocate_iommu_table_struct(struct table_struct *table,
-                                              const char *name)
+static void __init deallocate_device_table(struct table_struct *table)
 {
-    int order = 0;
-    if ( table->buffer == NULL )
-    {
-        order = get_order_from_bytes(table->alloc_size);
-        table->buffer = __alloc_amd_iommu_tables(order);
-
-        if ( table->buffer == NULL )
-        {
-            AMD_IOMMU_DEBUG("Error allocating %s\n", name);
-            return -ENOMEM;
-        }
-        memset(table->buffer, 0, PAGE_SIZE * (1UL << order));
-    }
-    return 0;
+    deallocate_buffer(table->buffer, table->alloc_size);
+    table->buffer = NULL;
 }
 
-static int __init allocate_cmd_buffer(struct amd_iommu *iommu)
+static void __init deallocate_ring_buffer(struct ring_buffer *ring_buf)
+{
+    deallocate_buffer(ring_buf->buffer, ring_buf->alloc_size);
+    ring_buf->buffer = NULL;
+    ring_buf->head = 0;
+    ring_buf->tail = 0;
+}
+
+static void * __init allocate_buffer(uint32_t alloc_size, const char *name)
+{
+    void * buffer;
+    int order = get_order_from_bytes(alloc_size);
+
+    buffer = __alloc_amd_iommu_tables(order);
+
+    if ( buffer == NULL )
+    {
+        AMD_IOMMU_DEBUG("Error allocating %s\n", name);
+        return NULL;
+    }
+
+    memset(buffer, 0, PAGE_SIZE * (1UL << order));
+    return buffer;
+}
+
+static void * __init allocate_ring_buffer(struct ring_buffer *ring_buf,
+                                          uint32_t entry_size,
+                                          uint64_t entries, const char *name)
+{
+    ring_buf->head = 0;
+    ring_buf->tail = 0;
+
+    ring_buf->alloc_size = PAGE_SIZE << get_order_from_bytes(entries *
+                                                             entry_size);
+    ring_buf->entries = ring_buf->alloc_size / entry_size;
+    ring_buf->buffer = allocate_buffer(ring_buf->alloc_size, name);
+    return ring_buf->buffer;
+}
+
+static void * __init allocate_cmd_buffer(struct amd_iommu *iommu)
 {
     /* allocate 'command buffer' in power of 2 increments of 4K */
-    iommu->cmd_buffer_tail = 0;
-    iommu->cmd_buffer.alloc_size = PAGE_SIZE <<
-                                   get_order_from_bytes(
-                                   PAGE_ALIGN(IOMMU_CMD_BUFFER_DEFAULT_ENTRIES
-                                              * IOMMU_CMD_BUFFER_ENTRY_SIZE));
-    iommu->cmd_buffer.entries = iommu->cmd_buffer.alloc_size /
-                                IOMMU_CMD_BUFFER_ENTRY_SIZE;
-
-    return (allocate_iommu_table_struct(&iommu->cmd_buffer, "Command Buffer"));
+    return allocate_ring_buffer(&iommu->cmd_buffer, sizeof(cmd_entry_t),
+                                IOMMU_CMD_BUFFER_DEFAULT_ENTRIES,
+                                "Command Buffer");
 }
 
-static int __init allocate_event_log(struct amd_iommu *iommu)
+static void * __init allocate_event_log(struct amd_iommu *iommu)
 {
-   /* allocate 'event log' in power of 2 increments of 4K */
-    iommu->event_log_head = 0;
-    iommu->event_log.alloc_size = PAGE_SIZE <<
-                                  get_order_from_bytes(
-                                  PAGE_ALIGN(IOMMU_EVENT_LOG_DEFAULT_ENTRIES *
-                                  IOMMU_EVENT_LOG_ENTRY_SIZE));
-    iommu->event_log.entries = iommu->event_log.alloc_size /
-                               IOMMU_EVENT_LOG_ENTRY_SIZE;
-
-    return (allocate_iommu_table_struct(&iommu->event_log, "Event Log"));
+    /* allocate 'event log' in power of 2 increments of 4K */
+    return allocate_ring_buffer(&iommu->event_log, sizeof(event_entry_t),
+                                IOMMU_EVENT_LOG_DEFAULT_ENTRIES, "Event Log");
 }
 
 static int __init amd_iommu_init_one(struct amd_iommu *iommu)
 {
-    if ( allocate_cmd_buffer(iommu) != 0 )
+    if ( allocate_cmd_buffer(iommu) == NULL )
         goto error_out;
 
-    if ( allocate_event_log(iommu) != 0 )
+    if ( allocate_event_log(iommu) == NULL )
         goto error_out;
 
     if ( map_iommu_mmio_region(iommu) != 0 )
@@ -708,8 +719,8 @@
         list_del(&iommu->list);
         if ( iommu->enabled )
         {
-            deallocate_iommu_table_struct(&iommu->cmd_buffer);
-            deallocate_iommu_table_struct(&iommu->event_log);
+            deallocate_ring_buffer(&iommu->cmd_buffer);
+            deallocate_ring_buffer(&iommu->event_log);
             unmap_iommu_mmio_region(iommu);
         }
         xfree(iommu);
@@ -719,7 +730,7 @@
     iterate_ivrs_entries(amd_iommu_free_intremap_table);
 
     /* free device table */
-    deallocate_iommu_table_struct(&device_table);
+    deallocate_device_table(&device_table);
 
     /* free ivrs_mappings[] */
     radix_tree_destroy(&ivrs_maps, xfree);
@@ -830,8 +841,10 @@
     device_table.entries = device_table.alloc_size /
                            IOMMU_DEV_TABLE_ENTRY_SIZE;
 
-    if ( allocate_iommu_table_struct(&device_table, "Device Table") != 0 )
-         return -ENOMEM;
+    device_table.buffer = allocate_buffer(device_table.alloc_size,
+                                          "Device Table");
+    if  ( device_table.buffer == NULL )
+        return -ENOMEM;
 
     /* Add device table entries */
     for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
diff -r 8d2fa20dd3f3 -r d59816959ac0 xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:45:47 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:48:57 2012 +0100
@@ -30,12 +30,42 @@
 
 extern struct list_head amd_iommu_head;
 
+#pragma pack(1)
+typedef struct event_entry
+{
+    uint32_t data[4];
+} event_entry_t;
+
+typedef struct ppr_entry
+{
+    uint32_t data[4];
+} ppr_entry_t;
+
+typedef struct cmd_entry
+{
+    uint32_t data[4];
+} cmd_entry_t;
+
+typedef struct dev_entry
+{
+    uint32_t data[8];
+} dev_entry_t;
+#pragma pack()
+
 struct table_struct {
     void *buffer;
     unsigned long entries;
     unsigned long alloc_size;
 };
 
+struct ring_buffer {
+    void *buffer;
+    unsigned long entries;
+    unsigned long alloc_size;
+    uint32_t tail;
+    uint32_t head;
+};
+
 typedef struct iommu_cap {
     uint32_t header;                    /* offset 00h */
     uint32_t base_low;                  /* offset 04h */
@@ -60,10 +90,8 @@
     unsigned long mmio_base_phys;
 
     struct table_struct dev_table;
-    struct table_struct cmd_buffer;
-    u32 cmd_buffer_tail;
-    struct table_struct event_log;
-    u32 event_log_head;
+    struct ring_buffer cmd_buffer;
+    struct ring_buffer event_log;
 
     int exclusion_enable;
     int exclusion_allow_all;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx7-0000e4-2n; Thu, 19 Jan 2012 21:55:25 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000bN-Tu
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1327010100!49501226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3147 invoked from network); 19 Jan 2012 21:55:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:01 -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 1Rnzx3-0007Qj-A6
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000f9-8Y
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Message-Id: <E1Rnzx3-0000f9-8Y@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Refactoring iommu ring
	buffer definition
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372537 -3600
# Node ID d59816959ac09deb033c966c5d170a482472104a
# Parent  8d2fa20dd3f37e5f2c670f2b0cd56649fcea8000
amd iommu: Refactoring iommu ring buffer definition

Introduce struct ring_buffer to represent iommu cmd buffer, event log and ppr log

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 8d2fa20dd3f3 -r d59816959ac0 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:45:47 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:48:57 2012 +0100
@@ -29,7 +29,7 @@
     u32 tail, head, *cmd_buffer;
     int i;
 
-    tail = iommu->cmd_buffer_tail;
+    tail = iommu->cmd_buffer.tail;
     if ( ++tail == iommu->cmd_buffer.entries )
         tail = 0;
 
@@ -40,13 +40,13 @@
     if ( head != tail )
     {
         cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
-                             (iommu->cmd_buffer_tail *
+                             (iommu->cmd_buffer.tail *
                              IOMMU_CMD_BUFFER_ENTRY_SIZE));
 
         for ( i = 0; i < IOMMU_CMD_BUFFER_U32_PER_ENTRY; i++ )
             cmd_buffer[i] = cmd[i];
 
-        iommu->cmd_buffer_tail = tail;
+        iommu->cmd_buffer.tail = tail;
         return 1;
     }
 
@@ -57,7 +57,7 @@
 {
     u32 tail;
 
-    set_field_in_reg_u32(iommu->cmd_buffer_tail, 0,
+    set_field_in_reg_u32(iommu->cmd_buffer.tail, 0,
                          IOMMU_CMD_BUFFER_TAIL_MASK,
                          IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
     writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
diff -r 8d2fa20dd3f3 -r d59816959ac0 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:45:47 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:48:57 2012 +0100
@@ -294,20 +294,20 @@
                                   IOMMU_EVENT_LOG_TAIL_MASK,
                                   IOMMU_EVENT_LOG_TAIL_SHIFT);
 
-    while ( tail != iommu->event_log_head )
+    while ( tail != iommu->event_log.head )
     {
         /* read event log entry */
         event_log = (u32 *)(iommu->event_log.buffer +
-                           (iommu->event_log_head *
+                           (iommu->event_log.head *
                            IOMMU_EVENT_LOG_ENTRY_SIZE));
 
         parse_event_log_entry(iommu, event_log);
 
-        if ( ++iommu->event_log_head == iommu->event_log.entries )
-            iommu->event_log_head = 0;
+        if ( ++iommu->event_log.head == iommu->event_log.entries )
+            iommu->event_log.head = 0;
 
         /* update head pointer */
-        set_field_in_reg_u32(iommu->event_log_head, 0,
+        set_field_in_reg_u32(iommu->event_log.head, 0,
                              IOMMU_EVENT_LOG_HEAD_MASK,
                              IOMMU_EVENT_LOG_HEAD_SHIFT, &head);
         writel(head, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
@@ -346,7 +346,7 @@
     writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
 
     /*reset event log base address */
-    iommu->event_log_head = 0;
+    iommu->event_log.head = 0;
 
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
 }
@@ -605,71 +605,82 @@
 
 }
 
-static void __init deallocate_iommu_table_struct(
-    struct table_struct *table)
+static void __init deallocate_buffer(void *buf, uint32_t sz)
 {
     int order = 0;
-    if ( table->buffer )
+    if ( buf )
     {
-        order = get_order_from_bytes(table->alloc_size);
-        __free_amd_iommu_tables(table->buffer, order);
-        table->buffer = NULL;
+        order = get_order_from_bytes(sz);
+        __free_amd_iommu_tables(buf, order);
     }
 }
 
-static int __init allocate_iommu_table_struct(struct table_struct *table,
-                                              const char *name)
+static void __init deallocate_device_table(struct table_struct *table)
 {
-    int order = 0;
-    if ( table->buffer == NULL )
-    {
-        order = get_order_from_bytes(table->alloc_size);
-        table->buffer = __alloc_amd_iommu_tables(order);
-
-        if ( table->buffer == NULL )
-        {
-            AMD_IOMMU_DEBUG("Error allocating %s\n", name);
-            return -ENOMEM;
-        }
-        memset(table->buffer, 0, PAGE_SIZE * (1UL << order));
-    }
-    return 0;
+    deallocate_buffer(table->buffer, table->alloc_size);
+    table->buffer = NULL;
 }
 
-static int __init allocate_cmd_buffer(struct amd_iommu *iommu)
+static void __init deallocate_ring_buffer(struct ring_buffer *ring_buf)
+{
+    deallocate_buffer(ring_buf->buffer, ring_buf->alloc_size);
+    ring_buf->buffer = NULL;
+    ring_buf->head = 0;
+    ring_buf->tail = 0;
+}
+
+static void * __init allocate_buffer(uint32_t alloc_size, const char *name)
+{
+    void * buffer;
+    int order = get_order_from_bytes(alloc_size);
+
+    buffer = __alloc_amd_iommu_tables(order);
+
+    if ( buffer == NULL )
+    {
+        AMD_IOMMU_DEBUG("Error allocating %s\n", name);
+        return NULL;
+    }
+
+    memset(buffer, 0, PAGE_SIZE * (1UL << order));
+    return buffer;
+}
+
+static void * __init allocate_ring_buffer(struct ring_buffer *ring_buf,
+                                          uint32_t entry_size,
+                                          uint64_t entries, const char *name)
+{
+    ring_buf->head = 0;
+    ring_buf->tail = 0;
+
+    ring_buf->alloc_size = PAGE_SIZE << get_order_from_bytes(entries *
+                                                             entry_size);
+    ring_buf->entries = ring_buf->alloc_size / entry_size;
+    ring_buf->buffer = allocate_buffer(ring_buf->alloc_size, name);
+    return ring_buf->buffer;
+}
+
+static void * __init allocate_cmd_buffer(struct amd_iommu *iommu)
 {
     /* allocate 'command buffer' in power of 2 increments of 4K */
-    iommu->cmd_buffer_tail = 0;
-    iommu->cmd_buffer.alloc_size = PAGE_SIZE <<
-                                   get_order_from_bytes(
-                                   PAGE_ALIGN(IOMMU_CMD_BUFFER_DEFAULT_ENTRIES
-                                              * IOMMU_CMD_BUFFER_ENTRY_SIZE));
-    iommu->cmd_buffer.entries = iommu->cmd_buffer.alloc_size /
-                                IOMMU_CMD_BUFFER_ENTRY_SIZE;
-
-    return (allocate_iommu_table_struct(&iommu->cmd_buffer, "Command Buffer"));
+    return allocate_ring_buffer(&iommu->cmd_buffer, sizeof(cmd_entry_t),
+                                IOMMU_CMD_BUFFER_DEFAULT_ENTRIES,
+                                "Command Buffer");
 }
 
-static int __init allocate_event_log(struct amd_iommu *iommu)
+static void * __init allocate_event_log(struct amd_iommu *iommu)
 {
-   /* allocate 'event log' in power of 2 increments of 4K */
-    iommu->event_log_head = 0;
-    iommu->event_log.alloc_size = PAGE_SIZE <<
-                                  get_order_from_bytes(
-                                  PAGE_ALIGN(IOMMU_EVENT_LOG_DEFAULT_ENTRIES *
-                                  IOMMU_EVENT_LOG_ENTRY_SIZE));
-    iommu->event_log.entries = iommu->event_log.alloc_size /
-                               IOMMU_EVENT_LOG_ENTRY_SIZE;
-
-    return (allocate_iommu_table_struct(&iommu->event_log, "Event Log"));
+    /* allocate 'event log' in power of 2 increments of 4K */
+    return allocate_ring_buffer(&iommu->event_log, sizeof(event_entry_t),
+                                IOMMU_EVENT_LOG_DEFAULT_ENTRIES, "Event Log");
 }
 
 static int __init amd_iommu_init_one(struct amd_iommu *iommu)
 {
-    if ( allocate_cmd_buffer(iommu) != 0 )
+    if ( allocate_cmd_buffer(iommu) == NULL )
         goto error_out;
 
-    if ( allocate_event_log(iommu) != 0 )
+    if ( allocate_event_log(iommu) == NULL )
         goto error_out;
 
     if ( map_iommu_mmio_region(iommu) != 0 )
@@ -708,8 +719,8 @@
         list_del(&iommu->list);
         if ( iommu->enabled )
         {
-            deallocate_iommu_table_struct(&iommu->cmd_buffer);
-            deallocate_iommu_table_struct(&iommu->event_log);
+            deallocate_ring_buffer(&iommu->cmd_buffer);
+            deallocate_ring_buffer(&iommu->event_log);
             unmap_iommu_mmio_region(iommu);
         }
         xfree(iommu);
@@ -719,7 +730,7 @@
     iterate_ivrs_entries(amd_iommu_free_intremap_table);
 
     /* free device table */
-    deallocate_iommu_table_struct(&device_table);
+    deallocate_device_table(&device_table);
 
     /* free ivrs_mappings[] */
     radix_tree_destroy(&ivrs_maps, xfree);
@@ -830,8 +841,10 @@
     device_table.entries = device_table.alloc_size /
                            IOMMU_DEV_TABLE_ENTRY_SIZE;
 
-    if ( allocate_iommu_table_struct(&device_table, "Device Table") != 0 )
-         return -ENOMEM;
+    device_table.buffer = allocate_buffer(device_table.alloc_size,
+                                          "Device Table");
+    if  ( device_table.buffer == NULL )
+        return -ENOMEM;
 
     /* Add device table entries */
     for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
diff -r 8d2fa20dd3f3 -r d59816959ac0 xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:45:47 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:48:57 2012 +0100
@@ -30,12 +30,42 @@
 
 extern struct list_head amd_iommu_head;
 
+#pragma pack(1)
+typedef struct event_entry
+{
+    uint32_t data[4];
+} event_entry_t;
+
+typedef struct ppr_entry
+{
+    uint32_t data[4];
+} ppr_entry_t;
+
+typedef struct cmd_entry
+{
+    uint32_t data[4];
+} cmd_entry_t;
+
+typedef struct dev_entry
+{
+    uint32_t data[8];
+} dev_entry_t;
+#pragma pack()
+
 struct table_struct {
     void *buffer;
     unsigned long entries;
     unsigned long alloc_size;
 };
 
+struct ring_buffer {
+    void *buffer;
+    unsigned long entries;
+    unsigned long alloc_size;
+    uint32_t tail;
+    uint32_t head;
+};
+
 typedef struct iommu_cap {
     uint32_t header;                    /* offset 00h */
     uint32_t base_low;                  /* offset 04h */
@@ -60,10 +90,8 @@
     unsigned long mmio_base_phys;
 
     struct table_struct dev_table;
-    struct table_struct cmd_buffer;
-    u32 cmd_buffer_tail;
-    struct table_struct event_log;
-    u32 event_log_head;
+    struct ring_buffer cmd_buffer;
+    struct ring_buffer event_log;
 
     int exclusion_enable;
     int exclusion_allow_all;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx6-0000dg-Sa; Thu, 19 Jan 2012 21:55:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000XR-03
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1327010114!9902116!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28069 invoked from network); 19 Jan 2012 21:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:15 -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 1Rnzww-0007Q2-6S
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzww-0000bk-57
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Message-Id: <E1Rnzww-0000bk-57@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: Update xsm-flask documentation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1326211465 0
# Node ID db22b1aa11d330b0289bb691842b942fc6799dfd
# Parent  e8f705bc9e59d30f264e3a868ad9ba59f39cfbf1
docs: Update xsm-flask documentation

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r e8f705bc9e59 -r db22b1aa11d3 docs/misc/xsm-flask.txt
--- a/docs/misc/xsm-flask.txt	Tue Dec 20 08:31:40 2011 +0100
+++ b/docs/misc/xsm-flask.txt	Tue Jan 10 16:04:25 2012 +0000
@@ -1,156 +1,97 @@
-These notes are compiled from xen-devel questions and postings that have occurred
-since the inclusion of XSM.  These notes are not intended to be definitive
-documentation but should address many common problems that arise when
-experimenting with XSM:FLASK.
+                     -----------------------
+                     XSM/FLASK Configuration
+                     -----------------------
 
-Xen XSM:FLASK configuration
----------------------------
+Xen provides a security framework called XSM, and FLASK is an implementation of
+a security model using this framework (at the time of writing, it is the only
+one). FLASK defines a mandatory access control policy providing fine-grained
+controls over Xen domains, allowing the policy writer to define what
+interactions between domains, devices, and the hypervisor are permitted.
 
-1) cd xen-unstable.hg
-2) edit Config.mk in the toplevel xen directory as follows:
+Some examples of what FLASK can do:
+ - Prevent two domains from communicating via event channels or grants
+ - Control which domains can use device passthrough (and which devices)
+ - Restrict or audit operations performed by privileged domains
+ - Prevent a privileged domain from arbitrarily mapping pages from other domains
 
-	XSM_ENABLE ?= y
-	FLASK_ENABLE ?= y
-	
-NB: Only one security module can be selected at a time.  If no module is
-selected, then the default DUMMY module will be enforced.  The DUMMY module
-only exercises the security framework and does not enforce any security
-policies.  Changing the security module selection will require recompiling xen.
-These settings will also configure the corresponding toolchain support.  
+Some of these examples require dom0 disaggregation to be useful, since the
+domain build process requires the ability to write to the new domain's memory.
 
-3) make xen
-4) make tools
 
+Setting up FLASK
+----------------
 
-Xen XSM:FLASK policy
---------------------
+Xen must be compiled with XSM and FLASK enabled; by default, the security
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
+FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
 
-These instructions will enable the configuration and build of the sample policy.
-The sample policy provides the MINIMUM policy necessary to boot a
-paravirtualized dom0 and create a pv or hvm domU.  Many of the 
-default capabilities and usages supported by dom0/domU are disallowed by the
-sample policy.  Further, the policy is comprised of a limited number of types and 
-must be adjusted to meet the specific security goals of the installation. 
-Modification of the policy is straightforward and is covered in a later section.
+FLASK uses only one domain configuration parameter (seclabel) defining the
+full security label of the newly created domain. If using the example policy,
+"seclabel='system_u:system_r:domU_t'" would be used for normal domains. For
+simple policies including the example policy, the user and role portions of the
+label are unused and will always be "system_u:system_r".  Most of FLASK policy
+consists of defining the interactions allowed between different types (domU_t
+would be the type in this example); FLASK policy does not distinguish between
+domains with the same type. This is the same format as used for SELinux
+labeling; see http://selinuxproject.org for more details on the use of the user,
+role, and optional MLS/MCS labels.
 
-NB: The policy is not automatically built as part of the tool support because 
-of an external dependancy on the checkpolicy compiler.  The FLASK policy uses 
-the same syntax and structure as SELinux and compiling the policy relies on 
-the SELinux policy toolchain.  This toolchain is available under many 
-distributions as well as the following URL,
+The FLASK security framework is mostly configured using a security policy file.
+This policy file is not normally generated during the Xen build process because
+it relies on the SELinux compiler "checkpolicy"; run
 
-	http://userspace.selinuxproject.org/trac/wiki/Releases
+	make -C tools/flask/policy
 
-You will need at least libsepol and checkpolicy in order to compile a policy.
+to compile the example policy included with Xen. The policy is generated from
+definition files under this directory. When creating or modifying security
+policy, most modifications will be made to the xen type enforcement (.te) file
+tools/flask/policy/policy/modules/xen/xen.te or the macro definitions in xen.if.
+The XSM policy file needs to be copied to /boot and loaded as a module by grub.
+The exact position of the module does not matter as long as it is after the Xen
+kernel; it is normally placed either just above the dom0 kernel or at the end.
+Once dom0 is running, the policy can be reloaded using "xl loadpolicy".
 
-1) cd xen-unstable.hg/tools/flask/policy
-2) make policy
-3) make install
-4) edit /etc/grub.conf, add a module line to the xen entry,
+The example policy included with Xen demonstrates most of the features of FLASK
+that can be used without dom0 disaggregation. It has two main types for domUs:
 
-	module /xenpolicy.24
+ - domU_t is a domain that can communicate with any other domU_t
+ - isolated_domU_t can only communicate with dom0
 
-NB: The .24 suffix reflects the policy format version and may differ for your
-system depending on the version of checkpolicy you used to build the policy.
-At the time of this writing, policy version 24 is the highest version 
-supported by the latest checkpolicy release and by the Xen Flask module.
-You can force the policy build to a specific policy version by uncommenting 
-the OUTPUT_POLICY= line in the policy Makefile and setting the value as
-desired (to any version supported by the Xen Flask module, presently in the
-range 15-24).  Make sure that your module line above matches the actual
-/xenpolicy.NN file that was created in /boot by the make install.
+More types can be added to allow groups of domains to communicate without
+allowing communication between groups, or only between certain groups.
 
-5) reboot, and select the updated xen entry
+The example policy also includes a resource type (nic_dev_t) for device
+passthrough, configured to allow use by domU_t. To label the PCI device 3:2.0
+for passthrough, run:
 
-NB: The module entry can be inserted on any line after the xen kernel line.  Typical
-configurations use the last module entry or the module entry that immediately 
-follows the xen kernel entry.
+	tools/flask/utils/flask-label-pci 0000:03:02.0 system_u:object_r:nic_dev_t
+
+This command must be rerun on each boot or after any policy reload.
+
+The example policy was only tested with simple domain creation and may be
+missing rules allowing accesses by dom0 or domU when a number of hypervisor
+features are used. When first loading or writing a policy, you should run FLASK
+in permissive mode (the default) and check the Xen logs (xl dmesg) for AVC
+denials before using it in enforcing mode (flask_enforcing=1 on the command
+line, or xl setenforce).
+
+
+MLS/MCS policy
+--------------
 
 If you want to use the MLS policy, then set TYPE=xen-mls in the policy Makefile
 before building the policy.  Note that the MLS constraints in policy/mls
 are incomplete and are only a sample.
 
-Xen configuration of xend
--------------------------
-
-1) cd /etc/xen
-2) edit xend-config.sxp
-3) uncomment the line containing the key:value pair entry, 
-
-	#(xsm_module_name dummy)
-
-4) change the value entry to 'flask'
-
-	(xsm_module_name flask)
-
-5) restart xend
-
-Creating policy controlled domains
-----------------------------------
-
-2) Edit the domain config file and add the following entry for a pv guest,
-
-	access_control = ["policy=,label=system_u:system_r:domU_t"]
-
-or add the following entry for a hvm guest:
-
-	access_control = ["policy=,label=system_u:system_r:domHU_t"]
-
-NB: The 'policy' field is not used by XSM:FLASK.  The 'label' must exist in the 
-loaded policy. 'system_u:system_r:domU_t' is one of the existing labels from 
-the sample policy and shown for example purposes.
-
-If you enabled the MLS policy, then append a MLS level (e.g. s0:c0) to the
-labels, e.g.:
-
-	access_control = ["policy=,label=system_u:system_r:domU_t:s0:c0"]
-
-2) Create the domain using the 'xm create' command.
-3) Use the 'xm list --label' command to list the running 
-domains and their labels.
-
-Updating the XSM:FLASK policy
------------------------------
-
-It is recommended that the XSM:FLASK policy be tailored to meet the specific
-security goals of the platform.  The policy is tailored by editing the xen.if and xen.te files in the 'policy' subdirectory.
-
-1) cd xen-unstable.hg/tools/flask/policy
-2) edit policy/modules/xen/xen.* - make changes to support platform security goals.
-3) make policy
-4) make install
-5) reboot
-
-Alternatively, one may reload the policy using the 'flask_loadpolicy' tool
-installed by the xen tools.
-
-1) flask_loadpolicy policy.24
-
-NB: The sample policy permits policy reloads as well as general manipulation of
-the Flask security server only from dom0.  The policy can be tailored further to
-restrict policy reloads and other manipulations to boot-time only, by removing 
-the corresponding statements from the policy.
-
-Enforcing the XSM:FLASK policy
-------------------------------
-
-By default, XSM:FLASK is compiled and installed in permissive mode.  This
-configuration will allow an XSM:FLASK system to start in enforcing mode.
-
-1) edit /etc/grub.conf
-2) append the parameter 'flask_enforcing=1' to the xen kernel line.
-3) reboot, and select the updated xen entry
 
 AVC denials
 -----------
 
-XSM:Flask will emit avc: denied messages when a permission is denied
-by the policy, just like SELinux.  For example, if you were to use
-system_u:system_r:domU_t label for a hvm guest (rather than
-system_u:system_r:domHU_t), you would get a set of denials upon xm
-create:
+XSM:Flask will emit avc: denied messages when a permission is denied by the
+policy, just like SELinux. For example, if the HVM rules are removed from the
+declare_domain and create_domain interfaces:
 
-# xm dmesg | grep avc
+# xl dmesg | grep avc
 (XEN) avc:  denied  { setparam } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
 (XEN) avc:  denied  { getparam } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
 (XEN) avc:  denied  { irqlevel } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
@@ -160,21 +101,29 @@
 (XEN) avc:  denied  { pcilevel } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
 
 Existing SELinux tools such as audit2allow can be applied to these denials, e.g.
-xm dmesg | audit2allow 
+xl dmesg | audit2allow
 
 The generated allow rules can then be fed back into the policy by
 adding them to xen.te, although manual review is advised and will
-often lead to adding parameterized rules to the interfaces in xen.if 
+often lead to adding parameterized rules to the interfaces in xen.if
 to address the general case.
 
-Device Policy
--------------
 
-Flask is capable of labeling devices and enforcing policies associated with
-them.  To enable this functionality the latest version of checkpolicy
-(>= 2.0.20) and libsepol (>=2.0.39) will be needed in order to compile it.  To
-enable the building of the new policies the following changes will need to be
-done to tools/flask/policy/Makefile.
+Device Labeling in Policy
+-------------------------
+
+FLASK is capable of labeling devices and enforcing policies associated with
+them. There are two methods to label devices: dynamic labeling using
+flask-label-pci or similar tools run in dom0, or static labeling defined in
+policy. Static labeling will make security policy machine-specific and may
+prevent the system from booting after any hardware changes (adding PCI cards,
+memory, or even changing certain BIOS settings). Dynamic labeling requires that
+the domain performing the labeling be trusted to label all the devices in the
+system properly.
+
+To enable static device labeling, a checkpolicy >= 2.0.20 and libsepol >=2.0.39
+are required. The policy Makefile (tools/flask/policy/Makefile) must also be
+changed as follows:
 
 ########################################
 #
@@ -197,7 +146,7 @@
 #        $(QUIET) $(CHECKPOLICY) -t Xen $^ -o $@   (Uncomment this line)
 
 
-Pirqs, PCI devices, I/O memory and ports can all be labeled.  There are
+IRQs, PCI devices, I/O memory and ports can all be labeled.  There are
 commented out lines in xen.te policy for examples on how to label devices.
 
 Device Labeling
@@ -223,13 +172,16 @@
 ioportcon 0xecc0-0xecdf system_u:object_r:nicP_t
 pcidevicecon 0xc800 system_u:object_r:nicP_t
 
-Labeling of the PCI device is tricky since there is no output in lspci that
-makes the information easily available.  The easiest way to obtain the
-information is to look at the avc denial line for the correct hex value.
+The PCI device label must be computed as the 32-bit SBDF number for the PCI
+device. It the PCI device is aaaa:bb:cc.d or bb:cc.d, then the SBDF can be
+calculated using:
+	SBDF = (a << 16) | (b << 8) | (c << 3) | d
 
-(XEN) avc:  denied  { add_device } for domid=0 device=0xc800 <---
-scontext=system_u:system_r:dom0_t tcontext=system_u:object_r:device_t
-tclass=resource
+The AVC denials for IRQs, memory, ports, and PCI devices will normally contain
+the ranges being denied to more easily determine what resources are required.
+When running in permissive mode, only the first denial of a given
+source/destination is printed to the log, so labeling devices using this method
+may require multiple passes to find all required ranges.
 
 Additional notes on XSM:FLASK
 -----------------------------
@@ -242,7 +194,7 @@
 	platform to boot in permissive mode which means that the policy is loaded 
 	but not enforced.  This mode is often helpful for developing new systems 
 	and policies as the policy violations are reported on the xen console and 
-	may be viewed in dom0 through 'xm dmesg'.
+	may be viewed in dom0 through 'xl dmesg'.
 	
 	To boot the platform into enforcing mode, which means that the policy is
 	loaded and enforced, append 'flask_enforcing=1' on the grub line.
diff -r e8f705bc9e59 -r db22b1aa11d3 tools/flask/policy/Makefile
--- a/tools/flask/policy/Makefile	Tue Dec 20 08:31:40 2011 +0100
+++ b/tools/flask/policy/Makefile	Tue Jan 10 16:04:25 2012 +0000
@@ -20,7 +20,7 @@
 # By default, checkpolicy will create the highest
 # version policy it supports.  Setting this will
 # override the version.
-# OUTPUT_POLICY = 24
+OUTPUT_POLICY = 24
 
 # Policy Type
 # xen

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx6-0000dg-Sa; Thu, 19 Jan 2012 21:55:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000XR-03
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1327010114!9902116!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28069 invoked from network); 19 Jan 2012 21:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:15 -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 1Rnzww-0007Q2-6S
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzww-0000bk-57
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Message-Id: <E1Rnzww-0000bk-57@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: Update xsm-flask documentation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1326211465 0
# Node ID db22b1aa11d330b0289bb691842b942fc6799dfd
# Parent  e8f705bc9e59d30f264e3a868ad9ba59f39cfbf1
docs: Update xsm-flask documentation

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r e8f705bc9e59 -r db22b1aa11d3 docs/misc/xsm-flask.txt
--- a/docs/misc/xsm-flask.txt	Tue Dec 20 08:31:40 2011 +0100
+++ b/docs/misc/xsm-flask.txt	Tue Jan 10 16:04:25 2012 +0000
@@ -1,156 +1,97 @@
-These notes are compiled from xen-devel questions and postings that have occurred
-since the inclusion of XSM.  These notes are not intended to be definitive
-documentation but should address many common problems that arise when
-experimenting with XSM:FLASK.
+                     -----------------------
+                     XSM/FLASK Configuration
+                     -----------------------
 
-Xen XSM:FLASK configuration
----------------------------
+Xen provides a security framework called XSM, and FLASK is an implementation of
+a security model using this framework (at the time of writing, it is the only
+one). FLASK defines a mandatory access control policy providing fine-grained
+controls over Xen domains, allowing the policy writer to define what
+interactions between domains, devices, and the hypervisor are permitted.
 
-1) cd xen-unstable.hg
-2) edit Config.mk in the toplevel xen directory as follows:
+Some examples of what FLASK can do:
+ - Prevent two domains from communicating via event channels or grants
+ - Control which domains can use device passthrough (and which devices)
+ - Restrict or audit operations performed by privileged domains
+ - Prevent a privileged domain from arbitrarily mapping pages from other domains
 
-	XSM_ENABLE ?= y
-	FLASK_ENABLE ?= y
-	
-NB: Only one security module can be selected at a time.  If no module is
-selected, then the default DUMMY module will be enforced.  The DUMMY module
-only exercises the security framework and does not enforce any security
-policies.  Changing the security module selection will require recompiling xen.
-These settings will also configure the corresponding toolchain support.  
+Some of these examples require dom0 disaggregation to be useful, since the
+domain build process requires the ability to write to the new domain's memory.
 
-3) make xen
-4) make tools
 
+Setting up FLASK
+----------------
 
-Xen XSM:FLASK policy
---------------------
+Xen must be compiled with XSM and FLASK enabled; by default, the security
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
+FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
 
-These instructions will enable the configuration and build of the sample policy.
-The sample policy provides the MINIMUM policy necessary to boot a
-paravirtualized dom0 and create a pv or hvm domU.  Many of the 
-default capabilities and usages supported by dom0/domU are disallowed by the
-sample policy.  Further, the policy is comprised of a limited number of types and 
-must be adjusted to meet the specific security goals of the installation. 
-Modification of the policy is straightforward and is covered in a later section.
+FLASK uses only one domain configuration parameter (seclabel) defining the
+full security label of the newly created domain. If using the example policy,
+"seclabel='system_u:system_r:domU_t'" would be used for normal domains. For
+simple policies including the example policy, the user and role portions of the
+label are unused and will always be "system_u:system_r".  Most of FLASK policy
+consists of defining the interactions allowed between different types (domU_t
+would be the type in this example); FLASK policy does not distinguish between
+domains with the same type. This is the same format as used for SELinux
+labeling; see http://selinuxproject.org for more details on the use of the user,
+role, and optional MLS/MCS labels.
 
-NB: The policy is not automatically built as part of the tool support because 
-of an external dependancy on the checkpolicy compiler.  The FLASK policy uses 
-the same syntax and structure as SELinux and compiling the policy relies on 
-the SELinux policy toolchain.  This toolchain is available under many 
-distributions as well as the following URL,
+The FLASK security framework is mostly configured using a security policy file.
+This policy file is not normally generated during the Xen build process because
+it relies on the SELinux compiler "checkpolicy"; run
 
-	http://userspace.selinuxproject.org/trac/wiki/Releases
+	make -C tools/flask/policy
 
-You will need at least libsepol and checkpolicy in order to compile a policy.
+to compile the example policy included with Xen. The policy is generated from
+definition files under this directory. When creating or modifying security
+policy, most modifications will be made to the xen type enforcement (.te) file
+tools/flask/policy/policy/modules/xen/xen.te or the macro definitions in xen.if.
+The XSM policy file needs to be copied to /boot and loaded as a module by grub.
+The exact position of the module does not matter as long as it is after the Xen
+kernel; it is normally placed either just above the dom0 kernel or at the end.
+Once dom0 is running, the policy can be reloaded using "xl loadpolicy".
 
-1) cd xen-unstable.hg/tools/flask/policy
-2) make policy
-3) make install
-4) edit /etc/grub.conf, add a module line to the xen entry,
+The example policy included with Xen demonstrates most of the features of FLASK
+that can be used without dom0 disaggregation. It has two main types for domUs:
 
-	module /xenpolicy.24
+ - domU_t is a domain that can communicate with any other domU_t
+ - isolated_domU_t can only communicate with dom0
 
-NB: The .24 suffix reflects the policy format version and may differ for your
-system depending on the version of checkpolicy you used to build the policy.
-At the time of this writing, policy version 24 is the highest version 
-supported by the latest checkpolicy release and by the Xen Flask module.
-You can force the policy build to a specific policy version by uncommenting 
-the OUTPUT_POLICY= line in the policy Makefile and setting the value as
-desired (to any version supported by the Xen Flask module, presently in the
-range 15-24).  Make sure that your module line above matches the actual
-/xenpolicy.NN file that was created in /boot by the make install.
+More types can be added to allow groups of domains to communicate without
+allowing communication between groups, or only between certain groups.
 
-5) reboot, and select the updated xen entry
+The example policy also includes a resource type (nic_dev_t) for device
+passthrough, configured to allow use by domU_t. To label the PCI device 3:2.0
+for passthrough, run:
 
-NB: The module entry can be inserted on any line after the xen kernel line.  Typical
-configurations use the last module entry or the module entry that immediately 
-follows the xen kernel entry.
+	tools/flask/utils/flask-label-pci 0000:03:02.0 system_u:object_r:nic_dev_t
+
+This command must be rerun on each boot or after any policy reload.
+
+The example policy was only tested with simple domain creation and may be
+missing rules allowing accesses by dom0 or domU when a number of hypervisor
+features are used. When first loading or writing a policy, you should run FLASK
+in permissive mode (the default) and check the Xen logs (xl dmesg) for AVC
+denials before using it in enforcing mode (flask_enforcing=1 on the command
+line, or xl setenforce).
+
+
+MLS/MCS policy
+--------------
 
 If you want to use the MLS policy, then set TYPE=xen-mls in the policy Makefile
 before building the policy.  Note that the MLS constraints in policy/mls
 are incomplete and are only a sample.
 
-Xen configuration of xend
--------------------------
-
-1) cd /etc/xen
-2) edit xend-config.sxp
-3) uncomment the line containing the key:value pair entry, 
-
-	#(xsm_module_name dummy)
-
-4) change the value entry to 'flask'
-
-	(xsm_module_name flask)
-
-5) restart xend
-
-Creating policy controlled domains
-----------------------------------
-
-2) Edit the domain config file and add the following entry for a pv guest,
-
-	access_control = ["policy=,label=system_u:system_r:domU_t"]
-
-or add the following entry for a hvm guest:
-
-	access_control = ["policy=,label=system_u:system_r:domHU_t"]
-
-NB: The 'policy' field is not used by XSM:FLASK.  The 'label' must exist in the 
-loaded policy. 'system_u:system_r:domU_t' is one of the existing labels from 
-the sample policy and shown for example purposes.
-
-If you enabled the MLS policy, then append a MLS level (e.g. s0:c0) to the
-labels, e.g.:
-
-	access_control = ["policy=,label=system_u:system_r:domU_t:s0:c0"]
-
-2) Create the domain using the 'xm create' command.
-3) Use the 'xm list --label' command to list the running 
-domains and their labels.
-
-Updating the XSM:FLASK policy
------------------------------
-
-It is recommended that the XSM:FLASK policy be tailored to meet the specific
-security goals of the platform.  The policy is tailored by editing the xen.if and xen.te files in the 'policy' subdirectory.
-
-1) cd xen-unstable.hg/tools/flask/policy
-2) edit policy/modules/xen/xen.* - make changes to support platform security goals.
-3) make policy
-4) make install
-5) reboot
-
-Alternatively, one may reload the policy using the 'flask_loadpolicy' tool
-installed by the xen tools.
-
-1) flask_loadpolicy policy.24
-
-NB: The sample policy permits policy reloads as well as general manipulation of
-the Flask security server only from dom0.  The policy can be tailored further to
-restrict policy reloads and other manipulations to boot-time only, by removing 
-the corresponding statements from the policy.
-
-Enforcing the XSM:FLASK policy
-------------------------------
-
-By default, XSM:FLASK is compiled and installed in permissive mode.  This
-configuration will allow an XSM:FLASK system to start in enforcing mode.
-
-1) edit /etc/grub.conf
-2) append the parameter 'flask_enforcing=1' to the xen kernel line.
-3) reboot, and select the updated xen entry
 
 AVC denials
 -----------
 
-XSM:Flask will emit avc: denied messages when a permission is denied
-by the policy, just like SELinux.  For example, if you were to use
-system_u:system_r:domU_t label for a hvm guest (rather than
-system_u:system_r:domHU_t), you would get a set of denials upon xm
-create:
+XSM:Flask will emit avc: denied messages when a permission is denied by the
+policy, just like SELinux. For example, if the HVM rules are removed from the
+declare_domain and create_domain interfaces:
 
-# xm dmesg | grep avc
+# xl dmesg | grep avc
 (XEN) avc:  denied  { setparam } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
 (XEN) avc:  denied  { getparam } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
 (XEN) avc:  denied  { irqlevel } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
@@ -160,21 +101,29 @@
 (XEN) avc:  denied  { pcilevel } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=hvm
 
 Existing SELinux tools such as audit2allow can be applied to these denials, e.g.
-xm dmesg | audit2allow 
+xl dmesg | audit2allow
 
 The generated allow rules can then be fed back into the policy by
 adding them to xen.te, although manual review is advised and will
-often lead to adding parameterized rules to the interfaces in xen.if 
+often lead to adding parameterized rules to the interfaces in xen.if
 to address the general case.
 
-Device Policy
--------------
 
-Flask is capable of labeling devices and enforcing policies associated with
-them.  To enable this functionality the latest version of checkpolicy
-(>= 2.0.20) and libsepol (>=2.0.39) will be needed in order to compile it.  To
-enable the building of the new policies the following changes will need to be
-done to tools/flask/policy/Makefile.
+Device Labeling in Policy
+-------------------------
+
+FLASK is capable of labeling devices and enforcing policies associated with
+them. There are two methods to label devices: dynamic labeling using
+flask-label-pci or similar tools run in dom0, or static labeling defined in
+policy. Static labeling will make security policy machine-specific and may
+prevent the system from booting after any hardware changes (adding PCI cards,
+memory, or even changing certain BIOS settings). Dynamic labeling requires that
+the domain performing the labeling be trusted to label all the devices in the
+system properly.
+
+To enable static device labeling, a checkpolicy >= 2.0.20 and libsepol >=2.0.39
+are required. The policy Makefile (tools/flask/policy/Makefile) must also be
+changed as follows:
 
 ########################################
 #
@@ -197,7 +146,7 @@
 #        $(QUIET) $(CHECKPOLICY) -t Xen $^ -o $@   (Uncomment this line)
 
 
-Pirqs, PCI devices, I/O memory and ports can all be labeled.  There are
+IRQs, PCI devices, I/O memory and ports can all be labeled.  There are
 commented out lines in xen.te policy for examples on how to label devices.
 
 Device Labeling
@@ -223,13 +172,16 @@
 ioportcon 0xecc0-0xecdf system_u:object_r:nicP_t
 pcidevicecon 0xc800 system_u:object_r:nicP_t
 
-Labeling of the PCI device is tricky since there is no output in lspci that
-makes the information easily available.  The easiest way to obtain the
-information is to look at the avc denial line for the correct hex value.
+The PCI device label must be computed as the 32-bit SBDF number for the PCI
+device. It the PCI device is aaaa:bb:cc.d or bb:cc.d, then the SBDF can be
+calculated using:
+	SBDF = (a << 16) | (b << 8) | (c << 3) | d
 
-(XEN) avc:  denied  { add_device } for domid=0 device=0xc800 <---
-scontext=system_u:system_r:dom0_t tcontext=system_u:object_r:device_t
-tclass=resource
+The AVC denials for IRQs, memory, ports, and PCI devices will normally contain
+the ranges being denied to more easily determine what resources are required.
+When running in permissive mode, only the first denial of a given
+source/destination is printed to the log, so labeling devices using this method
+may require multiple passes to find all required ranges.
 
 Additional notes on XSM:FLASK
 -----------------------------
@@ -242,7 +194,7 @@
 	platform to boot in permissive mode which means that the policy is loaded 
 	but not enforced.  This mode is often helpful for developing new systems 
 	and policies as the policy violations are reported on the xen console and 
-	may be viewed in dom0 through 'xm dmesg'.
+	may be viewed in dom0 through 'xl dmesg'.
 	
 	To boot the platform into enforcing mode, which means that the policy is
 	loaded and enforced, append 'flask_enforcing=1' on the grub line.
diff -r e8f705bc9e59 -r db22b1aa11d3 tools/flask/policy/Makefile
--- a/tools/flask/policy/Makefile	Tue Dec 20 08:31:40 2011 +0100
+++ b/tools/flask/policy/Makefile	Tue Jan 10 16:04:25 2012 +0000
@@ -20,7 +20,7 @@
 # By default, checkpolicy will create the highest
 # version policy it supports.  Setting this will
 # override the version.
-# OUTPUT_POLICY = 24
+OUTPUT_POLICY = 24
 
 # Policy Type
 # xen

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx6-0000ds-W1; Thu, 19 Jan 2012 21:55:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000Xc-Le
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1327010115!9841601!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11686 invoked from network); 19 Jan 2012 21:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:16 -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 1Rnzwx-0007Q9-62
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwx-0000cE-4t
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Message-Id: <E1Rnzwx-0000cE-4t@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: add feature flag to xenstore
	for XS_RESET_WATCHES
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1325788840 -3600
# Node ID ef99b8571a6fe4e53fb9df4da2833f8f5a5b4ec7
# Parent  164ed9b67ad050cbd9efa24f641120733926d7d6
libxl: add feature flag to xenstore for XS_RESET_WATCHES

Tell guest about availibilty of xenstoreds XS_RESET_WATCHES function.
Guests can not issue this command unconditionally because some buggy
toolstacks (such as EC2) do not ignore unknown commands properly.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 164ed9b67ad0 -r ef99b8571a6f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Jan 10 16:04:26 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Jan 05 19:40:40 2012 +0100
@@ -452,6 +452,7 @@
     libxl__xs_writev(gc, t, libxl__sprintf(gc, "%s/platform", dom_path), info->platformdata);
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-multiprocessor-suspend", dom_path), "1", 1);
+    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-xs_reset_watches", dom_path), "1", 1);
     if (!xs_transaction_end(ctx->xsh, t, 0)) {
         if (errno == EAGAIN) {
             t = 0;
diff -r 164ed9b67ad0 -r ef99b8571a6f tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 10 16:04:26 2012 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Jan 05 19:40:40 2012 +0100
@@ -1770,6 +1770,7 @@
         f('store/port',       self.store_port)
         f('store/ring-ref',   self.store_mfn)
 
+        f('control/platform-feature-xs_reset_watches', True)
         if arch.type == "x86":
             f('control/platform-feature-multiprocessor-suspend', True)
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx6-0000ds-W1; Thu, 19 Jan 2012 21:55:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000Xc-Le
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1327010115!9841601!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11686 invoked from network); 19 Jan 2012 21:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:16 -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 1Rnzwx-0007Q9-62
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwx-0000cE-4t
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:15 +0000
Message-Id: <E1Rnzwx-0000cE-4t@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: add feature flag to xenstore
	for XS_RESET_WATCHES
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1325788840 -3600
# Node ID ef99b8571a6fe4e53fb9df4da2833f8f5a5b4ec7
# Parent  164ed9b67ad050cbd9efa24f641120733926d7d6
libxl: add feature flag to xenstore for XS_RESET_WATCHES

Tell guest about availibilty of xenstoreds XS_RESET_WATCHES function.
Guests can not issue this command unconditionally because some buggy
toolstacks (such as EC2) do not ignore unknown commands properly.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 164ed9b67ad0 -r ef99b8571a6f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Tue Jan 10 16:04:26 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Jan 05 19:40:40 2012 +0100
@@ -452,6 +452,7 @@
     libxl__xs_writev(gc, t, libxl__sprintf(gc, "%s/platform", dom_path), info->platformdata);
 
     xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-multiprocessor-suspend", dom_path), "1", 1);
+    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-xs_reset_watches", dom_path), "1", 1);
     if (!xs_transaction_end(ctx->xsh, t, 0)) {
         if (errno == EAGAIN) {
             t = 0;
diff -r 164ed9b67ad0 -r ef99b8571a6f tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 10 16:04:26 2012 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Jan 05 19:40:40 2012 +0100
@@ -1770,6 +1770,7 @@
         f('store/port',       self.store_port)
         f('store/ring-ref',   self.store_mfn)
 
+        f('control/platform-feature-xs_reset_watches', True)
         if arch.type == "x86":
             f('control/platform-feature-multiprocessor-suspend', True)
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx8-0000gR-8e; Thu, 19 Jan 2012 21:55:26 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx6-0000Y9-Oy
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1327010117!11182589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22023 invoked from network); 19 Jan 2012 21:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:18 -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 1Rnzwy-0007QI-O1
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwy-0000cx-JY
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Message-Id: <E1Rnzwy-0000cx-JY@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: convert
	xenpaging_victim_t to struct victim
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125241 -3600
# Node ID 47ca45c8b318d37bb8412ce3d96cf7a37dcce743
# Parent  a2ed45b6df07556647b7dfd86b81dc2fd1324ed6
xenpaging: convert xenpaging_victim_t to struct victim

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/policy.h	Mon Jan 09 17:07:21 2012 +0100
@@ -29,7 +29,7 @@
 
 
 int policy_init(xenpaging_t *paging);
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim);
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim);
 void policy_notify_paged_out(unsigned long gfn);
 void policy_notify_paged_in(unsigned long gfn);
 void policy_notify_paged_in_nomru(unsigned long gfn);
diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/policy_default.c	Mon Jan 09 17:07:21 2012 +0100
@@ -77,7 +77,7 @@
     return rc;
 }
 
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim)
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim)
 {
     xc_interface *xch = paging->xc_handle;
     unsigned long wrap = current_gfn;
diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:21 2012 +0100
@@ -561,8 +561,7 @@
     RING_PUSH_RESPONSES(back_ring);
 }
 
-static int xenpaging_evict_page(xenpaging_t *paging,
-                         xenpaging_victim_t *victim, int fd, int i)
+static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     void *page;
@@ -711,8 +710,7 @@
         page_in_trigger();
 }
 
-static int evict_victim(xenpaging_t *paging,
-                        xenpaging_victim_t *victim, int fd, int i)
+static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     int j = 0;
@@ -755,7 +753,7 @@
 }
 
 /* Evict a batch of pages and write them to a free slot in the paging file */
-static int evict_pages(xenpaging_t *paging, int fd, xenpaging_victim_t *victims, int num_pages)
+static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages)
 {
     xc_interface *xch = paging->xc_handle;
     int rc, slot, num = 0;
@@ -782,7 +780,7 @@
 {
     struct sigaction act;
     xenpaging_t *paging;
-    xenpaging_victim_t *victims;
+    struct victim *victims;
     mem_event_request_t req;
     mem_event_response_t rsp;
     int num, prev_num = 0;
@@ -816,7 +814,7 @@
     }
 
     /* Allocate upper limit of pages to allow growing and shrinking */
-    victims = calloc(paging->max_pages, sizeof(xenpaging_victim_t));
+    victims = calloc(paging->max_pages, sizeof(struct victim));
     if ( !victims )
         goto out;
 
diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:21 2012 +0100
@@ -57,10 +57,10 @@
 } xenpaging_t;
 
 
-typedef struct xenpaging_victim {
+struct victim {
     /* the gfn of the page to evict */
     unsigned long gfn;
-} xenpaging_victim_t;
+};
 
 
 extern void create_page_in_thread(xenpaging_t *paging);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx8-0000gR-8e; Thu, 19 Jan 2012 21:55:26 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx6-0000Y9-Oy
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1327010117!11182589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22023 invoked from network); 19 Jan 2012 21:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:18 -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 1Rnzwy-0007QI-O1
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwy-0000cx-JY
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Message-Id: <E1Rnzwy-0000cx-JY@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: convert
	xenpaging_victim_t to struct victim
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125241 -3600
# Node ID 47ca45c8b318d37bb8412ce3d96cf7a37dcce743
# Parent  a2ed45b6df07556647b7dfd86b81dc2fd1324ed6
xenpaging: convert xenpaging_victim_t to struct victim

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/policy.h	Mon Jan 09 17:07:21 2012 +0100
@@ -29,7 +29,7 @@
 
 
 int policy_init(xenpaging_t *paging);
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim);
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim);
 void policy_notify_paged_out(unsigned long gfn);
 void policy_notify_paged_in(unsigned long gfn);
 void policy_notify_paged_in_nomru(unsigned long gfn);
diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/policy_default.c	Mon Jan 09 17:07:21 2012 +0100
@@ -77,7 +77,7 @@
     return rc;
 }
 
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim)
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim)
 {
     xc_interface *xch = paging->xc_handle;
     unsigned long wrap = current_gfn;
diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:21 2012 +0100
@@ -561,8 +561,7 @@
     RING_PUSH_RESPONSES(back_ring);
 }
 
-static int xenpaging_evict_page(xenpaging_t *paging,
-                         xenpaging_victim_t *victim, int fd, int i)
+static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     void *page;
@@ -711,8 +710,7 @@
         page_in_trigger();
 }
 
-static int evict_victim(xenpaging_t *paging,
-                        xenpaging_victim_t *victim, int fd, int i)
+static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     int j = 0;
@@ -755,7 +753,7 @@
 }
 
 /* Evict a batch of pages and write them to a free slot in the paging file */
-static int evict_pages(xenpaging_t *paging, int fd, xenpaging_victim_t *victims, int num_pages)
+static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages)
 {
     xc_interface *xch = paging->xc_handle;
     int rc, slot, num = 0;
@@ -782,7 +780,7 @@
 {
     struct sigaction act;
     xenpaging_t *paging;
-    xenpaging_victim_t *victims;
+    struct victim *victims;
     mem_event_request_t req;
     mem_event_response_t rsp;
     int num, prev_num = 0;
@@ -816,7 +814,7 @@
     }
 
     /* Allocate upper limit of pages to allow growing and shrinking */
-    victims = calloc(paging->max_pages, sizeof(xenpaging_victim_t));
+    victims = calloc(paging->max_pages, sizeof(struct victim));
     if ( !victims )
         goto out;
 
diff -r a2ed45b6df07 -r 47ca45c8b318 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Tue Jan 10 16:24:50 2012 +0000
+++ b/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:21 2012 +0100
@@ -57,10 +57,10 @@
 } xenpaging_t;
 
 
-typedef struct xenpaging_victim {
+struct victim {
     /* the gfn of the page to evict */
     unsigned long gfn;
-} xenpaging_victim_t;
+};
 
 
 extern void create_page_in_thread(xenpaging_t *paging);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000iG-Kv; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000Yk-3Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327010118!7822211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13861 invoked from network); 19 Jan 2012 21:55:19 -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;
	19 Jan 2012 21:55:19 -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 1Rnzx0-0007QU-Kt
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000dv-Jg
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Message-Id: <E1Rnzx0-0000dv-Jg@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Allow a page in
	p2m_ram_paged_out state to be loaded
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326365550 0
# Node ID 75b8e982eb7e9346d157daf89a9b42f94fcab157
# Parent  9cdcedc133e5227c635dbb00bd4779015311107a
x86/mm: Allow a page in p2m_ram_paged_out state to be loaded

This removes the need for a page to be accessed in order to be pageable
again. A pager can now page-in pages at will with no need to map them
in a separate thread.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 9cdcedc133e5 -r 75b8e982eb7e xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Jan 11 10:34:45 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 12 10:52:30 2012 +0000
@@ -964,7 +964,7 @@
 int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
 {
     struct page_info *page;
-    p2m_type_t p2mt;
+    p2m_type_t p2mt, target_p2mt;
     p2m_access_t a;
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -982,8 +982,8 @@
     mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
 
     ret = -ENOENT;
-    /* Allow only missing pages */
-    if ( p2mt != p2m_ram_paging_in_start )
+    /* Allow missing pages */
+    if ( (p2mt != p2m_ram_paging_in_start) && (p2mt != p2m_ram_paged) )
         goto out;
 
     /* Allocate a page if the gfn does not have one yet */
@@ -1018,8 +1018,15 @@
         }
     }
 
+    target_p2mt = (p2mt == p2m_ram_paging_in_start) ?
+        /* If we kicked the pager with a populate event, the pager will send
+         * a resume event back */
+        p2m_ram_paging_in :
+        /* If this was called asynchronously by the pager, then we can 
+         * transition directly to the final guest-accessible type */
+        (paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw);
     /* Fix p2m mapping */
-    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_paging_in, a);
+    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, target_p2mt, a);
 
     atomic_dec(&d->paged_pages);
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000iG-Kv; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000Yk-3Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327010118!7822211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13861 invoked from network); 19 Jan 2012 21:55:19 -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;
	19 Jan 2012 21:55:19 -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 1Rnzx0-0007QU-Kt
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx0-0000dv-Jg
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:18 +0000
Message-Id: <E1Rnzx0-0000dv-Jg@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Allow a page in
	p2m_ram_paged_out state to be loaded
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326365550 0
# Node ID 75b8e982eb7e9346d157daf89a9b42f94fcab157
# Parent  9cdcedc133e5227c635dbb00bd4779015311107a
x86/mm: Allow a page in p2m_ram_paged_out state to be loaded

This removes the need for a page to be accessed in order to be pageable
again. A pager can now page-in pages at will with no need to map them
in a separate thread.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 9cdcedc133e5 -r 75b8e982eb7e xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Jan 11 10:34:45 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 12 10:52:30 2012 +0000
@@ -964,7 +964,7 @@
 int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
 {
     struct page_info *page;
-    p2m_type_t p2mt;
+    p2m_type_t p2mt, target_p2mt;
     p2m_access_t a;
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -982,8 +982,8 @@
     mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
 
     ret = -ENOENT;
-    /* Allow only missing pages */
-    if ( p2mt != p2m_ram_paging_in_start )
+    /* Allow missing pages */
+    if ( (p2mt != p2m_ram_paging_in_start) && (p2mt != p2m_ram_paged) )
         goto out;
 
     /* Allocate a page if the gfn does not have one yet */
@@ -1018,8 +1018,15 @@
         }
     }
 
+    target_p2mt = (p2mt == p2m_ram_paging_in_start) ?
+        /* If we kicked the pager with a populate event, the pager will send
+         * a resume event back */
+        p2m_ram_paging_in :
+        /* If this was called asynchronously by the pager, then we can 
+         * transition directly to the final guest-accessible type */
+        (paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw);
     /* Fix p2m mapping */
-    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_paging_in, a);
+    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, target_p2mt, a);
 
     atomic_dec(&d->paged_pages);
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000hy-H9; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000YI-D8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1327010116!9869587!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19963 invoked from network); 19 Jan 2012 21:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:17 -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 1Rnzwy-0007QF-4n
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwy-0000ci-3d
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Message-Id: <E1Rnzwy-0000ci-3d@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpm: assorted adjustments
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326212690 0
# Node ID a2ed45b6df07556647b7dfd86b81dc2fd1324ed6
# Parent  3a79842d4845f55214042edc4885519258fdb335
xenpm: assorted adjustments

- use consistent error values (stop mixing of [positive] errno values
  with literal -E... ones)
- properly format output
- don't use leading zeros in decimal output
- move printing of average frequency into P-state conditional (rather
  than a C-state one)
- don't print some C-state related info when CPU idle management is
  disabled in the hypervisor
- use calloc() for array allocations that also got cleared via memset()
  so far

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 3a79842d4845 -r a2ed45b6df07 tools/misc/xenpm.c
--- a/tools/misc/xenpm.c	Tue Jan 10 16:13:06 2012 +0000
+++ b/tools/misc/xenpm.c	Tue Jan 10 16:24:50 2012 +0000
@@ -87,20 +87,20 @@
            cxstat->idle_time/1000000UL);
     for ( i = 0; i < cxstat->nr; i++ )
     {
-        printf("C%d                   : transition [%020"PRIu64"]\n",
+        printf("C%-20d: transition [%20"PRIu64"]\n",
                i, cxstat->triggers[i]);
-        printf("                       residency  [%020"PRIu64" ms]\n",
+        printf("                       residency  [%20"PRIu64" ms]\n",
                cxstat->residencies[i]/1000000UL);
     }
-    printf("pc2                  : [%020"PRIu64" ms]\n"
-           "pc3                  : [%020"PRIu64" ms]\n"
-           "pc6                  : [%020"PRIu64" ms]\n"
-           "pc7                  : [%020"PRIu64" ms]\n",
+    printf("pc2                  : [%20"PRIu64" ms]\n"
+           "pc3                  : [%20"PRIu64" ms]\n"
+           "pc6                  : [%20"PRIu64" ms]\n"
+           "pc7                  : [%20"PRIu64" ms]\n",
             cxstat->pc2/1000000UL, cxstat->pc3/1000000UL,
             cxstat->pc6/1000000UL, cxstat->pc7/1000000UL);
-    printf("cc3                  : [%020"PRIu64" ms]\n"
-           "cc6                  : [%020"PRIu64" ms]\n"
-           "cc7                  : [%020"PRIu64" ms]\n",
+    printf("cc3                  : [%20"PRIu64" ms]\n"
+           "cc6                  : [%20"PRIu64" ms]\n"
+           "cc7                  : [%20"PRIu64" ms]\n",
             cxstat->cc3/1000000UL, cxstat->cc6/1000000UL,
             cxstat->cc7/1000000UL);
     printf("\n");
@@ -114,7 +114,7 @@
 
     ret = xc_pm_get_max_cx(xc_handle, cpuid, &max_cx_num);
     if ( ret )
-        return errno;
+        return -errno;
 
     if ( !cxstat )
         return -EINVAL;
@@ -135,15 +135,14 @@
     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
     if( ret )
     {
-        int temp = errno;
+        ret = -errno;
         free(cxstat->triggers);
         free(cxstat->residencies);
         cxstat->triggers = NULL;
         cxstat->residencies = NULL;
-        return temp;
     }
 
-    return 0;
+    return ret;
 }
 
 static int show_max_cstate(xc_interface *xc_handle)
@@ -214,14 +213,13 @@
     for ( i = 0; i < pxstat->total; i++ )
     {
         if ( pxstat->cur == i )
-            printf("*P%d", i);
+            printf("*P%-9d", i);
         else
-            printf("P%d ", i);
-        printf("                  : freq       [%04"PRIu64" MHz]\n",
-               pxstat->pt[i].freq);
-        printf("                       transition [%020"PRIu64"]\n",
+            printf("P%-10d", i);
+        printf("[%4"PRIu64" MHz]", pxstat->pt[i].freq);
+        printf(": transition [%20"PRIu64"]\n",
                pxstat->pt[i].count);
-        printf("                       residency  [%020"PRIu64" ms]\n",
+        printf("                       residency  [%20"PRIu64" ms]\n",
                pxstat->pt[i].residency/1000000UL);
     }
     printf("\n");
@@ -235,7 +233,7 @@
 
     ret = xc_pm_get_max_px(xc_handle, cpuid, &max_px_num);
     if ( ret )
-        return errno;
+        return -errno;
 
     if ( !pxstat)
         return -EINVAL;
@@ -254,15 +252,14 @@
     ret = xc_pm_get_pxstat(xc_handle, cpuid, pxstat);
     if( ret )
     {
-        int temp = errno;
+        ret = -errno;
         free(pxstat->trans_pt);
         free(pxstat->pt);
         pxstat->trans_pt = NULL;
         pxstat->pt = NULL;
-        return temp;
     }
 
-    return 0;
+    return ret;
 }
 
 /* show cpu actual average freq information on CPU cpuid */
@@ -272,11 +269,9 @@
 
     ret = xc_get_cpufreq_avgfreq(xc_handle, cpuid, avgfreq);
     if ( ret )
-    {
-        return errno;
-    }
+        ret = -errno;
 
-    return 0;
+    return ret;
 }
 
 static int show_pxstat_by_cpuid(xc_interface *xc_handle, int cpuid)
@@ -325,7 +320,7 @@
 
 static void signal_int_handler(int signo)
 {
-    int i, j, k, ret;
+    int i, j, k;
     struct timeval tv;
     int cx_cap = 0, px_cap = 0;
     DECLARE_HYPERCALL_BUFFER(uint32_t, cpu_to_core);
@@ -404,6 +399,8 @@
                         res / 1000000UL, 100UL * res / (double)sum_px[i]);
             }
         }
+        if ( px_cap && avgfreq[i] )
+            printf("  Avg freq\t%d\tKHz\n", avgfreq[i]);
     }
 
     set_xen_guest_handle(info.cpu_to_core, cpu_to_core);
@@ -411,8 +408,7 @@
     set_xen_guest_handle(info.cpu_to_node, cpu_to_node);
     info.max_cpu_index = MAX_NR_CPU - 1;
 
-    ret = xc_topologyinfo(xc_handle, &info);
-    if ( !ret )
+    if ( cx_cap && !xc_topologyinfo(xc_handle, &info) )
     {
         uint32_t socket_ids[MAX_NR_CPU];
         uint32_t core_ids[MAX_NR_CPU];
@@ -461,7 +457,7 @@
                     if ( cpu_to_socket[j] == socket_ids[i] )
                         break;
                 }
-                printf("Socket %d\n", socket_ids[i]);
+                printf("\nSocket %d\n", socket_ids[i]);
                 res = cxstat_end[j].pc2 - cxstat_start[j].pc2;
                 printf("\tPC2\t%"PRIu64" ms\t%.2f%%\n",  res / 1000000UL,
                        100UL * res / (double)sum_cx[j]);
@@ -492,12 +488,9 @@
                     res = cxstat_end[j].cc7 - cxstat_start[j].cc7;
                     printf("\t\tCC7\t%"PRIu64" ms\t%.2f%%\n",  res / 1000000UL,
                            100UL * res / (double)sum_cx[j]);
-                    printf("\n");
-
                 }
             }
         }
-        printf("  Avg freq\t%d\tKHz\n", avgfreq[i]);
     }
 
     /* some clean up and then exits */
@@ -542,23 +535,23 @@
     }
     usec_start = tv.tv_sec * 1000000UL + tv.tv_usec;
 
-    sum = malloc(sizeof(uint64_t) * 2 * max_cpu_nr);
+    sum = calloc(2 * max_cpu_nr, sizeof(*sum));
     if ( sum == NULL )
         return ;
-    cxstat = malloc(sizeof(struct xc_cx_stat) * 2 * max_cpu_nr);
+    cxstat = calloc(2 * max_cpu_nr, sizeof(*cxstat));
     if ( cxstat == NULL )
     {
         free(sum);
         return ;
     }
-    pxstat = malloc(sizeof(struct xc_px_stat) * 2 * max_cpu_nr);
+    pxstat = calloc(2 * max_cpu_nr, sizeof(*pxstat));
     if ( pxstat == NULL )
     {
         free(sum);
         free(cxstat);
         return ;
     }
-    avgfreq = malloc(sizeof(int) * max_cpu_nr);
+    avgfreq = calloc(max_cpu_nr, sizeof(*avgfreq));
     if ( avgfreq == NULL )
     {
         free(sum);
@@ -566,10 +559,6 @@
         free(pxstat);
         return ;
     }
-    memset(sum, 0, sizeof(uint64_t) * 2 * max_cpu_nr);
-    memset(cxstat, 0, sizeof(struct xc_cx_stat) * 2 * max_cpu_nr);
-    memset(pxstat, 0, sizeof(struct xc_px_stat) * 2 * max_cpu_nr);
-    memset(avgfreq, 0, sizeof(int) * max_cpu_nr);
     sum_cx = sum;
     sum_px = sum + max_cpu_nr;
     cxstat_start = cxstat;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000hy-H9; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000YI-D8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1327010116!9869587!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19963 invoked from network); 19 Jan 2012 21:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:17 -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 1Rnzwy-0007QF-4n
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwy-0000ci-3d
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:16 +0000
Message-Id: <E1Rnzwy-0000ci-3d@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpm: assorted adjustments
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326212690 0
# Node ID a2ed45b6df07556647b7dfd86b81dc2fd1324ed6
# Parent  3a79842d4845f55214042edc4885519258fdb335
xenpm: assorted adjustments

- use consistent error values (stop mixing of [positive] errno values
  with literal -E... ones)
- properly format output
- don't use leading zeros in decimal output
- move printing of average frequency into P-state conditional (rather
  than a C-state one)
- don't print some C-state related info when CPU idle management is
  disabled in the hypervisor
- use calloc() for array allocations that also got cleared via memset()
  so far

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 3a79842d4845 -r a2ed45b6df07 tools/misc/xenpm.c
--- a/tools/misc/xenpm.c	Tue Jan 10 16:13:06 2012 +0000
+++ b/tools/misc/xenpm.c	Tue Jan 10 16:24:50 2012 +0000
@@ -87,20 +87,20 @@
            cxstat->idle_time/1000000UL);
     for ( i = 0; i < cxstat->nr; i++ )
     {
-        printf("C%d                   : transition [%020"PRIu64"]\n",
+        printf("C%-20d: transition [%20"PRIu64"]\n",
                i, cxstat->triggers[i]);
-        printf("                       residency  [%020"PRIu64" ms]\n",
+        printf("                       residency  [%20"PRIu64" ms]\n",
                cxstat->residencies[i]/1000000UL);
     }
-    printf("pc2                  : [%020"PRIu64" ms]\n"
-           "pc3                  : [%020"PRIu64" ms]\n"
-           "pc6                  : [%020"PRIu64" ms]\n"
-           "pc7                  : [%020"PRIu64" ms]\n",
+    printf("pc2                  : [%20"PRIu64" ms]\n"
+           "pc3                  : [%20"PRIu64" ms]\n"
+           "pc6                  : [%20"PRIu64" ms]\n"
+           "pc7                  : [%20"PRIu64" ms]\n",
             cxstat->pc2/1000000UL, cxstat->pc3/1000000UL,
             cxstat->pc6/1000000UL, cxstat->pc7/1000000UL);
-    printf("cc3                  : [%020"PRIu64" ms]\n"
-           "cc6                  : [%020"PRIu64" ms]\n"
-           "cc7                  : [%020"PRIu64" ms]\n",
+    printf("cc3                  : [%20"PRIu64" ms]\n"
+           "cc6                  : [%20"PRIu64" ms]\n"
+           "cc7                  : [%20"PRIu64" ms]\n",
             cxstat->cc3/1000000UL, cxstat->cc6/1000000UL,
             cxstat->cc7/1000000UL);
     printf("\n");
@@ -114,7 +114,7 @@
 
     ret = xc_pm_get_max_cx(xc_handle, cpuid, &max_cx_num);
     if ( ret )
-        return errno;
+        return -errno;
 
     if ( !cxstat )
         return -EINVAL;
@@ -135,15 +135,14 @@
     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
     if( ret )
     {
-        int temp = errno;
+        ret = -errno;
         free(cxstat->triggers);
         free(cxstat->residencies);
         cxstat->triggers = NULL;
         cxstat->residencies = NULL;
-        return temp;
     }
 
-    return 0;
+    return ret;
 }
 
 static int show_max_cstate(xc_interface *xc_handle)
@@ -214,14 +213,13 @@
     for ( i = 0; i < pxstat->total; i++ )
     {
         if ( pxstat->cur == i )
-            printf("*P%d", i);
+            printf("*P%-9d", i);
         else
-            printf("P%d ", i);
-        printf("                  : freq       [%04"PRIu64" MHz]\n",
-               pxstat->pt[i].freq);
-        printf("                       transition [%020"PRIu64"]\n",
+            printf("P%-10d", i);
+        printf("[%4"PRIu64" MHz]", pxstat->pt[i].freq);
+        printf(": transition [%20"PRIu64"]\n",
                pxstat->pt[i].count);
-        printf("                       residency  [%020"PRIu64" ms]\n",
+        printf("                       residency  [%20"PRIu64" ms]\n",
                pxstat->pt[i].residency/1000000UL);
     }
     printf("\n");
@@ -235,7 +233,7 @@
 
     ret = xc_pm_get_max_px(xc_handle, cpuid, &max_px_num);
     if ( ret )
-        return errno;
+        return -errno;
 
     if ( !pxstat)
         return -EINVAL;
@@ -254,15 +252,14 @@
     ret = xc_pm_get_pxstat(xc_handle, cpuid, pxstat);
     if( ret )
     {
-        int temp = errno;
+        ret = -errno;
         free(pxstat->trans_pt);
         free(pxstat->pt);
         pxstat->trans_pt = NULL;
         pxstat->pt = NULL;
-        return temp;
     }
 
-    return 0;
+    return ret;
 }
 
 /* show cpu actual average freq information on CPU cpuid */
@@ -272,11 +269,9 @@
 
     ret = xc_get_cpufreq_avgfreq(xc_handle, cpuid, avgfreq);
     if ( ret )
-    {
-        return errno;
-    }
+        ret = -errno;
 
-    return 0;
+    return ret;
 }
 
 static int show_pxstat_by_cpuid(xc_interface *xc_handle, int cpuid)
@@ -325,7 +320,7 @@
 
 static void signal_int_handler(int signo)
 {
-    int i, j, k, ret;
+    int i, j, k;
     struct timeval tv;
     int cx_cap = 0, px_cap = 0;
     DECLARE_HYPERCALL_BUFFER(uint32_t, cpu_to_core);
@@ -404,6 +399,8 @@
                         res / 1000000UL, 100UL * res / (double)sum_px[i]);
             }
         }
+        if ( px_cap && avgfreq[i] )
+            printf("  Avg freq\t%d\tKHz\n", avgfreq[i]);
     }
 
     set_xen_guest_handle(info.cpu_to_core, cpu_to_core);
@@ -411,8 +408,7 @@
     set_xen_guest_handle(info.cpu_to_node, cpu_to_node);
     info.max_cpu_index = MAX_NR_CPU - 1;
 
-    ret = xc_topologyinfo(xc_handle, &info);
-    if ( !ret )
+    if ( cx_cap && !xc_topologyinfo(xc_handle, &info) )
     {
         uint32_t socket_ids[MAX_NR_CPU];
         uint32_t core_ids[MAX_NR_CPU];
@@ -461,7 +457,7 @@
                     if ( cpu_to_socket[j] == socket_ids[i] )
                         break;
                 }
-                printf("Socket %d\n", socket_ids[i]);
+                printf("\nSocket %d\n", socket_ids[i]);
                 res = cxstat_end[j].pc2 - cxstat_start[j].pc2;
                 printf("\tPC2\t%"PRIu64" ms\t%.2f%%\n",  res / 1000000UL,
                        100UL * res / (double)sum_cx[j]);
@@ -492,12 +488,9 @@
                     res = cxstat_end[j].cc7 - cxstat_start[j].cc7;
                     printf("\t\tCC7\t%"PRIu64" ms\t%.2f%%\n",  res / 1000000UL,
                            100UL * res / (double)sum_cx[j]);
-                    printf("\n");
-
                 }
             }
         }
-        printf("  Avg freq\t%d\tKHz\n", avgfreq[i]);
     }
 
     /* some clean up and then exits */
@@ -542,23 +535,23 @@
     }
     usec_start = tv.tv_sec * 1000000UL + tv.tv_usec;
 
-    sum = malloc(sizeof(uint64_t) * 2 * max_cpu_nr);
+    sum = calloc(2 * max_cpu_nr, sizeof(*sum));
     if ( sum == NULL )
         return ;
-    cxstat = malloc(sizeof(struct xc_cx_stat) * 2 * max_cpu_nr);
+    cxstat = calloc(2 * max_cpu_nr, sizeof(*cxstat));
     if ( cxstat == NULL )
     {
         free(sum);
         return ;
     }
-    pxstat = malloc(sizeof(struct xc_px_stat) * 2 * max_cpu_nr);
+    pxstat = calloc(2 * max_cpu_nr, sizeof(*pxstat));
     if ( pxstat == NULL )
     {
         free(sum);
         free(cxstat);
         return ;
     }
-    avgfreq = malloc(sizeof(int) * max_cpu_nr);
+    avgfreq = calloc(max_cpu_nr, sizeof(*avgfreq));
     if ( avgfreq == NULL )
     {
         free(sum);
@@ -566,10 +559,6 @@
         free(pxstat);
         return ;
     }
-    memset(sum, 0, sizeof(uint64_t) * 2 * max_cpu_nr);
-    memset(cxstat, 0, sizeof(struct xc_cx_stat) * 2 * max_cpu_nr);
-    memset(pxstat, 0, sizeof(struct xc_px_stat) * 2 * max_cpu_nr);
-    memset(avgfreq, 0, sizeof(int) * max_cpu_nr);
     sum_cx = sum;
     sum_px = sum + max_cpu_nr;
     cxstat_start = cxstat;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000ie-Ow; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000Z9-UH
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1327010119!11619183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17085 invoked from network); 19 Jan 2012 21:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:20 -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 1Rnzx1-0007QX-5H
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx1-0000eA-3x
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Message-Id: <E1Rnzx1-0000eA-3x@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Disable paging_prep
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326365550 0
# Node ID f04dfb11dd615b1a1dc194332255b90b11cf69e3
# Parent  75b8e982eb7e9346d157daf89a9b42f94fcab157
x86/mm: Disable paging_prep

The only way to page-in a page is now the safe paging_load domctl.
(Unless the page was never paged out in the first place)

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 75b8e982eb7e -r f04dfb11dd61 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 12 10:52:30 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 12 10:52:30 2012 +0000
@@ -989,6 +989,10 @@
     /* Allocate a page if the gfn does not have one yet */
     if ( !mfn_valid(mfn) )
     {
+        /* If the user did not provide a buffer, we disallow */
+        ret = -EINVAL;
+        if ( unlikely(user_ptr == NULL) )
+            goto out;
         /* Get a free page */
         ret = -ENOMEM;
         page = alloc_domheap_page(p2m->domain, 0);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000ie-Ow; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000Z9-UH
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1327010119!11619183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17085 invoked from network); 19 Jan 2012 21:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:20 -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 1Rnzx1-0007QX-5H
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx1-0000eA-3x
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Message-Id: <E1Rnzx1-0000eA-3x@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Disable paging_prep
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326365550 0
# Node ID f04dfb11dd615b1a1dc194332255b90b11cf69e3
# Parent  75b8e982eb7e9346d157daf89a9b42f94fcab157
x86/mm: Disable paging_prep

The only way to page-in a page is now the safe paging_load domctl.
(Unless the page was never paged out in the first place)

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 75b8e982eb7e -r f04dfb11dd61 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 12 10:52:30 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 12 10:52:30 2012 +0000
@@ -989,6 +989,10 @@
     /* Allocate a page if the gfn does not have one yet */
     if ( !mfn_valid(mfn) )
     {
+        /* If the user did not provide a buffer, we disallow */
+        ret = -EINVAL;
+        if ( unlikely(user_ptr == NULL) )
+            goto out;
         /* Get a free page */
         ret = -ENOMEM;
         page = alloc_domheap_page(p2m->domain, 0);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000hT-BN; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000YF-Ak
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1327010117!11734781!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12557 invoked from network); 19 Jan 2012 21:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:18 -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 1Rnzwz-0007QL-4P
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwz-0000dC-3G
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Message-Id: <E1Rnzwz-0000dC-3G@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: convert xenpaging_t to
	struct xenpaging
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125246 -3600
# Node ID 42dab0075a9205efc30a0014199c776ffc5cd842
# Parent  47ca45c8b318d37bb8412ce3d96cf7a37dcce743
xenpaging: convert xenpaging_t to struct xenpaging

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/pagein.c
--- a/tools/xenpaging/pagein.c	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/pagein.c	Mon Jan 09 17:07:26 2012 +0100
@@ -61,7 +61,7 @@
     pthread_cond_signal(&page_in_cond);
 }
 
-void create_page_in_thread(xenpaging_t *paging)
+void create_page_in_thread(struct xenpaging *paging)
 {
     page_in_args.dom = paging->mem_event.domain_id;
     page_in_args.pagein_queue = paging->pagein_queue;
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/policy.h	Mon Jan 09 17:07:26 2012 +0100
@@ -28,8 +28,8 @@
 #include "xenpaging.h"
 
 
-int policy_init(xenpaging_t *paging);
-int policy_choose_victim(xenpaging_t *paging, struct victim *victim);
+int policy_init(struct xenpaging *paging);
+int policy_choose_victim(struct xenpaging *paging, struct victim *victim);
 void policy_notify_paged_out(unsigned long gfn);
 void policy_notify_paged_in(unsigned long gfn);
 void policy_notify_paged_in_nomru(unsigned long gfn);
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/policy_default.c	Mon Jan 09 17:07:26 2012 +0100
@@ -37,7 +37,7 @@
 static unsigned long max_pages;
 
 
-int policy_init(xenpaging_t *paging)
+int policy_init(struct xenpaging *paging)
 {
     int i;
     int rc = -ENOMEM;
@@ -77,7 +77,7 @@
     return rc;
 }
 
-int policy_choose_victim(xenpaging_t *paging, struct victim *victim)
+int policy_choose_victim(struct xenpaging *paging, struct victim *victim)
 {
     xc_interface *xch = paging->xc_handle;
     unsigned long wrap = current_gfn;
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:26 2012 +0100
@@ -61,7 +61,7 @@
     unlink_pagefile();
 }
 
-static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
+static int xenpaging_mem_paging_flush_ioemu_cache(struct xenpaging *paging)
 {
     struct xs_handle *xsh = paging->xs_handle;
     domid_t domain_id = paging->mem_event.domain_id;
@@ -75,7 +75,7 @@
     return rc == true ? 0 : -1;
 }
 
-static int xenpaging_wait_for_event_or_timeout(xenpaging_t *paging)
+static int xenpaging_wait_for_event_or_timeout(struct xenpaging *paging)
 {
     xc_interface *xch = paging->xc_handle;
     xc_evtchn *xce = paging->mem_event.xce_handle;
@@ -163,7 +163,7 @@
     return rc;
 }
 
-static int xenpaging_get_tot_pages(xenpaging_t *paging)
+static int xenpaging_get_tot_pages(struct xenpaging *paging)
 {
     xc_interface *xch = paging->xc_handle;
     xc_domaininfo_t domain_info;
@@ -218,7 +218,7 @@
     printf(" -h             --help                   this output.\n");
 }
 
-static int xenpaging_getopts(xenpaging_t *paging, int argc, char *argv[])
+static int xenpaging_getopts(struct xenpaging *paging, int argc, char *argv[])
 {
     int ch;
     static const char sopts[] = "hvd:f:m:r:";
@@ -277,9 +277,9 @@
     return 0;
 }
 
-static xenpaging_t *xenpaging_init(int argc, char *argv[])
+static struct xenpaging *xenpaging_init(int argc, char *argv[])
 {
-    xenpaging_t *paging;
+    struct xenpaging *paging;
     xc_domaininfo_t domain_info;
     xc_interface *xch = NULL;
     xentoollog_logger *dbg = NULL;
@@ -287,7 +287,7 @@
     int rc;
 
     /* Allocate memory */
-    paging = calloc(1, sizeof(xenpaging_t));
+    paging = calloc(1, sizeof(struct xenpaging));
     if ( !paging )
         goto err;
 
@@ -475,7 +475,7 @@
     return NULL;
 }
 
-static int xenpaging_teardown(xenpaging_t *paging)
+static int xenpaging_teardown(struct xenpaging *paging)
 {
     int rc;
     xc_interface *xch;
@@ -561,7 +561,7 @@
     RING_PUSH_RESPONSES(back_ring);
 }
 
-static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i)
+static int xenpaging_evict_page(struct xenpaging *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     void *page;
@@ -612,7 +612,7 @@
     return ret;
 }
 
-static int xenpaging_resume_page(xenpaging_t *paging, mem_event_response_t *rsp, int notify_policy)
+static int xenpaging_resume_page(struct xenpaging *paging, mem_event_response_t *rsp, int notify_policy)
 {
     int ret;
 
@@ -646,7 +646,7 @@
     return ret;
 }
 
-static int xenpaging_populate_page(xenpaging_t *paging,
+static int xenpaging_populate_page(struct xenpaging *paging,
     xen_pfn_t gfn, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
@@ -690,7 +690,7 @@
 }
 
 /* Trigger a page-in for a batch of pages */
-static void resume_pages(xenpaging_t *paging, int num_pages)
+static void resume_pages(struct xenpaging *paging, int num_pages)
 {
     xc_interface *xch = paging->xc_handle;
     int i, num = 0;
@@ -710,7 +710,7 @@
         page_in_trigger();
 }
 
-static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i)
+static int evict_victim(struct xenpaging *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     int j = 0;
@@ -753,7 +753,7 @@
 }
 
 /* Evict a batch of pages and write them to a free slot in the paging file */
-static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages)
+static int evict_pages(struct xenpaging *paging, int fd, struct victim *victims, int num_pages)
 {
     xc_interface *xch = paging->xc_handle;
     int rc, slot, num = 0;
@@ -779,7 +779,7 @@
 int main(int argc, char *argv[])
 {
     struct sigaction act;
-    xenpaging_t *paging;
+    struct xenpaging *paging;
     struct victim *victims;
     mem_event_request_t req;
     mem_event_response_t rsp;
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:26 2012 +0100
@@ -40,7 +40,7 @@
     void *ring_page;
 } mem_event_t;
 
-typedef struct xenpaging {
+struct xenpaging {
     xc_interface *xc_handle;
     struct xs_handle *xs_handle;
 
@@ -54,7 +54,7 @@
     int policy_mru_size;
     int debug;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
-} xenpaging_t;
+};
 
 
 struct victim {
@@ -63,7 +63,7 @@
 };
 
 
-extern void create_page_in_thread(xenpaging_t *paging);
+extern void create_page_in_thread(struct xenpaging *paging);
 extern void page_in_trigger(void);
 
 #endif // __XEN_PAGING_H__

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000hT-BN; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000YF-Ak
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1327010117!11734781!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12557 invoked from network); 19 Jan 2012 21:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:18 -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 1Rnzwz-0007QL-4P
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwz-0000dC-3G
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Message-Id: <E1Rnzwz-0000dC-3G@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: convert xenpaging_t to
	struct xenpaging
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125246 -3600
# Node ID 42dab0075a9205efc30a0014199c776ffc5cd842
# Parent  47ca45c8b318d37bb8412ce3d96cf7a37dcce743
xenpaging: convert xenpaging_t to struct xenpaging

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/pagein.c
--- a/tools/xenpaging/pagein.c	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/pagein.c	Mon Jan 09 17:07:26 2012 +0100
@@ -61,7 +61,7 @@
     pthread_cond_signal(&page_in_cond);
 }
 
-void create_page_in_thread(xenpaging_t *paging)
+void create_page_in_thread(struct xenpaging *paging)
 {
     page_in_args.dom = paging->mem_event.domain_id;
     page_in_args.pagein_queue = paging->pagein_queue;
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/policy.h	Mon Jan 09 17:07:26 2012 +0100
@@ -28,8 +28,8 @@
 #include "xenpaging.h"
 
 
-int policy_init(xenpaging_t *paging);
-int policy_choose_victim(xenpaging_t *paging, struct victim *victim);
+int policy_init(struct xenpaging *paging);
+int policy_choose_victim(struct xenpaging *paging, struct victim *victim);
 void policy_notify_paged_out(unsigned long gfn);
 void policy_notify_paged_in(unsigned long gfn);
 void policy_notify_paged_in_nomru(unsigned long gfn);
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/policy_default.c	Mon Jan 09 17:07:26 2012 +0100
@@ -37,7 +37,7 @@
 static unsigned long max_pages;
 
 
-int policy_init(xenpaging_t *paging)
+int policy_init(struct xenpaging *paging)
 {
     int i;
     int rc = -ENOMEM;
@@ -77,7 +77,7 @@
     return rc;
 }
 
-int policy_choose_victim(xenpaging_t *paging, struct victim *victim)
+int policy_choose_victim(struct xenpaging *paging, struct victim *victim)
 {
     xc_interface *xch = paging->xc_handle;
     unsigned long wrap = current_gfn;
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:26 2012 +0100
@@ -61,7 +61,7 @@
     unlink_pagefile();
 }
 
-static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
+static int xenpaging_mem_paging_flush_ioemu_cache(struct xenpaging *paging)
 {
     struct xs_handle *xsh = paging->xs_handle;
     domid_t domain_id = paging->mem_event.domain_id;
@@ -75,7 +75,7 @@
     return rc == true ? 0 : -1;
 }
 
-static int xenpaging_wait_for_event_or_timeout(xenpaging_t *paging)
+static int xenpaging_wait_for_event_or_timeout(struct xenpaging *paging)
 {
     xc_interface *xch = paging->xc_handle;
     xc_evtchn *xce = paging->mem_event.xce_handle;
@@ -163,7 +163,7 @@
     return rc;
 }
 
-static int xenpaging_get_tot_pages(xenpaging_t *paging)
+static int xenpaging_get_tot_pages(struct xenpaging *paging)
 {
     xc_interface *xch = paging->xc_handle;
     xc_domaininfo_t domain_info;
@@ -218,7 +218,7 @@
     printf(" -h             --help                   this output.\n");
 }
 
-static int xenpaging_getopts(xenpaging_t *paging, int argc, char *argv[])
+static int xenpaging_getopts(struct xenpaging *paging, int argc, char *argv[])
 {
     int ch;
     static const char sopts[] = "hvd:f:m:r:";
@@ -277,9 +277,9 @@
     return 0;
 }
 
-static xenpaging_t *xenpaging_init(int argc, char *argv[])
+static struct xenpaging *xenpaging_init(int argc, char *argv[])
 {
-    xenpaging_t *paging;
+    struct xenpaging *paging;
     xc_domaininfo_t domain_info;
     xc_interface *xch = NULL;
     xentoollog_logger *dbg = NULL;
@@ -287,7 +287,7 @@
     int rc;
 
     /* Allocate memory */
-    paging = calloc(1, sizeof(xenpaging_t));
+    paging = calloc(1, sizeof(struct xenpaging));
     if ( !paging )
         goto err;
 
@@ -475,7 +475,7 @@
     return NULL;
 }
 
-static int xenpaging_teardown(xenpaging_t *paging)
+static int xenpaging_teardown(struct xenpaging *paging)
 {
     int rc;
     xc_interface *xch;
@@ -561,7 +561,7 @@
     RING_PUSH_RESPONSES(back_ring);
 }
 
-static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i)
+static int xenpaging_evict_page(struct xenpaging *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     void *page;
@@ -612,7 +612,7 @@
     return ret;
 }
 
-static int xenpaging_resume_page(xenpaging_t *paging, mem_event_response_t *rsp, int notify_policy)
+static int xenpaging_resume_page(struct xenpaging *paging, mem_event_response_t *rsp, int notify_policy)
 {
     int ret;
 
@@ -646,7 +646,7 @@
     return ret;
 }
 
-static int xenpaging_populate_page(xenpaging_t *paging,
+static int xenpaging_populate_page(struct xenpaging *paging,
     xen_pfn_t gfn, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
@@ -690,7 +690,7 @@
 }
 
 /* Trigger a page-in for a batch of pages */
-static void resume_pages(xenpaging_t *paging, int num_pages)
+static void resume_pages(struct xenpaging *paging, int num_pages)
 {
     xc_interface *xch = paging->xc_handle;
     int i, num = 0;
@@ -710,7 +710,7 @@
         page_in_trigger();
 }
 
-static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i)
+static int evict_victim(struct xenpaging *paging, struct victim *victim, int fd, int i)
 {
     xc_interface *xch = paging->xc_handle;
     int j = 0;
@@ -753,7 +753,7 @@
 }
 
 /* Evict a batch of pages and write them to a free slot in the paging file */
-static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages)
+static int evict_pages(struct xenpaging *paging, int fd, struct victim *victims, int num_pages)
 {
     xc_interface *xch = paging->xc_handle;
     int rc, slot, num = 0;
@@ -779,7 +779,7 @@
 int main(int argc, char *argv[])
 {
     struct sigaction act;
-    xenpaging_t *paging;
+    struct xenpaging *paging;
     struct victim *victims;
     mem_event_request_t req;
     mem_event_response_t rsp;
diff -r 47ca45c8b318 -r 42dab0075a92 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:21 2012 +0100
+++ b/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:26 2012 +0100
@@ -40,7 +40,7 @@
     void *ring_page;
 } mem_event_t;
 
-typedef struct xenpaging {
+struct xenpaging {
     xc_interface *xc_handle;
     struct xs_handle *xs_handle;
 
@@ -54,7 +54,7 @@
     int policy_mru_size;
     int debug;
     unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
-} xenpaging_t;
+};
 
 
 struct victim {
@@ -63,7 +63,7 @@
 };
 
 
-extern void create_page_in_thread(xenpaging_t *paging);
+extern void create_page_in_thread(struct xenpaging *paging);
 extern void page_in_trigger(void);
 
 #endif // __XEN_PAGING_H__

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000he-EL; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000YY-Ev
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327010117!11670759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17458 invoked from network); 19 Jan 2012 21:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:18 -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 1Rnzwz-0007QO-KU
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwz-0000dR-JN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Message-Id: <E1Rnzwz-0000dR-JN@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: convert mem_event_t to
	struct mem_event
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125252 -3600
# Node ID da99d818b0070a751ee60f4abff98eeb0e08f8a6
# Parent  42dab0075a9205efc30a0014199c776ffc5cd842
xenpaging: convert mem_event_t to struct mem_event

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 42dab0075a92 -r da99d818b007 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:26 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:32 2012 +0100
@@ -527,7 +527,7 @@
     return -1;
 }
 
-static void get_request(mem_event_t *mem_event, mem_event_request_t *req)
+static void get_request(struct mem_event *mem_event, mem_event_request_t *req)
 {
     mem_event_back_ring_t *back_ring;
     RING_IDX req_cons;
@@ -544,7 +544,7 @@
     back_ring->sring->req_event = req_cons + 1;
 }
 
-static void put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
+static void put_response(struct mem_event *mem_event, mem_event_response_t *rsp)
 {
     mem_event_back_ring_t *back_ring;
     RING_IDX rsp_prod;
diff -r 42dab0075a92 -r da99d818b007 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:26 2012 +0100
+++ b/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:32 2012 +0100
@@ -31,14 +31,14 @@
 
 #define XENPAGING_PAGEIN_QUEUE_SIZE 64
 
-typedef struct mem_event {
+struct mem_event {
     domid_t domain_id;
     xc_evtchn *xce_handle;
     int port;
     mem_event_back_ring_t back_ring;
     mem_event_shared_page_t *shared_page;
     void *ring_page;
-} mem_event_t;
+};
 
 struct xenpaging {
     xc_interface *xc_handle;
@@ -46,7 +46,7 @@
 
     unsigned long *bitmap;
 
-    mem_event_t mem_event;
+    struct mem_event mem_event;
     /* number of pages for which data structures were allocated */
     int max_pages;
     int num_paged_out;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1Rnzx9-0000he-EL; Thu, 19 Jan 2012 21:55:27 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000YY-Ev
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327010117!11670759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17458 invoked from network); 19 Jan 2012 21:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:18 -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 1Rnzwz-0007QO-KU
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzwz-0000dR-JN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:17 +0000
Message-Id: <E1Rnzwz-0000dR-JN@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: convert mem_event_t to
	struct mem_event
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125252 -3600
# Node ID da99d818b0070a751ee60f4abff98eeb0e08f8a6
# Parent  42dab0075a9205efc30a0014199c776ffc5cd842
xenpaging: convert mem_event_t to struct mem_event

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 42dab0075a92 -r da99d818b007 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:26 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Mon Jan 09 17:07:32 2012 +0100
@@ -527,7 +527,7 @@
     return -1;
 }
 
-static void get_request(mem_event_t *mem_event, mem_event_request_t *req)
+static void get_request(struct mem_event *mem_event, mem_event_request_t *req)
 {
     mem_event_back_ring_t *back_ring;
     RING_IDX req_cons;
@@ -544,7 +544,7 @@
     back_ring->sring->req_event = req_cons + 1;
 }
 
-static void put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
+static void put_response(struct mem_event *mem_event, mem_event_response_t *rsp)
 {
     mem_event_back_ring_t *back_ring;
     RING_IDX rsp_prod;
diff -r 42dab0075a92 -r da99d818b007 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:26 2012 +0100
+++ b/tools/xenpaging/xenpaging.h	Mon Jan 09 17:07:32 2012 +0100
@@ -31,14 +31,14 @@
 
 #define XENPAGING_PAGEIN_QUEUE_SIZE 64
 
-typedef struct mem_event {
+struct mem_event {
     domid_t domain_id;
     xc_evtchn *xce_handle;
     int port;
     mem_event_back_ring_t back_ring;
     mem_event_shared_page_t *shared_page;
     void *ring_page;
-} mem_event_t;
+};
 
 struct xenpaging {
     xc_interface *xc_handle;
@@ -46,7 +46,7 @@
 
     unsigned long *bitmap;
 
-    mem_event_t mem_event;
+    struct mem_event mem_event;
     /* number of pages for which data structures were allocated */
     int max_pages;
     int num_paged_out;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxA-0000l8-Vi; Thu, 19 Jan 2012 21:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000Zt-4E
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1327010114!11574604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10080 invoked from network); 19 Jan 2012 21:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:15 -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 1Rnzww-0007Q5-M4
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzww-0000bz-Kv
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Message-Id: <E1Rnzww-0000bz-Kv@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] flask/policy: add missing
	manage_domain rules
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1326211466 0
# Node ID 164ed9b67ad050cbd9efa24f641120733926d7d6
# Parent  db22b1aa11d330b0289bb691842b942fc6799dfd
flask/policy: add missing manage_domain rules

The updated example policy did not include rules to allow managing the
created domains (pause, unpause, destroy); allow these actions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r db22b1aa11d3 -r 164ed9b67ad0 tools/flask/policy/policy/modules/xen/xen.if
--- a/tools/flask/policy/policy/modules/xen/xen.if	Tue Jan 10 16:04:25 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.if	Tue Jan 10 16:04:26 2012 +0000
@@ -29,6 +29,13 @@
 	allow $1 $2_$1_channel:event create;
 ')
 
+# manage_domain(priv, target)
+#   Allow managing a running domain
+define(`manage_domain', `
+	allow $1 $2:domain { getdomaininfo getvcpuinfo getvcpuaffinity
+			getaddrsize pause unpause trigger shutdown destroy
+			setvcpuaffinity setdomainmaxmem };
+')
 ################################################################################
 #
 # Inter-domain communication
diff -r db22b1aa11d3 -r 164ed9b67ad0 tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Tue Jan 10 16:04:25 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Tue Jan 10 16:04:26 2012 +0000
@@ -86,10 +86,12 @@
 declare_domain(domU_t)
 domain_self_comms(domU_t)
 create_domain(dom0_t, domU_t)
+manage_domain(dom0_t, domU_t)
 domain_comms(dom0_t, domU_t)
 
 declare_domain(isolated_domU_t)
 create_domain(dom0_t, isolated_domU_t)
+manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
 ###############################################################################

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxA-0000l8-Vi; Thu, 19 Jan 2012 21:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000Zt-4E
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1327010114!11574604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10080 invoked from network); 19 Jan 2012 21:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:15 -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 1Rnzww-0007Q5-M4
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzww-0000bz-Kv
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:14 +0000
Message-Id: <E1Rnzww-0000bz-Kv@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] flask/policy: add missing
	manage_domain rules
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1326211466 0
# Node ID 164ed9b67ad050cbd9efa24f641120733926d7d6
# Parent  db22b1aa11d330b0289bb691842b942fc6799dfd
flask/policy: add missing manage_domain rules

The updated example policy did not include rules to allow managing the
created domains (pause, unpause, destroy); allow these actions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r db22b1aa11d3 -r 164ed9b67ad0 tools/flask/policy/policy/modules/xen/xen.if
--- a/tools/flask/policy/policy/modules/xen/xen.if	Tue Jan 10 16:04:25 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.if	Tue Jan 10 16:04:26 2012 +0000
@@ -29,6 +29,13 @@
 	allow $1 $2_$1_channel:event create;
 ')
 
+# manage_domain(priv, target)
+#   Allow managing a running domain
+define(`manage_domain', `
+	allow $1 $2:domain { getdomaininfo getvcpuinfo getvcpuaffinity
+			getaddrsize pause unpause trigger shutdown destroy
+			setvcpuaffinity setdomainmaxmem };
+')
 ################################################################################
 #
 # Inter-domain communication
diff -r db22b1aa11d3 -r 164ed9b67ad0 tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Tue Jan 10 16:04:25 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Tue Jan 10 16:04:26 2012 +0000
@@ -86,10 +86,12 @@
 declare_domain(domU_t)
 domain_self_comms(domU_t)
 create_domain(dom0_t, domU_t)
+manage_domain(dom0_t, domU_t)
 domain_comms(dom0_t, domU_t)
 
 declare_domain(isolated_domU_t)
 create_domain(dom0_t, isolated_domU_t)
+manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
 ###############################################################################

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxB-0000lc-5o; Thu, 19 Jan 2012 21:55:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000ac-Bx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1327010120!9902125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28233 invoked from network); 19 Jan 2012 21:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:21 -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 1Rnzx2-0007Qd-7A
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000ee-5w
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Message-Id: <E1Rnzx2-0000ee-5w@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: fix build (once again)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326372291 -3600
# Node ID e71bd3a75f0711abbd7b6538f46a6b4f89d92969
# Parent  32dd444700bd721a9140f4a4edbcfdcfe06ffcf7
ia64: fix build (once again)

24423:069c08b7de46 failed to add a necessary include, and for a long
time kexec.h suffered from a missing structure forward declaration.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 32dd444700bd -r e71bd3a75f07 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c	Thu Jan 12 11:02:18 2012 +0000
+++ b/xen/arch/ia64/xen/mm.c	Thu Jan 12 13:44:51 2012 +0100
@@ -180,6 +180,7 @@
 #include <xen/guest_access.h>
 #include <asm/page.h>
 #include <asm/dom_fw_common.h>
+#include <xsm/xsm.h>
 #include <public/memory.h>
 #include <asm/event.h>
 #include <asm/debugger.h>
diff -r 32dd444700bd -r e71bd3a75f07 xen/include/asm-ia64/kexec.h
--- a/xen/include/asm-ia64/kexec.h	Thu Jan 12 11:02:18 2012 +0000
+++ b/xen/include/asm-ia64/kexec.h	Thu Jan 12 13:44:51 2012 +0100
@@ -4,6 +4,8 @@
 #include <xen/types.h>
 #include <xen/kexec.h>
 
+struct rsvd_region;
+
 extern const unsigned int relocate_new_kernel_size;
 extern void relocate_new_kernel(unsigned long indirection_page,
                                 unsigned long start_address,

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxB-0000lc-5o; Thu, 19 Jan 2012 21:55:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000ac-Bx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1327010120!9902125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28233 invoked from network); 19 Jan 2012 21:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:21 -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 1Rnzx2-0007Qd-7A
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000ee-5w
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Message-Id: <E1Rnzx2-0000ee-5w@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: fix build (once again)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326372291 -3600
# Node ID e71bd3a75f0711abbd7b6538f46a6b4f89d92969
# Parent  32dd444700bd721a9140f4a4edbcfdcfe06ffcf7
ia64: fix build (once again)

24423:069c08b7de46 failed to add a necessary include, and for a long
time kexec.h suffered from a missing structure forward declaration.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 32dd444700bd -r e71bd3a75f07 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c	Thu Jan 12 11:02:18 2012 +0000
+++ b/xen/arch/ia64/xen/mm.c	Thu Jan 12 13:44:51 2012 +0100
@@ -180,6 +180,7 @@
 #include <xen/guest_access.h>
 #include <asm/page.h>
 #include <asm/dom_fw_common.h>
+#include <xsm/xsm.h>
 #include <public/memory.h>
 #include <asm/event.h>
 #include <asm/debugger.h>
diff -r 32dd444700bd -r e71bd3a75f07 xen/include/asm-ia64/kexec.h
--- a/xen/include/asm-ia64/kexec.h	Thu Jan 12 11:02:18 2012 +0000
+++ b/xen/include/asm-ia64/kexec.h	Thu Jan 12 13:44:51 2012 +0100
@@ -4,6 +4,8 @@
 #include <xen/types.h>
 #include <xen/kexec.h>
 
+struct rsvd_region;
+
 extern const unsigned int relocate_new_kernel_size;
 extern void relocate_new_kernel(unsigned long indirection_page,
                                 unsigned long start_address,

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxC-0000ng-9b; Thu, 19 Jan 2012 21:55:30 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000bP-T7
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1327010121!11766363!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15352 invoked from network); 19 Jan 2012 21:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:22 -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 1Rnzx2-0007Qg-PK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000eu-Nr
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Message-Id: <E1Rnzx2-0000eu-Nr@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] move declarations of some required
	per-arch functions into common headers
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326372347 -3600
# Node ID 8d2fa20dd3f37e5f2c670f2b0cd56649fcea8000
# Parent  e71bd3a75f0711abbd7b6538f46a6b4f89d92969
move declarations of some required per-arch functions into common headers

... since it is pointless to have each arch declare them on their own
(and now and the - see ia64 - forget to do so).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Jan 12 13:45:47 2012 +0100
@@ -19,6 +19,7 @@
 #include <xen/console.h>
 #include <xen/grant_table.h>
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <xen/pci.h>
 #include <asm/vmx.h>
 #include <asm/dom_fw.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/ia64/xen/domain.c	Thu Jan 12 13:45:47 2012 +0100
@@ -31,6 +31,7 @@
 #include <asm/processor.h>
 #include <xen/event.h>
 #include <xen/console.h>
+#include <xen/hypercall.h>
 #include <xen/version.h>
 #include <xen/libelf.h>
 #include <asm/pgalloc.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/ia64/xen/xensetup.c	Thu Jan 12 13:45:47 2012 +0100
@@ -10,7 +10,7 @@
 #include <xen/multiboot.h>
 #include <xen/sched.h>
 #include <xen/mm.h>
-#include <public/version.h>
+#include <xen/hypercall.h>
 #include <xen/gdbstub.h>
 #include <xen/version.h>
 #include <xen/console.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/x86/domain.c	Thu Jan 12 13:45:47 2012 +0100
@@ -23,6 +23,7 @@
 #include <xen/grant_table.h>
 #include <xen/iocap.h>
 #include <xen/kernel.h>
+#include <xen/hypercall.h>
 #include <xen/multicall.h>
 #include <xen/irq.h>
 #include <xen/event.h>
@@ -46,7 +47,6 @@
 #include <asm/xstate.h>
 #include <asm/mpspec.h>
 #include <asm/ldt.h>
-#include <asm/hypercall.h>
 #include <asm/fixmap.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/x86/x86_64/domain.c
--- a/xen/arch/x86/x86_64/domain.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/x86/x86_64/domain.c	Thu Jan 12 13:45:47 2012 +0100
@@ -6,7 +6,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/guest_access.h>
-#include <asm/hypercall.h>
+#include <xen/hypercall.h>
 #include <compat/vcpu.h>
 
 #define xen_vcpu_info vcpu_info
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/common/kernel.c
--- a/xen/common/kernel.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/common/kernel.c	Thu Jan 12 13:45:47 2012 +0100
@@ -13,13 +13,10 @@
 #include <xen/paging.h>
 #include <xen/nmi.h>
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <asm/current.h>
 #include <public/nmi.h>
 #include <public/version.h>
-#ifdef CONFIG_X86
-#include <asm/shared.h>
-#include <asm/setup.h>
-#endif
 
 #ifndef COMPAT
 
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/asm-ia64/hypercall.h
--- a/xen/include/asm-ia64/hypercall.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/asm-ia64/hypercall.h	Thu Jan 12 13:45:47 2012 +0100
@@ -22,7 +22,4 @@
     u64 *pdone,
     u64 foreigndom);
 
-extern long
-arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg);
-
 #endif /* __ASM_IA64_HYPERCALL_H__ */
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/asm-x86/hypercall.h	Thu Jan 12 13:45:47 2012 +0100
@@ -90,16 +90,6 @@
 do_iret(
     void);
 
-struct vcpu;
-extern long
-arch_do_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg);
-
-extern long
-arch_do_sysctl(
-    struct xen_sysctl *op, 
-    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
-
 extern int
 do_kexec(
     unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/asm-x86/setup.h	Thu Jan 12 13:45:47 2012 +0100
@@ -2,7 +2,6 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
-#include <public/version.h>
 
 extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
@@ -40,7 +39,6 @@
 void discard_initial_images(void);
 
 int xen_in_range(unsigned long mfn);
-void arch_get_xen_caps(xen_capabilities_info_t *info);
 
 void microcode_grab_module(
     unsigned long *, const multiboot_info_t *, void *(*)(const module_t *));
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/xen/hypercall.h	Thu Jan 12 13:45:47 2012 +0100
@@ -14,6 +14,7 @@
 #include <public/platform.h>
 #include <public/event_channel.h>
 #include <public/tmem.h>
+#include <public/version.h>
 #include <asm/hypercall.h>
 #include <xsm/xsm.h>
 
@@ -45,6 +46,11 @@
     XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
 
 extern long
+arch_do_sysctl(
+    struct xen_sysctl *sysctl,
+    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+
+extern long
 do_platform_op(
     XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op);
 
@@ -102,6 +108,12 @@
     int vcpuid,
     XEN_GUEST_HANDLE(void) arg);
 
+struct vcpu;
+extern long
+arch_do_vcpu_op(int cmd,
+    struct vcpu *v,
+    XEN_GUEST_HANDLE(void) arg);
+
 extern long
 do_nmi_op(
     unsigned int cmd,
@@ -167,4 +179,6 @@
 
 #endif
 
+void arch_get_xen_caps(xen_capabilities_info_t *info);
+
 #endif /* __XEN_HYPERCALL_H__ */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxC-0000ng-9b; Thu, 19 Jan 2012 21:55:30 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000bP-T7
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1327010121!11766363!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15352 invoked from network); 19 Jan 2012 21:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:22 -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 1Rnzx2-0007Qg-PK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx2-0000eu-Nr
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:20 +0000
Message-Id: <E1Rnzx2-0000eu-Nr@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] move declarations of some required
	per-arch functions into common headers
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326372347 -3600
# Node ID 8d2fa20dd3f37e5f2c670f2b0cd56649fcea8000
# Parent  e71bd3a75f0711abbd7b6538f46a6b4f89d92969
move declarations of some required per-arch functions into common headers

... since it is pointless to have each arch declare them on their own
(and now and the - see ia64 - forget to do so).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Jan 12 13:45:47 2012 +0100
@@ -19,6 +19,7 @@
 #include <xen/console.h>
 #include <xen/grant_table.h>
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <xen/pci.h>
 #include <asm/vmx.h>
 #include <asm/dom_fw.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/ia64/xen/domain.c	Thu Jan 12 13:45:47 2012 +0100
@@ -31,6 +31,7 @@
 #include <asm/processor.h>
 #include <xen/event.h>
 #include <xen/console.h>
+#include <xen/hypercall.h>
 #include <xen/version.h>
 #include <xen/libelf.h>
 #include <asm/pgalloc.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/ia64/xen/xensetup.c	Thu Jan 12 13:45:47 2012 +0100
@@ -10,7 +10,7 @@
 #include <xen/multiboot.h>
 #include <xen/sched.h>
 #include <xen/mm.h>
-#include <public/version.h>
+#include <xen/hypercall.h>
 #include <xen/gdbstub.h>
 #include <xen/version.h>
 #include <xen/console.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/x86/domain.c	Thu Jan 12 13:45:47 2012 +0100
@@ -23,6 +23,7 @@
 #include <xen/grant_table.h>
 #include <xen/iocap.h>
 #include <xen/kernel.h>
+#include <xen/hypercall.h>
 #include <xen/multicall.h>
 #include <xen/irq.h>
 #include <xen/event.h>
@@ -46,7 +47,6 @@
 #include <asm/xstate.h>
 #include <asm/mpspec.h>
 #include <asm/ldt.h>
-#include <asm/hypercall.h>
 #include <asm/fixmap.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/arch/x86/x86_64/domain.c
--- a/xen/arch/x86/x86_64/domain.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/arch/x86/x86_64/domain.c	Thu Jan 12 13:45:47 2012 +0100
@@ -6,7 +6,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/guest_access.h>
-#include <asm/hypercall.h>
+#include <xen/hypercall.h>
 #include <compat/vcpu.h>
 
 #define xen_vcpu_info vcpu_info
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/common/kernel.c
--- a/xen/common/kernel.c	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/common/kernel.c	Thu Jan 12 13:45:47 2012 +0100
@@ -13,13 +13,10 @@
 #include <xen/paging.h>
 #include <xen/nmi.h>
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <asm/current.h>
 #include <public/nmi.h>
 #include <public/version.h>
-#ifdef CONFIG_X86
-#include <asm/shared.h>
-#include <asm/setup.h>
-#endif
 
 #ifndef COMPAT
 
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/asm-ia64/hypercall.h
--- a/xen/include/asm-ia64/hypercall.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/asm-ia64/hypercall.h	Thu Jan 12 13:45:47 2012 +0100
@@ -22,7 +22,4 @@
     u64 *pdone,
     u64 foreigndom);
 
-extern long
-arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg);
-
 #endif /* __ASM_IA64_HYPERCALL_H__ */
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/asm-x86/hypercall.h	Thu Jan 12 13:45:47 2012 +0100
@@ -90,16 +90,6 @@
 do_iret(
     void);
 
-struct vcpu;
-extern long
-arch_do_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg);
-
-extern long
-arch_do_sysctl(
-    struct xen_sysctl *op, 
-    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
-
 extern int
 do_kexec(
     unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg);
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/asm-x86/setup.h	Thu Jan 12 13:45:47 2012 +0100
@@ -2,7 +2,6 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
-#include <public/version.h>
 
 extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
@@ -40,7 +39,6 @@
 void discard_initial_images(void);
 
 int xen_in_range(unsigned long mfn);
-void arch_get_xen_caps(xen_capabilities_info_t *info);
 
 void microcode_grab_module(
     unsigned long *, const multiboot_info_t *, void *(*)(const module_t *));
diff -r e71bd3a75f07 -r 8d2fa20dd3f3 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Thu Jan 12 13:44:51 2012 +0100
+++ b/xen/include/xen/hypercall.h	Thu Jan 12 13:45:47 2012 +0100
@@ -14,6 +14,7 @@
 #include <public/platform.h>
 #include <public/event_channel.h>
 #include <public/tmem.h>
+#include <public/version.h>
 #include <asm/hypercall.h>
 #include <xsm/xsm.h>
 
@@ -45,6 +46,11 @@
     XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
 
 extern long
+arch_do_sysctl(
+    struct xen_sysctl *sysctl,
+    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+
+extern long
 do_platform_op(
     XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op);
 
@@ -102,6 +108,12 @@
     int vcpuid,
     XEN_GUEST_HANDLE(void) arg);
 
+struct vcpu;
+extern long
+arch_do_vcpu_op(int cmd,
+    struct vcpu *v,
+    XEN_GUEST_HANDLE(void) arg);
+
 extern long
 do_nmi_op(
     unsigned int cmd,
@@ -167,4 +179,6 @@
 
 #endif
 
+void arch_get_xen_caps(xen_capabilities_info_t *info);
+
 #endif /* __XEN_HYPERCALL_H__ */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxC-0000nx-Ce; Thu, 19 Jan 2012 21:55:30 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000bO-TF
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1327010119!11574610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10135 invoked from network); 19 Jan 2012 21:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:21 -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 1Rnzx1-0007Qa-MQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx1-0000eP-L8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Message-Id: <E1Rnzx1-0000eP-L8@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Code style fixes in
	mem_sharing.c
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326366138 0
# Node ID 32dd444700bd721a9140f4a4edbcfdcfe06ffcf7
# Parent  f04dfb11dd615b1a1dc194332255b90b11cf69e3
x86/mm: Code style fixes in mem_sharing.c

No functional changes, only code style issues.

One small diff in mem_sharing_gref_to_gfn() looks like a logic change,
but it's not.  The flow was confusing, so it's been clarified.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f04dfb11dd61 -r 32dd444700bd xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 12 10:52:30 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 12 11:02:18 2012 +0000
@@ -4316,9 +4316,9 @@
         return -EEXIST;
     }
 
-    /* Check if the ref count is 2. The first from PGT_allocated, and
+    /* Check if the ref count is 2. The first from PGC_allocated, and
      * the second from get_page_and_type at the top of this function */
-    if(page->count_info != (PGC_allocated | (2 + expected_refcnt)))
+    if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
     {
         /* Return type count back to zero */
         put_page_and_type(page);
@@ -4335,7 +4335,7 @@
 
 int page_make_private(struct domain *d, struct page_info *page)
 {
-    if(!get_page(page, dom_cow))
+    if ( !get_page(page, dom_cow) )
         return -EINVAL;
     
     spin_lock(&d->page_alloc_lock);
diff -r f04dfb11dd61 -r 32dd444700bd xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 12 10:52:30 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 12 11:02:18 2012 +0000
@@ -35,14 +35,14 @@
 #include "mm-locks.h"
 
 /* Auditing of memory sharing code? */
-#define MEM_SHARING_AUDIT  0
+#define MEM_SHARING_AUDIT 0
 
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void);
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
 #else
-# define mem_sharing_audit() do {} while(0)
+#define mem_sharing_audit() do {} while(0)
 #endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
@@ -56,7 +56,7 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 static shr_handle_t next_handle = 1;
-static atomic_t nr_saved_mfns = ATOMIC_INIT(0); 
+static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
 
 typedef struct shr_hash_entry 
 {
@@ -84,9 +84,9 @@
     return (head->next != head) && (head->next->next == head);
 }
 
-static inline struct gfn_info* gfn_get_info(struct list_head *list)
+static inline gfn_info_t *gfn_get_info(struct list_head *list)
 {
-    return list_entry(list->next, struct gfn_info, list);
+    return list_entry(list->next, gfn_info_t, list);
 }
 
 static void __init mem_sharing_hash_init(void)
@@ -116,12 +116,12 @@
 static void mem_sharing_gfn_destroy(gfn_info_t *gfn, int was_shared)
 {
     /* Decrement the number of pages, if the gfn was shared before */
-    if(was_shared)
+    if ( was_shared )
     {
         struct domain *d = get_domain_by_id(gfn->domain);
-        /* Domain may have been destroyed by now, if we are called from
-         * p2m_teardown */
-        if(d)
+        /* Domain may have been destroyed by now *
+         * (if we are called from p2m_teardown)  */
+        if ( d )
         {
             atomic_dec(&d->shr_pages);
             put_domain(d);
@@ -293,7 +293,7 @@
 
 unsigned int mem_sharing_get_nr_saved_mfns(void)
 {
-    return (unsigned int)atomic_read(&nr_saved_mfns);
+    return ((unsigned int)atomic_read(&nr_saved_mfns));
 }
 
 int mem_sharing_sharing_resume(struct domain *d)
@@ -317,14 +317,15 @@
 {
     struct page_info *page;
 
-    if(!mfn_valid(_mfn(mfn)))
+    if ( !mfn_valid(_mfn(mfn)) )
     {
-        printk("Invalid MFN=%lx\n", mfn);
+        gdprintk(XENLOG_ERR, "Invalid MFN=%lx\n", mfn);
         return -1;
     }
     page = mfn_to_page(_mfn(mfn));
 
-    printk("Debug page: MFN=%lx is ci=%lx, ti=%lx, owner_id=%d\n",
+    gdprintk(XENLOG_DEBUG, 
+            "Debug page: MFN=%lx is ci=%lx, ti=%lx, owner_id=%d\n",
             mfn_x(page_to_mfn(page)), 
             page->count_info, 
             page->u.inuse.type_info,
@@ -340,9 +341,9 @@
 
     mfn = get_gfn_unlocked(d, gfn, &p2mt);
 
-    printk("Debug for domain=%d, gfn=%lx, ", 
-            d->domain_id, 
-            gfn);
+    gdprintk(XENLOG_DEBUG, "Debug for domain=%d, gfn=%lx, ", 
+               d->domain_id, 
+               gfn);
     return mem_sharing_debug_mfn(mfn_x(mfn));
 }
 
@@ -359,8 +360,8 @@
 static grant_entry_header_t *
 shared_entry_header(struct grant_table *t, grant_ref_t ref)
 {
-    ASSERT(t->gt_version != 0);
-    if (t->gt_version == 1)
+    ASSERT (t->gt_version != 0);
+    if ( t->gt_version == 1 )
         return (grant_entry_header_t*)&shared_entry_v1(t, ref);
     else
         return &shared_entry_v2(t, ref).hdr;
@@ -370,25 +371,23 @@
                                    grant_ref_t ref, 
                                    unsigned long *gfn)
 {
-    if(d->grant_table->gt_version < 1)
+    if ( d->grant_table->gt_version < 1 )
         return -1;
 
-    if (d->grant_table->gt_version == 1) 
+    if ( d->grant_table->gt_version == 1 ) 
     {
         grant_entry_v1_t *sha1;
         sha1 = &shared_entry_v1(d->grant_table, ref);
         *gfn = sha1->frame;
-        return 0;
     } 
     else 
     {
         grant_entry_v2_t *sha2;
         sha2 = &shared_entry_v2(d->grant_table, ref);
         *gfn = sha2->full_page.frame;
-        return 0;
     }
  
-    return -2;
+    return 0;
 }
 
 /* Account for a GFN being shared/unshared.
@@ -428,20 +427,22 @@
     uint16_t status;
     unsigned long gfn;
 
-    if(d->grant_table->gt_version < 1)
+    if ( d->grant_table->gt_version < 1 )
     {
-        printk("Asked to debug [dom=%d,gref=%d], but not yet inited.\n",
+        gdprintk(XENLOG_ERR, 
+                "Asked to debug [dom=%d,gref=%d], but not yet inited.\n",
                 d->domain_id, ref);
         return -1;
     }
-    mem_sharing_gref_to_gfn(d, ref, &gfn); 
+    (void)mem_sharing_gref_to_gfn(d, ref, &gfn); 
     shah = shared_entry_header(d->grant_table, ref);
-    if (d->grant_table->gt_version == 1) 
+    if ( d->grant_table->gt_version == 1 ) 
         status = shah->flags;
     else 
         status = status_entry(d->grant_table, ref);
     
-    printk("==> Grant [dom=%d,ref=%d], status=%x. ", 
+    gdprintk(XENLOG_DEBUG,
+            "==> Grant [dom=%d,ref=%d], status=%x. ", 
             d->domain_id, ref, status);
 
     return mem_sharing_debug_gfn(d, gfn); 
@@ -467,24 +468,24 @@
 
     /* Check if mfn is valid */
     ret = -EINVAL;
-    if (!mfn_valid(mfn))
+    if ( !mfn_valid(mfn) )
         goto out;
 
     /* Return the handle if the page is already shared */
     page = mfn_to_page(mfn);
-    if (p2m_is_shared(p2mt)) {
+    if ( p2m_is_shared(p2mt) ) {
         *phandle = page->shr_handle;
         ret = 0;
         goto out;
     }
 
     /* Check p2m type */
-    if (!p2m_is_sharable(p2mt))
+    if ( !p2m_is_sharable(p2mt) )
         goto out;
 
     /* Try to convert the mfn to the sharable type */
     ret = page_make_sharable(d, page, expected_refcnt); 
-    if(ret) 
+    if ( ret ) 
         goto out;
 
     /* Create the handle */
@@ -501,7 +502,7 @@
     }
 
     /* Change the p2m type */
-    if(p2m_change_type(d, gfn, p2mt, p2m_ram_shared) != p2mt) 
+    if ( p2m_change_type(d, gfn, p2mt, p2m_ram_shared) != p2mt ) 
     {
         /* This is unlikely, as the type must have changed since we've checked
          * it a few lines above.
@@ -607,7 +608,7 @@
     mfn = get_gfn(d, gfn, &p2mt);
     
     /* Has someone already unshared it? */
-    if (!p2m_is_shared(p2mt)) {
+    if ( !p2m_is_shared(p2mt) ) {
         put_gfn(d, gfn);
         shr_unlock();
         return 0;
@@ -620,10 +621,11 @@
     list_for_each(le, &hash_entry->gfns)
     {
         gfn_info = list_entry(le, struct gfn_info, list);
-        if((gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id))
+        if ( (gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id) )
             goto gfn_found;
     }
-    printk("Could not find gfn_info for shared gfn: %lx\n", gfn);
+    gdprintk(XENLOG_ERR, "Could not find gfn_info for shared gfn: "
+                            "%lx\n", gfn);
     BUG();
 gfn_found: 
     /* Delete gfn_info from the list, but hold on to it, until we've allocated
@@ -633,7 +635,7 @@
 
     /* If the GFN is getting destroyed drop the references to MFN 
      * (possibly freeing the page), and exit early */
-    if(flags & MEM_SHARING_DESTROY_GFN)
+    if ( flags & MEM_SHARING_DESTROY_GFN )
     {
         mem_sharing_gfn_destroy(gfn_info, !last_gfn);
         if(last_gfn) 
@@ -691,8 +693,8 @@
     else
         atomic_dec(&nr_saved_mfns);
 
-    if(p2m_change_type(d, gfn, p2m_ram_shared, p2m_ram_rw) != 
-                                                p2m_ram_shared) 
+    if ( p2m_change_type(d, gfn, p2m_ram_shared, p2m_ram_rw) != 
+                                                p2m_ram_shared ) 
     {
         printk("Could not change p2m type.\n");
         BUG();
@@ -729,7 +731,7 @@
         {
             unsigned long gfn = mec->u.nominate.u.gfn;
             shr_handle_t handle;
-            if(!mem_sharing_enabled(d))
+            if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
             rc = mem_sharing_nominate_page(d, gfn, 0, &handle);
             mec->u.nominate.handle = handle;
@@ -742,9 +744,9 @@
             unsigned long gfn;
             shr_handle_t handle;
 
-            if(!mem_sharing_enabled(d))
+            if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
-            if(mem_sharing_gref_to_gfn(d, gref, &gfn) < 0)
+            if ( mem_sharing_gref_to_gfn(d, gref, &gfn) < 0 )
                 return -EINVAL;
             rc = mem_sharing_nominate_page(d, gfn, 3, &handle);
             mec->u.nominate.handle = handle;
@@ -761,7 +763,7 @@
 
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME:
         {
-            if(!mem_sharing_enabled(d))
+            if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
             rc = mem_sharing_sharing_resume(d);
         }

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxC-0000nx-Ce; Thu, 19 Jan 2012 21:55:30 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000bO-TF
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1327010119!11574610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10135 invoked from network); 19 Jan 2012 21:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:21 -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 1Rnzx1-0007Qa-MQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx1-0000eP-L8
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:19 +0000
Message-Id: <E1Rnzx1-0000eP-L8@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Code style fixes in
	mem_sharing.c
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326366138 0
# Node ID 32dd444700bd721a9140f4a4edbcfdcfe06ffcf7
# Parent  f04dfb11dd615b1a1dc194332255b90b11cf69e3
x86/mm: Code style fixes in mem_sharing.c

No functional changes, only code style issues.

One small diff in mem_sharing_gref_to_gfn() looks like a logic change,
but it's not.  The flow was confusing, so it's been clarified.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f04dfb11dd61 -r 32dd444700bd xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 12 10:52:30 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 12 11:02:18 2012 +0000
@@ -4316,9 +4316,9 @@
         return -EEXIST;
     }
 
-    /* Check if the ref count is 2. The first from PGT_allocated, and
+    /* Check if the ref count is 2. The first from PGC_allocated, and
      * the second from get_page_and_type at the top of this function */
-    if(page->count_info != (PGC_allocated | (2 + expected_refcnt)))
+    if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
     {
         /* Return type count back to zero */
         put_page_and_type(page);
@@ -4335,7 +4335,7 @@
 
 int page_make_private(struct domain *d, struct page_info *page)
 {
-    if(!get_page(page, dom_cow))
+    if ( !get_page(page, dom_cow) )
         return -EINVAL;
     
     spin_lock(&d->page_alloc_lock);
diff -r f04dfb11dd61 -r 32dd444700bd xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 12 10:52:30 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 12 11:02:18 2012 +0000
@@ -35,14 +35,14 @@
 #include "mm-locks.h"
 
 /* Auditing of memory sharing code? */
-#define MEM_SHARING_AUDIT  0
+#define MEM_SHARING_AUDIT 0
 
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void);
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
 #else
-# define mem_sharing_audit() do {} while(0)
+#define mem_sharing_audit() do {} while(0)
 #endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
@@ -56,7 +56,7 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 static shr_handle_t next_handle = 1;
-static atomic_t nr_saved_mfns = ATOMIC_INIT(0); 
+static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
 
 typedef struct shr_hash_entry 
 {
@@ -84,9 +84,9 @@
     return (head->next != head) && (head->next->next == head);
 }
 
-static inline struct gfn_info* gfn_get_info(struct list_head *list)
+static inline gfn_info_t *gfn_get_info(struct list_head *list)
 {
-    return list_entry(list->next, struct gfn_info, list);
+    return list_entry(list->next, gfn_info_t, list);
 }
 
 static void __init mem_sharing_hash_init(void)
@@ -116,12 +116,12 @@
 static void mem_sharing_gfn_destroy(gfn_info_t *gfn, int was_shared)
 {
     /* Decrement the number of pages, if the gfn was shared before */
-    if(was_shared)
+    if ( was_shared )
     {
         struct domain *d = get_domain_by_id(gfn->domain);
-        /* Domain may have been destroyed by now, if we are called from
-         * p2m_teardown */
-        if(d)
+        /* Domain may have been destroyed by now *
+         * (if we are called from p2m_teardown)  */
+        if ( d )
         {
             atomic_dec(&d->shr_pages);
             put_domain(d);
@@ -293,7 +293,7 @@
 
 unsigned int mem_sharing_get_nr_saved_mfns(void)
 {
-    return (unsigned int)atomic_read(&nr_saved_mfns);
+    return ((unsigned int)atomic_read(&nr_saved_mfns));
 }
 
 int mem_sharing_sharing_resume(struct domain *d)
@@ -317,14 +317,15 @@
 {
     struct page_info *page;
 
-    if(!mfn_valid(_mfn(mfn)))
+    if ( !mfn_valid(_mfn(mfn)) )
     {
-        printk("Invalid MFN=%lx\n", mfn);
+        gdprintk(XENLOG_ERR, "Invalid MFN=%lx\n", mfn);
         return -1;
     }
     page = mfn_to_page(_mfn(mfn));
 
-    printk("Debug page: MFN=%lx is ci=%lx, ti=%lx, owner_id=%d\n",
+    gdprintk(XENLOG_DEBUG, 
+            "Debug page: MFN=%lx is ci=%lx, ti=%lx, owner_id=%d\n",
             mfn_x(page_to_mfn(page)), 
             page->count_info, 
             page->u.inuse.type_info,
@@ -340,9 +341,9 @@
 
     mfn = get_gfn_unlocked(d, gfn, &p2mt);
 
-    printk("Debug for domain=%d, gfn=%lx, ", 
-            d->domain_id, 
-            gfn);
+    gdprintk(XENLOG_DEBUG, "Debug for domain=%d, gfn=%lx, ", 
+               d->domain_id, 
+               gfn);
     return mem_sharing_debug_mfn(mfn_x(mfn));
 }
 
@@ -359,8 +360,8 @@
 static grant_entry_header_t *
 shared_entry_header(struct grant_table *t, grant_ref_t ref)
 {
-    ASSERT(t->gt_version != 0);
-    if (t->gt_version == 1)
+    ASSERT (t->gt_version != 0);
+    if ( t->gt_version == 1 )
         return (grant_entry_header_t*)&shared_entry_v1(t, ref);
     else
         return &shared_entry_v2(t, ref).hdr;
@@ -370,25 +371,23 @@
                                    grant_ref_t ref, 
                                    unsigned long *gfn)
 {
-    if(d->grant_table->gt_version < 1)
+    if ( d->grant_table->gt_version < 1 )
         return -1;
 
-    if (d->grant_table->gt_version == 1) 
+    if ( d->grant_table->gt_version == 1 ) 
     {
         grant_entry_v1_t *sha1;
         sha1 = &shared_entry_v1(d->grant_table, ref);
         *gfn = sha1->frame;
-        return 0;
     } 
     else 
     {
         grant_entry_v2_t *sha2;
         sha2 = &shared_entry_v2(d->grant_table, ref);
         *gfn = sha2->full_page.frame;
-        return 0;
     }
  
-    return -2;
+    return 0;
 }
 
 /* Account for a GFN being shared/unshared.
@@ -428,20 +427,22 @@
     uint16_t status;
     unsigned long gfn;
 
-    if(d->grant_table->gt_version < 1)
+    if ( d->grant_table->gt_version < 1 )
     {
-        printk("Asked to debug [dom=%d,gref=%d], but not yet inited.\n",
+        gdprintk(XENLOG_ERR, 
+                "Asked to debug [dom=%d,gref=%d], but not yet inited.\n",
                 d->domain_id, ref);
         return -1;
     }
-    mem_sharing_gref_to_gfn(d, ref, &gfn); 
+    (void)mem_sharing_gref_to_gfn(d, ref, &gfn); 
     shah = shared_entry_header(d->grant_table, ref);
-    if (d->grant_table->gt_version == 1) 
+    if ( d->grant_table->gt_version == 1 ) 
         status = shah->flags;
     else 
         status = status_entry(d->grant_table, ref);
     
-    printk("==> Grant [dom=%d,ref=%d], status=%x. ", 
+    gdprintk(XENLOG_DEBUG,
+            "==> Grant [dom=%d,ref=%d], status=%x. ", 
             d->domain_id, ref, status);
 
     return mem_sharing_debug_gfn(d, gfn); 
@@ -467,24 +468,24 @@
 
     /* Check if mfn is valid */
     ret = -EINVAL;
-    if (!mfn_valid(mfn))
+    if ( !mfn_valid(mfn) )
         goto out;
 
     /* Return the handle if the page is already shared */
     page = mfn_to_page(mfn);
-    if (p2m_is_shared(p2mt)) {
+    if ( p2m_is_shared(p2mt) ) {
         *phandle = page->shr_handle;
         ret = 0;
         goto out;
     }
 
     /* Check p2m type */
-    if (!p2m_is_sharable(p2mt))
+    if ( !p2m_is_sharable(p2mt) )
         goto out;
 
     /* Try to convert the mfn to the sharable type */
     ret = page_make_sharable(d, page, expected_refcnt); 
-    if(ret) 
+    if ( ret ) 
         goto out;
 
     /* Create the handle */
@@ -501,7 +502,7 @@
     }
 
     /* Change the p2m type */
-    if(p2m_change_type(d, gfn, p2mt, p2m_ram_shared) != p2mt) 
+    if ( p2m_change_type(d, gfn, p2mt, p2m_ram_shared) != p2mt ) 
     {
         /* This is unlikely, as the type must have changed since we've checked
          * it a few lines above.
@@ -607,7 +608,7 @@
     mfn = get_gfn(d, gfn, &p2mt);
     
     /* Has someone already unshared it? */
-    if (!p2m_is_shared(p2mt)) {
+    if ( !p2m_is_shared(p2mt) ) {
         put_gfn(d, gfn);
         shr_unlock();
         return 0;
@@ -620,10 +621,11 @@
     list_for_each(le, &hash_entry->gfns)
     {
         gfn_info = list_entry(le, struct gfn_info, list);
-        if((gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id))
+        if ( (gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id) )
             goto gfn_found;
     }
-    printk("Could not find gfn_info for shared gfn: %lx\n", gfn);
+    gdprintk(XENLOG_ERR, "Could not find gfn_info for shared gfn: "
+                            "%lx\n", gfn);
     BUG();
 gfn_found: 
     /* Delete gfn_info from the list, but hold on to it, until we've allocated
@@ -633,7 +635,7 @@
 
     /* If the GFN is getting destroyed drop the references to MFN 
      * (possibly freeing the page), and exit early */
-    if(flags & MEM_SHARING_DESTROY_GFN)
+    if ( flags & MEM_SHARING_DESTROY_GFN )
     {
         mem_sharing_gfn_destroy(gfn_info, !last_gfn);
         if(last_gfn) 
@@ -691,8 +693,8 @@
     else
         atomic_dec(&nr_saved_mfns);
 
-    if(p2m_change_type(d, gfn, p2m_ram_shared, p2m_ram_rw) != 
-                                                p2m_ram_shared) 
+    if ( p2m_change_type(d, gfn, p2m_ram_shared, p2m_ram_rw) != 
+                                                p2m_ram_shared ) 
     {
         printk("Could not change p2m type.\n");
         BUG();
@@ -729,7 +731,7 @@
         {
             unsigned long gfn = mec->u.nominate.u.gfn;
             shr_handle_t handle;
-            if(!mem_sharing_enabled(d))
+            if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
             rc = mem_sharing_nominate_page(d, gfn, 0, &handle);
             mec->u.nominate.handle = handle;
@@ -742,9 +744,9 @@
             unsigned long gfn;
             shr_handle_t handle;
 
-            if(!mem_sharing_enabled(d))
+            if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
-            if(mem_sharing_gref_to_gfn(d, gref, &gfn) < 0)
+            if ( mem_sharing_gref_to_gfn(d, gref, &gfn) < 0 )
                 return -EINVAL;
             rc = mem_sharing_nominate_page(d, gfn, 3, &handle);
             mec->u.nominate.handle = handle;
@@ -761,7 +763,7 @@
 
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME:
         {
-            if(!mem_sharing_enabled(d))
+            if ( !mem_sharing_enabled(d) )
                 return -EINVAL;
             rc = mem_sharing_sharing_resume(d);
         }

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxD-0000qC-JZ; Thu, 19 Jan 2012 21:55:31 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxC-0000dR-2g
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1327010122!11766364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15372 invoked from network); 19 Jan 2012 21:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:23 -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 1Rnzx3-0007Qm-RB
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000fO-Pt
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Message-Id: <E1Rnzx3-0000fO-Pt@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Introduces new helper
	functions to simplify bitwise operations
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372574 -3600
# Node ID 522d544f40318079678ddc1d0885e9e8287fb33a
# Parent  d59816959ac09deb033c966c5d170a482472104a
amd iommu: Introduces new helper functions to simplify bitwise operations

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d59816959ac0 -r 522d544f4031 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:49:34 2012 +0100
@@ -33,10 +33,8 @@
     if ( ++tail == iommu->cmd_buffer.entries )
         tail = 0;
 
-    head = get_field_from_reg_u32(readl(iommu->mmio_base + 
-                                        IOMMU_CMD_BUFFER_HEAD_OFFSET),
-                                  IOMMU_CMD_BUFFER_HEAD_MASK,
-                                  IOMMU_CMD_BUFFER_HEAD_SHIFT);
+    head = iommu_get_rb_pointer(readl(iommu->mmio_base +
+                                      IOMMU_CMD_BUFFER_HEAD_OFFSET));
     if ( head != tail )
     {
         cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
@@ -55,11 +53,9 @@
 
 static void commit_iommu_command_buffer(struct amd_iommu *iommu)
 {
-    u32 tail;
+    u32 tail = 0;
 
-    set_field_in_reg_u32(iommu->cmd_buffer.tail, 0,
-                         IOMMU_CMD_BUFFER_TAIL_MASK,
-                         IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
+    iommu_set_rb_pointer(&tail, iommu->cmd_buffer.tail);
     writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
diff -r d59816959ac0 -r 522d544f4031 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:49:34 2012 +0100
@@ -106,21 +106,21 @@
     u64 addr_64, addr_lo, addr_hi;
     u32 entry;
 
+    ASSERT( iommu->dev_table.buffer );
+
     addr_64 = (u64)virt_to_maddr(iommu->dev_table.buffer);
     addr_lo = addr_64 & DMA_32BIT_MASK;
     addr_hi = addr_64 >> 32;
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_DEV_TABLE_BASE_LOW_MASK,
-                         IOMMU_DEV_TABLE_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
     set_field_in_reg_u32((iommu->dev_table.alloc_size / PAGE_SIZE) - 1,
                          entry, IOMMU_DEV_TABLE_SIZE_MASK,
                          IOMMU_DEV_TABLE_SIZE_SHIFT, &entry);
     writel(entry, iommu->mmio_base + IOMMU_DEV_TABLE_BASE_LOW_OFFSET);
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_DEV_TABLE_BASE_HIGH_MASK,
-                         IOMMU_DEV_TABLE_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     writel(entry, iommu->mmio_base + IOMMU_DEV_TABLE_BASE_HIGH_OFFSET);
 }
 
@@ -130,21 +130,21 @@
     u32 power_of2_entries;
     u32 entry;
 
+    ASSERT( iommu->cmd_buffer.buffer );
+
     addr_64 = (u64)virt_to_maddr(iommu->cmd_buffer.buffer);
     addr_lo = addr_64 & DMA_32BIT_MASK;
     addr_hi = addr_64 >> 32;
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_CMD_BUFFER_BASE_LOW_MASK,
-                         IOMMU_CMD_BUFFER_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
     writel(entry, iommu->mmio_base + IOMMU_CMD_BUFFER_BASE_LOW_OFFSET);
 
     power_of2_entries = get_order_from_bytes(iommu->cmd_buffer.alloc_size) +
         IOMMU_CMD_BUFFER_POWER_OF2_ENTRIES_PER_PAGE;
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_CMD_BUFFER_BASE_HIGH_MASK,
-                         IOMMU_CMD_BUFFER_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     set_field_in_reg_u32(power_of2_entries, entry,
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
@@ -157,21 +157,21 @@
     u32 power_of2_entries;
     u32 entry;
 
+    ASSERT( iommu->event_log.buffer );
+
     addr_64 = (u64)virt_to_maddr(iommu->event_log.buffer);
     addr_lo = addr_64 & DMA_32BIT_MASK;
     addr_hi = addr_64 >> 32;
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_EVENT_LOG_BASE_LOW_MASK,
-                         IOMMU_EVENT_LOG_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
     writel(entry, iommu->mmio_base + IOMMU_EVENT_LOG_BASE_LOW_OFFSET);
 
     power_of2_entries = get_order_from_bytes(iommu->event_log.alloc_size) +
                         IOMMU_EVENT_LOG_POWER_OF2_ENTRIES_PER_PAGE;
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                        IOMMU_EVENT_LOG_BASE_HIGH_MASK,
-                        IOMMU_EVENT_LOG_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     set_field_in_reg_u32(power_of2_entries, entry,
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
@@ -234,14 +234,12 @@
     addr_lo = iommu->exclusion_base & DMA_32BIT_MASK;
     addr_hi = iommu->exclusion_base >> 32;
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_EXCLUSION_BASE_HIGH_MASK,
-                         IOMMU_EXCLUSION_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     writel(entry, iommu->mmio_base+IOMMU_EXCLUSION_BASE_HIGH_OFFSET);
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_EXCLUSION_BASE_LOW_MASK,
-                         IOMMU_EXCLUSION_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
 
     set_field_in_reg_u32(iommu->exclusion_allow_all, entry,
                          IOMMU_EXCLUSION_ALLOW_ALL_MASK,
@@ -490,9 +488,7 @@
 
     if ( code == IOMMU_EVENT_IO_PAGE_FAULT )
     {
-        device_id = get_field_from_reg_u32(entry[0],
-                                           IOMMU_EVENT_DEVICE_ID_MASK,
-                                           IOMMU_EVENT_DEVICE_ID_SHIFT);
+        device_id = iommu_get_devid_from_event(entry[0]);
         domain_id = get_field_from_reg_u32(entry[1],
                                            IOMMU_EVENT_DOMAIN_ID_MASK,
                                            IOMMU_EVENT_DOMAIN_ID_SHIFT);
diff -r d59816959ac0 -r 522d544f4031 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:49:34 2012 +0100
@@ -82,10 +82,6 @@
 /* Device Table */
 #define IOMMU_DEV_TABLE_BASE_LOW_OFFSET		0x00
 #define IOMMU_DEV_TABLE_BASE_HIGH_OFFSET	0x04
-#define IOMMU_DEV_TABLE_BASE_LOW_MASK		0xFFFFF000
-#define IOMMU_DEV_TABLE_BASE_LOW_SHIFT		12
-#define IOMMU_DEV_TABLE_BASE_HIGH_MASK		0x000FFFFF
-#define IOMMU_DEV_TABLE_BASE_HIGH_SHIFT		0
 #define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FF
 #define IOMMU_DEV_TABLE_SIZE_SHIFT		0
 
@@ -164,22 +160,13 @@
 #define IOMMU_DEV_TABLE_INT_CONTROL_MASK        0x30000000
 #define IOMMU_DEV_TABLE_INT_CONTROL_SHIFT       28
 
-
 /* Command Buffer */
 #define IOMMU_CMD_BUFFER_BASE_LOW_OFFSET	0x08
 #define IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET	0x0C
 #define IOMMU_CMD_BUFFER_HEAD_OFFSET		0x2000
 #define IOMMU_CMD_BUFFER_TAIL_OFFSET		0x2008
-#define IOMMU_CMD_BUFFER_BASE_LOW_MASK		0xFFFFF000
-#define IOMMU_CMD_BUFFER_BASE_LOW_SHIFT		12
-#define IOMMU_CMD_BUFFER_BASE_HIGH_MASK		0x000FFFFF
-#define IOMMU_CMD_BUFFER_BASE_HIGH_SHIFT	0
 #define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000
 #define IOMMU_CMD_BUFFER_LENGTH_SHIFT		24
-#define IOMMU_CMD_BUFFER_HEAD_MASK		0x0007FFF0
-#define IOMMU_CMD_BUFFER_HEAD_SHIFT		4
-#define IOMMU_CMD_BUFFER_TAIL_MASK		0x0007FFF0
-#define IOMMU_CMD_BUFFER_TAIL_SHIFT		4
 
 #define IOMMU_CMD_BUFFER_ENTRY_SIZE			16
 #define IOMMU_CMD_BUFFER_POWER_OF2_ENTRIES_PER_PAGE	8
@@ -251,10 +238,6 @@
 #define IOMMU_EVENT_LOG_BASE_HIGH_OFFSET	0x14
 #define IOMMU_EVENT_LOG_HEAD_OFFSET		0x2010
 #define IOMMU_EVENT_LOG_TAIL_OFFSET		0x2018
-#define IOMMU_EVENT_LOG_BASE_LOW_MASK		0xFFFFF000
-#define IOMMU_EVENT_LOG_BASE_LOW_SHIFT		12
-#define IOMMU_EVENT_LOG_BASE_HIGH_MASK		0x000FFFFF
-#define IOMMU_EVENT_LOG_BASE_HIGH_SHIFT		0
 #define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000
 #define IOMMU_EVENT_LOG_LENGTH_SHIFT		24
 #define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0
@@ -440,4 +423,20 @@
 
 #define INV_IOMMU_ALL_PAGES_ADDRESS      ((1ULL << 63) - 1)
 
+#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0
+#define IOMMU_RING_BUFFER_PTR_SHIFT                 4
+
+#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_CMD_DEVICE_ID_SHIFT                   0
+
+#define IOMMU_CMD_ADDR_LOW_MASK                     0xFFFFF000
+#define IOMMU_CMD_ADDR_LOW_SHIFT                    12
+#define IOMMU_CMD_ADDR_HIGH_MASK                    0xFFFFFFFF
+#define IOMMU_CMD_ADDR_HIGH_SHIFT                   0
+
+#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000
+#define IOMMU_REG_BASE_ADDR_LOW_SHIFT               12
+#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFF
+#define IOMMU_REG_BASE_ADDR_HIGH_SHIFT              0
+
 #endif /* _ASM_X86_64_AMD_IOMMU_DEFS_H */
diff -r d59816959ac0 -r 522d544f4031 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:49:34 2012 +0100
@@ -192,4 +192,71 @@
     return !!(iommu->features & (1U << bit));
 }
 
+/* access tail or head pointer of ring buffer */
+static inline uint32_t iommu_get_rb_pointer(uint32_t reg)
+{
+    return get_field_from_reg_u32(reg, IOMMU_RING_BUFFER_PTR_MASK,
+                                  IOMMU_RING_BUFFER_PTR_SHIFT);
+}
+
+static inline void iommu_set_rb_pointer(uint32_t *reg, uint32_t val)
+{
+    set_field_in_reg_u32(val, *reg, IOMMU_RING_BUFFER_PTR_MASK,
+                         IOMMU_RING_BUFFER_PTR_SHIFT, reg);
+}
+
+/* access device id field from iommu cmd */
+static inline uint16_t iommu_get_devid_from_cmd(uint32_t cmd)
+{
+    return get_field_from_reg_u32(cmd, IOMMU_CMD_DEVICE_ID_MASK,
+                                  IOMMU_CMD_DEVICE_ID_SHIFT);
+}
+
+static inline void iommu_set_devid_to_cmd(uint32_t *cmd, uint16_t id)
+{
+    set_field_in_reg_u32(id, *cmd, IOMMU_CMD_DEVICE_ID_MASK,
+                         IOMMU_CMD_DEVICE_ID_SHIFT, cmd);
+}
+
+/* access address field from iommu cmd */
+static inline uint32_t iommu_get_addr_lo_from_cmd(uint32_t cmd)
+{
+    return get_field_from_reg_u32(cmd, IOMMU_CMD_ADDR_LOW_MASK,
+                                  IOMMU_CMD_ADDR_LOW_SHIFT);
+}
+
+static inline uint32_t iommu_get_addr_hi_from_cmd(uint32_t cmd)
+{
+    return get_field_from_reg_u32(cmd, IOMMU_CMD_ADDR_LOW_MASK,
+                                  IOMMU_CMD_ADDR_HIGH_SHIFT);
+}
+
+/* access address field from event log entry */
+#define iommu_get_devid_from_event          iommu_get_devid_from_cmd
+
+/* access iommu base addresses field from mmio regs */
+static inline void iommu_set_addr_lo_to_reg(uint32_t *reg, uint32_t addr)
+{
+    set_field_in_reg_u32(addr, *reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
+                         IOMMU_REG_BASE_ADDR_LOW_SHIFT, reg);
+}
+
+static inline void iommu_set_addr_hi_to_reg(uint32_t *reg, uint32_t addr)
+{
+    set_field_in_reg_u32(addr, *reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
+                         IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
+}
+
+static inline uint32_t iommu_get_addr_lo_from_reg(uint32_t reg)
+{
+    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
+                                  IOMMU_REG_BASE_ADDR_LOW_SHIFT);
+}
+
+static inline uint32_t iommu_get_addr_hi_from_reg(uint32_t reg)
+{
+    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
+                                  IOMMU_REG_BASE_ADDR_HIGH_SHIFT);
+}
+
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxD-0000qC-JZ; Thu, 19 Jan 2012 21:55:31 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxC-0000dR-2g
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1327010122!11766364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15372 invoked from network); 19 Jan 2012 21:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:23 -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 1Rnzx3-0007Qm-RB
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx3-0000fO-Pt
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:21 +0000
Message-Id: <E1Rnzx3-0000fO-Pt@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Introduces new helper
	functions to simplify bitwise operations
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372574 -3600
# Node ID 522d544f40318079678ddc1d0885e9e8287fb33a
# Parent  d59816959ac09deb033c966c5d170a482472104a
amd iommu: Introduces new helper functions to simplify bitwise operations

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d59816959ac0 -r 522d544f4031 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:49:34 2012 +0100
@@ -33,10 +33,8 @@
     if ( ++tail == iommu->cmd_buffer.entries )
         tail = 0;
 
-    head = get_field_from_reg_u32(readl(iommu->mmio_base + 
-                                        IOMMU_CMD_BUFFER_HEAD_OFFSET),
-                                  IOMMU_CMD_BUFFER_HEAD_MASK,
-                                  IOMMU_CMD_BUFFER_HEAD_SHIFT);
+    head = iommu_get_rb_pointer(readl(iommu->mmio_base +
+                                      IOMMU_CMD_BUFFER_HEAD_OFFSET));
     if ( head != tail )
     {
         cmd_buffer = (u32 *)(iommu->cmd_buffer.buffer +
@@ -55,11 +53,9 @@
 
 static void commit_iommu_command_buffer(struct amd_iommu *iommu)
 {
-    u32 tail;
+    u32 tail = 0;
 
-    set_field_in_reg_u32(iommu->cmd_buffer.tail, 0,
-                         IOMMU_CMD_BUFFER_TAIL_MASK,
-                         IOMMU_CMD_BUFFER_TAIL_SHIFT, &tail);
+    iommu_set_rb_pointer(&tail, iommu->cmd_buffer.tail);
     writel(tail, iommu->mmio_base+IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
diff -r d59816959ac0 -r 522d544f4031 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:49:34 2012 +0100
@@ -106,21 +106,21 @@
     u64 addr_64, addr_lo, addr_hi;
     u32 entry;
 
+    ASSERT( iommu->dev_table.buffer );
+
     addr_64 = (u64)virt_to_maddr(iommu->dev_table.buffer);
     addr_lo = addr_64 & DMA_32BIT_MASK;
     addr_hi = addr_64 >> 32;
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_DEV_TABLE_BASE_LOW_MASK,
-                         IOMMU_DEV_TABLE_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
     set_field_in_reg_u32((iommu->dev_table.alloc_size / PAGE_SIZE) - 1,
                          entry, IOMMU_DEV_TABLE_SIZE_MASK,
                          IOMMU_DEV_TABLE_SIZE_SHIFT, &entry);
     writel(entry, iommu->mmio_base + IOMMU_DEV_TABLE_BASE_LOW_OFFSET);
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_DEV_TABLE_BASE_HIGH_MASK,
-                         IOMMU_DEV_TABLE_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     writel(entry, iommu->mmio_base + IOMMU_DEV_TABLE_BASE_HIGH_OFFSET);
 }
 
@@ -130,21 +130,21 @@
     u32 power_of2_entries;
     u32 entry;
 
+    ASSERT( iommu->cmd_buffer.buffer );
+
     addr_64 = (u64)virt_to_maddr(iommu->cmd_buffer.buffer);
     addr_lo = addr_64 & DMA_32BIT_MASK;
     addr_hi = addr_64 >> 32;
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_CMD_BUFFER_BASE_LOW_MASK,
-                         IOMMU_CMD_BUFFER_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
     writel(entry, iommu->mmio_base + IOMMU_CMD_BUFFER_BASE_LOW_OFFSET);
 
     power_of2_entries = get_order_from_bytes(iommu->cmd_buffer.alloc_size) +
         IOMMU_CMD_BUFFER_POWER_OF2_ENTRIES_PER_PAGE;
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_CMD_BUFFER_BASE_HIGH_MASK,
-                         IOMMU_CMD_BUFFER_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     set_field_in_reg_u32(power_of2_entries, entry,
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
@@ -157,21 +157,21 @@
     u32 power_of2_entries;
     u32 entry;
 
+    ASSERT( iommu->event_log.buffer );
+
     addr_64 = (u64)virt_to_maddr(iommu->event_log.buffer);
     addr_lo = addr_64 & DMA_32BIT_MASK;
     addr_hi = addr_64 >> 32;
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_EVENT_LOG_BASE_LOW_MASK,
-                         IOMMU_EVENT_LOG_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
     writel(entry, iommu->mmio_base + IOMMU_EVENT_LOG_BASE_LOW_OFFSET);
 
     power_of2_entries = get_order_from_bytes(iommu->event_log.alloc_size) +
                         IOMMU_EVENT_LOG_POWER_OF2_ENTRIES_PER_PAGE;
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                        IOMMU_EVENT_LOG_BASE_HIGH_MASK,
-                        IOMMU_EVENT_LOG_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     set_field_in_reg_u32(power_of2_entries, entry,
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
@@ -234,14 +234,12 @@
     addr_lo = iommu->exclusion_base & DMA_32BIT_MASK;
     addr_hi = iommu->exclusion_base >> 32;
 
-    set_field_in_reg_u32((u32)addr_hi, 0,
-                         IOMMU_EXCLUSION_BASE_HIGH_MASK,
-                         IOMMU_EXCLUSION_BASE_HIGH_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
     writel(entry, iommu->mmio_base+IOMMU_EXCLUSION_BASE_HIGH_OFFSET);
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
-                         IOMMU_EXCLUSION_BASE_LOW_MASK,
-                         IOMMU_EXCLUSION_BASE_LOW_SHIFT, &entry);
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
 
     set_field_in_reg_u32(iommu->exclusion_allow_all, entry,
                          IOMMU_EXCLUSION_ALLOW_ALL_MASK,
@@ -490,9 +488,7 @@
 
     if ( code == IOMMU_EVENT_IO_PAGE_FAULT )
     {
-        device_id = get_field_from_reg_u32(entry[0],
-                                           IOMMU_EVENT_DEVICE_ID_MASK,
-                                           IOMMU_EVENT_DEVICE_ID_SHIFT);
+        device_id = iommu_get_devid_from_event(entry[0]);
         domain_id = get_field_from_reg_u32(entry[1],
                                            IOMMU_EVENT_DOMAIN_ID_MASK,
                                            IOMMU_EVENT_DOMAIN_ID_SHIFT);
diff -r d59816959ac0 -r 522d544f4031 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:49:34 2012 +0100
@@ -82,10 +82,6 @@
 /* Device Table */
 #define IOMMU_DEV_TABLE_BASE_LOW_OFFSET		0x00
 #define IOMMU_DEV_TABLE_BASE_HIGH_OFFSET	0x04
-#define IOMMU_DEV_TABLE_BASE_LOW_MASK		0xFFFFF000
-#define IOMMU_DEV_TABLE_BASE_LOW_SHIFT		12
-#define IOMMU_DEV_TABLE_BASE_HIGH_MASK		0x000FFFFF
-#define IOMMU_DEV_TABLE_BASE_HIGH_SHIFT		0
 #define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FF
 #define IOMMU_DEV_TABLE_SIZE_SHIFT		0
 
@@ -164,22 +160,13 @@
 #define IOMMU_DEV_TABLE_INT_CONTROL_MASK        0x30000000
 #define IOMMU_DEV_TABLE_INT_CONTROL_SHIFT       28
 
-
 /* Command Buffer */
 #define IOMMU_CMD_BUFFER_BASE_LOW_OFFSET	0x08
 #define IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET	0x0C
 #define IOMMU_CMD_BUFFER_HEAD_OFFSET		0x2000
 #define IOMMU_CMD_BUFFER_TAIL_OFFSET		0x2008
-#define IOMMU_CMD_BUFFER_BASE_LOW_MASK		0xFFFFF000
-#define IOMMU_CMD_BUFFER_BASE_LOW_SHIFT		12
-#define IOMMU_CMD_BUFFER_BASE_HIGH_MASK		0x000FFFFF
-#define IOMMU_CMD_BUFFER_BASE_HIGH_SHIFT	0
 #define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000
 #define IOMMU_CMD_BUFFER_LENGTH_SHIFT		24
-#define IOMMU_CMD_BUFFER_HEAD_MASK		0x0007FFF0
-#define IOMMU_CMD_BUFFER_HEAD_SHIFT		4
-#define IOMMU_CMD_BUFFER_TAIL_MASK		0x0007FFF0
-#define IOMMU_CMD_BUFFER_TAIL_SHIFT		4
 
 #define IOMMU_CMD_BUFFER_ENTRY_SIZE			16
 #define IOMMU_CMD_BUFFER_POWER_OF2_ENTRIES_PER_PAGE	8
@@ -251,10 +238,6 @@
 #define IOMMU_EVENT_LOG_BASE_HIGH_OFFSET	0x14
 #define IOMMU_EVENT_LOG_HEAD_OFFSET		0x2010
 #define IOMMU_EVENT_LOG_TAIL_OFFSET		0x2018
-#define IOMMU_EVENT_LOG_BASE_LOW_MASK		0xFFFFF000
-#define IOMMU_EVENT_LOG_BASE_LOW_SHIFT		12
-#define IOMMU_EVENT_LOG_BASE_HIGH_MASK		0x000FFFFF
-#define IOMMU_EVENT_LOG_BASE_HIGH_SHIFT		0
 #define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000
 #define IOMMU_EVENT_LOG_LENGTH_SHIFT		24
 #define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0
@@ -440,4 +423,20 @@
 
 #define INV_IOMMU_ALL_PAGES_ADDRESS      ((1ULL << 63) - 1)
 
+#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0
+#define IOMMU_RING_BUFFER_PTR_SHIFT                 4
+
+#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_CMD_DEVICE_ID_SHIFT                   0
+
+#define IOMMU_CMD_ADDR_LOW_MASK                     0xFFFFF000
+#define IOMMU_CMD_ADDR_LOW_SHIFT                    12
+#define IOMMU_CMD_ADDR_HIGH_MASK                    0xFFFFFFFF
+#define IOMMU_CMD_ADDR_HIGH_SHIFT                   0
+
+#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000
+#define IOMMU_REG_BASE_ADDR_LOW_SHIFT               12
+#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFF
+#define IOMMU_REG_BASE_ADDR_HIGH_SHIFT              0
+
 #endif /* _ASM_X86_64_AMD_IOMMU_DEFS_H */
diff -r d59816959ac0 -r 522d544f4031 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:48:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:49:34 2012 +0100
@@ -192,4 +192,71 @@
     return !!(iommu->features & (1U << bit));
 }
 
+/* access tail or head pointer of ring buffer */
+static inline uint32_t iommu_get_rb_pointer(uint32_t reg)
+{
+    return get_field_from_reg_u32(reg, IOMMU_RING_BUFFER_PTR_MASK,
+                                  IOMMU_RING_BUFFER_PTR_SHIFT);
+}
+
+static inline void iommu_set_rb_pointer(uint32_t *reg, uint32_t val)
+{
+    set_field_in_reg_u32(val, *reg, IOMMU_RING_BUFFER_PTR_MASK,
+                         IOMMU_RING_BUFFER_PTR_SHIFT, reg);
+}
+
+/* access device id field from iommu cmd */
+static inline uint16_t iommu_get_devid_from_cmd(uint32_t cmd)
+{
+    return get_field_from_reg_u32(cmd, IOMMU_CMD_DEVICE_ID_MASK,
+                                  IOMMU_CMD_DEVICE_ID_SHIFT);
+}
+
+static inline void iommu_set_devid_to_cmd(uint32_t *cmd, uint16_t id)
+{
+    set_field_in_reg_u32(id, *cmd, IOMMU_CMD_DEVICE_ID_MASK,
+                         IOMMU_CMD_DEVICE_ID_SHIFT, cmd);
+}
+
+/* access address field from iommu cmd */
+static inline uint32_t iommu_get_addr_lo_from_cmd(uint32_t cmd)
+{
+    return get_field_from_reg_u32(cmd, IOMMU_CMD_ADDR_LOW_MASK,
+                                  IOMMU_CMD_ADDR_LOW_SHIFT);
+}
+
+static inline uint32_t iommu_get_addr_hi_from_cmd(uint32_t cmd)
+{
+    return get_field_from_reg_u32(cmd, IOMMU_CMD_ADDR_LOW_MASK,
+                                  IOMMU_CMD_ADDR_HIGH_SHIFT);
+}
+
+/* access address field from event log entry */
+#define iommu_get_devid_from_event          iommu_get_devid_from_cmd
+
+/* access iommu base addresses field from mmio regs */
+static inline void iommu_set_addr_lo_to_reg(uint32_t *reg, uint32_t addr)
+{
+    set_field_in_reg_u32(addr, *reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
+                         IOMMU_REG_BASE_ADDR_LOW_SHIFT, reg);
+}
+
+static inline void iommu_set_addr_hi_to_reg(uint32_t *reg, uint32_t addr)
+{
+    set_field_in_reg_u32(addr, *reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
+                         IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
+}
+
+static inline uint32_t iommu_get_addr_lo_from_reg(uint32_t reg)
+{
+    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
+                                  IOMMU_REG_BASE_ADDR_LOW_SHIFT);
+}
+
+static inline uint32_t iommu_get_addr_hi_from_reg(uint32_t reg)
+{
+    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
+                                  IOMMU_REG_BASE_ADDR_HIGH_SHIFT);
+}
+
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:32 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxE-0000sH-Ms; Thu, 19 Jan 2012 21:55:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000fM-5w
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1327010123!11616245!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21571 invoked from network); 19 Jan 2012 21:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:24 -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 1Rnzx5-0007Qs-02
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx4-0000fs-Si
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:22 +0000
Message-Id: <E1Rnzx4-0000fs-Si@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Enable ppr log
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372757 -3600
# Node ID e4c28269bebf7feb40e9516b38ef183574fa04a5
# Parent  6c104b46ef8977a8cac58f3c700f2ded6e03c557
amd iommu: Enable ppr log

IOMMUv2 writes peripheral page service request (PPR) records into ppr
log to report guest OS pending DMA page requests from ATS devices.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 6c104b46ef89 -r e4c28269bebf xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:50:50 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:52:37 2012 +0100
@@ -126,14 +126,15 @@
 
 static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
 {
-    u64 addr_64, addr_lo, addr_hi;
+    u64 addr_64;
+    u32 addr_lo, addr_hi;
     u32 power_of2_entries;
     u32 entry;
 
     ASSERT( iommu->cmd_buffer.buffer );
 
-    addr_64 = (u64)virt_to_maddr(iommu->cmd_buffer.buffer);
-    addr_lo = addr_64 & DMA_32BIT_MASK;
+    addr_64 = virt_to_maddr(iommu->cmd_buffer.buffer);
+    addr_lo = addr_64;
     addr_hi = addr_64 >> 32;
 
     entry = 0;
@@ -153,14 +154,15 @@
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
 {
-    u64 addr_64, addr_lo, addr_hi;
+    u64 addr_64;
+    u32 addr_lo, addr_hi;
     u32 power_of2_entries;
     u32 entry;
 
     ASSERT( iommu->event_log.buffer );
 
-    addr_64 = (u64)virt_to_maddr(iommu->event_log.buffer);
-    addr_lo = addr_64 & DMA_32BIT_MASK;
+    addr_64 = virt_to_maddr(iommu->event_log.buffer);
+    addr_lo = addr_64;
     addr_hi = addr_64 >> 32;
 
     entry = 0;
@@ -178,6 +180,35 @@
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
 }
 
+static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
+{
+    u64 addr_64;
+    u32 addr_lo, addr_hi;
+    u32 power_of2_entries;
+    u32 entry;
+
+    ASSERT ( iommu->ppr_log.buffer );
+
+    addr_64 = virt_to_maddr(iommu->ppr_log.buffer);
+    addr_lo = addr_64;
+    addr_hi = addr_64 >> 32;
+
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
+    writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_LOW_OFFSET);
+
+    power_of2_entries = get_order_from_bytes(iommu->ppr_log.alloc_size) +
+                        IOMMU_PPR_LOG_POWER_OF2_ENTRIES_PER_PAGE;
+
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
+    set_field_in_reg_u32(power_of2_entries, entry,
+                        IOMMU_PPR_LOG_LENGTH_MASK,
+                        IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);
+    writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);
+}
+
+
 static void set_iommu_translation_control(struct amd_iommu *iommu,
                                                  int enable)
 {
@@ -215,10 +246,10 @@
 
 static void register_iommu_exclusion_range(struct amd_iommu *iommu)
 {
-    u64 addr_lo, addr_hi;
+    u32 addr_lo, addr_hi;
     u32 entry;
 
-    addr_lo = iommu->exclusion_limit & DMA_32BIT_MASK;
+    addr_lo = iommu->exclusion_limit;
     addr_hi = iommu->exclusion_limit >> 32;
 
     set_field_in_reg_u32((u32)addr_hi, 0,
@@ -278,6 +309,35 @@
     writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
 }
 
+static void set_iommu_ppr_log_control(struct amd_iommu *iommu,
+                                      int enable)
+{
+    u32 entry;
+
+    entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+
+    /*reset head and tail pointer manually before enablement */
+    if ( enable )
+    {
+        writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);
+        writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);
+
+        iommu_set_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT);
+        iommu_set_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT);
+        iommu_set_bit(&entry, IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT);
+    }
+    else
+    {
+        iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT);
+        iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT);
+        iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT);
+    }
+
+    writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+    if ( enable )
+        AMD_IOMMU_DEBUG("PPR Log Enabled.\n");
+}
+
 static void parse_event_log_entry(struct amd_iommu *, u32 entry[]);
 
 static int amd_iommu_read_event_log(struct amd_iommu *iommu)
@@ -585,12 +645,19 @@
     register_iommu_event_log_in_mmio_space(iommu);
     register_iommu_exclusion_range(iommu);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        register_iommu_ppr_log_in_mmio_space(iommu);
+
     iommu_msi_set_affinity(irq_to_desc(iommu->irq), &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_ht_flags(iommu);
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
+
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
@@ -671,16 +738,29 @@
                                 IOMMU_EVENT_LOG_DEFAULT_ENTRIES, "Event Log");
 }
 
+static void * __init allocate_ppr_log(struct amd_iommu *iommu)
+{
+    /* allocate 'ppr log' in power of 2 increments of 4K */
+    return allocate_ring_buffer(&iommu->ppr_log, sizeof(ppr_entry_t),
+                                IOMMU_PPR_LOG_DEFAULT_ENTRIES, "PPR Log");
+}
+
 static int __init amd_iommu_init_one(struct amd_iommu *iommu)
 {
+    if ( map_iommu_mmio_region(iommu) != 0 )
+        goto error_out;
+
+    get_iommu_features(iommu);
+
     if ( allocate_cmd_buffer(iommu) == NULL )
         goto error_out;
 
     if ( allocate_event_log(iommu) == NULL )
         goto error_out;
 
-    if ( map_iommu_mmio_region(iommu) != 0 )
-        goto error_out;
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        if ( allocate_ppr_log(iommu) == NULL )
+            goto error_out;
 
     if ( set_iommu_interrupt_handler(iommu) == 0 )
         goto error_out;
@@ -693,8 +773,6 @@
     iommu->dev_table.entries = device_table.entries;
     iommu->dev_table.buffer = device_table.buffer;
 
-    get_iommu_features(iommu);
-
     enable_iommu(iommu);
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
@@ -717,6 +795,7 @@
         {
             deallocate_ring_buffer(&iommu->cmd_buffer);
             deallocate_ring_buffer(&iommu->event_log);
+            deallocate_ring_buffer(&iommu->ppr_log);
             unmap_iommu_mmio_region(iommu);
         }
         xfree(iommu);
@@ -915,6 +994,10 @@
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_DISABLED);
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
+
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
 
     iommu->enabled = 0;
diff -r 6c104b46ef89 -r e4c28269bebf xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:50:50 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:52:37 2012 +0100
@@ -93,6 +93,7 @@
     struct table_struct dev_table;
     struct ring_buffer cmd_buffer;
     struct ring_buffer event_log;
+    struct ring_buffer ppr_log;
 
     int exclusion_enable;
     int exclusion_allow_all;
diff -r 6c104b46ef89 -r e4c28269bebf xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:50:50 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:52:37 2012 +0100
@@ -27,6 +27,9 @@
 /* IOMMU Event Log entries: in power of 2 increments, minimum of 256 */
 #define IOMMU_EVENT_LOG_DEFAULT_ENTRIES     512
 
+/* IOMMU PPR Log entries: in power of 2 increments, minimum of 256 */
+#define IOMMU_PPR_LOG_DEFAULT_ENTRIES       512
+
 #define PTE_PER_TABLE_SHIFT		9
 #define PTE_PER_TABLE_SIZE		(1 << PTE_PER_TABLE_SHIFT)
 #define PTE_PER_TABLE_MASK		(~(PTE_PER_TABLE_SIZE - 1))

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:32 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxE-0000sH-Ms; Thu, 19 Jan 2012 21:55:32 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000fM-5w
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1327010123!11616245!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21571 invoked from network); 19 Jan 2012 21:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:24 -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 1Rnzx5-0007Qs-02
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx4-0000fs-Si
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:22 +0000
Message-Id: <E1Rnzx4-0000fs-Si@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Enable ppr log
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372757 -3600
# Node ID e4c28269bebf7feb40e9516b38ef183574fa04a5
# Parent  6c104b46ef8977a8cac58f3c700f2ded6e03c557
amd iommu: Enable ppr log

IOMMUv2 writes peripheral page service request (PPR) records into ppr
log to report guest OS pending DMA page requests from ATS devices.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 6c104b46ef89 -r e4c28269bebf xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:50:50 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:52:37 2012 +0100
@@ -126,14 +126,15 @@
 
 static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
 {
-    u64 addr_64, addr_lo, addr_hi;
+    u64 addr_64;
+    u32 addr_lo, addr_hi;
     u32 power_of2_entries;
     u32 entry;
 
     ASSERT( iommu->cmd_buffer.buffer );
 
-    addr_64 = (u64)virt_to_maddr(iommu->cmd_buffer.buffer);
-    addr_lo = addr_64 & DMA_32BIT_MASK;
+    addr_64 = virt_to_maddr(iommu->cmd_buffer.buffer);
+    addr_lo = addr_64;
     addr_hi = addr_64 >> 32;
 
     entry = 0;
@@ -153,14 +154,15 @@
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
 {
-    u64 addr_64, addr_lo, addr_hi;
+    u64 addr_64;
+    u32 addr_lo, addr_hi;
     u32 power_of2_entries;
     u32 entry;
 
     ASSERT( iommu->event_log.buffer );
 
-    addr_64 = (u64)virt_to_maddr(iommu->event_log.buffer);
-    addr_lo = addr_64 & DMA_32BIT_MASK;
+    addr_64 = virt_to_maddr(iommu->event_log.buffer);
+    addr_lo = addr_64;
     addr_hi = addr_64 >> 32;
 
     entry = 0;
@@ -178,6 +180,35 @@
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
 }
 
+static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
+{
+    u64 addr_64;
+    u32 addr_lo, addr_hi;
+    u32 power_of2_entries;
+    u32 entry;
+
+    ASSERT ( iommu->ppr_log.buffer );
+
+    addr_64 = virt_to_maddr(iommu->ppr_log.buffer);
+    addr_lo = addr_64;
+    addr_hi = addr_64 >> 32;
+
+    entry = 0;
+    iommu_set_addr_lo_to_reg(&entry, addr_lo >> PAGE_SHIFT);
+    writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_LOW_OFFSET);
+
+    power_of2_entries = get_order_from_bytes(iommu->ppr_log.alloc_size) +
+                        IOMMU_PPR_LOG_POWER_OF2_ENTRIES_PER_PAGE;
+
+    entry = 0;
+    iommu_set_addr_hi_to_reg(&entry, addr_hi);
+    set_field_in_reg_u32(power_of2_entries, entry,
+                        IOMMU_PPR_LOG_LENGTH_MASK,
+                        IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);
+    writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);
+}
+
+
 static void set_iommu_translation_control(struct amd_iommu *iommu,
                                                  int enable)
 {
@@ -215,10 +246,10 @@
 
 static void register_iommu_exclusion_range(struct amd_iommu *iommu)
 {
-    u64 addr_lo, addr_hi;
+    u32 addr_lo, addr_hi;
     u32 entry;
 
-    addr_lo = iommu->exclusion_limit & DMA_32BIT_MASK;
+    addr_lo = iommu->exclusion_limit;
     addr_hi = iommu->exclusion_limit >> 32;
 
     set_field_in_reg_u32((u32)addr_hi, 0,
@@ -278,6 +309,35 @@
     writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
 }
 
+static void set_iommu_ppr_log_control(struct amd_iommu *iommu,
+                                      int enable)
+{
+    u32 entry;
+
+    entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+
+    /*reset head and tail pointer manually before enablement */
+    if ( enable )
+    {
+        writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);
+        writel(0x0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);
+
+        iommu_set_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT);
+        iommu_set_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT);
+        iommu_set_bit(&entry, IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT);
+    }
+    else
+    {
+        iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT);
+        iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT);
+        iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT);
+    }
+
+    writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+    if ( enable )
+        AMD_IOMMU_DEBUG("PPR Log Enabled.\n");
+}
+
 static void parse_event_log_entry(struct amd_iommu *, u32 entry[]);
 
 static int amd_iommu_read_event_log(struct amd_iommu *iommu)
@@ -585,12 +645,19 @@
     register_iommu_event_log_in_mmio_space(iommu);
     register_iommu_exclusion_range(iommu);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        register_iommu_ppr_log_in_mmio_space(iommu);
+
     iommu_msi_set_affinity(irq_to_desc(iommu->irq), &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_ht_flags(iommu);
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
+
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
@@ -671,16 +738,29 @@
                                 IOMMU_EVENT_LOG_DEFAULT_ENTRIES, "Event Log");
 }
 
+static void * __init allocate_ppr_log(struct amd_iommu *iommu)
+{
+    /* allocate 'ppr log' in power of 2 increments of 4K */
+    return allocate_ring_buffer(&iommu->ppr_log, sizeof(ppr_entry_t),
+                                IOMMU_PPR_LOG_DEFAULT_ENTRIES, "PPR Log");
+}
+
 static int __init amd_iommu_init_one(struct amd_iommu *iommu)
 {
+    if ( map_iommu_mmio_region(iommu) != 0 )
+        goto error_out;
+
+    get_iommu_features(iommu);
+
     if ( allocate_cmd_buffer(iommu) == NULL )
         goto error_out;
 
     if ( allocate_event_log(iommu) == NULL )
         goto error_out;
 
-    if ( map_iommu_mmio_region(iommu) != 0 )
-        goto error_out;
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        if ( allocate_ppr_log(iommu) == NULL )
+            goto error_out;
 
     if ( set_iommu_interrupt_handler(iommu) == 0 )
         goto error_out;
@@ -693,8 +773,6 @@
     iommu->dev_table.entries = device_table.entries;
     iommu->dev_table.buffer = device_table.buffer;
 
-    get_iommu_features(iommu);
-
     enable_iommu(iommu);
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
@@ -717,6 +795,7 @@
         {
             deallocate_ring_buffer(&iommu->cmd_buffer);
             deallocate_ring_buffer(&iommu->event_log);
+            deallocate_ring_buffer(&iommu->ppr_log);
             unmap_iommu_mmio_region(iommu);
         }
         xfree(iommu);
@@ -915,6 +994,10 @@
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_DISABLED);
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
+
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+        set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
 
     iommu->enabled = 0;
diff -r 6c104b46ef89 -r e4c28269bebf xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:50:50 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:52:37 2012 +0100
@@ -93,6 +93,7 @@
     struct table_struct dev_table;
     struct ring_buffer cmd_buffer;
     struct ring_buffer event_log;
+    struct ring_buffer ppr_log;
 
     int exclusion_enable;
     int exclusion_allow_all;
diff -r 6c104b46ef89 -r e4c28269bebf xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:50:50 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:52:37 2012 +0100
@@ -27,6 +27,9 @@
 /* IOMMU Event Log entries: in power of 2 increments, minimum of 256 */
 #define IOMMU_EVENT_LOG_DEFAULT_ENTRIES     512
 
+/* IOMMU PPR Log entries: in power of 2 increments, minimum of 256 */
+#define IOMMU_PPR_LOG_DEFAULT_ENTRIES       512
+
 #define PTE_PER_TABLE_SHIFT		9
 #define PTE_PER_TABLE_SIZE		(1 << PTE_PER_TABLE_SHIFT)
 #define PTE_PER_TABLE_MASK		(~(PTE_PER_TABLE_SIZE - 1))

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxE-0000sV-PR; Thu, 19 Jan 2012 21:55:32 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000p7-BY
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327010081!50989351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4395 invoked from network); 19 Jan 2012 21:54:42 -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;
	19 Jan 2012 21:54:42 -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 1RnzxA-0007Rc-9g
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000iI-8L
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Message-Id: <E1RnzxA-0000iI-8L@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] force inclusion of xen/config.h
	through compiler option
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326440011 -3600
# Node ID 86b8a1e3a419943801968da12042b4fe53fff537
# Parent  c5eadfd5c639a494b58cf6c0675b8f78412bcf43
force inclusion of xen/config.h through compiler option

As we expect all source files to include the header as the first thing
anyway, stop doing this by repeating the inclusion in each and every
source file (and in many headers), but rather enforce this uniformly
through the compiler command line.

As a first cleanup step, remove the explicit inclusion from all common
headers. Further cleanup can be done incrementally.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/Rules.mk
--- a/xen/Rules.mk	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/Rules.mk	Fri Jan 13 08:33:31 2012 +0100
@@ -41,7 +41,7 @@
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS-y                += -g -D__XEN__
+CFLAGS-y                += -g -D__XEN__ --include $(BASEDIR)/include/xen/config.h
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
@@ -59,7 +59,7 @@
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
 
-AFLAGS-y                += -D__ASSEMBLY__
+AFLAGS-y                += -D__ASSEMBLY__ --include $(BASEDIR)/include/xen/config.h
 
 # Clang's built-in assembler can't handle .code16/.code32/.code64 yet
 AFLAGS-$(clang)         += -no-integrated-as
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/bitmap.h
--- a/xen/include/xen/bitmap.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/bitmap.h	Fri Jan 13 08:33:31 2012 +0100
@@ -3,7 +3,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/bitops.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/byteorder/swab.h
--- a/xen/include/xen/byteorder/swab.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/byteorder/swab.h	Fri Jan 13 08:33:31 2012 +0100
@@ -10,8 +10,6 @@
  *    to clean up support for bizarre-endian architectures.
  */
 
-#include <xen/compiler.h>
-
 /* casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
  */
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/cache.h
--- a/xen/include/xen/cache.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/cache.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __LINUX_CACHE_H
 #define __LINUX_CACHE_H
 
-#include <xen/config.h>
 #include <asm/cache.h>
 
 #ifndef L1_CACHE_ALIGN
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/compat.h
--- a/xen/include/xen/compat.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/compat.h	Fri Jan 13 08:33:31 2012 +0100
@@ -5,8 +5,6 @@
 #ifndef __XEN_COMPAT_H__
 #define __XEN_COMPAT_H__
 
-#include <xen/config.h>
-
 #ifdef CONFIG_COMPAT
 
 #include <xen/types.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/cpumask.h
--- a/xen/include/xen/cpumask.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/cpumask.h	Fri Jan 13 08:33:31 2012 +0100
@@ -75,7 +75,6 @@
  *    inside a macro, the way we do the other calls.
  */
 
-#include <xen/config.h>
 #include <xen/bitmap.h>
 #include <xen/kernel.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/ctype.h
--- a/xen/include/xen/ctype.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/ctype.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,8 +1,6 @@
 #ifndef _LINUX_CTYPE_H
 #define _LINUX_CTYPE_H
 
-#include <xen/config.h>
-
 /*
  * NOTE! This ctype does not handle EOF like the standard C
  * library is required to.
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/domain_page.h
--- a/xen/include/xen/domain_page.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/domain_page.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_DOMAIN_PAGE_H__
 #define __XEN_DOMAIN_PAGE_H__
 
-#include <xen/config.h>
 #include <xen/mm.h>
 
 #ifdef CONFIG_DOMAIN_PAGE
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/event.h
--- a/xen/include/xen/event.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/event.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_EVENT_H__
 #define __XEN_EVENT_H__
 
-#include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/grant_table.h	Fri Jan 13 08:33:31 2012 +0100
@@ -24,7 +24,6 @@
 #ifndef __XEN_GRANT_TABLE_H__
 #define __XEN_GRANT_TABLE_H__
 
-#include <xen/config.h>
 #include <public/grant_table.h>
 #include <asm/grant_table.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/hypercall.h	Fri Jan 13 08:33:31 2012 +0100
@@ -5,7 +5,6 @@
 #ifndef __XEN_HYPERCALL_H__
 #define __XEN_HYPERCALL_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/time.h>
 #include <public/xen.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/init.h
--- a/xen/include/xen/init.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/init.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _LINUX_INIT_H
 #define _LINUX_INIT_H
 
-#include <xen/config.h>
 #include <asm/init.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/inttypes.h
--- a/xen/include/xen/inttypes.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/inttypes.h	Fri Jan 13 08:33:31 2012 +0100
@@ -23,7 +23,6 @@
 #ifndef _XEN_INTTYPES_H
 #define _XEN_INTTYPES_H	1
 
-#include <xen/config.h>
 #include <xen/types.h>
 
 # if BITS_PER_LONG == 64
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/irq.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __XEN_IRQ_H__
 #define __XEN_IRQ_H__
 
-#include <xen/config.h>
 #include <xen/cpumask.h>
 #include <xen/rcupdate.h>
 #include <xen/spinlock.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/irq_cpustat.h
--- a/xen/include/xen/irq_cpustat.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/irq_cpustat.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
  * Keith Owens <kaos@ocs.com.au> July 2000.
  */
 
-#include <xen/config.h>
 #include <asm/hardirq.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/lib.h	Fri Jan 13 08:33:31 2012 +0100
@@ -3,7 +3,6 @@
 
 #include <xen/inttypes.h>
 #include <xen/stdarg.h>
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/string.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/mm.h	Fri Jan 13 08:33:31 2012 +0100
@@ -28,7 +28,6 @@
 #ifndef __XEN_MM_H__
 #define __XEN_MM_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/notifier.h
--- a/xen/include/xen/notifier.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/notifier.h	Fri Jan 13 08:33:31 2012 +0100
@@ -10,7 +10,6 @@
 #ifndef __XEN_NOTIFIER_H__
 #define __XEN_NOTIFIER_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/kernel.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/numa.h
--- a/xen/include/xen/numa.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/numa.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _XEN_NUMA_H
 #define _XEN_NUMA_H
 
-#include <xen/config.h>
 #include <asm/numa.h>
 
 #ifndef NODES_SHIFT
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/paging.h
--- a/xen/include/xen/paging.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/paging.h	Fri Jan 13 08:33:31 2012 +0100
@@ -2,8 +2,6 @@
 #ifndef __XEN_PAGING_H__
 #define __XEN_PAGING_H__
 
-#include <xen/config.h>
-
 #if defined CONFIG_PAGING_ASSISTANCE
 
 #include <asm/paging.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/pci.h	Fri Jan 13 08:33:31 2012 +0100
@@ -7,7 +7,6 @@
 #ifndef __XEN_PCI_H__
 #define __XEN_PCI_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/percpu.h
--- a/xen/include/xen/percpu.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/percpu.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __XEN_PERCPU_H__
 #define __XEN_PERCPU_H__
 
-#include <xen/config.h>
 #include <asm/percpu.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/preempt.h
--- a/xen/include/xen/preempt.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/preempt.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_PREEMPT_H__
 #define __XEN_PREEMPT_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/percpu.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/radix-tree.h
--- a/xen/include/xen/radix-tree.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/radix-tree.h	Fri Jan 13 08:33:31 2012 +0100
@@ -20,7 +20,6 @@
 #ifndef _XEN_RADIX_TREE_H
 #define _XEN_RADIX_TREE_H
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/rcupdate.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/sched.h	Fri Jan 13 08:33:31 2012 +0100
@@ -2,7 +2,6 @@
 #ifndef __SCHED_H__
 #define __SCHED_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
 #include <xen/shared.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/shared.h
--- a/xen/include/xen/shared.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/shared.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,8 +1,6 @@
 #ifndef __XEN_SHARED_H__
 #define __XEN_SHARED_H__
 
-#include <xen/config.h>
-
 #ifdef CONFIG_COMPAT
 
 #include <compat/xen.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/smp.h
--- a/xen/include/xen/smp.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/smp.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __XEN_SMP_H__
 #define __XEN_SMP_H__
 
-#include <xen/config.h>
 #include <asm/smp.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/softirq.h
--- a/xen/include/xen/softirq.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/softirq.h	Fri Jan 13 08:33:31 2012 +0100
@@ -11,7 +11,6 @@
     NR_COMMON_SOFTIRQS
 };
 
-#include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/smp.h>
 #include <asm/bitops.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/spinlock.h
--- a/xen/include/xen/spinlock.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/spinlock.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __SPINLOCK_H__
 #define __SPINLOCK_H__
 
-#include <xen/config.h>
 #include <asm/system.h>
 #include <asm/spinlock.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/symbols.h
--- a/xen/include/xen/symbols.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/symbols.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _XEN_SYMBOLS_H
 #define _XEN_SYMBOLS_H
 
-#include <xen/config.h>
 #include <xen/types.h>
 
 #define KSYM_NAME_LEN 127
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/tmem_xen.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_TMEM_XEN_H__
 #define __XEN_TMEM_XEN_H__
 
-#include <xen/config.h>
 #include <xen/mm.h> /* heap alloc/free */
 #include <xen/xmalloc.h> /* xmalloc/xfree */
 #include <xen/sched.h>  /* struct domain */
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/trace.h
--- a/xen/include/xen/trace.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/trace.h	Fri Jan 13 08:33:31 2012 +0100
@@ -23,7 +23,6 @@
 
 extern int tb_init_done;
 
-#include <xen/config.h>
 #include <public/sysctl.h>
 #include <public/trace.h>
 #include <asm/trace.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/types.h
--- a/xen/include/xen/types.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/types.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __TYPES_H__
 #define __TYPES_H__
 
-#include <xen/config.h>
 #include <asm/types.h>
 
 #define BITS_TO_LONGS(bits) \
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/vga.h
--- a/xen/include/xen/vga.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/vga.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef _XEN_VGA_H
 #define _XEN_VGA_H
 
-#include <xen/config.h>
 #include <public/xen.h>
 
 #ifdef CONFIG_VGA
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/xenoprof.h	Fri Jan 13 08:33:31 2012 +0100
@@ -10,7 +10,6 @@
 #ifndef __XEN_XENOPROF_H__
 #define __XEN_XENOPROF_H__
 
-#include <xen/config.h>
 #include <xen/inttypes.h>
 #include <public/xenoprof.h>
 #include <asm/xenoprof.h>

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxE-0000sV-PR; Thu, 19 Jan 2012 21:55:32 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000p7-BY
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327010081!50989351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4395 invoked from network); 19 Jan 2012 21:54:42 -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;
	19 Jan 2012 21:54:42 -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 1RnzxA-0007Rc-9g
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000iI-8L
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Message-Id: <E1RnzxA-0000iI-8L@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] force inclusion of xen/config.h
	through compiler option
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326440011 -3600
# Node ID 86b8a1e3a419943801968da12042b4fe53fff537
# Parent  c5eadfd5c639a494b58cf6c0675b8f78412bcf43
force inclusion of xen/config.h through compiler option

As we expect all source files to include the header as the first thing
anyway, stop doing this by repeating the inclusion in each and every
source file (and in many headers), but rather enforce this uniformly
through the compiler command line.

As a first cleanup step, remove the explicit inclusion from all common
headers. Further cleanup can be done incrementally.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/Rules.mk
--- a/xen/Rules.mk	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/Rules.mk	Fri Jan 13 08:33:31 2012 +0100
@@ -41,7 +41,7 @@
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS-y                += -g -D__XEN__
+CFLAGS-y                += -g -D__XEN__ --include $(BASEDIR)/include/xen/config.h
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
@@ -59,7 +59,7 @@
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
 
-AFLAGS-y                += -D__ASSEMBLY__
+AFLAGS-y                += -D__ASSEMBLY__ --include $(BASEDIR)/include/xen/config.h
 
 # Clang's built-in assembler can't handle .code16/.code32/.code64 yet
 AFLAGS-$(clang)         += -no-integrated-as
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/bitmap.h
--- a/xen/include/xen/bitmap.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/bitmap.h	Fri Jan 13 08:33:31 2012 +0100
@@ -3,7 +3,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/bitops.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/byteorder/swab.h
--- a/xen/include/xen/byteorder/swab.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/byteorder/swab.h	Fri Jan 13 08:33:31 2012 +0100
@@ -10,8 +10,6 @@
  *    to clean up support for bizarre-endian architectures.
  */
 
-#include <xen/compiler.h>
-
 /* casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
  */
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/cache.h
--- a/xen/include/xen/cache.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/cache.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __LINUX_CACHE_H
 #define __LINUX_CACHE_H
 
-#include <xen/config.h>
 #include <asm/cache.h>
 
 #ifndef L1_CACHE_ALIGN
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/compat.h
--- a/xen/include/xen/compat.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/compat.h	Fri Jan 13 08:33:31 2012 +0100
@@ -5,8 +5,6 @@
 #ifndef __XEN_COMPAT_H__
 #define __XEN_COMPAT_H__
 
-#include <xen/config.h>
-
 #ifdef CONFIG_COMPAT
 
 #include <xen/types.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/cpumask.h
--- a/xen/include/xen/cpumask.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/cpumask.h	Fri Jan 13 08:33:31 2012 +0100
@@ -75,7 +75,6 @@
  *    inside a macro, the way we do the other calls.
  */
 
-#include <xen/config.h>
 #include <xen/bitmap.h>
 #include <xen/kernel.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/ctype.h
--- a/xen/include/xen/ctype.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/ctype.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,8 +1,6 @@
 #ifndef _LINUX_CTYPE_H
 #define _LINUX_CTYPE_H
 
-#include <xen/config.h>
-
 /*
  * NOTE! This ctype does not handle EOF like the standard C
  * library is required to.
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/domain_page.h
--- a/xen/include/xen/domain_page.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/domain_page.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_DOMAIN_PAGE_H__
 #define __XEN_DOMAIN_PAGE_H__
 
-#include <xen/config.h>
 #include <xen/mm.h>
 
 #ifdef CONFIG_DOMAIN_PAGE
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/event.h
--- a/xen/include/xen/event.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/event.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_EVENT_H__
 #define __XEN_EVENT_H__
 
-#include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/grant_table.h	Fri Jan 13 08:33:31 2012 +0100
@@ -24,7 +24,6 @@
 #ifndef __XEN_GRANT_TABLE_H__
 #define __XEN_GRANT_TABLE_H__
 
-#include <xen/config.h>
 #include <public/grant_table.h>
 #include <asm/grant_table.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/hypercall.h	Fri Jan 13 08:33:31 2012 +0100
@@ -5,7 +5,6 @@
 #ifndef __XEN_HYPERCALL_H__
 #define __XEN_HYPERCALL_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/time.h>
 #include <public/xen.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/init.h
--- a/xen/include/xen/init.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/init.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _LINUX_INIT_H
 #define _LINUX_INIT_H
 
-#include <xen/config.h>
 #include <asm/init.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/inttypes.h
--- a/xen/include/xen/inttypes.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/inttypes.h	Fri Jan 13 08:33:31 2012 +0100
@@ -23,7 +23,6 @@
 #ifndef _XEN_INTTYPES_H
 #define _XEN_INTTYPES_H	1
 
-#include <xen/config.h>
 #include <xen/types.h>
 
 # if BITS_PER_LONG == 64
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/irq.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __XEN_IRQ_H__
 #define __XEN_IRQ_H__
 
-#include <xen/config.h>
 #include <xen/cpumask.h>
 #include <xen/rcupdate.h>
 #include <xen/spinlock.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/irq_cpustat.h
--- a/xen/include/xen/irq_cpustat.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/irq_cpustat.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
  * Keith Owens <kaos@ocs.com.au> July 2000.
  */
 
-#include <xen/config.h>
 #include <asm/hardirq.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/lib.h	Fri Jan 13 08:33:31 2012 +0100
@@ -3,7 +3,6 @@
 
 #include <xen/inttypes.h>
 #include <xen/stdarg.h>
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/string.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/mm.h	Fri Jan 13 08:33:31 2012 +0100
@@ -28,7 +28,6 @@
 #ifndef __XEN_MM_H__
 #define __XEN_MM_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/notifier.h
--- a/xen/include/xen/notifier.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/notifier.h	Fri Jan 13 08:33:31 2012 +0100
@@ -10,7 +10,6 @@
 #ifndef __XEN_NOTIFIER_H__
 #define __XEN_NOTIFIER_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/kernel.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/numa.h
--- a/xen/include/xen/numa.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/numa.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _XEN_NUMA_H
 #define _XEN_NUMA_H
 
-#include <xen/config.h>
 #include <asm/numa.h>
 
 #ifndef NODES_SHIFT
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/paging.h
--- a/xen/include/xen/paging.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/paging.h	Fri Jan 13 08:33:31 2012 +0100
@@ -2,8 +2,6 @@
 #ifndef __XEN_PAGING_H__
 #define __XEN_PAGING_H__
 
-#include <xen/config.h>
-
 #if defined CONFIG_PAGING_ASSISTANCE
 
 #include <asm/paging.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/pci.h	Fri Jan 13 08:33:31 2012 +0100
@@ -7,7 +7,6 @@
 #ifndef __XEN_PCI_H__
 #define __XEN_PCI_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/percpu.h
--- a/xen/include/xen/percpu.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/percpu.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __XEN_PERCPU_H__
 #define __XEN_PERCPU_H__
 
-#include <xen/config.h>
 #include <asm/percpu.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/preempt.h
--- a/xen/include/xen/preempt.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/preempt.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_PREEMPT_H__
 #define __XEN_PREEMPT_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/percpu.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/radix-tree.h
--- a/xen/include/xen/radix-tree.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/radix-tree.h	Fri Jan 13 08:33:31 2012 +0100
@@ -20,7 +20,6 @@
 #ifndef _XEN_RADIX_TREE_H
 #define _XEN_RADIX_TREE_H
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/rcupdate.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/sched.h	Fri Jan 13 08:33:31 2012 +0100
@@ -2,7 +2,6 @@
 #ifndef __SCHED_H__
 #define __SCHED_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
 #include <xen/shared.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/shared.h
--- a/xen/include/xen/shared.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/shared.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,8 +1,6 @@
 #ifndef __XEN_SHARED_H__
 #define __XEN_SHARED_H__
 
-#include <xen/config.h>
-
 #ifdef CONFIG_COMPAT
 
 #include <compat/xen.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/smp.h
--- a/xen/include/xen/smp.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/smp.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __XEN_SMP_H__
 #define __XEN_SMP_H__
 
-#include <xen/config.h>
 #include <asm/smp.h>
 
 /*
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/softirq.h
--- a/xen/include/xen/softirq.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/softirq.h	Fri Jan 13 08:33:31 2012 +0100
@@ -11,7 +11,6 @@
     NR_COMMON_SOFTIRQS
 };
 
-#include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/smp.h>
 #include <asm/bitops.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/spinlock.h
--- a/xen/include/xen/spinlock.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/spinlock.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __SPINLOCK_H__
 #define __SPINLOCK_H__
 
-#include <xen/config.h>
 #include <asm/system.h>
 #include <asm/spinlock.h>
 
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/symbols.h
--- a/xen/include/xen/symbols.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/symbols.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _XEN_SYMBOLS_H
 #define _XEN_SYMBOLS_H
 
-#include <xen/config.h>
 #include <xen/types.h>
 
 #define KSYM_NAME_LEN 127
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/tmem_xen.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef __XEN_TMEM_XEN_H__
 #define __XEN_TMEM_XEN_H__
 
-#include <xen/config.h>
 #include <xen/mm.h> /* heap alloc/free */
 #include <xen/xmalloc.h> /* xmalloc/xfree */
 #include <xen/sched.h>  /* struct domain */
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/trace.h
--- a/xen/include/xen/trace.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/trace.h	Fri Jan 13 08:33:31 2012 +0100
@@ -23,7 +23,6 @@
 
 extern int tb_init_done;
 
-#include <xen/config.h>
 #include <public/sysctl.h>
 #include <public/trace.h>
 #include <asm/trace.h>
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/types.h
--- a/xen/include/xen/types.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/types.h	Fri Jan 13 08:33:31 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef __TYPES_H__
 #define __TYPES_H__
 
-#include <xen/config.h>
 #include <asm/types.h>
 
 #define BITS_TO_LONGS(bits) \
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/vga.h
--- a/xen/include/xen/vga.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/vga.h	Fri Jan 13 08:33:31 2012 +0100
@@ -9,7 +9,6 @@
 #ifndef _XEN_VGA_H
 #define _XEN_VGA_H
 
-#include <xen/config.h>
 #include <public/xen.h>
 
 #ifdef CONFIG_VGA
diff -r c5eadfd5c639 -r 86b8a1e3a419 xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Thu Jan 12 17:51:11 2012 +0000
+++ b/xen/include/xen/xenoprof.h	Fri Jan 13 08:33:31 2012 +0100
@@ -10,7 +10,6 @@
 #ifndef __XEN_XENOPROF_H__
 #define __XEN_XENOPROF_H__
 
-#include <xen/config.h>
 #include <xen/inttypes.h>
 #include <public/xenoprof.h>
 #include <asm/xenoprof.h>

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000ul-0E; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000gH-LA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1327010123!9872174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1998 invoked from network); 19 Jan 2012 21:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:25 -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 1Rnzx5-0007Qv-Km
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000g7-H3
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
Message-Id: <E1Rnzx5-0000g7-H3@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Enable guest level
	translation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372800 -3600
# Node ID 25a79988dbec04e478369818d3d46d63b9da70d1
# Parent  e4c28269bebf7feb40e9516b38ef183574fa04a5
amd iommu: Enable guest level translation

Similar to nested paging for SVM, IOMMUv2 supports two level
translations for DMA. This patch enables this feature.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r e4c28269bebf -r 25a79988dbec xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:52:37 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:53:20 2012 +0100
@@ -217,12 +217,29 @@
     entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
 
     enable ?
-        iommu_set_bit(&entry, IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT):
+        iommu_set_bit(&entry, IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT) :
         iommu_clear_bit(&entry, IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT);
 
     writel(entry, iommu->mmio_base+IOMMU_CONTROL_MMIO_OFFSET);
 }
 
+static void set_iommu_guest_translation_control(struct amd_iommu *iommu,
+                                                int enable)
+{
+    u32 entry;
+
+    entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+
+    enable ?
+        iommu_set_bit(&entry, IOMMU_CONTROL_GT_ENABLE_SHIFT) :
+        iommu_clear_bit(&entry, IOMMU_CONTROL_GT_ENABLE_SHIFT);
+
+    writel(entry, iommu->mmio_base+IOMMU_CONTROL_MMIO_OFFSET);
+
+    if ( enable )
+        AMD_IOMMU_DEBUG("Guest Translation Enabled.\n");
+}
+
 static void set_iommu_command_buffer_control(struct amd_iommu *iommu,
                                                     int enable)
 {
@@ -658,6 +675,9 @@
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
+        set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_ENABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
@@ -998,6 +1018,9 @@
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
+        set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_DISABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
 
     iommu->enabled = 0;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000ul-0E; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000gH-LA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1327010123!9872174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1998 invoked from network); 19 Jan 2012 21:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:25 -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 1Rnzx5-0007Qv-Km
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx5-0000g7-H3
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:23 +0000
Message-Id: <E1Rnzx5-0000g7-H3@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Enable guest level
	translation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372800 -3600
# Node ID 25a79988dbec04e478369818d3d46d63b9da70d1
# Parent  e4c28269bebf7feb40e9516b38ef183574fa04a5
amd iommu: Enable guest level translation

Similar to nested paging for SVM, IOMMUv2 supports two level
translations for DMA. This patch enables this feature.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r e4c28269bebf -r 25a79988dbec xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:52:37 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:53:20 2012 +0100
@@ -217,12 +217,29 @@
     entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
 
     enable ?
-        iommu_set_bit(&entry, IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT):
+        iommu_set_bit(&entry, IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT) :
         iommu_clear_bit(&entry, IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT);
 
     writel(entry, iommu->mmio_base+IOMMU_CONTROL_MMIO_OFFSET);
 }
 
+static void set_iommu_guest_translation_control(struct amd_iommu *iommu,
+                                                int enable)
+{
+    u32 entry;
+
+    entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+
+    enable ?
+        iommu_set_bit(&entry, IOMMU_CONTROL_GT_ENABLE_SHIFT) :
+        iommu_clear_bit(&entry, IOMMU_CONTROL_GT_ENABLE_SHIFT);
+
+    writel(entry, iommu->mmio_base+IOMMU_CONTROL_MMIO_OFFSET);
+
+    if ( enable )
+        AMD_IOMMU_DEBUG("Guest Translation Enabled.\n");
+}
+
 static void set_iommu_command_buffer_control(struct amd_iommu *iommu,
                                                     int enable)
 {
@@ -658,6 +675,9 @@
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
+        set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_ENABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
@@ -998,6 +1018,9 @@
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
 
+    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
+        set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_DISABLED);
+
     set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
 
     iommu->enabled = 0;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000uy-3L; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxE-0000go-4O
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1327010125!9269014!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18048 invoked from network); 19 Jan 2012 21:55:25 -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;
	19 Jan 2012 21:55:25 -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 1Rnzx6-0007R1-Nx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx6-0000gb-MX
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Message-Id: <E1Rnzx6-0000gb-MX@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Enable FC bit in iommu
	host level PTE
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372868 -3600
# Node ID 9db6fe19dd04d2ac33eebed528058811f1cf0183
# Parent  d4daaab0164306859e21b7a931a0f5eaab8da24c
amd iommu: Enable FC bit in iommu host level PTE

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d4daaab01643 -r 9db6fe19dd04 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:53:57 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:54:28 2012 +0100
@@ -83,6 +83,13 @@
     set_field_in_reg_u32(ir, entry,
                          IOMMU_PDE_IO_READ_PERMISSION_MASK,
                          IOMMU_PDE_IO_READ_PERMISSION_SHIFT, &entry);
+
+    /* FC bit should be enabled in PTE, this helps to solve potential
+     * issues with ATS devices
+     */
+    if ( next_level == IOMMU_PAGING_MODE_LEVEL_0 )
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+                             IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
     pde[1] = entry;
 
     /* mark next level as 'present' */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000uy-3L; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxE-0000go-4O
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1327010125!9269014!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18048 invoked from network); 19 Jan 2012 21:55:25 -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;
	19 Jan 2012 21:55:25 -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 1Rnzx6-0007R1-Nx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx6-0000gb-MX
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Message-Id: <E1Rnzx6-0000gb-MX@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Enable FC bit in iommu
	host level PTE
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372868 -3600
# Node ID 9db6fe19dd04d2ac33eebed528058811f1cf0183
# Parent  d4daaab0164306859e21b7a931a0f5eaab8da24c
amd iommu: Enable FC bit in iommu host level PTE

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d4daaab01643 -r 9db6fe19dd04 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:53:57 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:54:28 2012 +0100
@@ -83,6 +83,13 @@
     set_field_in_reg_u32(ir, entry,
                          IOMMU_PDE_IO_READ_PERMISSION_MASK,
                          IOMMU_PDE_IO_READ_PERMISSION_SHIFT, &entry);
+
+    /* FC bit should be enabled in PTE, this helps to solve potential
+     * issues with ATS devices
+     */
+    if ( next_level == IOMMU_PAGING_MODE_LEVEL_0 )
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+                             IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
     pde[1] = entry;
 
     /* mark next level as 'present' */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000vC-6T; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000gb-Ng
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327010122!11550900!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 726 invoked from network); 19 Jan 2012 21:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:23 -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 1Rnzx4-0007Qp-CT
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx4-0000fd-Ay
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:22 +0000
Message-Id: <E1Rnzx4-0000fd-Ay@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Add iommu emulation for
	hvm guest
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372650 -3600
# Node ID 6c104b46ef8977a8cac58f3c700f2ded6e03c557
# Parent  522d544f40318079678ddc1d0885e9e8287fb33a
amd iommu: Add iommu emulation for hvm guest

ATS device driver that support PASID [1] and PRI [2] capabilites needs
to work with iommu driver in guest OS. We have to expose iommu
functionality to HVM guest, if we want assign ATS device to it. A new
hypervisor mmio handler is added to intercept iommu mmio accesses from
guest.

Signed-off-by: Wei Wang <wei.wang2@amd.com>

[1] http://www.pcisig.com/specifications/pciexpress/specifications/ECN-PASID-ATS-2011-03-31.pdf
[2] http://www.pcisig.com/members/downloads/specifications/iov/ats_r1.1_26Jan09.pdf
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 522d544f4031 -r 6c104b46ef89 xen/arch/x86/hvm/intercept.c
--- a/xen/arch/x86/hvm/intercept.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/arch/x86/hvm/intercept.c	Thu Jan 12 13:50:50 2012 +0100
@@ -38,7 +38,8 @@
     &hpet_mmio_handler,
     &vlapic_mmio_handler,
     &vioapic_mmio_handler,
-    &msixtbl_mmio_handler
+    &msixtbl_mmio_handler,
+    &iommu_mmio_handler
 };
 
 static int hvm_mmio_access(struct vcpu *v,
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/Makefile
--- a/xen/drivers/passthrough/amd/Makefile	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/Makefile	Thu Jan 12 13:50:50 2012 +0100
@@ -5,3 +5,4 @@
 obj-bin-y += iommu_acpi.init.o
 obj-y += iommu_intr.o
 obj-y += iommu_cmd.o
+obj-y += iommu_guest.o
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:50:50 2012 +0100
@@ -398,3 +398,15 @@
     invalidate_iommu_all(iommu);
     flush_command_buffer(iommu);
 }
+
+void amd_iommu_send_guest_cmd(struct amd_iommu *iommu, u32 cmd[])
+{
+    unsigned long flags;
+
+    spin_lock_irqsave(&iommu->lock, flags);
+
+    send_iommu_command(iommu, cmd);
+    flush_command_buffer(iommu);
+
+    spin_unlock_irqrestore(&iommu->lock, flags);
+}
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/iommu_guest.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/passthrough/amd/iommu_guest.c	Thu Jan 12 13:50:50 2012 +0100
@@ -0,0 +1,911 @@
+/*
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Author: Wei Wang <wei.wang2@amd.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#include <xen/sched.h>
+#include <asm/p2m.h>
+#include <asm/hvm/iommu.h>
+#include <asm/amd-iommu.h>
+#include <asm/hvm/svm/amd-iommu-proto.h>
+
+
+#define IOMMU_MMIO_SIZE                         0x8000
+#define IOMMU_MMIO_PAGE_NR                      0x8
+#define RING_BF_LENGTH_MASK                     0x0F000000
+#define RING_BF_LENGTH_SHIFT                    24
+
+#define PASMAX_9_bit                            0x8
+#define GUEST_CR3_1_LEVEL                       0x0
+#define GUEST_ADDRESS_SIZE_6_LEVEL              0x2
+#define HOST_ADDRESS_SIZE_6_LEVEL               0x2
+
+#define guest_iommu_set_status(iommu, bit) \
+        iommu_set_bit(&((iommu)->reg_status.lo), bit)
+
+#define guest_iommu_clear_status(iommu, bit) \
+        iommu_clear_bit(&((iommu)->reg_status.lo), bit)
+
+#define reg_to_u64(reg) (((uint64_t)reg.hi << 32) | reg.lo )
+#define u64_to_reg(reg, val) \
+    do \
+    { \
+        (reg)->lo = (u32)(val); \
+        (reg)->hi = (val) >> 32; \
+    } while (0)
+
+static unsigned int machine_bdf(struct domain *d, uint16_t guest_bdf)
+{
+    return guest_bdf;
+}
+
+static uint16_t guest_bdf(struct domain *d, uint16_t machine_bdf)
+{
+    return machine_bdf;
+}
+
+static inline struct guest_iommu *domain_iommu(struct domain *d)
+{
+    return domain_hvm_iommu(d)->g_iommu;
+}
+
+static inline struct guest_iommu *vcpu_iommu(struct vcpu *v)
+{
+    return domain_hvm_iommu(v->domain)->g_iommu;
+}
+
+static void guest_iommu_enable(struct guest_iommu *iommu)
+{
+    iommu->enabled = 1;
+}
+
+static void guest_iommu_disable(struct guest_iommu *iommu)
+{
+    iommu->enabled = 0;
+}
+
+static uint64_t get_guest_cr3_from_dte(dev_entry_t *dte)
+{
+    uint64_t gcr3_1, gcr3_2, gcr3_3;
+
+    gcr3_1 = get_field_from_reg_u32(dte->data[1],
+                                    IOMMU_DEV_TABLE_GCR3_1_MASK,
+                                    IOMMU_DEV_TABLE_GCR3_1_SHIFT);
+    gcr3_2 = get_field_from_reg_u32(dte->data[2],
+                                    IOMMU_DEV_TABLE_GCR3_2_MASK,
+                                    IOMMU_DEV_TABLE_GCR3_2_SHIFT);
+    gcr3_3 = get_field_from_reg_u32(dte->data[3],
+                                    IOMMU_DEV_TABLE_GCR3_3_MASK,
+                                    IOMMU_DEV_TABLE_GCR3_3_SHIFT);
+
+    return ((gcr3_3 << 31) | (gcr3_2 << 15 ) | (gcr3_1 << 12)) >> PAGE_SHIFT;
+}
+
+static uint16_t get_domid_from_dte(dev_entry_t *dte)
+{
+    return get_field_from_reg_u32(dte->data[2], IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
+                                  IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT);
+}
+
+static uint16_t get_glx_from_dte(dev_entry_t *dte)
+{
+    return get_field_from_reg_u32(dte->data[1], IOMMU_DEV_TABLE_GLX_MASK,
+                                  IOMMU_DEV_TABLE_GLX_SHIFT);
+}
+
+static uint16_t get_gv_from_dte(dev_entry_t *dte)
+{
+    return get_field_from_reg_u32(dte->data[1],IOMMU_DEV_TABLE_GV_MASK,
+                                  IOMMU_DEV_TABLE_GV_SHIFT);
+}
+
+static unsigned int host_domid(struct domain *d, uint64_t g_domid)
+{
+    /* Only support one PPR device in guest for now */
+    return d->domain_id;
+}
+
+static unsigned long get_gfn_from_base_reg(uint64_t base_raw)
+{
+    struct mmio_reg reg;
+    uint64_t addr64;
+
+    reg.lo = iommu_get_addr_lo_from_reg(base_raw & DMA_32BIT_MASK);
+    reg.hi = iommu_get_addr_hi_from_reg(base_raw >> 32);
+    addr64 = reg_to_u64(reg);
+
+    ASSERT ( addr64 != 0 );
+
+    return addr64 >> PAGE_SHIFT;
+}
+
+static void guest_iommu_deliver_msi(struct domain *d)
+{
+    uint8_t vector, dest, dest_mode, delivery_mode, trig_mode;
+    struct guest_iommu *iommu = domain_iommu(d);
+
+    vector = iommu->msi.vector;
+    dest = iommu->msi.dest;
+    dest_mode = iommu->msi.dest_mode;
+    delivery_mode = iommu->msi.delivery_mode;
+    trig_mode = iommu->msi.trig_mode;
+
+    vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
+}
+
+static unsigned long guest_iommu_get_table_mfn(struct domain *d,
+                                               uint64_t base_raw,
+                                               unsigned int entry_size,
+                                               unsigned int pos)
+{
+    unsigned long idx, gfn, mfn;
+    p2m_type_t p2mt;
+
+    gfn = get_gfn_from_base_reg(base_raw);
+    idx = (pos * entry_size) >> PAGE_SHIFT;
+
+    mfn = mfn_x(get_gfn(d, gfn + idx, &p2mt));
+    put_gfn(d, gfn);
+
+    return mfn;
+}
+
+static void guest_iommu_enable_dev_table(struct guest_iommu *iommu)
+{
+    uint32_t length_raw = get_field_from_reg_u32(iommu->dev_table.reg_base.lo,
+                                                 IOMMU_DEV_TABLE_SIZE_MASK,
+                                                 IOMMU_DEV_TABLE_SIZE_SHIFT);
+    iommu->dev_table.size = (length_raw + 1) * PAGE_SIZE;
+}
+
+static void guest_iommu_enable_ring_buffer(struct guest_iommu *iommu,
+                                           struct guest_buffer *buffer,
+                                           uint32_t entry_size)
+{
+    uint32_t length_raw = get_field_from_reg_u32(buffer->reg_base.hi,
+                                                 RING_BF_LENGTH_MASK,
+                                                 RING_BF_LENGTH_SHIFT);
+    buffer->entries = 1 << length_raw;
+}
+
+void guest_iommu_add_ppr_log(struct domain *d, u32 entry[])
+{
+    uint16_t gdev_id;
+    unsigned long mfn, tail, head;
+    ppr_entry_t *log, *log_base;
+    struct guest_iommu *iommu;
+
+    iommu = domain_iommu(d);
+    tail = iommu_get_rb_pointer(iommu->ppr_log.reg_tail.lo);
+    head = iommu_get_rb_pointer(iommu->ppr_log.reg_head.lo);
+
+    if ( tail >= iommu->ppr_log.entries || head >= iommu->ppr_log.entries )
+    {
+        AMD_IOMMU_DEBUG("Error: guest iommu ppr log overflows\n");
+        guest_iommu_disable(iommu);
+        return;
+    }
+
+    mfn = guest_iommu_get_table_mfn(d, reg_to_u64(iommu->ppr_log.reg_base),
+                                    sizeof(ppr_entry_t), tail);
+    ASSERT(mfn_valid(mfn));
+
+    log_base = map_domain_page(mfn);
+    log = log_base + tail % (PAGE_SIZE / sizeof(ppr_entry_t));
+
+    /* Convert physical device id back into virtual device id */
+    gdev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
+    iommu_set_devid_to_cmd(&entry[0], gdev_id);
+
+    memcpy(log, entry, sizeof(ppr_entry_t));
+
+    /* Now shift ppr log tail pointer */
+    if ( ++tail >= iommu->ppr_log.entries )
+    {
+        tail = 0;
+        guest_iommu_set_status(iommu, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT);
+    }
+    iommu_set_rb_pointer(&iommu->ppr_log.reg_tail.lo, tail);
+    unmap_domain_page(log_base);
+
+    guest_iommu_deliver_msi(d);
+}
+
+void guest_iommu_add_event_log(struct domain *d, u32 entry[])
+{
+    uint16_t dev_id;
+    unsigned long mfn, tail, head;
+    event_entry_t *log, *log_base;
+    struct guest_iommu *iommu;
+
+    iommu = domain_iommu(d);
+    tail = iommu_get_rb_pointer(iommu->event_log.reg_tail.lo);
+    head = iommu_get_rb_pointer(iommu->event_log.reg_head.lo);
+
+    if ( tail >= iommu->event_log.entries || head >= iommu->event_log.entries )
+    {
+        AMD_IOMMU_DEBUG("Error: guest iommu event overflows\n");
+        guest_iommu_disable(iommu);
+        return;
+    }
+
+    mfn = guest_iommu_get_table_mfn(d, reg_to_u64(iommu->event_log.reg_base),
+                                    sizeof(event_entry_t), tail);
+    ASSERT(mfn_valid(mfn));
+
+    log_base = map_domain_page(mfn);
+    log = log_base + tail % (PAGE_SIZE / sizeof(event_entry_t));
+
+    /* re-write physical device id into virtual device id */
+    dev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
+    iommu_set_devid_to_cmd(&entry[0], dev_id);
+    memcpy(log, entry, sizeof(event_entry_t));
+
+    /* Now shift event log tail pointer */
+    if ( ++tail >= iommu->event_log.entries )
+    {
+        tail = 0;
+        guest_iommu_set_status(iommu, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
+    }
+
+    iommu_set_rb_pointer(&iommu->event_log.reg_tail.lo, tail);
+    unmap_domain_page(log_base);
+
+    guest_iommu_deliver_msi(d);
+}
+
+static int do_complete_ppr_request(struct domain *d, cmd_entry_t *cmd)
+{
+    uint16_t dev_id;
+    struct amd_iommu *iommu;
+
+    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
+    iommu = find_iommu_for_device(0, dev_id);
+
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x\n",
+                        __func__, dev_id);
+        return -ENODEV;
+    }
+
+    /* replace virtual device id into physical */
+    iommu_set_devid_to_cmd(&cmd->data[0], dev_id);
+    amd_iommu_send_guest_cmd(iommu, cmd->data);
+
+    return 0;
+}
+
+static int do_invalidate_pages(struct domain *d, cmd_entry_t *cmd)
+{
+    uint16_t gdom_id, hdom_id;
+    struct amd_iommu *iommu = NULL;
+
+    gdom_id = get_field_from_reg_u32(cmd->data[1],
+                                    IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
+                                    IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT);
+
+    hdom_id = host_domid(d, gdom_id);
+    set_field_in_reg_u32(hdom_id, cmd->data[1],
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT, &cmd->data[1]);
+
+    for_each_amd_iommu ( iommu )
+        amd_iommu_send_guest_cmd(iommu, cmd->data);
+
+    return 0;
+}
+
+static int do_invalidate_all(struct domain *d, cmd_entry_t *cmd)
+{
+    struct amd_iommu *iommu = NULL;
+
+    for_each_amd_iommu ( iommu )
+        amd_iommu_flush_all_pages(d);
+
+    return 0;
+}
+
+static int do_invalidate_iotlb_pages(struct domain *d, cmd_entry_t *cmd)
+{
+    struct amd_iommu *iommu;
+    uint16_t dev_id;
+
+    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
+
+    iommu = find_iommu_for_device(0, dev_id);
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x\n",
+                         __func__, dev_id);
+        return -ENODEV;
+    }
+
+    iommu_set_devid_to_cmd(&cmd->data[0], dev_id);
+    amd_iommu_send_guest_cmd(iommu, cmd->data);
+
+    return 0;
+}
+
+static int do_completion_wait(struct domain *d, cmd_entry_t *cmd)
+{
+    bool_t com_wait_int_en, com_wait_int, i, s;
+    struct guest_iommu *iommu;
+    unsigned long gfn;
+    p2m_type_t p2mt;
+
+    iommu = domain_iommu(d);
+
+    i = iommu_get_bit(cmd->data[0], IOMMU_COMP_WAIT_I_FLAG_SHIFT);
+    s = iommu_get_bit(cmd->data[0], IOMMU_COMP_WAIT_S_FLAG_SHIFT);
+
+    if ( i )
+        guest_iommu_set_status(iommu, IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
+
+    if ( s )
+    {
+        uint64_t gaddr_lo, gaddr_hi, gaddr_64, data;
+        void *vaddr;
+
+        data = (uint64_t)cmd->data[3] << 32 | cmd->data[2];
+        gaddr_lo = get_field_from_reg_u32(cmd->data[0],
+                                          IOMMU_COMP_WAIT_ADDR_LOW_MASK,
+                                          IOMMU_COMP_WAIT_ADDR_LOW_SHIFT);
+        gaddr_hi = get_field_from_reg_u32(cmd->data[1],
+                                          IOMMU_COMP_WAIT_ADDR_HIGH_MASK,
+                                          IOMMU_COMP_WAIT_ADDR_HIGH_SHIFT);
+
+        gaddr_64 = (gaddr_hi << 32) | (gaddr_lo << 3);
+
+        gfn = gaddr_64 >> PAGE_SHIFT;
+        vaddr = map_domain_page(mfn_x(get_gfn(d, gfn ,&p2mt)));
+        put_gfn(d, gfn);
+
+        write_u64_atomic((uint64_t *)(vaddr + (gaddr_64 & (PAGE_SIZE-1))),
+                         data);
+        unmap_domain_page(vaddr);
+    }
+
+    com_wait_int_en = iommu_get_bit(iommu->reg_ctrl.lo,
+                                    IOMMU_CONTROL_COMP_WAIT_INT_SHIFT);
+    com_wait_int = iommu_get_bit(iommu->reg_status.lo,
+                                 IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
+
+    if ( com_wait_int_en && com_wait_int )
+        guest_iommu_deliver_msi(d);
+
+    return 0;
+}
+
+static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
+{
+    uint16_t gbdf, mbdf, req_id, gdom_id, hdom_id;
+    dev_entry_t *gdte, *mdte, *dte_base;
+    struct amd_iommu *iommu = NULL;
+    struct guest_iommu *g_iommu;
+    uint64_t gcr3_gfn, gcr3_mfn;
+    uint8_t glx, gv;
+    unsigned long dte_mfn, flags;
+    p2m_type_t p2mt;
+
+    g_iommu = domain_iommu(d);
+    gbdf = iommu_get_devid_from_cmd(cmd->data[0]);
+    mbdf = machine_bdf(d, gbdf);
+
+    /* Guest can only update DTEs for its passthru devices */
+    if ( mbdf == 0 || gbdf == 0 )
+        return 0;
+
+    /* Sometimes guest invalidates devices from non-exists dtes */
+    if ( (gbdf * sizeof(dev_entry_t)) > g_iommu->dev_table.size )
+        return 0;
+
+    dte_mfn = guest_iommu_get_table_mfn(d,
+                                        reg_to_u64(g_iommu->dev_table.reg_base),
+                                        sizeof(dev_entry_t), gbdf);
+    ASSERT(mfn_valid(dte_mfn));
+
+    dte_base = map_domain_page(dte_mfn);
+
+    gdte = dte_base + gbdf % (PAGE_SIZE / sizeof(dev_entry_t));
+
+    gdom_id  = get_domid_from_dte(gdte);
+    gcr3_gfn = get_guest_cr3_from_dte(gdte);
+
+    /* Do not update host dte before gcr3 has been set */
+    if ( gcr3_gfn == 0 )
+        return 0;
+
+    gcr3_mfn = mfn_x(get_gfn(d, gcr3_gfn, &p2mt));
+    put_gfn(d, gcr3_gfn);
+
+    ASSERT(mfn_valid(gcr3_mfn));
+
+    /* Read guest dte information */
+    iommu = find_iommu_for_device(0, mbdf);
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x!\n",
+                        __func__, mbdf);
+        return -ENODEV;
+    }
+
+    glx = get_glx_from_dte(gdte);
+    gv = get_gv_from_dte(gdte);
+
+    unmap_domain_page(dte_base);
+
+    /* Setup host device entry */
+    hdom_id = host_domid(d, gdom_id);
+    req_id = get_dma_requestor_id(iommu->seg, mbdf);
+    mdte = iommu->dev_table.buffer + (req_id * sizeof(dev_entry_t));
+
+    spin_lock_irqsave(&iommu->lock, flags);
+    iommu_dte_set_guest_cr3((u32 *)mdte, hdom_id,
+                            gcr3_mfn << PAGE_SHIFT, gv, glx);
+
+    amd_iommu_flush_device(iommu, req_id);
+    spin_unlock_irqrestore(&iommu->lock, flags);
+
+    return 0;
+}
+
+static void guest_iommu_process_command(unsigned long _d)
+{
+    unsigned long opcode, tail, head, entries_per_page, cmd_mfn;
+    cmd_entry_t *cmd, *cmd_base;
+    struct domain *d = (struct domain *)_d;
+    struct guest_iommu *iommu;
+
+    iommu = domain_iommu(d);
+
+    if ( !iommu->enabled )
+        return;
+
+    head = iommu_get_rb_pointer(iommu->cmd_buffer.reg_head.lo);
+    tail = iommu_get_rb_pointer(iommu->cmd_buffer.reg_tail.lo);
+
+    /* Tail pointer is rolled over by guest driver, value outside
+     * cmd_buffer_entries cause iommu disabled
+     */
+
+    if ( tail >= iommu->cmd_buffer.entries ||
+         head >= iommu->cmd_buffer.entries )
+    {
+        AMD_IOMMU_DEBUG("Error: guest iommu cmd buffer overflows\n");
+        guest_iommu_disable(iommu);
+        return;
+    }
+
+    entries_per_page = PAGE_SIZE / sizeof(cmd_entry_t);
+
+    while ( head != tail )
+    {
+        int ret = 0;
+
+        cmd_mfn = guest_iommu_get_table_mfn(d,
+                                            reg_to_u64(iommu->cmd_buffer.reg_base),
+                                            sizeof(cmd_entry_t), head);
+        ASSERT(mfn_valid(cmd_mfn));
+
+        cmd_base = map_domain_page(cmd_mfn);
+        cmd = cmd_base + head % entries_per_page;
+
+        opcode = get_field_from_reg_u32(cmd->data[1],
+                                        IOMMU_CMD_OPCODE_MASK,
+                                        IOMMU_CMD_OPCODE_SHIFT);
+        switch ( opcode )
+        {
+        case IOMMU_CMD_COMPLETION_WAIT:
+            ret = do_completion_wait(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY:
+            ret = do_invalidate_dte(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_IOMMU_PAGES:
+            ret = do_invalidate_pages(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_IOTLB_PAGES:
+            ret = do_invalidate_iotlb_pages(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_INT_TABLE:
+            break;
+        case IOMMU_CMD_COMPLETE_PPR_REQUEST:
+            ret = do_complete_ppr_request(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_IOMMU_ALL:
+            ret = do_invalidate_all(d, cmd);
+            break;
+        default:
+            AMD_IOMMU_DEBUG("CMD: Unknown command cmd_type = %lx "
+                            "head = %ld\n", opcode, head);
+            break;
+        }
+
+        unmap_domain_page(cmd_base);
+        if ( ++head >= iommu->cmd_buffer.entries )
+            head = 0;
+        if ( ret )
+            guest_iommu_disable(iommu);
+    }
+
+    /* Now shift cmd buffer head pointer */
+    iommu_set_rb_pointer(&iommu->cmd_buffer.reg_head.lo, head);
+    return;
+}
+
+static int guest_iommu_write_ctrl(struct guest_iommu *iommu, uint64_t newctrl)
+{
+    bool_t cmd_en, event_en, iommu_en, ppr_en, ppr_log_en;
+    bool_t cmd_en_old, event_en_old, iommu_en_old;
+    bool_t cmd_run;
+
+    iommu_en = iommu_get_bit(newctrl,
+                             IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT);
+    iommu_en_old = iommu_get_bit(iommu->reg_ctrl.lo,
+                                 IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT);
+
+    cmd_en = iommu_get_bit(newctrl,
+                           IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT);
+    cmd_en_old = iommu_get_bit(iommu->reg_ctrl.lo,
+                               IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT);
+    cmd_run = iommu_get_bit(iommu->reg_status.lo,
+                            IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT);
+    event_en = iommu_get_bit(newctrl,
+                             IOMMU_CONTROL_EVENT_LOG_ENABLE_SHIFT);
+    event_en_old = iommu_get_bit(iommu->reg_ctrl.lo,
+                                 IOMMU_CONTROL_EVENT_LOG_ENABLE_SHIFT);
+
+    ppr_en = iommu_get_bit(newctrl,
+                           IOMMU_CONTROL_PPR_ENABLE_SHIFT);
+    ppr_log_en = iommu_get_bit(newctrl,
+                               IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT);
+
+    if ( iommu_en )
+    {
+        guest_iommu_enable(iommu);
+        guest_iommu_enable_dev_table(iommu);
+    }
+
+    if ( iommu_en && cmd_en )
+    {
+        guest_iommu_enable_ring_buffer(iommu, &iommu->cmd_buffer,
+                                       sizeof(cmd_entry_t));
+        /* Enable iommu command processing */
+        tasklet_schedule(&iommu->cmd_buffer_tasklet);
+    }
+
+    if ( iommu_en && event_en )
+    {
+        guest_iommu_enable_ring_buffer(iommu, &iommu->event_log,
+                                       sizeof(event_entry_t));
+        guest_iommu_set_status(iommu, IOMMU_STATUS_EVENT_LOG_RUN_SHIFT);
+        guest_iommu_clear_status(iommu, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
+    }
+
+    if ( iommu_en && ppr_en && ppr_log_en )
+    {
+        guest_iommu_enable_ring_buffer(iommu, &iommu->ppr_log,
+                                       sizeof(ppr_entry_t));
+        guest_iommu_set_status(iommu, IOMMU_STATUS_PPR_LOG_RUN_SHIFT);
+        guest_iommu_clear_status(iommu, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT);
+    }
+
+    if ( iommu_en && cmd_en_old && !cmd_en )
+    {
+        /* Disable iommu command processing */
+        tasklet_kill(&iommu->cmd_buffer_tasklet);
+    }
+
+    if ( event_en_old && !event_en )
+        guest_iommu_clear_status(iommu, IOMMU_STATUS_EVENT_LOG_RUN_SHIFT);
+
+    if ( iommu_en_old && !iommu_en )
+        guest_iommu_disable(iommu);
+
+    u64_to_reg(&iommu->reg_ctrl, newctrl);
+    return 0;
+}
+
+static uint64_t iommu_mmio_read64(struct guest_iommu *iommu,
+                                  unsigned long offset)
+{
+    uint64_t val;
+
+    switch ( offset )
+    {
+    case IOMMU_DEV_TABLE_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->dev_table.reg_base);
+        break;
+    case IOMMU_CMD_BUFFER_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->cmd_buffer.reg_base);
+        break;
+    case IOMMU_EVENT_LOG_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->event_log.reg_base);
+        break;
+    case IOMMU_PPR_LOG_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->ppr_log.reg_base);
+        break;
+    case IOMMU_CMD_BUFFER_HEAD_OFFSET:
+        val = reg_to_u64(iommu->cmd_buffer.reg_head);
+        break;
+    case IOMMU_CMD_BUFFER_TAIL_OFFSET:
+        val = reg_to_u64(iommu->cmd_buffer.reg_tail);
+        break;
+    case IOMMU_EVENT_LOG_HEAD_OFFSET:
+        val = reg_to_u64(iommu->event_log.reg_head);
+        break;
+    case IOMMU_EVENT_LOG_TAIL_OFFSET:
+        val = reg_to_u64(iommu->event_log.reg_tail);
+        break;
+    case IOMMU_PPR_LOG_HEAD_OFFSET:
+        val = reg_to_u64(iommu->ppr_log.reg_head);
+        break;
+    case IOMMU_PPR_LOG_TAIL_OFFSET:
+        val = reg_to_u64(iommu->ppr_log.reg_tail);
+        break;
+    case IOMMU_CONTROL_MMIO_OFFSET:
+        val = reg_to_u64(iommu->reg_ctrl);
+        break;
+    case IOMMU_STATUS_MMIO_OFFSET:
+        val = reg_to_u64(iommu->reg_status);
+        break;
+    case IOMMU_EXT_FEATURE_MMIO_OFFSET:
+        val = reg_to_u64(iommu->reg_ext_feature);
+        break;
+
+    default:
+        AMD_IOMMU_DEBUG("Guest reads unknown mmio offset = %lx\n", offset);
+        val = 0;
+        break;
+    }
+
+    return val;
+}
+
+static int guest_iommu_mmio_read(struct vcpu *v, unsigned long addr,
+                                 unsigned long len, unsigned long *pval)
+{
+    struct guest_iommu *iommu = vcpu_iommu(v);
+    unsigned long offset;
+    uint64_t val;
+    uint32_t mmio, shift;
+    uint64_t mask = 0;
+
+    offset = addr - iommu->mmio_base;
+
+    if ( unlikely((offset & (len - 1 )) || (len > 8)) )
+    {
+        AMD_IOMMU_DEBUG("iommu mmio read access is not aligned:"
+                        " offset = %lx, len = %lx\n", offset, len);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    mask = (len == 8) ? ~0ULL : (1ULL << (len * 8)) - 1;
+    shift = (offset & 7u) * 8;
+
+    /* mmio access is always aligned on 8-byte boundary */
+    mmio = offset & (~7u);
+
+    spin_lock(&iommu->lock);
+    val = iommu_mmio_read64(iommu, mmio);
+    spin_unlock(&iommu->lock);
+
+    *pval = (val >> shift ) & mask;
+
+    return X86EMUL_OKAY;
+}
+
+static void guest_iommu_mmio_write64(struct guest_iommu *iommu,
+                                    unsigned long offset, uint64_t val)
+{
+    switch ( offset )
+    {
+    case IOMMU_DEV_TABLE_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->dev_table.reg_base, val);
+        break;
+    case IOMMU_CMD_BUFFER_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->cmd_buffer.reg_base, val);
+        break;
+    case IOMMU_EVENT_LOG_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->event_log.reg_base, val);
+    case IOMMU_PPR_LOG_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->ppr_log.reg_base, val);
+        break;
+    case IOMMU_CONTROL_MMIO_OFFSET:
+        guest_iommu_write_ctrl(iommu, val);
+        break;
+    case IOMMU_CMD_BUFFER_HEAD_OFFSET:
+        u64_to_reg(&iommu->cmd_buffer.reg_head, val);
+        break;
+    case IOMMU_CMD_BUFFER_TAIL_OFFSET:
+        u64_to_reg(&iommu->cmd_buffer.reg_tail, val);
+        tasklet_schedule(&iommu->cmd_buffer_tasklet);
+        break;
+    case IOMMU_EVENT_LOG_HEAD_OFFSET:
+        u64_to_reg(&iommu->event_log.reg_head, val);
+        break;
+    case IOMMU_EVENT_LOG_TAIL_OFFSET:
+        u64_to_reg(&iommu->event_log.reg_tail, val);
+        break;
+    case IOMMU_PPR_LOG_HEAD_OFFSET:
+        u64_to_reg(&iommu->ppr_log.reg_head, val);
+        break;
+    case IOMMU_PPR_LOG_TAIL_OFFSET:
+        u64_to_reg(&iommu->ppr_log.reg_tail, val);
+        break;
+    case IOMMU_STATUS_MMIO_OFFSET:
+        u64_to_reg(&iommu->reg_status, val);
+        break;
+
+    default:
+        AMD_IOMMU_DEBUG("guest writes unknown mmio offset = %lx,"
+                        " val = %" PRIx64 "\n", offset, val);
+        break;
+    }
+}
+
+static int guest_iommu_mmio_write(struct vcpu *v, unsigned long addr,
+                                  unsigned long len, unsigned long val)
+{
+    struct guest_iommu *iommu = vcpu_iommu(v);
+    unsigned long offset;
+    uint64_t reg_old, mmio;
+    uint32_t shift;
+    uint64_t mask = 0;
+
+    offset = addr - iommu->mmio_base;
+
+    if ( unlikely((offset & (len - 1)) || (len > 8)) )
+    {
+        AMD_IOMMU_DEBUG("iommu mmio write access is not aligned:"
+                        " offset = %lx, len = %lx\n", offset, len);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    mask = (len == 8) ? ~0ULL : (1ULL << (len * 8)) - 1;
+    shift = (offset & 7) * 8;
+
+    /* mmio access is always aligned on 8-byte boundary */
+    mmio = offset & ~7;
+
+    spin_lock(&iommu->lock);
+
+    reg_old = iommu_mmio_read64(iommu, mmio);
+    reg_old &= ~(mask << shift);
+    val = reg_old | ((val & mask) << shift);
+    guest_iommu_mmio_write64(iommu, mmio, val);
+
+    spin_unlock(&iommu->lock);
+
+    return X86EMUL_OKAY;
+}
+
+int guest_iommu_set_base(struct domain *d, uint64_t base)
+{
+    p2m_type_t t;
+    struct guest_iommu *iommu = domain_iommu(d);
+
+    iommu->mmio_base = base;
+    base >>= PAGE_SHIFT;
+
+    for ( int i = 0; i < IOMMU_MMIO_PAGE_NR; i++ )
+    {
+        unsigned long gfn = base + i;
+
+        get_gfn_query(d, gfn, &t);
+        p2m_change_type(d, gfn, t, p2m_mmio_dm);
+        put_gfn(d, gfn);
+    }
+
+    return 0;
+}
+
+/* Initialize mmio read only bits */
+static void guest_iommu_reg_init(struct guest_iommu *iommu)
+{
+    uint32_t lower, upper;
+
+    lower = upper = 0;
+    /* Support prefetch */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_PREFSUP_SHIFT);
+    /* Support PPR log */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_PPRSUP_SHIFT);
+    /* Support guest translation */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_GTSUP_SHIFT);
+    /* Support invalidate all command */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_IASUP_SHIFT);
+
+    /* Host translation size has 6 levels */
+    set_field_in_reg_u32(HOST_ADDRESS_SIZE_6_LEVEL, lower,
+                         IOMMU_EXT_FEATURE_HATS_MASK,
+                         IOMMU_EXT_FEATURE_HATS_SHIFT,
+                         &lower);
+    /* Guest translation size has 6 levels */
+    set_field_in_reg_u32(GUEST_ADDRESS_SIZE_6_LEVEL, lower,
+                         IOMMU_EXT_FEATURE_GATS_MASK,
+                         IOMMU_EXT_FEATURE_GATS_SHIFT,
+                         &lower);
+    /* Single level gCR3 */
+    set_field_in_reg_u32(GUEST_CR3_1_LEVEL, lower,
+                         IOMMU_EXT_FEATURE_GLXSUP_MASK,
+                         IOMMU_EXT_FEATURE_GLXSUP_SHIFT, &lower);
+    /* 9 bit PASID */
+    set_field_in_reg_u32(PASMAX_9_bit, upper,
+                         IOMMU_EXT_FEATURE_PASMAX_MASK,
+                         IOMMU_EXT_FEATURE_PASMAX_SHIFT, &upper);
+
+    iommu->reg_ext_feature.lo = lower;
+    iommu->reg_ext_feature.hi = upper;
+}
+
+/* Domain specific initialization */
+int guest_iommu_init(struct domain* d)
+{
+    struct guest_iommu *iommu;
+    struct hvm_iommu *hd  = domain_hvm_iommu(d);
+
+    if ( !is_hvm_domain(d) )
+        return 0;
+
+    iommu = xzalloc(struct guest_iommu);
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("Error allocating guest iommu structure.\n");
+        return 1;
+    }
+
+    guest_iommu_reg_init(iommu);
+    iommu->domain = d;
+    hd->g_iommu = iommu;
+
+    tasklet_init(&iommu->cmd_buffer_tasklet,
+                 guest_iommu_process_command, (unsigned long)d);
+
+    spin_lock_init(&iommu->lock);
+
+    return 0;
+}
+
+void guest_iommu_destroy(struct domain *d)
+{
+    struct guest_iommu *iommu;
+
+    if ( !is_hvm_domain(d) )
+        return;
+
+    iommu = domain_iommu(d);
+
+    tasklet_kill(&iommu->cmd_buffer_tasklet);
+    xfree(iommu);
+
+    domain_hvm_iommu(d)->g_iommu = NULL;
+}
+
+static int guest_iommu_mmio_range(struct vcpu *v, unsigned long addr)
+{
+    struct guest_iommu *iommu = vcpu_iommu(v);
+
+    return addr >= iommu->mmio_base &&
+           addr < iommu->mmio_base + IOMMU_MMIO_SIZE;
+}
+
+const struct hvm_mmio_handler iommu_mmio_handler = {
+    .check_handler = guest_iommu_mmio_range,
+    .read_handler = guest_iommu_mmio_read,
+    .write_handler = guest_iommu_mmio_write
+};
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:50:50 2012 +0100
@@ -234,6 +234,53 @@
     dte[3] = entry;
 }
 
+void iommu_dte_set_guest_cr3(u32 *dte, u16 dom_id, u64 gcr3,
+                             int gv, unsigned int glx)
+{
+    u32 entry, gcr3_1, gcr3_2, gcr3_3;
+
+    gcr3_3 = gcr3 >> 31;
+    gcr3_2 = (gcr3 >> 15) & 0xFFFF;
+    gcr3_1 = (gcr3 >> PAGE_SHIFT) & 0x7;
+
+    /* I bit must be set when gcr3 is enabled */
+    entry = dte[3];
+    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+                         IOMMU_DEV_TABLE_IOTLB_SUPPORT_MASK,
+                         IOMMU_DEV_TABLE_IOTLB_SUPPORT_SHIFT, &entry);
+    /* update gcr3 */
+    set_field_in_reg_u32(gcr3_3, entry,
+                         IOMMU_DEV_TABLE_GCR3_3_MASK,
+                         IOMMU_DEV_TABLE_GCR3_3_SHIFT, &entry);
+    dte[3] = entry;
+
+    set_field_in_reg_u32(dom_id, entry,
+                         IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
+                         IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
+    /* update gcr3 */
+    entry = dte[2];
+    set_field_in_reg_u32(gcr3_2, entry,
+                         IOMMU_DEV_TABLE_GCR3_2_MASK,
+                         IOMMU_DEV_TABLE_GCR3_2_SHIFT, &entry);
+    dte[2] = entry;
+
+    entry = dte[1];
+    /* Enable GV bit */
+    set_field_in_reg_u32(!!gv, entry,
+                         IOMMU_DEV_TABLE_GV_MASK,
+                         IOMMU_DEV_TABLE_GV_SHIFT, &entry);
+
+    /* 1 level guest cr3 table  */
+    set_field_in_reg_u32(glx, entry,
+                         IOMMU_DEV_TABLE_GLX_MASK,
+                         IOMMU_DEV_TABLE_GLX_SHIFT, &entry);
+    /* update gcr3 */
+    set_field_in_reg_u32(gcr3_1, entry,
+                         IOMMU_DEV_TABLE_GCR3_1_MASK,
+                         IOMMU_DEV_TABLE_GCR3_1_SHIFT, &entry);
+    dte[1] = entry;
+}
+
 u64 amd_iommu_get_next_table_from_pte(u32 *entry)
 {
     u64 addr_lo, addr_hi, ptr;
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Thu Jan 12 13:50:50 2012 +0100
@@ -260,6 +260,8 @@
 
     hd->domain_id = d->domain_id;
 
+    guest_iommu_init(d);
+
     return 0;
 }
 
@@ -443,6 +445,7 @@
 
 static void amd_iommu_domain_destroy(struct domain *d)
 {
+    guest_iommu_destroy(d);
     deallocate_iommu_page_tables(d);
     amd_iommu_flush_all_pages(d);
 }
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:50:50 2012 +0100
@@ -24,6 +24,7 @@
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
+#include <xen/tasklet.h>
 #include <asm/hvm/svm/amd-iommu-defs.h>
 
 #define iommu_found()           (!list_empty(&amd_iommu_head))
@@ -129,4 +130,55 @@
 int iterate_ivrs_mappings(int (*)(u16 seg, struct ivrs_mappings *));
 int iterate_ivrs_entries(int (*)(u16 seg, struct ivrs_mappings *));
 
+/* iommu tables in guest space */
+struct mmio_reg {
+    uint32_t    lo;
+    uint32_t    hi;
+};
+
+struct guest_dev_table {
+    struct mmio_reg         reg_base;
+    uint32_t                size;
+};
+
+struct guest_buffer {
+    struct mmio_reg         reg_base;
+    struct mmio_reg         reg_tail;
+    struct mmio_reg         reg_head;
+    uint32_t                entries;
+};
+
+struct guest_iommu_msi {
+    uint8_t                 vector;
+    uint8_t                 dest;
+    uint8_t                 dest_mode;
+    uint8_t                 delivery_mode;
+    uint8_t                 trig_mode;
+};
+
+/* virtual IOMMU structure */
+struct guest_iommu {
+
+    struct domain          *domain;
+    spinlock_t              lock;
+    bool_t                  enabled;
+
+    struct guest_dev_table  dev_table;
+    struct guest_buffer     cmd_buffer;
+    struct guest_buffer     event_log;
+    struct guest_buffer     ppr_log;
+
+    struct tasklet          cmd_buffer_tasklet;
+
+    uint64_t                mmio_base;             /* MMIO base address */
+
+    /* MMIO regs */
+    struct mmio_reg         reg_ctrl;              /* MMIO offset 0018h */
+    struct mmio_reg         reg_status;            /* MMIO offset 2020h */
+    struct mmio_reg         reg_ext_feature;       /* MMIO offset 0030h */
+
+    /* guest interrupt settings */
+    struct guest_iommu_msi  msi;
+};
+
 #endif /* _ASM_X86_64_AMD_IOMMU_H */
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/hvm/io.h
--- a/xen/include/asm-x86/hvm/io.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/hvm/io.h	Thu Jan 12 13:50:50 2012 +0100
@@ -69,8 +69,9 @@
 extern const struct hvm_mmio_handler vlapic_mmio_handler;
 extern const struct hvm_mmio_handler vioapic_mmio_handler;
 extern const struct hvm_mmio_handler msixtbl_mmio_handler;
+extern const struct hvm_mmio_handler iommu_mmio_handler;
 
-#define HVM_MMIO_HANDLER_NR 4
+#define HVM_MMIO_HANDLER_NR 5
 
 int hvm_io_intercept(ioreq_t *p, int type);
 void register_io_handler(
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:50:50 2012 +0100
@@ -113,6 +113,13 @@
 #define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT	12
 
 /* DeviceTable Entry[63:32] */
+#define IOMMU_DEV_TABLE_GV_SHIFT                    23
+#define IOMMU_DEV_TABLE_GV_MASK                     0x800000
+#define IOMMU_DEV_TABLE_GLX_SHIFT                   24
+#define IOMMU_DEV_TABLE_GLX_MASK                    0x3000000
+#define IOMMU_DEV_TABLE_GCR3_1_SHIFT                26
+#define IOMMU_DEV_TABLE_GCR3_1_MASK                 0x1c000000
+
 #define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_HIGH_MASK	0x000FFFFF
 #define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_HIGH_SHIFT	0
 #define IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK		0x20000000
@@ -123,6 +130,8 @@
 /* DeviceTable Entry[95:64] */
 #define IOMMU_DEV_TABLE_DOMAIN_ID_MASK	0x0000FFFF
 #define IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT	0
+#define IOMMU_DEV_TABLE_GCR3_2_SHIFT                16
+#define IOMMU_DEV_TABLE_GCR3_2_MASK                 0xFFFF0000
 
 /* DeviceTable Entry[127:96] */
 #define IOMMU_DEV_TABLE_IOTLB_SUPPORT_MASK		0x00000001
@@ -151,6 +160,8 @@
 #define IOMMU_DEV_TABLE_INT_TABLE_IGN_UNMAPPED_SHIFT      5
 #define IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK      0xFFFFFFC0
 #define IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_SHIFT     6
+#define IOMMU_DEV_TABLE_GCR3_3_SHIFT                11
+#define IOMMU_DEV_TABLE_GCR3_3_MASK                 0xfffff800
 
 /* DeviceTable Entry[191:160] */
 #define IOMMU_DEV_TABLE_INT_TABLE_PTR_HIGH_MASK     0x000FFFFF
@@ -179,6 +190,7 @@
 #define IOMMU_CMD_INVALIDATE_IOMMU_PAGES	0x3
 #define IOMMU_CMD_INVALIDATE_IOTLB_PAGES	0x4
 #define IOMMU_CMD_INVALIDATE_INT_TABLE		0x5
+#define IOMMU_CMD_COMPLETE_PPR_REQUEST      0x7
 #define IOMMU_CMD_INVALIDATE_IOMMU_ALL      0x8
 
 /* COMPLETION_WAIT command */
@@ -265,6 +277,28 @@
 #define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
 
+/* PPR Log */
+#define IOMMU_PPR_LOG_ENTRY_SIZE                        16
+#define IOMMU_PPR_LOG_POWER_OF2_ENTRIES_PER_PAGE        8
+#define IOMMU_PPR_LOG_U32_PER_ENTRY   (IOMMU_PPR_LOG_ENTRY_SIZE / 4)
+
+#define IOMMU_PPR_LOG_BASE_LOW_OFFSET                   0x0038
+#define IOMMU_PPR_LOG_BASE_HIGH_OFFSET                  0x003C
+#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000
+#define IOMMU_PPR_LOG_BASE_LOW_SHIFT                    12
+#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFF
+#define IOMMU_PPR_LOG_BASE_HIGH_SHIFT                   0
+#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000
+#define IOMMU_PPR_LOG_LENGTH_SHIFT                      24
+#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_HEAD_SHIFT                        4
+#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_TAIL_SHIFT                        4
+#define IOMMU_PPR_LOG_HEAD_OFFSET                       0x2030
+#define IOMMU_PPR_LOG_TAIL_OFFSET                       0x2038
+#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_PPR_LOG_DEVICE_ID_SHIFT                   0
+
 /* Control Register */
 #define IOMMU_CONTROL_MMIO_OFFSET			0x18
 #define IOMMU_CONTROL_TRANSLATION_ENABLE_MASK		0x00000001
@@ -292,6 +326,11 @@
 #define IOMMU_CONTROL_RESTART_MASK			0x80000000
 #define IOMMU_CONTROL_RESTART_SHIFT			31
 
+#define IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT      13
+#define IOMMU_CONTROL_PPR_INT_SHIFT             14
+#define IOMMU_CONTROL_PPR_ENABLE_SHIFT          15
+#define IOMMU_CONTROL_GT_ENABLE_SHIFT           16
+
 /* Exclusion Register */
 #define IOMMU_EXCLUSION_BASE_LOW_OFFSET		0x20
 #define IOMMU_EXCLUSION_BASE_HIGH_OFFSET	0x24
@@ -325,7 +364,8 @@
 #define IOMMU_EXT_FEATURE_HATS_MASK                     0x00000C00
 #define IOMMU_EXT_FEATURE_GATS_SHIFT                    0x12
 #define IOMMU_EXT_FEATURE_GATS_MASK                     0x00003000
-#define IOMMU_EXT_FEATURE_GLXSUP                        0x14
+#define IOMMU_EXT_FEATURE_GLXSUP_SHIFT                  0x14
+#define IOMMU_EXT_FEATURE_GLXSUP_MASK                   0x0000C000
 
 #define IOMMU_EXT_FEATURE_PASMAX_SHIFT                  0x0
 #define IOMMU_EXT_FEATURE_PASMAX_MASK                   0x0000001F
@@ -342,6 +382,9 @@
 #define IOMMU_STATUS_EVENT_LOG_RUN_SHIFT	3
 #define IOMMU_STATUS_CMD_BUFFER_RUN_MASK	0x00000010
 #define IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT	4
+#define IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT     5
+#define IOMMU_STATUS_PPR_LOG_INT_SHIFT          6
+#define IOMMU_STATUS_PPR_LOG_RUN_SHIFT          7
 
 /* I/O Page Table */
 #define IOMMU_PAGE_TABLE_ENTRY_SIZE	8
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:50:50 2012 +0100
@@ -71,6 +71,8 @@
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid);
 void iommu_dte_set_iotlb(u32 *dte, u8 i);
 void iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev);
+void iommu_dte_set_guest_cr3(u32 *dte, u16 dom_id, u64 gcr3,
+                             int gv, unsigned int glx);
 
 /* send cmd to iommu */
 void amd_iommu_flush_all_pages(struct domain *d);
@@ -106,6 +108,14 @@
 void amd_iommu_suspend(void);
 void amd_iommu_crash_shutdown(void);
 
+/* guest iommu support */
+void amd_iommu_send_guest_cmd(struct amd_iommu *iommu, u32 cmd[]);
+void guest_iommu_add_ppr_log(struct domain *d, u32 entry[]);
+void guest_iommu_add_event_log(struct domain *d, u32 entry[]);
+int guest_iommu_init(struct domain* d);
+void guest_iommu_destroy(struct domain *d);
+int guest_iommu_set_base(struct domain *d, uint64_t base);
+
 static inline u32 get_field_from_reg_u32(u32 reg_value, u32 mask, u32 shift)
 {
     u32 field;
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/xen/hvm/iommu.h
--- a/xen/include/xen/hvm/iommu.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/xen/hvm/iommu.h	Thu Jan 12 13:50:50 2012 +0100
@@ -47,6 +47,7 @@
     int domain_id;
     int paging_mode;
     struct page_info *root_table;
+    struct guest_iommu *g_iommu;
 
     /* iommu_ops */
     const struct iommu_ops *platform_ops;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000vC-6T; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000gb-Ng
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327010122!11550900!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 726 invoked from network); 19 Jan 2012 21:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:23 -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 1Rnzx4-0007Qp-CT
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx4-0000fd-Ay
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:22 +0000
Message-Id: <E1Rnzx4-0000fd-Ay@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Add iommu emulation for
	hvm guest
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372650 -3600
# Node ID 6c104b46ef8977a8cac58f3c700f2ded6e03c557
# Parent  522d544f40318079678ddc1d0885e9e8287fb33a
amd iommu: Add iommu emulation for hvm guest

ATS device driver that support PASID [1] and PRI [2] capabilites needs
to work with iommu driver in guest OS. We have to expose iommu
functionality to HVM guest, if we want assign ATS device to it. A new
hypervisor mmio handler is added to intercept iommu mmio accesses from
guest.

Signed-off-by: Wei Wang <wei.wang2@amd.com>

[1] http://www.pcisig.com/specifications/pciexpress/specifications/ECN-PASID-ATS-2011-03-31.pdf
[2] http://www.pcisig.com/members/downloads/specifications/iov/ats_r1.1_26Jan09.pdf
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 522d544f4031 -r 6c104b46ef89 xen/arch/x86/hvm/intercept.c
--- a/xen/arch/x86/hvm/intercept.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/arch/x86/hvm/intercept.c	Thu Jan 12 13:50:50 2012 +0100
@@ -38,7 +38,8 @@
     &hpet_mmio_handler,
     &vlapic_mmio_handler,
     &vioapic_mmio_handler,
-    &msixtbl_mmio_handler
+    &msixtbl_mmio_handler,
+    &iommu_mmio_handler
 };
 
 static int hvm_mmio_access(struct vcpu *v,
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/Makefile
--- a/xen/drivers/passthrough/amd/Makefile	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/Makefile	Thu Jan 12 13:50:50 2012 +0100
@@ -5,3 +5,4 @@
 obj-bin-y += iommu_acpi.init.o
 obj-y += iommu_intr.o
 obj-y += iommu_cmd.o
+obj-y += iommu_guest.o
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Thu Jan 12 13:50:50 2012 +0100
@@ -398,3 +398,15 @@
     invalidate_iommu_all(iommu);
     flush_command_buffer(iommu);
 }
+
+void amd_iommu_send_guest_cmd(struct amd_iommu *iommu, u32 cmd[])
+{
+    unsigned long flags;
+
+    spin_lock_irqsave(&iommu->lock, flags);
+
+    send_iommu_command(iommu, cmd);
+    flush_command_buffer(iommu);
+
+    spin_unlock_irqrestore(&iommu->lock, flags);
+}
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/iommu_guest.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/drivers/passthrough/amd/iommu_guest.c	Thu Jan 12 13:50:50 2012 +0100
@@ -0,0 +1,911 @@
+/*
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Author: Wei Wang <wei.wang2@amd.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#include <xen/sched.h>
+#include <asm/p2m.h>
+#include <asm/hvm/iommu.h>
+#include <asm/amd-iommu.h>
+#include <asm/hvm/svm/amd-iommu-proto.h>
+
+
+#define IOMMU_MMIO_SIZE                         0x8000
+#define IOMMU_MMIO_PAGE_NR                      0x8
+#define RING_BF_LENGTH_MASK                     0x0F000000
+#define RING_BF_LENGTH_SHIFT                    24
+
+#define PASMAX_9_bit                            0x8
+#define GUEST_CR3_1_LEVEL                       0x0
+#define GUEST_ADDRESS_SIZE_6_LEVEL              0x2
+#define HOST_ADDRESS_SIZE_6_LEVEL               0x2
+
+#define guest_iommu_set_status(iommu, bit) \
+        iommu_set_bit(&((iommu)->reg_status.lo), bit)
+
+#define guest_iommu_clear_status(iommu, bit) \
+        iommu_clear_bit(&((iommu)->reg_status.lo), bit)
+
+#define reg_to_u64(reg) (((uint64_t)reg.hi << 32) | reg.lo )
+#define u64_to_reg(reg, val) \
+    do \
+    { \
+        (reg)->lo = (u32)(val); \
+        (reg)->hi = (val) >> 32; \
+    } while (0)
+
+static unsigned int machine_bdf(struct domain *d, uint16_t guest_bdf)
+{
+    return guest_bdf;
+}
+
+static uint16_t guest_bdf(struct domain *d, uint16_t machine_bdf)
+{
+    return machine_bdf;
+}
+
+static inline struct guest_iommu *domain_iommu(struct domain *d)
+{
+    return domain_hvm_iommu(d)->g_iommu;
+}
+
+static inline struct guest_iommu *vcpu_iommu(struct vcpu *v)
+{
+    return domain_hvm_iommu(v->domain)->g_iommu;
+}
+
+static void guest_iommu_enable(struct guest_iommu *iommu)
+{
+    iommu->enabled = 1;
+}
+
+static void guest_iommu_disable(struct guest_iommu *iommu)
+{
+    iommu->enabled = 0;
+}
+
+static uint64_t get_guest_cr3_from_dte(dev_entry_t *dte)
+{
+    uint64_t gcr3_1, gcr3_2, gcr3_3;
+
+    gcr3_1 = get_field_from_reg_u32(dte->data[1],
+                                    IOMMU_DEV_TABLE_GCR3_1_MASK,
+                                    IOMMU_DEV_TABLE_GCR3_1_SHIFT);
+    gcr3_2 = get_field_from_reg_u32(dte->data[2],
+                                    IOMMU_DEV_TABLE_GCR3_2_MASK,
+                                    IOMMU_DEV_TABLE_GCR3_2_SHIFT);
+    gcr3_3 = get_field_from_reg_u32(dte->data[3],
+                                    IOMMU_DEV_TABLE_GCR3_3_MASK,
+                                    IOMMU_DEV_TABLE_GCR3_3_SHIFT);
+
+    return ((gcr3_3 << 31) | (gcr3_2 << 15 ) | (gcr3_1 << 12)) >> PAGE_SHIFT;
+}
+
+static uint16_t get_domid_from_dte(dev_entry_t *dte)
+{
+    return get_field_from_reg_u32(dte->data[2], IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
+                                  IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT);
+}
+
+static uint16_t get_glx_from_dte(dev_entry_t *dte)
+{
+    return get_field_from_reg_u32(dte->data[1], IOMMU_DEV_TABLE_GLX_MASK,
+                                  IOMMU_DEV_TABLE_GLX_SHIFT);
+}
+
+static uint16_t get_gv_from_dte(dev_entry_t *dte)
+{
+    return get_field_from_reg_u32(dte->data[1],IOMMU_DEV_TABLE_GV_MASK,
+                                  IOMMU_DEV_TABLE_GV_SHIFT);
+}
+
+static unsigned int host_domid(struct domain *d, uint64_t g_domid)
+{
+    /* Only support one PPR device in guest for now */
+    return d->domain_id;
+}
+
+static unsigned long get_gfn_from_base_reg(uint64_t base_raw)
+{
+    struct mmio_reg reg;
+    uint64_t addr64;
+
+    reg.lo = iommu_get_addr_lo_from_reg(base_raw & DMA_32BIT_MASK);
+    reg.hi = iommu_get_addr_hi_from_reg(base_raw >> 32);
+    addr64 = reg_to_u64(reg);
+
+    ASSERT ( addr64 != 0 );
+
+    return addr64 >> PAGE_SHIFT;
+}
+
+static void guest_iommu_deliver_msi(struct domain *d)
+{
+    uint8_t vector, dest, dest_mode, delivery_mode, trig_mode;
+    struct guest_iommu *iommu = domain_iommu(d);
+
+    vector = iommu->msi.vector;
+    dest = iommu->msi.dest;
+    dest_mode = iommu->msi.dest_mode;
+    delivery_mode = iommu->msi.delivery_mode;
+    trig_mode = iommu->msi.trig_mode;
+
+    vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
+}
+
+static unsigned long guest_iommu_get_table_mfn(struct domain *d,
+                                               uint64_t base_raw,
+                                               unsigned int entry_size,
+                                               unsigned int pos)
+{
+    unsigned long idx, gfn, mfn;
+    p2m_type_t p2mt;
+
+    gfn = get_gfn_from_base_reg(base_raw);
+    idx = (pos * entry_size) >> PAGE_SHIFT;
+
+    mfn = mfn_x(get_gfn(d, gfn + idx, &p2mt));
+    put_gfn(d, gfn);
+
+    return mfn;
+}
+
+static void guest_iommu_enable_dev_table(struct guest_iommu *iommu)
+{
+    uint32_t length_raw = get_field_from_reg_u32(iommu->dev_table.reg_base.lo,
+                                                 IOMMU_DEV_TABLE_SIZE_MASK,
+                                                 IOMMU_DEV_TABLE_SIZE_SHIFT);
+    iommu->dev_table.size = (length_raw + 1) * PAGE_SIZE;
+}
+
+static void guest_iommu_enable_ring_buffer(struct guest_iommu *iommu,
+                                           struct guest_buffer *buffer,
+                                           uint32_t entry_size)
+{
+    uint32_t length_raw = get_field_from_reg_u32(buffer->reg_base.hi,
+                                                 RING_BF_LENGTH_MASK,
+                                                 RING_BF_LENGTH_SHIFT);
+    buffer->entries = 1 << length_raw;
+}
+
+void guest_iommu_add_ppr_log(struct domain *d, u32 entry[])
+{
+    uint16_t gdev_id;
+    unsigned long mfn, tail, head;
+    ppr_entry_t *log, *log_base;
+    struct guest_iommu *iommu;
+
+    iommu = domain_iommu(d);
+    tail = iommu_get_rb_pointer(iommu->ppr_log.reg_tail.lo);
+    head = iommu_get_rb_pointer(iommu->ppr_log.reg_head.lo);
+
+    if ( tail >= iommu->ppr_log.entries || head >= iommu->ppr_log.entries )
+    {
+        AMD_IOMMU_DEBUG("Error: guest iommu ppr log overflows\n");
+        guest_iommu_disable(iommu);
+        return;
+    }
+
+    mfn = guest_iommu_get_table_mfn(d, reg_to_u64(iommu->ppr_log.reg_base),
+                                    sizeof(ppr_entry_t), tail);
+    ASSERT(mfn_valid(mfn));
+
+    log_base = map_domain_page(mfn);
+    log = log_base + tail % (PAGE_SIZE / sizeof(ppr_entry_t));
+
+    /* Convert physical device id back into virtual device id */
+    gdev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
+    iommu_set_devid_to_cmd(&entry[0], gdev_id);
+
+    memcpy(log, entry, sizeof(ppr_entry_t));
+
+    /* Now shift ppr log tail pointer */
+    if ( ++tail >= iommu->ppr_log.entries )
+    {
+        tail = 0;
+        guest_iommu_set_status(iommu, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT);
+    }
+    iommu_set_rb_pointer(&iommu->ppr_log.reg_tail.lo, tail);
+    unmap_domain_page(log_base);
+
+    guest_iommu_deliver_msi(d);
+}
+
+void guest_iommu_add_event_log(struct domain *d, u32 entry[])
+{
+    uint16_t dev_id;
+    unsigned long mfn, tail, head;
+    event_entry_t *log, *log_base;
+    struct guest_iommu *iommu;
+
+    iommu = domain_iommu(d);
+    tail = iommu_get_rb_pointer(iommu->event_log.reg_tail.lo);
+    head = iommu_get_rb_pointer(iommu->event_log.reg_head.lo);
+
+    if ( tail >= iommu->event_log.entries || head >= iommu->event_log.entries )
+    {
+        AMD_IOMMU_DEBUG("Error: guest iommu event overflows\n");
+        guest_iommu_disable(iommu);
+        return;
+    }
+
+    mfn = guest_iommu_get_table_mfn(d, reg_to_u64(iommu->event_log.reg_base),
+                                    sizeof(event_entry_t), tail);
+    ASSERT(mfn_valid(mfn));
+
+    log_base = map_domain_page(mfn);
+    log = log_base + tail % (PAGE_SIZE / sizeof(event_entry_t));
+
+    /* re-write physical device id into virtual device id */
+    dev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
+    iommu_set_devid_to_cmd(&entry[0], dev_id);
+    memcpy(log, entry, sizeof(event_entry_t));
+
+    /* Now shift event log tail pointer */
+    if ( ++tail >= iommu->event_log.entries )
+    {
+        tail = 0;
+        guest_iommu_set_status(iommu, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
+    }
+
+    iommu_set_rb_pointer(&iommu->event_log.reg_tail.lo, tail);
+    unmap_domain_page(log_base);
+
+    guest_iommu_deliver_msi(d);
+}
+
+static int do_complete_ppr_request(struct domain *d, cmd_entry_t *cmd)
+{
+    uint16_t dev_id;
+    struct amd_iommu *iommu;
+
+    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
+    iommu = find_iommu_for_device(0, dev_id);
+
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x\n",
+                        __func__, dev_id);
+        return -ENODEV;
+    }
+
+    /* replace virtual device id into physical */
+    iommu_set_devid_to_cmd(&cmd->data[0], dev_id);
+    amd_iommu_send_guest_cmd(iommu, cmd->data);
+
+    return 0;
+}
+
+static int do_invalidate_pages(struct domain *d, cmd_entry_t *cmd)
+{
+    uint16_t gdom_id, hdom_id;
+    struct amd_iommu *iommu = NULL;
+
+    gdom_id = get_field_from_reg_u32(cmd->data[1],
+                                    IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
+                                    IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT);
+
+    hdom_id = host_domid(d, gdom_id);
+    set_field_in_reg_u32(hdom_id, cmd->data[1],
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK,
+                         IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT, &cmd->data[1]);
+
+    for_each_amd_iommu ( iommu )
+        amd_iommu_send_guest_cmd(iommu, cmd->data);
+
+    return 0;
+}
+
+static int do_invalidate_all(struct domain *d, cmd_entry_t *cmd)
+{
+    struct amd_iommu *iommu = NULL;
+
+    for_each_amd_iommu ( iommu )
+        amd_iommu_flush_all_pages(d);
+
+    return 0;
+}
+
+static int do_invalidate_iotlb_pages(struct domain *d, cmd_entry_t *cmd)
+{
+    struct amd_iommu *iommu;
+    uint16_t dev_id;
+
+    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
+
+    iommu = find_iommu_for_device(0, dev_id);
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x\n",
+                         __func__, dev_id);
+        return -ENODEV;
+    }
+
+    iommu_set_devid_to_cmd(&cmd->data[0], dev_id);
+    amd_iommu_send_guest_cmd(iommu, cmd->data);
+
+    return 0;
+}
+
+static int do_completion_wait(struct domain *d, cmd_entry_t *cmd)
+{
+    bool_t com_wait_int_en, com_wait_int, i, s;
+    struct guest_iommu *iommu;
+    unsigned long gfn;
+    p2m_type_t p2mt;
+
+    iommu = domain_iommu(d);
+
+    i = iommu_get_bit(cmd->data[0], IOMMU_COMP_WAIT_I_FLAG_SHIFT);
+    s = iommu_get_bit(cmd->data[0], IOMMU_COMP_WAIT_S_FLAG_SHIFT);
+
+    if ( i )
+        guest_iommu_set_status(iommu, IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
+
+    if ( s )
+    {
+        uint64_t gaddr_lo, gaddr_hi, gaddr_64, data;
+        void *vaddr;
+
+        data = (uint64_t)cmd->data[3] << 32 | cmd->data[2];
+        gaddr_lo = get_field_from_reg_u32(cmd->data[0],
+                                          IOMMU_COMP_WAIT_ADDR_LOW_MASK,
+                                          IOMMU_COMP_WAIT_ADDR_LOW_SHIFT);
+        gaddr_hi = get_field_from_reg_u32(cmd->data[1],
+                                          IOMMU_COMP_WAIT_ADDR_HIGH_MASK,
+                                          IOMMU_COMP_WAIT_ADDR_HIGH_SHIFT);
+
+        gaddr_64 = (gaddr_hi << 32) | (gaddr_lo << 3);
+
+        gfn = gaddr_64 >> PAGE_SHIFT;
+        vaddr = map_domain_page(mfn_x(get_gfn(d, gfn ,&p2mt)));
+        put_gfn(d, gfn);
+
+        write_u64_atomic((uint64_t *)(vaddr + (gaddr_64 & (PAGE_SIZE-1))),
+                         data);
+        unmap_domain_page(vaddr);
+    }
+
+    com_wait_int_en = iommu_get_bit(iommu->reg_ctrl.lo,
+                                    IOMMU_CONTROL_COMP_WAIT_INT_SHIFT);
+    com_wait_int = iommu_get_bit(iommu->reg_status.lo,
+                                 IOMMU_STATUS_COMP_WAIT_INT_SHIFT);
+
+    if ( com_wait_int_en && com_wait_int )
+        guest_iommu_deliver_msi(d);
+
+    return 0;
+}
+
+static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
+{
+    uint16_t gbdf, mbdf, req_id, gdom_id, hdom_id;
+    dev_entry_t *gdte, *mdte, *dte_base;
+    struct amd_iommu *iommu = NULL;
+    struct guest_iommu *g_iommu;
+    uint64_t gcr3_gfn, gcr3_mfn;
+    uint8_t glx, gv;
+    unsigned long dte_mfn, flags;
+    p2m_type_t p2mt;
+
+    g_iommu = domain_iommu(d);
+    gbdf = iommu_get_devid_from_cmd(cmd->data[0]);
+    mbdf = machine_bdf(d, gbdf);
+
+    /* Guest can only update DTEs for its passthru devices */
+    if ( mbdf == 0 || gbdf == 0 )
+        return 0;
+
+    /* Sometimes guest invalidates devices from non-exists dtes */
+    if ( (gbdf * sizeof(dev_entry_t)) > g_iommu->dev_table.size )
+        return 0;
+
+    dte_mfn = guest_iommu_get_table_mfn(d,
+                                        reg_to_u64(g_iommu->dev_table.reg_base),
+                                        sizeof(dev_entry_t), gbdf);
+    ASSERT(mfn_valid(dte_mfn));
+
+    dte_base = map_domain_page(dte_mfn);
+
+    gdte = dte_base + gbdf % (PAGE_SIZE / sizeof(dev_entry_t));
+
+    gdom_id  = get_domid_from_dte(gdte);
+    gcr3_gfn = get_guest_cr3_from_dte(gdte);
+
+    /* Do not update host dte before gcr3 has been set */
+    if ( gcr3_gfn == 0 )
+        return 0;
+
+    gcr3_mfn = mfn_x(get_gfn(d, gcr3_gfn, &p2mt));
+    put_gfn(d, gcr3_gfn);
+
+    ASSERT(mfn_valid(gcr3_mfn));
+
+    /* Read guest dte information */
+    iommu = find_iommu_for_device(0, mbdf);
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x!\n",
+                        __func__, mbdf);
+        return -ENODEV;
+    }
+
+    glx = get_glx_from_dte(gdte);
+    gv = get_gv_from_dte(gdte);
+
+    unmap_domain_page(dte_base);
+
+    /* Setup host device entry */
+    hdom_id = host_domid(d, gdom_id);
+    req_id = get_dma_requestor_id(iommu->seg, mbdf);
+    mdte = iommu->dev_table.buffer + (req_id * sizeof(dev_entry_t));
+
+    spin_lock_irqsave(&iommu->lock, flags);
+    iommu_dte_set_guest_cr3((u32 *)mdte, hdom_id,
+                            gcr3_mfn << PAGE_SHIFT, gv, glx);
+
+    amd_iommu_flush_device(iommu, req_id);
+    spin_unlock_irqrestore(&iommu->lock, flags);
+
+    return 0;
+}
+
+static void guest_iommu_process_command(unsigned long _d)
+{
+    unsigned long opcode, tail, head, entries_per_page, cmd_mfn;
+    cmd_entry_t *cmd, *cmd_base;
+    struct domain *d = (struct domain *)_d;
+    struct guest_iommu *iommu;
+
+    iommu = domain_iommu(d);
+
+    if ( !iommu->enabled )
+        return;
+
+    head = iommu_get_rb_pointer(iommu->cmd_buffer.reg_head.lo);
+    tail = iommu_get_rb_pointer(iommu->cmd_buffer.reg_tail.lo);
+
+    /* Tail pointer is rolled over by guest driver, value outside
+     * cmd_buffer_entries cause iommu disabled
+     */
+
+    if ( tail >= iommu->cmd_buffer.entries ||
+         head >= iommu->cmd_buffer.entries )
+    {
+        AMD_IOMMU_DEBUG("Error: guest iommu cmd buffer overflows\n");
+        guest_iommu_disable(iommu);
+        return;
+    }
+
+    entries_per_page = PAGE_SIZE / sizeof(cmd_entry_t);
+
+    while ( head != tail )
+    {
+        int ret = 0;
+
+        cmd_mfn = guest_iommu_get_table_mfn(d,
+                                            reg_to_u64(iommu->cmd_buffer.reg_base),
+                                            sizeof(cmd_entry_t), head);
+        ASSERT(mfn_valid(cmd_mfn));
+
+        cmd_base = map_domain_page(cmd_mfn);
+        cmd = cmd_base + head % entries_per_page;
+
+        opcode = get_field_from_reg_u32(cmd->data[1],
+                                        IOMMU_CMD_OPCODE_MASK,
+                                        IOMMU_CMD_OPCODE_SHIFT);
+        switch ( opcode )
+        {
+        case IOMMU_CMD_COMPLETION_WAIT:
+            ret = do_completion_wait(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY:
+            ret = do_invalidate_dte(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_IOMMU_PAGES:
+            ret = do_invalidate_pages(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_IOTLB_PAGES:
+            ret = do_invalidate_iotlb_pages(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_INT_TABLE:
+            break;
+        case IOMMU_CMD_COMPLETE_PPR_REQUEST:
+            ret = do_complete_ppr_request(d, cmd);
+            break;
+        case IOMMU_CMD_INVALIDATE_IOMMU_ALL:
+            ret = do_invalidate_all(d, cmd);
+            break;
+        default:
+            AMD_IOMMU_DEBUG("CMD: Unknown command cmd_type = %lx "
+                            "head = %ld\n", opcode, head);
+            break;
+        }
+
+        unmap_domain_page(cmd_base);
+        if ( ++head >= iommu->cmd_buffer.entries )
+            head = 0;
+        if ( ret )
+            guest_iommu_disable(iommu);
+    }
+
+    /* Now shift cmd buffer head pointer */
+    iommu_set_rb_pointer(&iommu->cmd_buffer.reg_head.lo, head);
+    return;
+}
+
+static int guest_iommu_write_ctrl(struct guest_iommu *iommu, uint64_t newctrl)
+{
+    bool_t cmd_en, event_en, iommu_en, ppr_en, ppr_log_en;
+    bool_t cmd_en_old, event_en_old, iommu_en_old;
+    bool_t cmd_run;
+
+    iommu_en = iommu_get_bit(newctrl,
+                             IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT);
+    iommu_en_old = iommu_get_bit(iommu->reg_ctrl.lo,
+                                 IOMMU_CONTROL_TRANSLATION_ENABLE_SHIFT);
+
+    cmd_en = iommu_get_bit(newctrl,
+                           IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT);
+    cmd_en_old = iommu_get_bit(iommu->reg_ctrl.lo,
+                               IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT);
+    cmd_run = iommu_get_bit(iommu->reg_status.lo,
+                            IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT);
+    event_en = iommu_get_bit(newctrl,
+                             IOMMU_CONTROL_EVENT_LOG_ENABLE_SHIFT);
+    event_en_old = iommu_get_bit(iommu->reg_ctrl.lo,
+                                 IOMMU_CONTROL_EVENT_LOG_ENABLE_SHIFT);
+
+    ppr_en = iommu_get_bit(newctrl,
+                           IOMMU_CONTROL_PPR_ENABLE_SHIFT);
+    ppr_log_en = iommu_get_bit(newctrl,
+                               IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT);
+
+    if ( iommu_en )
+    {
+        guest_iommu_enable(iommu);
+        guest_iommu_enable_dev_table(iommu);
+    }
+
+    if ( iommu_en && cmd_en )
+    {
+        guest_iommu_enable_ring_buffer(iommu, &iommu->cmd_buffer,
+                                       sizeof(cmd_entry_t));
+        /* Enable iommu command processing */
+        tasklet_schedule(&iommu->cmd_buffer_tasklet);
+    }
+
+    if ( iommu_en && event_en )
+    {
+        guest_iommu_enable_ring_buffer(iommu, &iommu->event_log,
+                                       sizeof(event_entry_t));
+        guest_iommu_set_status(iommu, IOMMU_STATUS_EVENT_LOG_RUN_SHIFT);
+        guest_iommu_clear_status(iommu, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
+    }
+
+    if ( iommu_en && ppr_en && ppr_log_en )
+    {
+        guest_iommu_enable_ring_buffer(iommu, &iommu->ppr_log,
+                                       sizeof(ppr_entry_t));
+        guest_iommu_set_status(iommu, IOMMU_STATUS_PPR_LOG_RUN_SHIFT);
+        guest_iommu_clear_status(iommu, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT);
+    }
+
+    if ( iommu_en && cmd_en_old && !cmd_en )
+    {
+        /* Disable iommu command processing */
+        tasklet_kill(&iommu->cmd_buffer_tasklet);
+    }
+
+    if ( event_en_old && !event_en )
+        guest_iommu_clear_status(iommu, IOMMU_STATUS_EVENT_LOG_RUN_SHIFT);
+
+    if ( iommu_en_old && !iommu_en )
+        guest_iommu_disable(iommu);
+
+    u64_to_reg(&iommu->reg_ctrl, newctrl);
+    return 0;
+}
+
+static uint64_t iommu_mmio_read64(struct guest_iommu *iommu,
+                                  unsigned long offset)
+{
+    uint64_t val;
+
+    switch ( offset )
+    {
+    case IOMMU_DEV_TABLE_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->dev_table.reg_base);
+        break;
+    case IOMMU_CMD_BUFFER_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->cmd_buffer.reg_base);
+        break;
+    case IOMMU_EVENT_LOG_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->event_log.reg_base);
+        break;
+    case IOMMU_PPR_LOG_BASE_LOW_OFFSET:
+        val = reg_to_u64(iommu->ppr_log.reg_base);
+        break;
+    case IOMMU_CMD_BUFFER_HEAD_OFFSET:
+        val = reg_to_u64(iommu->cmd_buffer.reg_head);
+        break;
+    case IOMMU_CMD_BUFFER_TAIL_OFFSET:
+        val = reg_to_u64(iommu->cmd_buffer.reg_tail);
+        break;
+    case IOMMU_EVENT_LOG_HEAD_OFFSET:
+        val = reg_to_u64(iommu->event_log.reg_head);
+        break;
+    case IOMMU_EVENT_LOG_TAIL_OFFSET:
+        val = reg_to_u64(iommu->event_log.reg_tail);
+        break;
+    case IOMMU_PPR_LOG_HEAD_OFFSET:
+        val = reg_to_u64(iommu->ppr_log.reg_head);
+        break;
+    case IOMMU_PPR_LOG_TAIL_OFFSET:
+        val = reg_to_u64(iommu->ppr_log.reg_tail);
+        break;
+    case IOMMU_CONTROL_MMIO_OFFSET:
+        val = reg_to_u64(iommu->reg_ctrl);
+        break;
+    case IOMMU_STATUS_MMIO_OFFSET:
+        val = reg_to_u64(iommu->reg_status);
+        break;
+    case IOMMU_EXT_FEATURE_MMIO_OFFSET:
+        val = reg_to_u64(iommu->reg_ext_feature);
+        break;
+
+    default:
+        AMD_IOMMU_DEBUG("Guest reads unknown mmio offset = %lx\n", offset);
+        val = 0;
+        break;
+    }
+
+    return val;
+}
+
+static int guest_iommu_mmio_read(struct vcpu *v, unsigned long addr,
+                                 unsigned long len, unsigned long *pval)
+{
+    struct guest_iommu *iommu = vcpu_iommu(v);
+    unsigned long offset;
+    uint64_t val;
+    uint32_t mmio, shift;
+    uint64_t mask = 0;
+
+    offset = addr - iommu->mmio_base;
+
+    if ( unlikely((offset & (len - 1 )) || (len > 8)) )
+    {
+        AMD_IOMMU_DEBUG("iommu mmio read access is not aligned:"
+                        " offset = %lx, len = %lx\n", offset, len);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    mask = (len == 8) ? ~0ULL : (1ULL << (len * 8)) - 1;
+    shift = (offset & 7u) * 8;
+
+    /* mmio access is always aligned on 8-byte boundary */
+    mmio = offset & (~7u);
+
+    spin_lock(&iommu->lock);
+    val = iommu_mmio_read64(iommu, mmio);
+    spin_unlock(&iommu->lock);
+
+    *pval = (val >> shift ) & mask;
+
+    return X86EMUL_OKAY;
+}
+
+static void guest_iommu_mmio_write64(struct guest_iommu *iommu,
+                                    unsigned long offset, uint64_t val)
+{
+    switch ( offset )
+    {
+    case IOMMU_DEV_TABLE_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->dev_table.reg_base, val);
+        break;
+    case IOMMU_CMD_BUFFER_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->cmd_buffer.reg_base, val);
+        break;
+    case IOMMU_EVENT_LOG_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->event_log.reg_base, val);
+    case IOMMU_PPR_LOG_BASE_LOW_OFFSET:
+        u64_to_reg(&iommu->ppr_log.reg_base, val);
+        break;
+    case IOMMU_CONTROL_MMIO_OFFSET:
+        guest_iommu_write_ctrl(iommu, val);
+        break;
+    case IOMMU_CMD_BUFFER_HEAD_OFFSET:
+        u64_to_reg(&iommu->cmd_buffer.reg_head, val);
+        break;
+    case IOMMU_CMD_BUFFER_TAIL_OFFSET:
+        u64_to_reg(&iommu->cmd_buffer.reg_tail, val);
+        tasklet_schedule(&iommu->cmd_buffer_tasklet);
+        break;
+    case IOMMU_EVENT_LOG_HEAD_OFFSET:
+        u64_to_reg(&iommu->event_log.reg_head, val);
+        break;
+    case IOMMU_EVENT_LOG_TAIL_OFFSET:
+        u64_to_reg(&iommu->event_log.reg_tail, val);
+        break;
+    case IOMMU_PPR_LOG_HEAD_OFFSET:
+        u64_to_reg(&iommu->ppr_log.reg_head, val);
+        break;
+    case IOMMU_PPR_LOG_TAIL_OFFSET:
+        u64_to_reg(&iommu->ppr_log.reg_tail, val);
+        break;
+    case IOMMU_STATUS_MMIO_OFFSET:
+        u64_to_reg(&iommu->reg_status, val);
+        break;
+
+    default:
+        AMD_IOMMU_DEBUG("guest writes unknown mmio offset = %lx,"
+                        " val = %" PRIx64 "\n", offset, val);
+        break;
+    }
+}
+
+static int guest_iommu_mmio_write(struct vcpu *v, unsigned long addr,
+                                  unsigned long len, unsigned long val)
+{
+    struct guest_iommu *iommu = vcpu_iommu(v);
+    unsigned long offset;
+    uint64_t reg_old, mmio;
+    uint32_t shift;
+    uint64_t mask = 0;
+
+    offset = addr - iommu->mmio_base;
+
+    if ( unlikely((offset & (len - 1)) || (len > 8)) )
+    {
+        AMD_IOMMU_DEBUG("iommu mmio write access is not aligned:"
+                        " offset = %lx, len = %lx\n", offset, len);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    mask = (len == 8) ? ~0ULL : (1ULL << (len * 8)) - 1;
+    shift = (offset & 7) * 8;
+
+    /* mmio access is always aligned on 8-byte boundary */
+    mmio = offset & ~7;
+
+    spin_lock(&iommu->lock);
+
+    reg_old = iommu_mmio_read64(iommu, mmio);
+    reg_old &= ~(mask << shift);
+    val = reg_old | ((val & mask) << shift);
+    guest_iommu_mmio_write64(iommu, mmio, val);
+
+    spin_unlock(&iommu->lock);
+
+    return X86EMUL_OKAY;
+}
+
+int guest_iommu_set_base(struct domain *d, uint64_t base)
+{
+    p2m_type_t t;
+    struct guest_iommu *iommu = domain_iommu(d);
+
+    iommu->mmio_base = base;
+    base >>= PAGE_SHIFT;
+
+    for ( int i = 0; i < IOMMU_MMIO_PAGE_NR; i++ )
+    {
+        unsigned long gfn = base + i;
+
+        get_gfn_query(d, gfn, &t);
+        p2m_change_type(d, gfn, t, p2m_mmio_dm);
+        put_gfn(d, gfn);
+    }
+
+    return 0;
+}
+
+/* Initialize mmio read only bits */
+static void guest_iommu_reg_init(struct guest_iommu *iommu)
+{
+    uint32_t lower, upper;
+
+    lower = upper = 0;
+    /* Support prefetch */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_PREFSUP_SHIFT);
+    /* Support PPR log */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_PPRSUP_SHIFT);
+    /* Support guest translation */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_GTSUP_SHIFT);
+    /* Support invalidate all command */
+    iommu_set_bit(&lower,IOMMU_EXT_FEATURE_IASUP_SHIFT);
+
+    /* Host translation size has 6 levels */
+    set_field_in_reg_u32(HOST_ADDRESS_SIZE_6_LEVEL, lower,
+                         IOMMU_EXT_FEATURE_HATS_MASK,
+                         IOMMU_EXT_FEATURE_HATS_SHIFT,
+                         &lower);
+    /* Guest translation size has 6 levels */
+    set_field_in_reg_u32(GUEST_ADDRESS_SIZE_6_LEVEL, lower,
+                         IOMMU_EXT_FEATURE_GATS_MASK,
+                         IOMMU_EXT_FEATURE_GATS_SHIFT,
+                         &lower);
+    /* Single level gCR3 */
+    set_field_in_reg_u32(GUEST_CR3_1_LEVEL, lower,
+                         IOMMU_EXT_FEATURE_GLXSUP_MASK,
+                         IOMMU_EXT_FEATURE_GLXSUP_SHIFT, &lower);
+    /* 9 bit PASID */
+    set_field_in_reg_u32(PASMAX_9_bit, upper,
+                         IOMMU_EXT_FEATURE_PASMAX_MASK,
+                         IOMMU_EXT_FEATURE_PASMAX_SHIFT, &upper);
+
+    iommu->reg_ext_feature.lo = lower;
+    iommu->reg_ext_feature.hi = upper;
+}
+
+/* Domain specific initialization */
+int guest_iommu_init(struct domain* d)
+{
+    struct guest_iommu *iommu;
+    struct hvm_iommu *hd  = domain_hvm_iommu(d);
+
+    if ( !is_hvm_domain(d) )
+        return 0;
+
+    iommu = xzalloc(struct guest_iommu);
+    if ( !iommu )
+    {
+        AMD_IOMMU_DEBUG("Error allocating guest iommu structure.\n");
+        return 1;
+    }
+
+    guest_iommu_reg_init(iommu);
+    iommu->domain = d;
+    hd->g_iommu = iommu;
+
+    tasklet_init(&iommu->cmd_buffer_tasklet,
+                 guest_iommu_process_command, (unsigned long)d);
+
+    spin_lock_init(&iommu->lock);
+
+    return 0;
+}
+
+void guest_iommu_destroy(struct domain *d)
+{
+    struct guest_iommu *iommu;
+
+    if ( !is_hvm_domain(d) )
+        return;
+
+    iommu = domain_iommu(d);
+
+    tasklet_kill(&iommu->cmd_buffer_tasklet);
+    xfree(iommu);
+
+    domain_hvm_iommu(d)->g_iommu = NULL;
+}
+
+static int guest_iommu_mmio_range(struct vcpu *v, unsigned long addr)
+{
+    struct guest_iommu *iommu = vcpu_iommu(v);
+
+    return addr >= iommu->mmio_base &&
+           addr < iommu->mmio_base + IOMMU_MMIO_SIZE;
+}
+
+const struct hvm_mmio_handler iommu_mmio_handler = {
+    .check_handler = guest_iommu_mmio_range,
+    .read_handler = guest_iommu_mmio_read,
+    .write_handler = guest_iommu_mmio_write
+};
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/iommu_map.c
--- a/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_map.c	Thu Jan 12 13:50:50 2012 +0100
@@ -234,6 +234,53 @@
     dte[3] = entry;
 }
 
+void iommu_dte_set_guest_cr3(u32 *dte, u16 dom_id, u64 gcr3,
+                             int gv, unsigned int glx)
+{
+    u32 entry, gcr3_1, gcr3_2, gcr3_3;
+
+    gcr3_3 = gcr3 >> 31;
+    gcr3_2 = (gcr3 >> 15) & 0xFFFF;
+    gcr3_1 = (gcr3 >> PAGE_SHIFT) & 0x7;
+
+    /* I bit must be set when gcr3 is enabled */
+    entry = dte[3];
+    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+                         IOMMU_DEV_TABLE_IOTLB_SUPPORT_MASK,
+                         IOMMU_DEV_TABLE_IOTLB_SUPPORT_SHIFT, &entry);
+    /* update gcr3 */
+    set_field_in_reg_u32(gcr3_3, entry,
+                         IOMMU_DEV_TABLE_GCR3_3_MASK,
+                         IOMMU_DEV_TABLE_GCR3_3_SHIFT, &entry);
+    dte[3] = entry;
+
+    set_field_in_reg_u32(dom_id, entry,
+                         IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
+                         IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
+    /* update gcr3 */
+    entry = dte[2];
+    set_field_in_reg_u32(gcr3_2, entry,
+                         IOMMU_DEV_TABLE_GCR3_2_MASK,
+                         IOMMU_DEV_TABLE_GCR3_2_SHIFT, &entry);
+    dte[2] = entry;
+
+    entry = dte[1];
+    /* Enable GV bit */
+    set_field_in_reg_u32(!!gv, entry,
+                         IOMMU_DEV_TABLE_GV_MASK,
+                         IOMMU_DEV_TABLE_GV_SHIFT, &entry);
+
+    /* 1 level guest cr3 table  */
+    set_field_in_reg_u32(glx, entry,
+                         IOMMU_DEV_TABLE_GLX_MASK,
+                         IOMMU_DEV_TABLE_GLX_SHIFT, &entry);
+    /* update gcr3 */
+    set_field_in_reg_u32(gcr3_1, entry,
+                         IOMMU_DEV_TABLE_GCR3_1_MASK,
+                         IOMMU_DEV_TABLE_GCR3_1_SHIFT, &entry);
+    dte[1] = entry;
+}
+
 u64 amd_iommu_get_next_table_from_pte(u32 *entry)
 {
     u64 addr_lo, addr_hi, ptr;
diff -r 522d544f4031 -r 6c104b46ef89 xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Thu Jan 12 13:50:50 2012 +0100
@@ -260,6 +260,8 @@
 
     hd->domain_id = d->domain_id;
 
+    guest_iommu_init(d);
+
     return 0;
 }
 
@@ -443,6 +445,7 @@
 
 static void amd_iommu_domain_destroy(struct domain *d)
 {
+    guest_iommu_destroy(d);
     deallocate_iommu_page_tables(d);
     amd_iommu_flush_all_pages(d);
 }
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Jan 12 13:50:50 2012 +0100
@@ -24,6 +24,7 @@
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
+#include <xen/tasklet.h>
 #include <asm/hvm/svm/amd-iommu-defs.h>
 
 #define iommu_found()           (!list_empty(&amd_iommu_head))
@@ -129,4 +130,55 @@
 int iterate_ivrs_mappings(int (*)(u16 seg, struct ivrs_mappings *));
 int iterate_ivrs_entries(int (*)(u16 seg, struct ivrs_mappings *));
 
+/* iommu tables in guest space */
+struct mmio_reg {
+    uint32_t    lo;
+    uint32_t    hi;
+};
+
+struct guest_dev_table {
+    struct mmio_reg         reg_base;
+    uint32_t                size;
+};
+
+struct guest_buffer {
+    struct mmio_reg         reg_base;
+    struct mmio_reg         reg_tail;
+    struct mmio_reg         reg_head;
+    uint32_t                entries;
+};
+
+struct guest_iommu_msi {
+    uint8_t                 vector;
+    uint8_t                 dest;
+    uint8_t                 dest_mode;
+    uint8_t                 delivery_mode;
+    uint8_t                 trig_mode;
+};
+
+/* virtual IOMMU structure */
+struct guest_iommu {
+
+    struct domain          *domain;
+    spinlock_t              lock;
+    bool_t                  enabled;
+
+    struct guest_dev_table  dev_table;
+    struct guest_buffer     cmd_buffer;
+    struct guest_buffer     event_log;
+    struct guest_buffer     ppr_log;
+
+    struct tasklet          cmd_buffer_tasklet;
+
+    uint64_t                mmio_base;             /* MMIO base address */
+
+    /* MMIO regs */
+    struct mmio_reg         reg_ctrl;              /* MMIO offset 0018h */
+    struct mmio_reg         reg_status;            /* MMIO offset 2020h */
+    struct mmio_reg         reg_ext_feature;       /* MMIO offset 0030h */
+
+    /* guest interrupt settings */
+    struct guest_iommu_msi  msi;
+};
+
 #endif /* _ASM_X86_64_AMD_IOMMU_H */
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/hvm/io.h
--- a/xen/include/asm-x86/hvm/io.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/hvm/io.h	Thu Jan 12 13:50:50 2012 +0100
@@ -69,8 +69,9 @@
 extern const struct hvm_mmio_handler vlapic_mmio_handler;
 extern const struct hvm_mmio_handler vioapic_mmio_handler;
 extern const struct hvm_mmio_handler msixtbl_mmio_handler;
+extern const struct hvm_mmio_handler iommu_mmio_handler;
 
-#define HVM_MMIO_HANDLER_NR 4
+#define HVM_MMIO_HANDLER_NR 5
 
 int hvm_io_intercept(ioreq_t *p, int type);
 void register_io_handler(
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h	Thu Jan 12 13:50:50 2012 +0100
@@ -113,6 +113,13 @@
 #define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT	12
 
 /* DeviceTable Entry[63:32] */
+#define IOMMU_DEV_TABLE_GV_SHIFT                    23
+#define IOMMU_DEV_TABLE_GV_MASK                     0x800000
+#define IOMMU_DEV_TABLE_GLX_SHIFT                   24
+#define IOMMU_DEV_TABLE_GLX_MASK                    0x3000000
+#define IOMMU_DEV_TABLE_GCR3_1_SHIFT                26
+#define IOMMU_DEV_TABLE_GCR3_1_MASK                 0x1c000000
+
 #define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_HIGH_MASK	0x000FFFFF
 #define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_HIGH_SHIFT	0
 #define IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK		0x20000000
@@ -123,6 +130,8 @@
 /* DeviceTable Entry[95:64] */
 #define IOMMU_DEV_TABLE_DOMAIN_ID_MASK	0x0000FFFF
 #define IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT	0
+#define IOMMU_DEV_TABLE_GCR3_2_SHIFT                16
+#define IOMMU_DEV_TABLE_GCR3_2_MASK                 0xFFFF0000
 
 /* DeviceTable Entry[127:96] */
 #define IOMMU_DEV_TABLE_IOTLB_SUPPORT_MASK		0x00000001
@@ -151,6 +160,8 @@
 #define IOMMU_DEV_TABLE_INT_TABLE_IGN_UNMAPPED_SHIFT      5
 #define IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK      0xFFFFFFC0
 #define IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_SHIFT     6
+#define IOMMU_DEV_TABLE_GCR3_3_SHIFT                11
+#define IOMMU_DEV_TABLE_GCR3_3_MASK                 0xfffff800
 
 /* DeviceTable Entry[191:160] */
 #define IOMMU_DEV_TABLE_INT_TABLE_PTR_HIGH_MASK     0x000FFFFF
@@ -179,6 +190,7 @@
 #define IOMMU_CMD_INVALIDATE_IOMMU_PAGES	0x3
 #define IOMMU_CMD_INVALIDATE_IOTLB_PAGES	0x4
 #define IOMMU_CMD_INVALIDATE_INT_TABLE		0x5
+#define IOMMU_CMD_COMPLETE_PPR_REQUEST      0x7
 #define IOMMU_CMD_INVALIDATE_IOMMU_ALL      0x8
 
 /* COMPLETION_WAIT command */
@@ -265,6 +277,28 @@
 #define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
 
+/* PPR Log */
+#define IOMMU_PPR_LOG_ENTRY_SIZE                        16
+#define IOMMU_PPR_LOG_POWER_OF2_ENTRIES_PER_PAGE        8
+#define IOMMU_PPR_LOG_U32_PER_ENTRY   (IOMMU_PPR_LOG_ENTRY_SIZE / 4)
+
+#define IOMMU_PPR_LOG_BASE_LOW_OFFSET                   0x0038
+#define IOMMU_PPR_LOG_BASE_HIGH_OFFSET                  0x003C
+#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000
+#define IOMMU_PPR_LOG_BASE_LOW_SHIFT                    12
+#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFF
+#define IOMMU_PPR_LOG_BASE_HIGH_SHIFT                   0
+#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000
+#define IOMMU_PPR_LOG_LENGTH_SHIFT                      24
+#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_HEAD_SHIFT                        4
+#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_TAIL_SHIFT                        4
+#define IOMMU_PPR_LOG_HEAD_OFFSET                       0x2030
+#define IOMMU_PPR_LOG_TAIL_OFFSET                       0x2038
+#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_PPR_LOG_DEVICE_ID_SHIFT                   0
+
 /* Control Register */
 #define IOMMU_CONTROL_MMIO_OFFSET			0x18
 #define IOMMU_CONTROL_TRANSLATION_ENABLE_MASK		0x00000001
@@ -292,6 +326,11 @@
 #define IOMMU_CONTROL_RESTART_MASK			0x80000000
 #define IOMMU_CONTROL_RESTART_SHIFT			31
 
+#define IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT      13
+#define IOMMU_CONTROL_PPR_INT_SHIFT             14
+#define IOMMU_CONTROL_PPR_ENABLE_SHIFT          15
+#define IOMMU_CONTROL_GT_ENABLE_SHIFT           16
+
 /* Exclusion Register */
 #define IOMMU_EXCLUSION_BASE_LOW_OFFSET		0x20
 #define IOMMU_EXCLUSION_BASE_HIGH_OFFSET	0x24
@@ -325,7 +364,8 @@
 #define IOMMU_EXT_FEATURE_HATS_MASK                     0x00000C00
 #define IOMMU_EXT_FEATURE_GATS_SHIFT                    0x12
 #define IOMMU_EXT_FEATURE_GATS_MASK                     0x00003000
-#define IOMMU_EXT_FEATURE_GLXSUP                        0x14
+#define IOMMU_EXT_FEATURE_GLXSUP_SHIFT                  0x14
+#define IOMMU_EXT_FEATURE_GLXSUP_MASK                   0x0000C000
 
 #define IOMMU_EXT_FEATURE_PASMAX_SHIFT                  0x0
 #define IOMMU_EXT_FEATURE_PASMAX_MASK                   0x0000001F
@@ -342,6 +382,9 @@
 #define IOMMU_STATUS_EVENT_LOG_RUN_SHIFT	3
 #define IOMMU_STATUS_CMD_BUFFER_RUN_MASK	0x00000010
 #define IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT	4
+#define IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT     5
+#define IOMMU_STATUS_PPR_LOG_INT_SHIFT          6
+#define IOMMU_STATUS_PPR_LOG_RUN_SHIFT          7
 
 /* I/O Page Table */
 #define IOMMU_PAGE_TABLE_ENTRY_SIZE	8
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Thu Jan 12 13:50:50 2012 +0100
@@ -71,6 +71,8 @@
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid);
 void iommu_dte_set_iotlb(u32 *dte, u8 i);
 void iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev);
+void iommu_dte_set_guest_cr3(u32 *dte, u16 dom_id, u64 gcr3,
+                             int gv, unsigned int glx);
 
 /* send cmd to iommu */
 void amd_iommu_flush_all_pages(struct domain *d);
@@ -106,6 +108,14 @@
 void amd_iommu_suspend(void);
 void amd_iommu_crash_shutdown(void);
 
+/* guest iommu support */
+void amd_iommu_send_guest_cmd(struct amd_iommu *iommu, u32 cmd[]);
+void guest_iommu_add_ppr_log(struct domain *d, u32 entry[]);
+void guest_iommu_add_event_log(struct domain *d, u32 entry[]);
+int guest_iommu_init(struct domain* d);
+void guest_iommu_destroy(struct domain *d);
+int guest_iommu_set_base(struct domain *d, uint64_t base);
+
 static inline u32 get_field_from_reg_u32(u32 reg_value, u32 mask, u32 shift)
 {
     u32 field;
diff -r 522d544f4031 -r 6c104b46ef89 xen/include/xen/hvm/iommu.h
--- a/xen/include/xen/hvm/iommu.h	Thu Jan 12 13:49:34 2012 +0100
+++ b/xen/include/xen/hvm/iommu.h	Thu Jan 12 13:50:50 2012 +0100
@@ -47,6 +47,7 @@
     int domain_id;
     int paging_mode;
     struct page_info *root_table;
+    struct guest_iommu *g_iommu;
 
     /* iommu_ops */
     const struct iommu_ops *platform_ops;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000vV-9m; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxE-0000hE-Ir
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327010124!9875100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32198 invoked from network); 19 Jan 2012 21:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:25 -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 1Rnzx6-0007Qy-7v
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx6-0000gM-3Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Message-Id: <E1Rnzx6-0000gM-3Z@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: add ppr log processing
	into iommu interrupt handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372837 -3600
# Node ID d4daaab0164306859e21b7a931a0f5eaab8da24c
# Parent  25a79988dbec04e478369818d3d46d63b9da70d1
amd iommu: add ppr log processing into iommu interrupt handling

PPR log and event log share the same interrupt source. Interrupt
handler should check both of them.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 25a79988dbec -r d4daaab01643 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:53:20 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:53:57 2012 +0100
@@ -355,75 +355,90 @@
         AMD_IOMMU_DEBUG("PPR Log Enabled.\n");
 }
 
-static void parse_event_log_entry(struct amd_iommu *, u32 entry[]);
+/* read event log or ppr log from iommu ring buffer */
+static int iommu_read_log(struct amd_iommu *iommu,
+                          struct ring_buffer *log,
+                          unsigned int entry_size,
+                          void (*parse_func)(struct amd_iommu *, u32 *))
+{
+    u32 tail, head, *entry, tail_offest, head_offset;
 
-static int amd_iommu_read_event_log(struct amd_iommu *iommu)
-{
-    u32 tail, head, *event_log;
-
-    BUG_ON( !iommu );
+    BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
 
     /* make sure there's an entry in the log */
-    tail = readl(iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
-    tail = get_field_from_reg_u32(tail,
-                                  IOMMU_EVENT_LOG_TAIL_MASK,
-                                  IOMMU_EVENT_LOG_TAIL_SHIFT);
+    tail_offest = ( log == &iommu->event_log ) ?
+        IOMMU_EVENT_LOG_TAIL_OFFSET :
+        IOMMU_PPR_LOG_TAIL_OFFSET;
 
-    while ( tail != iommu->event_log.head )
+    head_offset = ( log == &iommu->event_log ) ?
+        IOMMU_EVENT_LOG_HEAD_OFFSET :
+        IOMMU_PPR_LOG_HEAD_OFFSET;
+
+    tail = readl(iommu->mmio_base + tail_offest);
+    tail = iommu_get_rb_pointer(tail);
+
+    while ( tail != log->head )
     {
         /* read event log entry */
-        event_log = (u32 *)(iommu->event_log.buffer +
-                           (iommu->event_log.head *
-                           IOMMU_EVENT_LOG_ENTRY_SIZE));
+        entry = (u32 *)(log->buffer + log->head * entry_size);
 
-        parse_event_log_entry(iommu, event_log);
-
-        if ( ++iommu->event_log.head == iommu->event_log.entries )
-            iommu->event_log.head = 0;
+        parse_func(iommu, entry);
+        if ( ++log->head == log->entries )
+            log->head = 0;
 
         /* update head pointer */
-        set_field_in_reg_u32(iommu->event_log.head, 0,
-                             IOMMU_EVENT_LOG_HEAD_MASK,
-                             IOMMU_EVENT_LOG_HEAD_SHIFT, &head);
-        writel(head, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+        head = 0;
+        iommu_set_rb_pointer(&head, log->head);
+
+        writel(head, iommu->mmio_base + head_offset);
     }
 
     return 0;
 }
 
-static void amd_iommu_reset_event_log(struct amd_iommu *iommu)
+/* reset event log or ppr log when overflow */
+static void iommu_reset_log(struct amd_iommu *iommu,
+                            struct ring_buffer *log,
+                            void (*ctrl_func)(struct amd_iommu *iommu, int))
 {
     u32 entry;
-    int log_run;
+    int log_run, run_bit, of_bit;
     int loop_count = 1000;
 
+    BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
+
+    run_bit = ( log == &iommu->event_log ) ?
+        IOMMU_STATUS_EVENT_LOG_RUN_SHIFT :
+        IOMMU_STATUS_PPR_LOG_RUN_SHIFT;
+
+    of_bit = ( log == &iommu->event_log ) ?
+        IOMMU_STATUS_EVENT_OVERFLOW_SHIFT :
+        IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT;
+
     /* wait until EventLogRun bit = 0 */
     do {
         entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-        log_run = iommu_get_bit(entry, IOMMU_STATUS_EVENT_LOG_RUN_SHIFT);
+        log_run = iommu_get_bit(entry, run_bit);
         loop_count--;
     } while ( log_run && loop_count );
 
     if ( log_run )
     {
-        AMD_IOMMU_DEBUG("Warning: EventLogRun bit is not cleared"
-                        "before reset!\n");
+        AMD_IOMMU_DEBUG("Warning: Log Run bit %d is not cleared"
+                        "before reset!\n", run_bit);
         return;
     }
 
-    set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
+    ctrl_func(iommu, IOMMU_CONTROL_DISABLED);
 
-    /* read event log for debugging */
-    amd_iommu_read_event_log(iommu);
     /*clear overflow bit */
-    iommu_clear_bit(&entry, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
-
-    writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+    iommu_clear_bit(&entry, of_bit);
+    writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
     /*reset event log base address */
-    iommu->event_log.head = 0;
+    log->head = 0;
 
-    set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
+    ctrl_func(iommu, IOMMU_CONTROL_ENABLED);
 }
 
 static void iommu_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
@@ -595,30 +610,95 @@
     }
 }
 
-static void amd_iommu_page_fault(int irq, void *dev_id,
-                             struct cpu_user_regs *regs)
+static void iommu_check_event_log(struct amd_iommu *iommu)
 {
     u32 entry;
     unsigned long flags;
-    struct amd_iommu *iommu = dev_id;
 
     spin_lock_irqsave(&iommu->lock, flags);
-    amd_iommu_read_event_log(iommu);
+
+    iommu_read_log(iommu, &iommu->event_log,
+                   sizeof(event_entry_t), parse_event_log_entry);
 
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
     if ( iommu_get_bit(entry, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT) )
-        amd_iommu_reset_event_log(iommu);
+        iommu_reset_log(iommu, &iommu->event_log, set_iommu_event_log_control);
 
     /* reset interrupt status bit */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
     iommu_set_bit(&entry, IOMMU_STATUS_EVENT_LOG_INT_SHIFT);
 
-    writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+    writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
     spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
+void parse_ppr_log_entry(struct amd_iommu *iommu, u32 entry[])
+{
+
+    u16 device_id;
+    u8 bus, devfn;
+    struct pci_dev *pdev;
+    struct domain *d;
+
+    /* here device_id is physical value */
+    device_id = iommu_get_devid_from_cmd(entry[0]);
+    bus = PCI_BUS(device_id);
+    devfn = PCI_DEVFN2(device_id);
+
+    local_irq_enable();
+
+    spin_lock(&pcidevs_lock);
+    pdev = pci_get_pdev(0, bus, devfn);
+    spin_unlock(&pcidevs_lock);
+
+    local_irq_disable();
+
+    if ( pdev == NULL )
+        return;
+
+    d = pdev->domain;
+
+    guest_iommu_add_ppr_log(d, entry);
+}
+
+static void iommu_check_ppr_log(struct amd_iommu *iommu)
+{
+    u32 entry;
+    unsigned long flags;
+
+    spin_lock_irqsave(&iommu->lock, flags);
+
+    iommu_read_log(iommu, &iommu->ppr_log,
+                   sizeof(ppr_entry_t), parse_ppr_log_entry);
+
+    /*check event overflow */
+    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
+    if ( iommu_get_bit(entry, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT) )
+        iommu_reset_log(iommu, &iommu->ppr_log, set_iommu_ppr_log_control);
+
+    /* reset interrupt status bit */
+    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+    iommu_set_bit(&entry, IOMMU_STATUS_PPR_LOG_INT_SHIFT);
+
+    writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
+    spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+static void iommu_interrupt_handler(int irq, void *dev_id,
+                                    struct cpu_user_regs *regs)
+{
+    struct amd_iommu *iommu = dev_id;
+    iommu_check_event_log(iommu);
+
+    if ( iommu->ppr_log.buffer != NULL )
+        iommu_check_ppr_log(iommu);
+}
+
 static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
@@ -631,8 +711,7 @@
     }
     
     irq_desc[irq].handler = &iommu_msi_type;
-    ret = request_irq(irq, amd_iommu_page_fault, 0,
-                             "amd_iommu", iommu);
+    ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
         irq_desc[irq].handler = &no_irq_type;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:34 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000vV-9m; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxE-0000hE-Ir
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327010124!9875100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32198 invoked from network); 19 Jan 2012 21:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:25 -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 1Rnzx6-0007Qy-7v
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx6-0000gM-3Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:24 +0000
Message-Id: <E1Rnzx6-0000gM-3Z@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: add ppr log processing
	into iommu interrupt handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326372837 -3600
# Node ID d4daaab0164306859e21b7a931a0f5eaab8da24c
# Parent  25a79988dbec04e478369818d3d46d63b9da70d1
amd iommu: add ppr log processing into iommu interrupt handling

PPR log and event log share the same interrupt source. Interrupt
handler should check both of them.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 25a79988dbec -r d4daaab01643 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:53:20 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 12 13:53:57 2012 +0100
@@ -355,75 +355,90 @@
         AMD_IOMMU_DEBUG("PPR Log Enabled.\n");
 }
 
-static void parse_event_log_entry(struct amd_iommu *, u32 entry[]);
+/* read event log or ppr log from iommu ring buffer */
+static int iommu_read_log(struct amd_iommu *iommu,
+                          struct ring_buffer *log,
+                          unsigned int entry_size,
+                          void (*parse_func)(struct amd_iommu *, u32 *))
+{
+    u32 tail, head, *entry, tail_offest, head_offset;
 
-static int amd_iommu_read_event_log(struct amd_iommu *iommu)
-{
-    u32 tail, head, *event_log;
-
-    BUG_ON( !iommu );
+    BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
 
     /* make sure there's an entry in the log */
-    tail = readl(iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
-    tail = get_field_from_reg_u32(tail,
-                                  IOMMU_EVENT_LOG_TAIL_MASK,
-                                  IOMMU_EVENT_LOG_TAIL_SHIFT);
+    tail_offest = ( log == &iommu->event_log ) ?
+        IOMMU_EVENT_LOG_TAIL_OFFSET :
+        IOMMU_PPR_LOG_TAIL_OFFSET;
 
-    while ( tail != iommu->event_log.head )
+    head_offset = ( log == &iommu->event_log ) ?
+        IOMMU_EVENT_LOG_HEAD_OFFSET :
+        IOMMU_PPR_LOG_HEAD_OFFSET;
+
+    tail = readl(iommu->mmio_base + tail_offest);
+    tail = iommu_get_rb_pointer(tail);
+
+    while ( tail != log->head )
     {
         /* read event log entry */
-        event_log = (u32 *)(iommu->event_log.buffer +
-                           (iommu->event_log.head *
-                           IOMMU_EVENT_LOG_ENTRY_SIZE));
+        entry = (u32 *)(log->buffer + log->head * entry_size);
 
-        parse_event_log_entry(iommu, event_log);
-
-        if ( ++iommu->event_log.head == iommu->event_log.entries )
-            iommu->event_log.head = 0;
+        parse_func(iommu, entry);
+        if ( ++log->head == log->entries )
+            log->head = 0;
 
         /* update head pointer */
-        set_field_in_reg_u32(iommu->event_log.head, 0,
-                             IOMMU_EVENT_LOG_HEAD_MASK,
-                             IOMMU_EVENT_LOG_HEAD_SHIFT, &head);
-        writel(head, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+        head = 0;
+        iommu_set_rb_pointer(&head, log->head);
+
+        writel(head, iommu->mmio_base + head_offset);
     }
 
     return 0;
 }
 
-static void amd_iommu_reset_event_log(struct amd_iommu *iommu)
+/* reset event log or ppr log when overflow */
+static void iommu_reset_log(struct amd_iommu *iommu,
+                            struct ring_buffer *log,
+                            void (*ctrl_func)(struct amd_iommu *iommu, int))
 {
     u32 entry;
-    int log_run;
+    int log_run, run_bit, of_bit;
     int loop_count = 1000;
 
+    BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
+
+    run_bit = ( log == &iommu->event_log ) ?
+        IOMMU_STATUS_EVENT_LOG_RUN_SHIFT :
+        IOMMU_STATUS_PPR_LOG_RUN_SHIFT;
+
+    of_bit = ( log == &iommu->event_log ) ?
+        IOMMU_STATUS_EVENT_OVERFLOW_SHIFT :
+        IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT;
+
     /* wait until EventLogRun bit = 0 */
     do {
         entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-        log_run = iommu_get_bit(entry, IOMMU_STATUS_EVENT_LOG_RUN_SHIFT);
+        log_run = iommu_get_bit(entry, run_bit);
         loop_count--;
     } while ( log_run && loop_count );
 
     if ( log_run )
     {
-        AMD_IOMMU_DEBUG("Warning: EventLogRun bit is not cleared"
-                        "before reset!\n");
+        AMD_IOMMU_DEBUG("Warning: Log Run bit %d is not cleared"
+                        "before reset!\n", run_bit);
         return;
     }
 
-    set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
+    ctrl_func(iommu, IOMMU_CONTROL_DISABLED);
 
-    /* read event log for debugging */
-    amd_iommu_read_event_log(iommu);
     /*clear overflow bit */
-    iommu_clear_bit(&entry, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
-
-    writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+    iommu_clear_bit(&entry, of_bit);
+    writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
     /*reset event log base address */
-    iommu->event_log.head = 0;
+    log->head = 0;
 
-    set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
+    ctrl_func(iommu, IOMMU_CONTROL_ENABLED);
 }
 
 static void iommu_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
@@ -595,30 +610,95 @@
     }
 }
 
-static void amd_iommu_page_fault(int irq, void *dev_id,
-                             struct cpu_user_regs *regs)
+static void iommu_check_event_log(struct amd_iommu *iommu)
 {
     u32 entry;
     unsigned long flags;
-    struct amd_iommu *iommu = dev_id;
 
     spin_lock_irqsave(&iommu->lock, flags);
-    amd_iommu_read_event_log(iommu);
+
+    iommu_read_log(iommu, &iommu->event_log,
+                   sizeof(event_entry_t), parse_event_log_entry);
 
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
     if ( iommu_get_bit(entry, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT) )
-        amd_iommu_reset_event_log(iommu);
+        iommu_reset_log(iommu, &iommu->event_log, set_iommu_event_log_control);
 
     /* reset interrupt status bit */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
     iommu_set_bit(&entry, IOMMU_STATUS_EVENT_LOG_INT_SHIFT);
 
-    writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+    writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
     spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
+void parse_ppr_log_entry(struct amd_iommu *iommu, u32 entry[])
+{
+
+    u16 device_id;
+    u8 bus, devfn;
+    struct pci_dev *pdev;
+    struct domain *d;
+
+    /* here device_id is physical value */
+    device_id = iommu_get_devid_from_cmd(entry[0]);
+    bus = PCI_BUS(device_id);
+    devfn = PCI_DEVFN2(device_id);
+
+    local_irq_enable();
+
+    spin_lock(&pcidevs_lock);
+    pdev = pci_get_pdev(0, bus, devfn);
+    spin_unlock(&pcidevs_lock);
+
+    local_irq_disable();
+
+    if ( pdev == NULL )
+        return;
+
+    d = pdev->domain;
+
+    guest_iommu_add_ppr_log(d, entry);
+}
+
+static void iommu_check_ppr_log(struct amd_iommu *iommu)
+{
+    u32 entry;
+    unsigned long flags;
+
+    spin_lock_irqsave(&iommu->lock, flags);
+
+    iommu_read_log(iommu, &iommu->ppr_log,
+                   sizeof(ppr_entry_t), parse_ppr_log_entry);
+
+    /*check event overflow */
+    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
+    if ( iommu_get_bit(entry, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT) )
+        iommu_reset_log(iommu, &iommu->ppr_log, set_iommu_ppr_log_control);
+
+    /* reset interrupt status bit */
+    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+    iommu_set_bit(&entry, IOMMU_STATUS_PPR_LOG_INT_SHIFT);
+
+    writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+
+    spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+static void iommu_interrupt_handler(int irq, void *dev_id,
+                                    struct cpu_user_regs *regs)
+{
+    struct amd_iommu *iommu = dev_id;
+    iommu_check_event_log(iommu);
+
+    if ( iommu->ppr_log.buffer != NULL )
+        iommu_check_ppr_log(iommu);
+}
+
 static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
@@ -631,8 +711,7 @@
     }
     
     irq_desc[irq].handler = &iommu_msi_type;
-    ret = request_irq(irq, amd_iommu_page_fault, 0,
-                             "amd_iommu", iommu);
+    ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
         irq_desc[irq].handler = &no_irq_type;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:35 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000wi-LL; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxF-0000id-9n
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1327010125!9907602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5034 invoked from network); 19 Jan 2012 21:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:26 -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 1Rnzx7-0007R5-7b
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000gq-6E
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Message-Id: <E1Rnzx7-0000gq-6E@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: move and fold certain type
	property definitions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326383035 -3600
# Node ID ac8e624d3dbbc15cf5dc4e6607b299f1773ec4b0
# Parent  9db6fe19dd04d2ac33eebed528058811f1cf0183
x86: move and fold certain type property definitions

Not only is it less code to have them consolidated, it also permits
their use virtually everywhere (since config.h is required to be
included everywhere. (Shouldn't we, btw, follow Linux and remove the
explicit inclusion in favor of command line enforced one?)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 9db6fe19dd04 -r ac8e624d3dbb xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Thu Jan 12 13:54:28 2012 +0100
+++ b/xen/include/asm-x86/config.h	Thu Jan 12 16:43:55 2012 +0100
@@ -8,11 +8,16 @@
 #define __X86_CONFIG_H__
 
 #if defined(__x86_64__)
+# define LONG_BYTEORDER 3
 # define CONFIG_PAGING_LEVELS 4
 #else
+# define LONG_BYTEORDER 2
 # define CONFIG_PAGING_LEVELS 3
 #endif
 
+#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
+#define BITS_PER_LONG (BYTES_PER_LONG << 3)
+
 #define CONFIG_X86 1
 #define CONFIG_X86_HT 1
 #define CONFIG_PAGING_ASSISTANCE 1
diff -r 9db6fe19dd04 -r ac8e624d3dbb xen/include/asm-x86/types.h
--- a/xen/include/asm-x86/types.h	Thu Jan 12 13:54:28 2012 +0100
+++ b/xen/include/asm-x86/types.h	Thu Jan 12 16:43:55 2012 +0100
@@ -55,14 +55,4 @@
 
 #endif /* __ASSEMBLY__ */
 
-#if defined(__i386__)
-#define BITS_PER_LONG 32
-#define BYTES_PER_LONG 4
-#define LONG_BYTEORDER 2
-#elif defined(__x86_64__)
-#define BITS_PER_LONG 64
-#define BYTES_PER_LONG 8
-#define LONG_BYTEORDER 3
-#endif
-
 #endif /* __X86_TYPES_H__ */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:35 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxG-0000wi-LL; Thu, 19 Jan 2012 21:55:34 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxF-0000id-9n
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1327010125!9907602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5034 invoked from network); 19 Jan 2012 21:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:26 -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 1Rnzx7-0007R5-7b
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000gq-6E
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Message-Id: <E1Rnzx7-0000gq-6E@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: move and fold certain type
	property definitions
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326383035 -3600
# Node ID ac8e624d3dbbc15cf5dc4e6607b299f1773ec4b0
# Parent  9db6fe19dd04d2ac33eebed528058811f1cf0183
x86: move and fold certain type property definitions

Not only is it less code to have them consolidated, it also permits
their use virtually everywhere (since config.h is required to be
included everywhere. (Shouldn't we, btw, follow Linux and remove the
explicit inclusion in favor of command line enforced one?)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 9db6fe19dd04 -r ac8e624d3dbb xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Thu Jan 12 13:54:28 2012 +0100
+++ b/xen/include/asm-x86/config.h	Thu Jan 12 16:43:55 2012 +0100
@@ -8,11 +8,16 @@
 #define __X86_CONFIG_H__
 
 #if defined(__x86_64__)
+# define LONG_BYTEORDER 3
 # define CONFIG_PAGING_LEVELS 4
 #else
+# define LONG_BYTEORDER 2
 # define CONFIG_PAGING_LEVELS 3
 #endif
 
+#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
+#define BITS_PER_LONG (BYTES_PER_LONG << 3)
+
 #define CONFIG_X86 1
 #define CONFIG_X86_HT 1
 #define CONFIG_PAGING_ASSISTANCE 1
diff -r 9db6fe19dd04 -r ac8e624d3dbb xen/include/asm-x86/types.h
--- a/xen/include/asm-x86/types.h	Thu Jan 12 13:54:28 2012 +0100
+++ b/xen/include/asm-x86/types.h	Thu Jan 12 16:43:55 2012 +0100
@@ -55,14 +55,4 @@
 
 #endif /* __ASSEMBLY__ */
 
-#if defined(__i386__)
-#define BITS_PER_LONG 32
-#define BYTES_PER_LONG 4
-#define LONG_BYTEORDER 2
-#elif defined(__x86_64__)
-#define BITS_PER_LONG 64
-#define BYTES_PER_LONG 8
-#define LONG_BYTEORDER 3
-#endif
-
 #endif /* __X86_TYPES_H__ */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxH-0000zb-Td; Thu, 19 Jan 2012 21:55:35 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000pM-Hk
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327010082!50989353!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4433 invoked from network); 19 Jan 2012 21:54:43 -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;
	19 Jan 2012 21:54:43 -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 1RnzxB-0007Ri-Bm
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxB-0000im-9r
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Message-Id: <E1RnzxB-0000im-9r@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] .gitignore: ocaml: add xenlight.mli
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473649 0
# Node ID 5ac7713e7f5d9711770ec9d2e555bf82e086dc98
# Parent  6f5fff70668b2ed0d3a70a673531676280ba5ca6
.gitignore: ocaml: add xenlight.mli

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 6f5fff70668b -r 5ac7713e7f5d .gitignore
--- a/.gitignore	Fri Jan 13 08:34:57 2012 +0100
+++ b/.gitignore	Fri Jan 13 16:54:09 2012 +0000
@@ -359,6 +359,7 @@
 tools/ocaml/libs/xl/_libxl_types.ml.in
 tools/ocaml/libs/xl/_libxl_types.mli.in
 tools/ocaml/libs/xl/xenlight.ml
+tools/ocaml/libs/xl/xenlight.mli
 tools/ocaml/xenstored/oxenstored
 
 tools/debugger/kdd/kdd

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxH-0000zb-Td; Thu, 19 Jan 2012 21:55:35 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000pM-Hk
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327010082!50989353!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4433 invoked from network); 19 Jan 2012 21:54:43 -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;
	19 Jan 2012 21:54:43 -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 1RnzxB-0007Ri-Bm
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxB-0000im-9r
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Message-Id: <E1RnzxB-0000im-9r@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] .gitignore: ocaml: add xenlight.mli
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473649 0
# Node ID 5ac7713e7f5d9711770ec9d2e555bf82e086dc98
# Parent  6f5fff70668b2ed0d3a70a673531676280ba5ca6
.gitignore: ocaml: add xenlight.mli

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 6f5fff70668b -r 5ac7713e7f5d .gitignore
--- a/.gitignore	Fri Jan 13 08:34:57 2012 +0100
+++ b/.gitignore	Fri Jan 13 16:54:09 2012 +0000
@@ -359,6 +359,7 @@
 tools/ocaml/libs/xl/_libxl_types.ml.in
 tools/ocaml/libs/xl/_libxl_types.mli.in
 tools/ocaml/libs/xl/xenlight.ml
+tools/ocaml/libs/xl/xenlight.mli
 tools/ocaml/xenstored/oxenstored
 
 tools/debugger/kdd/kdd

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxH-0000zP-Qj; Thu, 19 Jan 2012 21:55:35 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000kQ-6B
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327010126!9875104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32336 invoked from network); 19 Jan 2012 21:55:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:27 -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 1Rnzx8-0007RG-7s
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000hK-6i
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Message-Id: <E1Rnzx8-0000hK-6i@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86-64: globally use -mno-sse
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326383214 -3600
# Node ID 50743407a526debba7d7b3be3f1dd27bf62d72d6
# Parent  c362e0526e5d0adfd886a4603cc1024cd9d16329
x86-64: globally use -mno-sse

This eliminates pointless prologue code from functions having variable
argument lists (since that way xmm registers can't possibly be passed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r c362e0526e5d -r 50743407a526 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Thu Jan 12 16:45:39 2012 +0100
+++ b/xen/arch/x86/Rules.mk	Thu Jan 12 16:46:54 2012 +0100
@@ -41,7 +41,7 @@
 endif
 
 ifeq ($(TARGET_SUBARCH),x86_64)
-CFLAGS += -mno-red-zone -fpic
+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)
diff -r c362e0526e5d -r 50743407a526 xen/arch/x86/efi/Makefile
--- a/xen/arch/x86/efi/Makefile	Thu Jan 12 16:45:39 2012 +0100
+++ b/xen/arch/x86/efi/Makefile	Thu Jan 12 16:46:54 2012 +0100
@@ -1,4 +1,4 @@
-CFLAGS += -fshort-wchar -mno-sse
+CFLAGS += -fshort-wchar
 
 obj-y += stub.o
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxH-0000zP-Qj; Thu, 19 Jan 2012 21:55:35 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000kQ-6B
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327010126!9875104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32336 invoked from network); 19 Jan 2012 21:55:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:27 -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 1Rnzx8-0007RG-7s
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000hK-6i
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Message-Id: <E1Rnzx8-0000hK-6i@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86-64: globally use -mno-sse
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326383214 -3600
# Node ID 50743407a526debba7d7b3be3f1dd27bf62d72d6
# Parent  c362e0526e5d0adfd886a4603cc1024cd9d16329
x86-64: globally use -mno-sse

This eliminates pointless prologue code from functions having variable
argument lists (since that way xmm registers can't possibly be passed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r c362e0526e5d -r 50743407a526 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk	Thu Jan 12 16:45:39 2012 +0100
+++ b/xen/arch/x86/Rules.mk	Thu Jan 12 16:46:54 2012 +0100
@@ -41,7 +41,7 @@
 endif
 
 ifeq ($(TARGET_SUBARCH),x86_64)
-CFLAGS += -mno-red-zone -fpic
+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)
diff -r c362e0526e5d -r 50743407a526 xen/arch/x86/efi/Makefile
--- a/xen/arch/x86/efi/Makefile	Thu Jan 12 16:45:39 2012 +0100
+++ b/xen/arch/x86/efi/Makefile	Thu Jan 12 16:46:54 2012 +0100
@@ -1,4 +1,4 @@
-CFLAGS += -fshort-wchar -mno-sse
+CFLAGS += -fshort-wchar
 
 obj-y += stub.o
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxI-0000zp-02; Thu, 19 Jan 2012 21:55:36 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000j9-7Y
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1327010126!7944173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27069 invoked from network); 19 Jan 2012 21:55:26 -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;
	19 Jan 2012 21:55:26 -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 1Rnzx7-0007RA-OO
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000h5-Mu
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Message-Id: <E1Rnzx7-0000h5-Mu@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: properly define size_t
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326383139 -3600
# Node ID c362e0526e5d0adfd886a4603cc1024cd9d16329
# Parent  ac8e624d3dbbc15cf5dc4e6607b299f1773ec4b0
x86: properly define size_t

Having it defined unilaterally as 'unsigned long' got me surprised
recently when I tried to use the 'z' printk type modifier, as that is
expected by the compiler to be used only on the type it knows size_t
is supposed to have.

Generally the compiler provides a construct to do this, so use it when
available.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
---


diff -r ac8e624d3dbb -r c362e0526e5d xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Thu Jan 12 16:43:55 2012 +0100
+++ b/xen/arch/x86/microcode_amd.c	Thu Jan 12 16:45:39 2012 +0100
@@ -183,10 +183,10 @@
     struct microcode_amd *mc_amd,
     const void *buf,
     size_t bufsize,
-    unsigned long *offset)
+    size_t *offset)
 {
     const uint8_t *bufp = buf;
-    unsigned long off;
+    size_t off;
     const struct mpbhdr *mpbuf;
 
     off = *offset;
@@ -203,7 +203,7 @@
         return -EINVAL;
     }
 
-    printk(KERN_DEBUG "microcode: size %lu, block size %u, offset %ld\n",
+    printk(KERN_DEBUG "microcode: size %zu, block size %u, offset %zu\n",
            bufsize, mpbuf->len, off);
 
     if ( (off + mpbuf->len) > bufsize )
@@ -234,7 +234,7 @@
 static int install_equiv_cpu_table(
     struct microcode_amd *mc_amd,
     const uint32_t *buf,
-    unsigned long *offset)
+    size_t *offset)
 {
     const struct mpbhdr *mpbuf = (const struct mpbhdr *)&buf[1];
 
diff -r ac8e624d3dbb -r c362e0526e5d xen/include/asm-x86/types.h
--- a/xen/include/asm-x86/types.h	Thu Jan 12 16:43:55 2012 +0100
+++ b/xen/include/asm-x86/types.h	Thu Jan 12 16:45:39 2012 +0100
@@ -47,7 +47,13 @@
 #define PRIpaddr "016lx"
 #endif
 
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ size_t;
+#elif defined(__i386__)
+typedef unsigned int size_t;
+#else
 typedef unsigned long size_t;
+#endif
 
 typedef char bool_t;
 #define test_and_set_bool(b)   xchg(&(b), 1)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxI-0000zp-02; Thu, 19 Jan 2012 21:55:36 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000j9-7Y
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1327010126!7944173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27069 invoked from network); 19 Jan 2012 21:55:26 -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;
	19 Jan 2012 21:55:26 -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 1Rnzx7-0007RA-OO
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx7-0000h5-Mu
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:25 +0000
Message-Id: <E1Rnzx7-0000h5-Mu@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: properly define size_t
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326383139 -3600
# Node ID c362e0526e5d0adfd886a4603cc1024cd9d16329
# Parent  ac8e624d3dbbc15cf5dc4e6607b299f1773ec4b0
x86: properly define size_t

Having it defined unilaterally as 'unsigned long' got me surprised
recently when I tried to use the 'z' printk type modifier, as that is
expected by the compiler to be used only on the type it knows size_t
is supposed to have.

Generally the compiler provides a construct to do this, so use it when
available.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
---


diff -r ac8e624d3dbb -r c362e0526e5d xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Thu Jan 12 16:43:55 2012 +0100
+++ b/xen/arch/x86/microcode_amd.c	Thu Jan 12 16:45:39 2012 +0100
@@ -183,10 +183,10 @@
     struct microcode_amd *mc_amd,
     const void *buf,
     size_t bufsize,
-    unsigned long *offset)
+    size_t *offset)
 {
     const uint8_t *bufp = buf;
-    unsigned long off;
+    size_t off;
     const struct mpbhdr *mpbuf;
 
     off = *offset;
@@ -203,7 +203,7 @@
         return -EINVAL;
     }
 
-    printk(KERN_DEBUG "microcode: size %lu, block size %u, offset %ld\n",
+    printk(KERN_DEBUG "microcode: size %zu, block size %u, offset %zu\n",
            bufsize, mpbuf->len, off);
 
     if ( (off + mpbuf->len) > bufsize )
@@ -234,7 +234,7 @@
 static int install_equiv_cpu_table(
     struct microcode_amd *mc_amd,
     const uint32_t *buf,
-    unsigned long *offset)
+    size_t *offset)
 {
     const struct mpbhdr *mpbuf = (const struct mpbhdr *)&buf[1];
 
diff -r ac8e624d3dbb -r c362e0526e5d xen/include/asm-x86/types.h
--- a/xen/include/asm-x86/types.h	Thu Jan 12 16:43:55 2012 +0100
+++ b/xen/include/asm-x86/types.h	Thu Jan 12 16:45:39 2012 +0100
@@ -47,7 +47,13 @@
 #define PRIpaddr "016lx"
 #endif
 
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ size_t;
+#elif defined(__i386__)
+typedef unsigned int size_t;
+#else
 typedef unsigned long size_t;
+#endif
 
 typedef char bool_t;
 #define test_and_set_bool(b)   xchg(&(b), 1)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxI-000106-3u; Thu, 19 Jan 2012 21:55:36 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000m1-R9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1327010127!9902134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28333 invoked from network); 19 Jan 2012 21:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:28 -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 1Rnzx8-0007RN-ON
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000hZ-Mv
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Message-Id: <E1Rnzx8-0000hZ-Mv@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix operator associativity
	bug in mm-locks.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1326386345 0
# Node ID 80765dec9616de06027a18e5ad7d43017c70e7dd
# Parent  50743407a526debba7d7b3be3f1dd27bf62d72d6
x86/mm: Fix operator associativity bug in mm-locks.h

In an order-enforcing wrapper for an "external" recursive lock,
we aim to increment/decrement a recurse count and only update the
lock ordering on zero counts.

Unfortunately we incrementing/decrementing the pointer to the
recurse count, rather than the count itself.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 50743407a526 -r 80765dec9616 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 12 16:46:54 2012 +0100
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 12 16:39:05 2012 +0000
@@ -81,7 +81,7 @@
 {
     if ( recurse_count )
     {
-        if ( *recurse_count++ == 0 )
+        if ( (*recurse_count)++ == 0 )
         {
             *unlock_level = __get_lock_level();
         }
@@ -125,7 +125,7 @@
     if ( recurse_count )
     {
         BUG_ON(*recurse_count == 0);
-        if ( *recurse_count-- == 1 )
+        if ( (*recurse_count)-- == 1 )
         {
             __set_lock_level(unlock_level);
         }

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:36 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxI-000106-3u; Thu, 19 Jan 2012 21:55:36 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000m1-R9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1327010127!9902134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28333 invoked from network); 19 Jan 2012 21:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:28 -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 1Rnzx8-0007RN-ON
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx8-0000hZ-Mv
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:26 +0000
Message-Id: <E1Rnzx8-0000hZ-Mv@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix operator associativity
	bug in mm-locks.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1326386345 0
# Node ID 80765dec9616de06027a18e5ad7d43017c70e7dd
# Parent  50743407a526debba7d7b3be3f1dd27bf62d72d6
x86/mm: Fix operator associativity bug in mm-locks.h

In an order-enforcing wrapper for an "external" recursive lock,
we aim to increment/decrement a recurse count and only update the
lock ordering on zero counts.

Unfortunately we incrementing/decrementing the pointer to the
recurse count, rather than the count itself.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 50743407a526 -r 80765dec9616 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 12 16:46:54 2012 +0100
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 12 16:39:05 2012 +0000
@@ -81,7 +81,7 @@
 {
     if ( recurse_count )
     {
-        if ( *recurse_count++ == 0 )
+        if ( (*recurse_count)++ == 0 )
         {
             *unlock_level = __get_lock_level();
         }
@@ -125,7 +125,7 @@
     if ( recurse_count )
     {
         BUG_ON(*recurse_count == 0);
-        if ( *recurse_count-- == 1 )
+        if ( (*recurse_count)-- == 1 )
         {
             __set_lock_level(unlock_level);
         }

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:37 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxJ-00013H-9C; Thu, 19 Jan 2012 21:55:37 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000nK-Bz
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327010128!4296374!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31248 invoked from network); 19 Jan 2012 21:55:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:29 -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 1Rnzx9-0007RU-NV
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx9-0000i3-MD
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Message-Id: <E1Rnzx9-0000i3-MD@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix build with make prior to
	3.81
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326390671 0
# Node ID c5eadfd5c639a494b58cf6c0675b8f78412bcf43
# Parent  94b5fb649d94451fa06352d240f4cf8fe37f9631
libxl: fix build with make prior to 3.81

Up to 3.80, make only supported simple 'else' constructs, which got
violated by 24432:e0effa7c04f5.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 94b5fb649d94 -r c5eadfd5c639 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Thu Jan 12 16:45:21 2012 +0000
+++ b/tools/libxl/Makefile	Thu Jan 12 17:51:11 2012 +0000
@@ -35,12 +35,14 @@
 
 ifeq ($(CONFIG_NetBSD),y)
 LIBXL_OBJS-y += libxl_netbsd.o
-else ifeq ($(CONFIG_Linux),y)
+else
+ifeq ($(CONFIG_Linux),y)
 LIBXL_OBJS-y += libxl_linux.o
 else
 $(error Your Operating System is not supported by libxenlight, \
 please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
 endif
+endif
 
 LIBXL_LIBS += -lyajl
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:37 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxJ-00013H-9C; Thu, 19 Jan 2012 21:55:37 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000nK-Bz
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327010128!4296374!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31248 invoked from network); 19 Jan 2012 21:55:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:29 -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 1Rnzx9-0007RU-NV
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx9-0000i3-MD
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Message-Id: <E1Rnzx9-0000i3-MD@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix build with make prior to
	3.81
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326390671 0
# Node ID c5eadfd5c639a494b58cf6c0675b8f78412bcf43
# Parent  94b5fb649d94451fa06352d240f4cf8fe37f9631
libxl: fix build with make prior to 3.81

Up to 3.80, make only supported simple 'else' constructs, which got
violated by 24432:e0effa7c04f5.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 94b5fb649d94 -r c5eadfd5c639 tools/libxl/Makefile
--- a/tools/libxl/Makefile	Thu Jan 12 16:45:21 2012 +0000
+++ b/tools/libxl/Makefile	Thu Jan 12 17:51:11 2012 +0000
@@ -35,12 +35,14 @@
 
 ifeq ($(CONFIG_NetBSD),y)
 LIBXL_OBJS-y += libxl_netbsd.o
-else ifeq ($(CONFIG_Linux),y)
+else
+ifeq ($(CONFIG_Linux),y)
 LIBXL_OBJS-y += libxl_linux.o
 else
 $(error Your Operating System is not supported by libxenlight, \
 please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
 endif
+endif
 
 LIBXL_LIBS += -lyajl
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:37 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxJ-00013c-CJ; Thu, 19 Jan 2012 21:55:37 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000nd-Li
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1327010127!9898702!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7628 invoked from network); 19 Jan 2012 21:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:28 -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 1Rnzx9-0007RR-7j
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx9-0000ho-6V
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Message-Id: <E1Rnzx9-0000ho-6V@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] .gitignore
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1326386721 0
# Node ID 94b5fb649d94451fa06352d240f4cf8fe37f9631
# Parent  80765dec9616de06027a18e5ad7d43017c70e7dd
.gitignore

Introduce a .gitignore file for the convenience of people who use git.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 80765dec9616 -r 94b5fb649d94 .gitignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Thu Jan 12 16:45:21 2012 +0000
@@ -0,0 +1,372 @@
+.hg
+*.orig
+*.rej
+*~
+*.o
+*.d
+*.opic
+*.a
+*.so
+*.so.[0-9]*
+*.bin
+*.bak
+*.tmp
+TAGS
+.config
+
+dist
+tools/ioemu-dir
+tools/ioemu-remote
+stubdom/*.tar.gz
+
+build-*
+dist/*
+docs/*.aux
+docs/*.dvi
+docs/*.log
+docs/*.pdf
+docs/*.ps
+docs/*.toc
+docs/api/*
+docs/figs/xenserver.eps
+docs/html/*
+docs/interface/WARNINGS
+docs/interface/images.pl
+docs/interface/images.tex
+docs/interface/img1.png
+docs/interface/index.html
+docs/interface/interface.css
+docs/interface/interface.html
+docs/interface/labels.pl
+docs/man1/
+docs/man5/
+docs/pdf/*
+docs/ps/*
+docs/user/WARNINGS
+docs/user/images.pl
+docs/user/images.tex
+docs/user/img1.png
+docs/user/img2.png
+docs/user/img3.png
+docs/user/index.html
+docs/user/internals.pl
+docs/user/labels.pl
+docs/user/user.css
+docs/user/user.html
+docs/xen-api/vm_lifecycle.eps
+docs/xen-api/xenapi-datamodel-graph.eps
+docs/xen-api/xenapi.out
+docs/xen-api/xenapi.dvi
+docs/xen-api/xenapi.pdf
+docs/xen-api/xenapi.ps
+docs/xen-api/xenapi.toc
+extras/mini-os/arch/ia64/gen_off.s
+extras/mini-os/include/mini-os
+extras/mini-os/include/ia64/mini-os
+extras/mini-os/include/ia64/offsets.h
+extras/mini-os/include/x86/mini-os
+extras/mini-os/include/xen
+extras/mini-os/mini-os*
+install/*
+linux-[^/]*-paravirt/*
+linux-2.6[^/]*/*
+linux-[^/]*-rc/*
+linux-[^/]*-tip/*
+linux-[^/]*-git/*
+linux-[^/]*.patch
+mkddbxen
+netbsd-[^/]*-tools/*
+netbsd-[^/]*-xen0/*
+netbsd-[^/]*-xenU/*
+netbsd-[^/]*.patch
+patches/*/.makedep
+patches/ebtables-brnf-5_vs_2.4.25.diff
+patches/ebtables.diff
+patches/tmp/*
+pristine-*
+ref-*
+tmp-*
+stubdom/binutils-*
+stubdom/cross-root-*
+stubdom/gcc-*
+stubdom/include
+stubdom/ioemu
+stubdom/xenstore
+stubdom/libxc-*
+stubdom/lwip-*
+stubdom/mini-os-*
+stubdom/mk-headers-*
+stubdom/newlib-1.*
+stubdom/newlib-x86*
+stubdom/pciutils-*
+stubdom/zlib-*
+stubdom/grub-*
+stubdom/ocaml-*
+stubdom/lwip/
+stubdom/ioemu/
+stubdom/stubdompath.sh
+tools/*/build/lib*/*.py
+tools/blktap2/daemon/blktapctrl
+tools/blktap2/drivers/img2qcow
+tools/blktap2/drivers/lock-util
+tools/blktap2/drivers/qcow-create
+tools/blktap2/drivers/qcow2raw
+tools/blktap2/drivers/tapdisk
+tools/blktap2/drivers/tapdisk-client
+tools/blktap2/drivers/tapdisk-diff
+tools/blktap2/drivers/tapdisk-stream
+tools/blktap2/drivers/tapdisk2
+tools/blktap2/drivers/td-util
+tools/blktap2/vhd/vhd-update
+tools/blktap2/vhd/vhd-util
+tools/blktap/drivers/blktapctrl
+tools/blktap/drivers/img2qcow
+tools/blktap/drivers/qcow-create
+tools/blktap/drivers/qcow2raw
+tools/blktap/drivers/tapdisk
+tools/check/.*
+tools/console/xenconsole
+tools/console/xenconsoled
+tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
+tools/debugger/gdb/gdb-6.2.1/*
+tools/debugger/gdb/gdb-6.2.1.tar.bz2
+tools/debugger/gdbsx/gdbsx
+tools/debugger/xenitp/xenitp
+tools/firmware/*/biossums
+tools/firmware/*.bin
+tools/firmware/*.sym
+tools/firmware/*bios/*bios*.txt
+tools/firmware/etherboot/gpxe/*
+tools/firmware/extboot/extboot.img
+tools/firmware/extboot/signrom
+tools/firmware/hvmloader/acpi/mk_dsdt
+tools/firmware/hvmloader/acpi/dsdt*.c
+tools/firmware/hvmloader/acpi/dsdt*.asl
+tools/firmware/hvmloader/acpi/ssdt_*.h
+tools/firmware/hvmloader/hvmloader
+tools/firmware/hvmloader/roms.h
+tools/firmware/hvmloader/roms.inc
+tools/firmware/rombios/BIOS-bochs-[^/]*
+tools/firmware/rombios/_rombios[^/]*_.c
+tools/firmware/rombios/rombios[^/]*.s
+tools/firmware/rombios/32bit/32bitbios_flat.h
+tools/firmware/vgabios/vbetables-gen
+tools/firmware/vgabios/vbetables.h
+tools/flask/loadpolicy/flask-loadpolicy
+tools/flask/utils/flask-getenforce
+tools/flask/utils/flask-loadpolicy
+tools/flask/utils/flask-setenforce
+tools/flask/utils/flask-label-pci
+tools/fs-back/fs-backend
+tools/hotplug/common/hotplugpath.sh
+tools/include/xen/*
+tools/include/xen-foreign/*.(c|h|size)
+tools/include/xen-foreign/checker
+tools/ioemu/.pc/*
+tools/ioemu/config-host.h
+tools/ioemu/config-host.mak
+tools/ioemu/i386-dm/Makefile
+tools/ioemu/i386-dm/config.h
+tools/ioemu/i386-dm/config.mak
+tools/ioemu/i386-dm/qemu-dm
+tools/ioemu/qemu-doc.html
+tools/ioemu/qemu-img.1
+tools/ioemu/qemu-img.pod
+tools/ioemu/qemu-tech.html
+tools/ioemu/qemu.1
+tools/ioemu/qemu.pod
+tools/ioemu/tapdisk-ioemu
+tools/libxc/ia64/asm/*.h
+tools/libxc/ia64/acpi/*.h
+tools/libxc/ia64/acpi/platform/*.h
+tools/libxc/ia64/dom_fw_asm.S
+tools/libxc/ia64/dom_fw_common.c
+tools/libxc/ia64/dom_fw_domu.c
+tools/libxc/ia64/xen/*.h
+tools/libxen/libxenapi-
+tools/libxen/test/test_bindings
+tools/libxen/test/test_event_handling
+tools/libxl/libxlu_cfg_y.output
+tools/libxl/xl
+tools/libxl/testenum
+tools/libxl/testenum.c
+tools/libaio/src/*.ol
+tools/libaio/src/*.os
+tools/misc/cpuperf/cpuperf-perfcntr
+tools/misc/cpuperf/cpuperf-xen
+tools/misc/lomount/lomount
+tools/misc/mbootpack/bin2c
+tools/misc/mbootpack/bootsect
+tools/misc/mbootpack/bzimage_header.c
+tools/misc/mbootpack/mbootpack
+tools/misc/mbootpack/setup
+tools/misc/miniterm/miniterm
+tools/misc/xc_shadow
+tools/misc/xen_cpuperf
+tools/misc/xen-detect
+tools/misc/xen-tmem-list-parse
+tools/misc/xenperf
+tools/misc/xenpm
+tools/misc/xen-hvmctx
+tools/misc/gtraceview
+tools/misc/gtracestat
+tools/misc/xenlockprof
+tools/pygrub/build/*
+tools/python/build/*
+tools/python/xen/util/path.py
+tools/remus/imqebt/imqebt
+tools/remus/kmod/*(.cmd|.mod|.ko|.mod.c|.symvers|.xen)
+tools/security/secpol_tool
+tools/security/xen/*
+tools/security/xensec_tool
+tools/tests/blowfish.bin
+tools/tests/blowfish.h
+tools/tests/test_x86_emulator
+tools/tests/x86_emulate
+tools/tests/regression/installed/*
+tools/tests/regression/build/*
+tools/tests/regression/downloads/*
+tools/vnet/Make.local
+tools/vnet/build/*
+tools/vnet/gc
+tools/vnet/gc*/*
+tools/vnet/vnet-module/*.ko
+tools/vnet/vnet-module/.*.cmd
+tools/vnet/vnet-module/.tmp_versions/*
+tools/vnet/vnet-module/vnet_module.mod.*
+tools/vnet/vnetd/vnetd
+tools/vtpm/tpm_emulator-*.tar.gz
+tools/vtpm/tpm_emulator/*
+tools/vtpm/vtpm/*
+tools/vtpm_manager/manager/vtpm_managerd
+tools/xcutils/lsevtchn
+tools/xcutils/xc_restore
+tools/xcutils/xc_save
+tools/xcutils/readnotes
+tools/xenfb/sdlfb
+tools/xenfb/vncfb
+tools/xenmon/xentrace_setmask
+tools/xenmon/xenbaked
+tools/xenpaging/xenpaging
+tools/xenpmd/xenpmd
+tools/xenstat/xentop/xentop
+tools/xenstore/testsuite/tmp/*
+tools/xenstore/xen
+tools/xenstore/xenstore
+tools/xenstore/xenstore-chmod
+tools/xenstore/xenstore-exists
+tools/xenstore/xenstore-list
+tools/xenstore/xenstore-read
+tools/xenstore/xenstore-rm
+tools/xenstore/xenstore-write
+tools/xenstore/xenstore-control
+tools/xenstore/xenstore-ls
+tools/xenstore/xenstored
+tools/xenstore/xenstored_test
+tools/xenstore/xs_crashme
+tools/xenstore/xs_random
+tools/xenstore/xs_stress
+tools/xenstore/xs_tdb_dump
+tools/xenstore/xs_test
+tools/xenstore/xs_watch_stress
+tools/xentrace/xentrace_setsize
+tools/xentrace/tbctl
+tools/xentrace/xenctx
+tools/xentrace/xentrace
+tools/xm-test/ramdisk/buildroot
+tools/xm-test/aclocal.m4
+tools/xm-test/autom4te
+tools/xm-test/install-sh
+tools/xm-test/mkinstalldirs
+tools/xm-test/missing
+tools/xm-test/config(ure|.log|.status|.guess|.sub)
+tools/xm-test/Makefile(.in)*
+tools/xm-test/*/Makefile(.in)*
+tools/xm-test/lib/XmTestLib/config.py
+tools/xm-test/lib/XmTestReport/xmtest.py
+tools/xm-test/tests/*.test
+tools/ioemu-remote
+tools/ioemu-dir
+tools/ocaml-xenstored*
+xen/.banner*
+xen/BLOG
+xen/System.map
+xen/arch/x86/asm-offsets.s
+xen/arch/x86/boot/mkelf32
+xen/arch/x86/xen.lds
+xen/arch/x86/boot/reloc.S
+xen/ddb/*
+xen/include/headers.chk
+xen/include/asm
+xen/include/asm-*/asm-offsets.h
+xen/include/asm-ia64/asm-xsi-offsets.h
+xen/include/asm-ia64/.offsets.h.stamp
+xen/include/asm-ia64/xen
+xen/include/compat/*
+xen/include/hypervisor-ifs/arch
+xen/include/linux
+xen/include/public/public
+xen/include/xen/*.new
+xen/include/xen/acm_policy.h
+xen/include/xen/banner.h
+xen/include/xen/compile.h
+xen/tools/figlet/figlet
+xen/tools/symbols
+xen/xen
+xen/xen-syms
+xen/xen.*
+xen/arch/ia64/asm-offsets.s
+xen/arch/ia64/asm-xsi-offsets.s
+xen/arch/ia64/map.out
+xen/arch/ia64/xen.lds.s
+unmodified_drivers/linux-2.6/.tmp_versions
+unmodified_drivers/linux-2.6/*.cmd
+unmodified_drivers/linux-2.6/*.ko
+unmodified_drivers/linux-2.6/*.mod.c
+LibVNCServer*
+
+tools/firmware/rombios/_rombios_.c
+tools/firmware/rombios/rombios.s
+tools/firmware/rombios/rombios.sym
+tools/include/xen-foreign/checker.c
+tools/include/xen-foreign/ia64.h
+tools/include/xen-foreign/structs.pyc
+tools/include/xen-foreign/x86_32.h
+tools/include/xen-foreign/x86_64.h
+
+.git
+tools/misc/xen-hptool
+tools/libxl/_*.[ch]
+tools/libxl/testidl
+tools/libxl/testidl.c
+tools/libxl/*.pyc
+tools/blktap2/control/tap-ctl
+tools/firmware/etherboot/eb-roms.h
+tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
+tools/misc/xenwatchdogd
+tools/misc/xen-hvmcrash
+tools/libvchan/vchan-node[12]
+tools/ocaml/*/.ocamldep.make
+tools/ocaml/*/*.cm[ixao]
+tools/ocaml/*/*.cmxa
+tools/ocaml/*/*.annot
+tools/ocaml/*/*/.ocamldep.make
+tools/ocaml/*/*/*.cm[ixao]
+tools/ocaml/*/*/*.cmxa
+tools/ocaml/*/*/*.annot
+tools/ocaml/*/*/META
+tools/ocaml/libs/xl/_libxl_types.inc
+tools/ocaml/libs/xl/_libxl_types.ml.in
+tools/ocaml/libs/xl/_libxl_types.mli.in
+tools/ocaml/libs/xl/xenlight.ml
+tools/ocaml/xenstored/oxenstored
+
+tools/debugger/kdd/kdd
+tools/firmware/etherboot/ipxe.tar.gz
+tools/firmware/etherboot/ipxe/
+tools/python/xen/lowlevel/xl/_pyxl_types.c
+tools/python/xen/lowlevel/xl/_pyxl_types.h
+tools/xenstore/xenstore-watch
+
+docs/txt/misc/*.txt
+docs/txt/man/*.txt

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:37 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxJ-00013c-CJ; Thu, 19 Jan 2012 21:55:37 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000nd-Li
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1327010127!9898702!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7628 invoked from network); 19 Jan 2012 21:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:28 -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 1Rnzx9-0007RR-7j
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rnzx9-0000ho-6V
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:27 +0000
Message-Id: <E1Rnzx9-0000ho-6V@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] .gitignore
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1326386721 0
# Node ID 94b5fb649d94451fa06352d240f4cf8fe37f9631
# Parent  80765dec9616de06027a18e5ad7d43017c70e7dd
.gitignore

Introduce a .gitignore file for the convenience of people who use git.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 80765dec9616 -r 94b5fb649d94 .gitignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Thu Jan 12 16:45:21 2012 +0000
@@ -0,0 +1,372 @@
+.hg
+*.orig
+*.rej
+*~
+*.o
+*.d
+*.opic
+*.a
+*.so
+*.so.[0-9]*
+*.bin
+*.bak
+*.tmp
+TAGS
+.config
+
+dist
+tools/ioemu-dir
+tools/ioemu-remote
+stubdom/*.tar.gz
+
+build-*
+dist/*
+docs/*.aux
+docs/*.dvi
+docs/*.log
+docs/*.pdf
+docs/*.ps
+docs/*.toc
+docs/api/*
+docs/figs/xenserver.eps
+docs/html/*
+docs/interface/WARNINGS
+docs/interface/images.pl
+docs/interface/images.tex
+docs/interface/img1.png
+docs/interface/index.html
+docs/interface/interface.css
+docs/interface/interface.html
+docs/interface/labels.pl
+docs/man1/
+docs/man5/
+docs/pdf/*
+docs/ps/*
+docs/user/WARNINGS
+docs/user/images.pl
+docs/user/images.tex
+docs/user/img1.png
+docs/user/img2.png
+docs/user/img3.png
+docs/user/index.html
+docs/user/internals.pl
+docs/user/labels.pl
+docs/user/user.css
+docs/user/user.html
+docs/xen-api/vm_lifecycle.eps
+docs/xen-api/xenapi-datamodel-graph.eps
+docs/xen-api/xenapi.out
+docs/xen-api/xenapi.dvi
+docs/xen-api/xenapi.pdf
+docs/xen-api/xenapi.ps
+docs/xen-api/xenapi.toc
+extras/mini-os/arch/ia64/gen_off.s
+extras/mini-os/include/mini-os
+extras/mini-os/include/ia64/mini-os
+extras/mini-os/include/ia64/offsets.h
+extras/mini-os/include/x86/mini-os
+extras/mini-os/include/xen
+extras/mini-os/mini-os*
+install/*
+linux-[^/]*-paravirt/*
+linux-2.6[^/]*/*
+linux-[^/]*-rc/*
+linux-[^/]*-tip/*
+linux-[^/]*-git/*
+linux-[^/]*.patch
+mkddbxen
+netbsd-[^/]*-tools/*
+netbsd-[^/]*-xen0/*
+netbsd-[^/]*-xenU/*
+netbsd-[^/]*.patch
+patches/*/.makedep
+patches/ebtables-brnf-5_vs_2.4.25.diff
+patches/ebtables.diff
+patches/tmp/*
+pristine-*
+ref-*
+tmp-*
+stubdom/binutils-*
+stubdom/cross-root-*
+stubdom/gcc-*
+stubdom/include
+stubdom/ioemu
+stubdom/xenstore
+stubdom/libxc-*
+stubdom/lwip-*
+stubdom/mini-os-*
+stubdom/mk-headers-*
+stubdom/newlib-1.*
+stubdom/newlib-x86*
+stubdom/pciutils-*
+stubdom/zlib-*
+stubdom/grub-*
+stubdom/ocaml-*
+stubdom/lwip/
+stubdom/ioemu/
+stubdom/stubdompath.sh
+tools/*/build/lib*/*.py
+tools/blktap2/daemon/blktapctrl
+tools/blktap2/drivers/img2qcow
+tools/blktap2/drivers/lock-util
+tools/blktap2/drivers/qcow-create
+tools/blktap2/drivers/qcow2raw
+tools/blktap2/drivers/tapdisk
+tools/blktap2/drivers/tapdisk-client
+tools/blktap2/drivers/tapdisk-diff
+tools/blktap2/drivers/tapdisk-stream
+tools/blktap2/drivers/tapdisk2
+tools/blktap2/drivers/td-util
+tools/blktap2/vhd/vhd-update
+tools/blktap2/vhd/vhd-util
+tools/blktap/drivers/blktapctrl
+tools/blktap/drivers/img2qcow
+tools/blktap/drivers/qcow-create
+tools/blktap/drivers/qcow2raw
+tools/blktap/drivers/tapdisk
+tools/check/.*
+tools/console/xenconsole
+tools/console/xenconsoled
+tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
+tools/debugger/gdb/gdb-6.2.1/*
+tools/debugger/gdb/gdb-6.2.1.tar.bz2
+tools/debugger/gdbsx/gdbsx
+tools/debugger/xenitp/xenitp
+tools/firmware/*/biossums
+tools/firmware/*.bin
+tools/firmware/*.sym
+tools/firmware/*bios/*bios*.txt
+tools/firmware/etherboot/gpxe/*
+tools/firmware/extboot/extboot.img
+tools/firmware/extboot/signrom
+tools/firmware/hvmloader/acpi/mk_dsdt
+tools/firmware/hvmloader/acpi/dsdt*.c
+tools/firmware/hvmloader/acpi/dsdt*.asl
+tools/firmware/hvmloader/acpi/ssdt_*.h
+tools/firmware/hvmloader/hvmloader
+tools/firmware/hvmloader/roms.h
+tools/firmware/hvmloader/roms.inc
+tools/firmware/rombios/BIOS-bochs-[^/]*
+tools/firmware/rombios/_rombios[^/]*_.c
+tools/firmware/rombios/rombios[^/]*.s
+tools/firmware/rombios/32bit/32bitbios_flat.h
+tools/firmware/vgabios/vbetables-gen
+tools/firmware/vgabios/vbetables.h
+tools/flask/loadpolicy/flask-loadpolicy
+tools/flask/utils/flask-getenforce
+tools/flask/utils/flask-loadpolicy
+tools/flask/utils/flask-setenforce
+tools/flask/utils/flask-label-pci
+tools/fs-back/fs-backend
+tools/hotplug/common/hotplugpath.sh
+tools/include/xen/*
+tools/include/xen-foreign/*.(c|h|size)
+tools/include/xen-foreign/checker
+tools/ioemu/.pc/*
+tools/ioemu/config-host.h
+tools/ioemu/config-host.mak
+tools/ioemu/i386-dm/Makefile
+tools/ioemu/i386-dm/config.h
+tools/ioemu/i386-dm/config.mak
+tools/ioemu/i386-dm/qemu-dm
+tools/ioemu/qemu-doc.html
+tools/ioemu/qemu-img.1
+tools/ioemu/qemu-img.pod
+tools/ioemu/qemu-tech.html
+tools/ioemu/qemu.1
+tools/ioemu/qemu.pod
+tools/ioemu/tapdisk-ioemu
+tools/libxc/ia64/asm/*.h
+tools/libxc/ia64/acpi/*.h
+tools/libxc/ia64/acpi/platform/*.h
+tools/libxc/ia64/dom_fw_asm.S
+tools/libxc/ia64/dom_fw_common.c
+tools/libxc/ia64/dom_fw_domu.c
+tools/libxc/ia64/xen/*.h
+tools/libxen/libxenapi-
+tools/libxen/test/test_bindings
+tools/libxen/test/test_event_handling
+tools/libxl/libxlu_cfg_y.output
+tools/libxl/xl
+tools/libxl/testenum
+tools/libxl/testenum.c
+tools/libaio/src/*.ol
+tools/libaio/src/*.os
+tools/misc/cpuperf/cpuperf-perfcntr
+tools/misc/cpuperf/cpuperf-xen
+tools/misc/lomount/lomount
+tools/misc/mbootpack/bin2c
+tools/misc/mbootpack/bootsect
+tools/misc/mbootpack/bzimage_header.c
+tools/misc/mbootpack/mbootpack
+tools/misc/mbootpack/setup
+tools/misc/miniterm/miniterm
+tools/misc/xc_shadow
+tools/misc/xen_cpuperf
+tools/misc/xen-detect
+tools/misc/xen-tmem-list-parse
+tools/misc/xenperf
+tools/misc/xenpm
+tools/misc/xen-hvmctx
+tools/misc/gtraceview
+tools/misc/gtracestat
+tools/misc/xenlockprof
+tools/pygrub/build/*
+tools/python/build/*
+tools/python/xen/util/path.py
+tools/remus/imqebt/imqebt
+tools/remus/kmod/*(.cmd|.mod|.ko|.mod.c|.symvers|.xen)
+tools/security/secpol_tool
+tools/security/xen/*
+tools/security/xensec_tool
+tools/tests/blowfish.bin
+tools/tests/blowfish.h
+tools/tests/test_x86_emulator
+tools/tests/x86_emulate
+tools/tests/regression/installed/*
+tools/tests/regression/build/*
+tools/tests/regression/downloads/*
+tools/vnet/Make.local
+tools/vnet/build/*
+tools/vnet/gc
+tools/vnet/gc*/*
+tools/vnet/vnet-module/*.ko
+tools/vnet/vnet-module/.*.cmd
+tools/vnet/vnet-module/.tmp_versions/*
+tools/vnet/vnet-module/vnet_module.mod.*
+tools/vnet/vnetd/vnetd
+tools/vtpm/tpm_emulator-*.tar.gz
+tools/vtpm/tpm_emulator/*
+tools/vtpm/vtpm/*
+tools/vtpm_manager/manager/vtpm_managerd
+tools/xcutils/lsevtchn
+tools/xcutils/xc_restore
+tools/xcutils/xc_save
+tools/xcutils/readnotes
+tools/xenfb/sdlfb
+tools/xenfb/vncfb
+tools/xenmon/xentrace_setmask
+tools/xenmon/xenbaked
+tools/xenpaging/xenpaging
+tools/xenpmd/xenpmd
+tools/xenstat/xentop/xentop
+tools/xenstore/testsuite/tmp/*
+tools/xenstore/xen
+tools/xenstore/xenstore
+tools/xenstore/xenstore-chmod
+tools/xenstore/xenstore-exists
+tools/xenstore/xenstore-list
+tools/xenstore/xenstore-read
+tools/xenstore/xenstore-rm
+tools/xenstore/xenstore-write
+tools/xenstore/xenstore-control
+tools/xenstore/xenstore-ls
+tools/xenstore/xenstored
+tools/xenstore/xenstored_test
+tools/xenstore/xs_crashme
+tools/xenstore/xs_random
+tools/xenstore/xs_stress
+tools/xenstore/xs_tdb_dump
+tools/xenstore/xs_test
+tools/xenstore/xs_watch_stress
+tools/xentrace/xentrace_setsize
+tools/xentrace/tbctl
+tools/xentrace/xenctx
+tools/xentrace/xentrace
+tools/xm-test/ramdisk/buildroot
+tools/xm-test/aclocal.m4
+tools/xm-test/autom4te
+tools/xm-test/install-sh
+tools/xm-test/mkinstalldirs
+tools/xm-test/missing
+tools/xm-test/config(ure|.log|.status|.guess|.sub)
+tools/xm-test/Makefile(.in)*
+tools/xm-test/*/Makefile(.in)*
+tools/xm-test/lib/XmTestLib/config.py
+tools/xm-test/lib/XmTestReport/xmtest.py
+tools/xm-test/tests/*.test
+tools/ioemu-remote
+tools/ioemu-dir
+tools/ocaml-xenstored*
+xen/.banner*
+xen/BLOG
+xen/System.map
+xen/arch/x86/asm-offsets.s
+xen/arch/x86/boot/mkelf32
+xen/arch/x86/xen.lds
+xen/arch/x86/boot/reloc.S
+xen/ddb/*
+xen/include/headers.chk
+xen/include/asm
+xen/include/asm-*/asm-offsets.h
+xen/include/asm-ia64/asm-xsi-offsets.h
+xen/include/asm-ia64/.offsets.h.stamp
+xen/include/asm-ia64/xen
+xen/include/compat/*
+xen/include/hypervisor-ifs/arch
+xen/include/linux
+xen/include/public/public
+xen/include/xen/*.new
+xen/include/xen/acm_policy.h
+xen/include/xen/banner.h
+xen/include/xen/compile.h
+xen/tools/figlet/figlet
+xen/tools/symbols
+xen/xen
+xen/xen-syms
+xen/xen.*
+xen/arch/ia64/asm-offsets.s
+xen/arch/ia64/asm-xsi-offsets.s
+xen/arch/ia64/map.out
+xen/arch/ia64/xen.lds.s
+unmodified_drivers/linux-2.6/.tmp_versions
+unmodified_drivers/linux-2.6/*.cmd
+unmodified_drivers/linux-2.6/*.ko
+unmodified_drivers/linux-2.6/*.mod.c
+LibVNCServer*
+
+tools/firmware/rombios/_rombios_.c
+tools/firmware/rombios/rombios.s
+tools/firmware/rombios/rombios.sym
+tools/include/xen-foreign/checker.c
+tools/include/xen-foreign/ia64.h
+tools/include/xen-foreign/structs.pyc
+tools/include/xen-foreign/x86_32.h
+tools/include/xen-foreign/x86_64.h
+
+.git
+tools/misc/xen-hptool
+tools/libxl/_*.[ch]
+tools/libxl/testidl
+tools/libxl/testidl.c
+tools/libxl/*.pyc
+tools/blktap2/control/tap-ctl
+tools/firmware/etherboot/eb-roms.h
+tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
+tools/misc/xenwatchdogd
+tools/misc/xen-hvmcrash
+tools/libvchan/vchan-node[12]
+tools/ocaml/*/.ocamldep.make
+tools/ocaml/*/*.cm[ixao]
+tools/ocaml/*/*.cmxa
+tools/ocaml/*/*.annot
+tools/ocaml/*/*/.ocamldep.make
+tools/ocaml/*/*/*.cm[ixao]
+tools/ocaml/*/*/*.cmxa
+tools/ocaml/*/*/*.annot
+tools/ocaml/*/*/META
+tools/ocaml/libs/xl/_libxl_types.inc
+tools/ocaml/libs/xl/_libxl_types.ml.in
+tools/ocaml/libs/xl/_libxl_types.mli.in
+tools/ocaml/libs/xl/xenlight.ml
+tools/ocaml/xenstored/oxenstored
+
+tools/debugger/kdd/kdd
+tools/firmware/etherboot/ipxe.tar.gz
+tools/firmware/etherboot/ipxe/
+tools/python/xen/lowlevel/xl/_pyxl_types.c
+tools/python/xen/lowlevel/xl/_pyxl_types.h
+tools/xenstore/xenstore-watch
+
+docs/txt/misc/*.txt
+docs/txt/man/*.txt

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:38 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxK-00016v-LS; Thu, 19 Jan 2012 21:55:38 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxI-0000zN-7t
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327010086!50989361!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4514 invoked from network); 19 Jan 2012 21:54:47 -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;
	19 Jan 2012 21:54:47 -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 1RnzxG-0007Sr-1C
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000kx-06
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Message-Id: <E1RnzxG-0000kx-06@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] cleanup get_gfn_from_base_reg()
	function.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326728175 -3600
# Node ID 6f8d5e8fdf1f77915c8b8c3b740a9eeec6ce869d
# Parent  0d4a60bf37b95b58bbae7019e0c263c556999131
cleanup get_gfn_from_base_reg() function.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0d4a60bf37b9 -r 6f8d5e8fdf1f xen/drivers/passthrough/amd/iommu_guest.c
--- a/xen/drivers/passthrough/amd/iommu_guest.c	Mon Jan 16 09:55:05 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_guest.c	Mon Jan 16 16:36:15 2012 +0100
@@ -121,16 +121,9 @@
 
 static unsigned long get_gfn_from_base_reg(uint64_t base_raw)
 {
-    struct mmio_reg reg;
-    uint64_t addr64;
-
-    reg.lo = iommu_get_addr_lo_from_reg(base_raw & DMA_32BIT_MASK);
-    reg.hi = iommu_get_addr_hi_from_reg(base_raw >> 32);
-    addr64 = reg_to_u64(reg);
-
-    ASSERT ( addr64 != 0 );
-
-    return addr64 >> PAGE_SHIFT;
+    base_raw &= PADDR_MASK;
+    ASSERT ( base_raw != 0 );
+    return base_raw >> PAGE_SHIFT;
 }
 
 static void guest_iommu_deliver_msi(struct domain *d)
diff -r 0d4a60bf37b9 -r 6f8d5e8fdf1f xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Mon Jan 16 09:55:05 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Mon Jan 16 16:36:15 2012 +0100
@@ -257,16 +257,4 @@
                          IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
 }
 
-static inline uint32_t iommu_get_addr_lo_from_reg(uint32_t reg)
-{
-    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
-                                  IOMMU_REG_BASE_ADDR_LOW_SHIFT);
-}
-
-static inline uint32_t iommu_get_addr_hi_from_reg(uint32_t reg)
-{
-    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
-                                  IOMMU_REG_BASE_ADDR_HIGH_SHIFT);
-}
-
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:38 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxK-00016v-LS; Thu, 19 Jan 2012 21:55:38 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxI-0000zN-7t
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327010086!50989361!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4514 invoked from network); 19 Jan 2012 21:54:47 -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;
	19 Jan 2012 21:54:47 -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 1RnzxG-0007Sr-1C
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000kx-06
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Message-Id: <E1RnzxG-0000kx-06@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] cleanup get_gfn_from_base_reg()
	function.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1326728175 -3600
# Node ID 6f8d5e8fdf1f77915c8b8c3b740a9eeec6ce869d
# Parent  0d4a60bf37b95b58bbae7019e0c263c556999131
cleanup get_gfn_from_base_reg() function.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 0d4a60bf37b9 -r 6f8d5e8fdf1f xen/drivers/passthrough/amd/iommu_guest.c
--- a/xen/drivers/passthrough/amd/iommu_guest.c	Mon Jan 16 09:55:05 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_guest.c	Mon Jan 16 16:36:15 2012 +0100
@@ -121,16 +121,9 @@
 
 static unsigned long get_gfn_from_base_reg(uint64_t base_raw)
 {
-    struct mmio_reg reg;
-    uint64_t addr64;
-
-    reg.lo = iommu_get_addr_lo_from_reg(base_raw & DMA_32BIT_MASK);
-    reg.hi = iommu_get_addr_hi_from_reg(base_raw >> 32);
-    addr64 = reg_to_u64(reg);
-
-    ASSERT ( addr64 != 0 );
-
-    return addr64 >> PAGE_SHIFT;
+    base_raw &= PADDR_MASK;
+    ASSERT ( base_raw != 0 );
+    return base_raw >> PAGE_SHIFT;
 }
 
 static void guest_iommu_deliver_msi(struct domain *d)
diff -r 0d4a60bf37b9 -r 6f8d5e8fdf1f xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Mon Jan 16 09:55:05 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Mon Jan 16 16:36:15 2012 +0100
@@ -257,16 +257,4 @@
                          IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
 }
 
-static inline uint32_t iommu_get_addr_lo_from_reg(uint32_t reg)
-{
-    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
-                                  IOMMU_REG_BASE_ADDR_LOW_SHIFT);
-}
-
-static inline uint32_t iommu_get_addr_hi_from_reg(uint32_t reg)
-{
-    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
-                                  IOMMU_REG_BASE_ADDR_HIGH_SHIFT);
-}
-
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:40 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxL-00019W-Q2; Thu, 19 Jan 2012 21:55:39 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000qA-4s
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1327010129!9891858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8071 invoked from network); 19 Jan 2012 21:55:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:30 -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 1RnzxA-0007Rf-Qu
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000iX-PD
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Message-Id: <E1RnzxA-0000iX-PD@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] remove inclusion of asm/config.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326440097 -3600
# Node ID 6f5fff70668b2ed0d3a70a673531676280ba5ca6
# Parent  86b8a1e3a419943801968da12042b4fe53fff537
remove inclusion of asm/config.h

This was always bogus (xen/config.h should have been used instead) and
is superfluous now that xen/config.h gets included through the compiler
command line.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/ia64/vmx/optvfault.S
--- a/xen/arch/ia64/vmx/optvfault.S	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/ia64/vmx/optvfault.S	Fri Jan 13 08:34:57 2012 +0100
@@ -6,8 +6,6 @@
  * Xuefei Xu (Anthony Xu) <anthony.xu@intel.com>
  */
 
-#include <linux/config.h>
-#include <asm/config.h>
 #include <asm/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/kregs.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/ia64/xen/cpufreq/cpufreq.c
--- a/xen/arch/ia64/xen/cpufreq/cpufreq.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/ia64/xen/cpufreq/cpufreq.c	Fri Jan 13 08:34:57 2012 +0100
@@ -21,7 +21,6 @@
 #include <xen/xmalloc.h>
 #include <asm/bug.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <asm/pal.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/ia64/xen/ivt.S
--- a/xen/arch/ia64/xen/ivt.S	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/ia64/xen/ivt.S	Fri Jan 13 08:34:57 2012 +0100
@@ -1,7 +1,6 @@
 #include <asm/debugger.h>
 #include <asm/vhpt.h>
 #include <public/arch-ia64.h>
-#include <asm/config.h>
 /*
  * arch/ia64/kernel/ivt.S
  *
@@ -43,8 +42,6 @@
  * Table is based upon EAS2.6 (Oct 1999)
  */
 
-#include <linux/config.h>
-
 #include <asm/asmmacro.h>
 #include <asm/break.h>
 #include <asm/ia32.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/x86/acpi/cpufreq/cpufreq.c
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c	Fri Jan 13 08:34:57 2012 +0100
@@ -38,7 +38,6 @@
 #include <asm/bug.h>
 #include <asm/msr.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <asm/cpufeature.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c	Fri Jan 13 08:34:57 2012 +0100
@@ -32,7 +32,6 @@
 #include <asm/bug.h>
 #include <asm/msr.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <asm/cpufeature.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq.c	Fri Jan 13 08:34:57 2012 +0100
@@ -41,7 +41,6 @@
 #include <xen/cpu.h>
 #include <asm/bug.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <acpi/acpi.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/drivers/cpufreq/cpufreq_ondemand.c
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c	Fri Jan 13 08:34:57 2012 +0100
@@ -18,7 +18,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
 #include <xen/timer.h>
-#include <asm/config.h>
 #include <acpi/cpufreq/cpufreq.h>
 
 #define DEF_FREQUENCY_UP_THRESHOLD              (80)
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/drivers/cpufreq/utility.c
--- a/xen/drivers/cpufreq/utility.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/drivers/cpufreq/utility.c	Fri Jan 13 08:34:57 2012 +0100
@@ -28,7 +28,6 @@
 #include <xen/sched.h>
 #include <xen/timer.h>
 #include <xen/trace.h>
-#include <asm/config.h>
 #include <acpi/cpufreq/cpufreq.h>
 #include <public/sysctl.h>
 
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-ia64/linux-xen/asm/perfmon.h
--- a/xen/include/asm-ia64/linux-xen/asm/perfmon.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-ia64/linux-xen/asm/perfmon.h	Fri Jan 13 08:34:57 2012 +0100
@@ -7,7 +7,6 @@
 #define _ASM_IA64_PERFMON_H
 
 #ifdef XEN
-#include <asm/config.h>
 #ifndef pt_regs
 #define pt_regs cpu_user_regs
 #endif
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-ia64/privop_stat.h
--- a/xen/include/asm-ia64/privop_stat.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-ia64/privop_stat.h	Fri Jan 13 08:34:57 2012 +0100
@@ -1,6 +1,6 @@
 #ifndef _XEN_IA64_PRIVOP_STAT_H
 #define _XEN_IA64_PRIVOP_STAT_H
-#include <asm/config.h>
+
 #include <xen/types.h>
 #include <public/xen.h>
 
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-ia64/xensystem.h
--- a/xen/include/asm-ia64/xensystem.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-ia64/xensystem.h	Fri Jan 13 08:34:57 2012 +0100
@@ -10,7 +10,6 @@
  * 	Kun Tian (Kevin Tian) <kevin.tian@intel.com>
  *
  */
-#include <asm/config.h>
 
 /* Define HV space hierarchy.
    VMM memory space is protected by CPL for paravirtualized domains and
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-x86/hvm/svm/nestedsvm.h
--- a/xen/include/asm-x86/hvm/svm/nestedsvm.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/nestedsvm.h	Fri Jan 13 08:34:57 2012 +0100
@@ -19,7 +19,6 @@
 #ifndef __ASM_X86_HVM_SVM_NESTEDSVM_H__
 #define __ASM_X86_HVM_SVM_NESTEDSVM_H__
 
-#include <asm/config.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/svm/vmcb.h>
 
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Jan 13 08:34:57 2012 +0100
@@ -19,7 +19,6 @@
 #ifndef __ASM_X86_HVM_VMX_VMCS_H__
 #define __ASM_X86_HVM_VMX_VMCS_H__
 
-#include <asm/config.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/vpmu.h>
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:40 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxL-00019W-Q2; Thu, 19 Jan 2012 21:55:39 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000qA-4s
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1327010129!9891858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8071 invoked from network); 19 Jan 2012 21:55:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:30 -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 1RnzxA-0007Rf-Qu
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxA-0000iX-PD
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:28 +0000
Message-Id: <E1RnzxA-0000iX-PD@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] remove inclusion of asm/config.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326440097 -3600
# Node ID 6f5fff70668b2ed0d3a70a673531676280ba5ca6
# Parent  86b8a1e3a419943801968da12042b4fe53fff537
remove inclusion of asm/config.h

This was always bogus (xen/config.h should have been used instead) and
is superfluous now that xen/config.h gets included through the compiler
command line.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/ia64/vmx/optvfault.S
--- a/xen/arch/ia64/vmx/optvfault.S	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/ia64/vmx/optvfault.S	Fri Jan 13 08:34:57 2012 +0100
@@ -6,8 +6,6 @@
  * Xuefei Xu (Anthony Xu) <anthony.xu@intel.com>
  */
 
-#include <linux/config.h>
-#include <asm/config.h>
 #include <asm/pgtable.h>
 #include <asm/asmmacro.h>
 #include <asm/kregs.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/ia64/xen/cpufreq/cpufreq.c
--- a/xen/arch/ia64/xen/cpufreq/cpufreq.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/ia64/xen/cpufreq/cpufreq.c	Fri Jan 13 08:34:57 2012 +0100
@@ -21,7 +21,6 @@
 #include <xen/xmalloc.h>
 #include <asm/bug.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <asm/pal.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/ia64/xen/ivt.S
--- a/xen/arch/ia64/xen/ivt.S	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/ia64/xen/ivt.S	Fri Jan 13 08:34:57 2012 +0100
@@ -1,7 +1,6 @@
 #include <asm/debugger.h>
 #include <asm/vhpt.h>
 #include <public/arch-ia64.h>
-#include <asm/config.h>
 /*
  * arch/ia64/kernel/ivt.S
  *
@@ -43,8 +42,6 @@
  * Table is based upon EAS2.6 (Oct 1999)
  */
 
-#include <linux/config.h>
-
 #include <asm/asmmacro.h>
 #include <asm/break.h>
 #include <asm/ia32.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/x86/acpi/cpufreq/cpufreq.c
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c	Fri Jan 13 08:34:57 2012 +0100
@@ -38,7 +38,6 @@
 #include <asm/bug.h>
 #include <asm/msr.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <asm/cpufeature.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c	Fri Jan 13 08:34:57 2012 +0100
@@ -32,7 +32,6 @@
 #include <asm/bug.h>
 #include <asm/msr.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <asm/cpufeature.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq.c	Fri Jan 13 08:34:57 2012 +0100
@@ -41,7 +41,6 @@
 #include <xen/cpu.h>
 #include <asm/bug.h>
 #include <asm/io.h>
-#include <asm/config.h>
 #include <asm/processor.h>
 #include <asm/percpu.h>
 #include <acpi/acpi.h>
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/drivers/cpufreq/cpufreq_ondemand.c
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c	Fri Jan 13 08:34:57 2012 +0100
@@ -18,7 +18,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
 #include <xen/timer.h>
-#include <asm/config.h>
 #include <acpi/cpufreq/cpufreq.h>
 
 #define DEF_FREQUENCY_UP_THRESHOLD              (80)
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/drivers/cpufreq/utility.c
--- a/xen/drivers/cpufreq/utility.c	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/drivers/cpufreq/utility.c	Fri Jan 13 08:34:57 2012 +0100
@@ -28,7 +28,6 @@
 #include <xen/sched.h>
 #include <xen/timer.h>
 #include <xen/trace.h>
-#include <asm/config.h>
 #include <acpi/cpufreq/cpufreq.h>
 #include <public/sysctl.h>
 
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-ia64/linux-xen/asm/perfmon.h
--- a/xen/include/asm-ia64/linux-xen/asm/perfmon.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-ia64/linux-xen/asm/perfmon.h	Fri Jan 13 08:34:57 2012 +0100
@@ -7,7 +7,6 @@
 #define _ASM_IA64_PERFMON_H
 
 #ifdef XEN
-#include <asm/config.h>
 #ifndef pt_regs
 #define pt_regs cpu_user_regs
 #endif
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-ia64/privop_stat.h
--- a/xen/include/asm-ia64/privop_stat.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-ia64/privop_stat.h	Fri Jan 13 08:34:57 2012 +0100
@@ -1,6 +1,6 @@
 #ifndef _XEN_IA64_PRIVOP_STAT_H
 #define _XEN_IA64_PRIVOP_STAT_H
-#include <asm/config.h>
+
 #include <xen/types.h>
 #include <public/xen.h>
 
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-ia64/xensystem.h
--- a/xen/include/asm-ia64/xensystem.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-ia64/xensystem.h	Fri Jan 13 08:34:57 2012 +0100
@@ -10,7 +10,6 @@
  * 	Kun Tian (Kevin Tian) <kevin.tian@intel.com>
  *
  */
-#include <asm/config.h>
 
 /* Define HV space hierarchy.
    VMM memory space is protected by CPL for paravirtualized domains and
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-x86/hvm/svm/nestedsvm.h
--- a/xen/include/asm-x86/hvm/svm/nestedsvm.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/nestedsvm.h	Fri Jan 13 08:34:57 2012 +0100
@@ -19,7 +19,6 @@
 #ifndef __ASM_X86_HVM_SVM_NESTEDSVM_H__
 #define __ASM_X86_HVM_SVM_NESTEDSVM_H__
 
-#include <asm/config.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/svm/vmcb.h>
 
diff -r 86b8a1e3a419 -r 6f5fff70668b xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Jan 13 08:33:31 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Jan 13 08:34:57 2012 +0100
@@ -19,7 +19,6 @@
 #ifndef __ASM_X86_HVM_VMX_VMCS_H__
 #define __ASM_X86_HVM_VMX_VMCS_H__
 
-#include <asm/config.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/vpmu.h>
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:40 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001A3-1g; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-00012L-88
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1327010066!61729797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,DIET_1
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10280 invoked from network); 19 Jan 2012 21:54:27 -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;
	19 Jan 2012 21:54:27 -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 1RnzxF-0007Sd-2e
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxF-0000kT-0S
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Message-Id: <E1RnzxF-0000kT-0S@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] sedf: remove useless tracing printk
	and harmonize comments style.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1326665112 0
# Node ID ffe158446c79a318a2f878dc938c0e61f46694e0
# Parent  a141f6d64916e3006cca13403d1b449d087893b8
sedf: remove useless tracing printk and harmonize comments style.

sched_sedf.c used o have its own mechanism for producing tracing-alike
kind of information (domain block, wakeup, etc.). Nowadays, with an
even not so high number of pCPUs/vCPUs, just trying to enable this
makes the serial console completely unusable, produces tons of very
hard to parse and interpreet logging and can easily livelock
Dom0. Moreover, pretty much the same result this is struggling to get
to, is better achieved by enabling the scheduler-related tracing
events, as it is for the other schedulers (say, credit or credit2).

For all these reasons, this removes that machinery completely. While
at it, check in some cosmetics that harmonize the comments withim
themself and with the rest of the code base.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---


diff -r a141f6d64916 -r ffe158446c79 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Sun Jan 15 22:02:35 2012 +0000
+++ b/xen/common/sched_sedf.c	Sun Jan 15 22:05:12 2012 +0000
@@ -13,14 +13,6 @@
 #include <xen/time.h>
 #include <xen/errno.h>
 
-/*verbosity settings*/
-#define SEDFLEVEL 0
-#define PRINT(_f, _a...)                        \
-    do {                                        \
-        if ( (_f) <= SEDFLEVEL )                \
-            printk(_a );                        \
-    } while ( 0 )
-
 #define SEDF_CPUONLINE(_pool)                                             \
     (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 
@@ -71,34 +63,35 @@
     struct list_head list;
     struct list_head extralist[2];
  
-    /*Parameters for EDF*/
-    s_time_t  period;  /*=(relative deadline)*/
-    s_time_t  slice;  /*=worst case execution time*/
+    /* Parameters for EDF */
+    s_time_t  period;  /* = relative deadline */
+    s_time_t  slice;   /* = worst case execution time */
  
-    /*Advaced Parameters*/
-    /*Latency Scaling*/
+    /* Advaced Parameters */
+
+    /* Latency Scaling */
     s_time_t  period_orig;
     s_time_t  slice_orig;
     s_time_t  latency;
  
-    /*status of domain*/
+    /* Status of domain */
     int       status;
-    /*weights for "Scheduling for beginners/ lazy/ etc." ;)*/
+    /* Weights for "Scheduling for beginners/ lazy/ etc." ;) */
     short     weight;
     short     extraweight;
-    /*Bookkeeping*/
+    /* Bookkeeping */
     s_time_t  deadl_abs;
     s_time_t  sched_start_abs;
     s_time_t  cputime;
-    /* times the domain un-/blocked */
+    /* Times the domain un-/blocked */
     s_time_t  block_abs;
     s_time_t  unblock_abs;
  
-    /*scores for {util, block penalty}-weighted extratime distribution*/
+    /* Scores for {util, block penalty}-weighted extratime distribution */
     int   score[2];
     s_time_t  short_block_lost_tot;
  
-    /*Statistics*/
+    /* Statistics */
     s_time_t  extra_time_tot;
 
 #ifdef SEDF_STATS
@@ -165,18 +158,17 @@
 {
     struct list_head *list = EXTRALIST(d,i);
     ASSERT(extraq_on(d,i));
-    PRINT(3, "Removing domain %i.%i from L%i extraq\n",
-          d->domain->domain_id, d->vcpu_id, i);
     list_del(list);
     list->next = NULL;
     ASSERT(!extraq_on(d, i));
 }
 
-/* adds a domain to the queue of processes which are aware of extra time. List
-   is sorted by score, where a lower score means higher priority for an extra
-   slice. It also updates the score, by simply subtracting a fixed value from
-   each entry, in order to avoid overflow. The algorithm works by simply
-   charging each domain that recieved extratime with an inverse of its weight.
+/*
+ * Adds a domain to the queue of processes which are aware of extra time. List
+ * is sorted by score, where a lower score means higher priority for an extra
+ * slice. It also updates the score, by simply subtracting a fixed value from
+ * each entry, in order to avoid overflow. The algorithm works by simply
+ * charging each domain that recieved extratime with an inverse of its weight.
  */ 
 static inline void extraq_add_sort_update(struct vcpu *d, int i, int sub)
 {
@@ -185,11 +177,6 @@
  
     ASSERT(!extraq_on(d,i));
 
-    PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %"PRIi64")"
-          " to L%i extraq\n",
-          d->domain->domain_id, d->vcpu_id, EDOM_INFO(d)->score[i],
-          EDOM_INFO(d)->short_block_lost_tot, i);
-
     /*
      * Iterate through all elements to find our "hole" and on our way
      * update all the other scores.
@@ -200,25 +187,18 @@
         curinf->score[i] -= sub;
         if ( EDOM_INFO(d)->score[i] < curinf->score[i] )
             break;
-        PRINT(4,"\tbehind domain %i.%i (score= %i)\n",
-              curinf->vcpu->domain->domain_id,
-              curinf->vcpu->vcpu_id, curinf->score[i]);
     }
 
-    /* cur now contains the element, before which we'll enqueue. */
-    PRINT(3, "\tlist_add to %p\n", cur->prev);
+    /* cur now contains the element, before which we'll enqueue */
     list_add(EXTRALIST(d,i),cur->prev);
  
-    /* Continue updating the extraq. */
+    /* Continue updating the extraq */
     if ( (cur != EXTRAQ(d->processor,i)) && sub )
     {
         for ( cur = cur->next; cur != EXTRAQ(d->processor,i); cur = cur->next )
         {
             curinf = list_entry(cur,struct sedf_vcpu_info, extralist[i]);
             curinf->score[i] -= sub;
-            PRINT(4, "\tupdating domain %i.%i (score= %u)\n",
-                  curinf->vcpu->domain->domain_id, 
-                  curinf->vcpu->vcpu_id, curinf->score[i]);
         }
     }
 
@@ -228,29 +208,14 @@
 {
     if ( extraq_on(d, EXTRA_UTIL_Q) )
     {
-        PRINT(2,"Dom %i.%i is on L1 extraQ\n",
-              d->domain->domain_id, d->vcpu_id);
-
         if ( !(EDOM_INFO(d)->status & EXTRA_AWARE) &&
              !extra_runs(EDOM_INFO(d)) )
-        {
             extraq_del(d, EXTRA_UTIL_Q);
-            PRINT(2,"Removed dom %i.%i from L1 extraQ\n",
-                  d->domain->domain_id, d->vcpu_id);
-        }
     }
     else
     {
-        PRINT(2, "Dom %i.%i is NOT on L1 extraQ\n",
-              d->domain->domain_id,
-              d->vcpu_id);
-
         if ( (EDOM_INFO(d)->status & EXTRA_AWARE) && sedf_runnable(d) )
-        {
             extraq_add_sort_update(d, EXTRA_UTIL_Q, 0);
-            PRINT(2,"Added dom %i.%i to L1 extraQ\n",
-                  d->domain->domain_id, d->vcpu_id);
-        }
     }
 }
 
@@ -259,7 +224,7 @@
     struct sedf_vcpu_info *inf = EDOM_INFO(d);
 
     if ( inf->status & EXTRA_AWARE )
-        /* Put on the weighted extraq without updating any scores. */
+        /* Put on the weighted extraq without updating any scores */
         extraq_add_sort_update(d, EXTRA_UTIL_Q, 0);
 }
 
@@ -272,8 +237,6 @@
 {
     struct list_head *list = LIST(d);
     ASSERT(__task_on_queue(d));
-    PRINT(3,"Removing domain %i.%i (bop= %"PRIu64") from runq/waitq\n",
-          d->domain->domain_id, d->vcpu_id, PERIOD_BEGIN(EDOM_INFO(d)));
     list_del(list);
     list->next = NULL;
     ASSERT(!__task_on_queue(d));
@@ -286,13 +249,12 @@
 {
     struct list_head     *cur;
 
-    /* Iterate through all elements to find our "hole". */
+    /* Iterate through all elements to find our "hole" */
     list_for_each( cur, list )
         if ( comp(element, cur) < 0 )
             break;
 
-    /* cur now contains the element, before which we'll enqueue. */
-    PRINT(3,"\tlist_add to %p\n",cur->prev);
+    /* cur now contains the element, before which we'll enqueue */
     list_add(element, cur->prev);
 }
 
@@ -310,30 +272,28 @@
         return 1;                                                       \
 }
 
-/* adds a domain to the queue of processes which wait for the beginning of the
-   next period; this list is therefore sortet by this time, which is simply
-   absol. deadline - period
+/*
+ * Adds a domain to the queue of processes which wait for the beginning of the
+ * next period; this list is therefore sortet by this time, which is simply
+ * absol. deadline - period.
  */ 
 DOMAIN_COMPARER(waitq, list, PERIOD_BEGIN(d1), PERIOD_BEGIN(d2));
 static inline void __add_to_waitqueue_sort(struct vcpu *v)
 {
     ASSERT(!__task_on_queue(v));
-    PRINT(3,"Adding domain %i.%i (bop= %"PRIu64") to waitq\n",
-          v->domain->domain_id, v->vcpu_id, PERIOD_BEGIN(EDOM_INFO(v)));
     list_insert_sort(WAITQ(v->processor), LIST(v), waitq_comp);
     ASSERT(__task_on_queue(v));
 }
 
-/* adds a domain to the queue of processes which have started their current
-   period and are runnable (i.e. not blocked, dieing,...). The first element
-   on this list is running on the processor, if the list is empty the idle
-   task will run. As we are implementing EDF, this list is sorted by deadlines.
+/*
+ * Adds a domain to the queue of processes which have started their current
+ * period and are runnable (i.e. not blocked, dieing,...). The first element
+ * on this list is running on the processor, if the list is empty the idle
+ * task will run. As we are implementing EDF, this list is sorted by deadlines.
  */ 
 DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs);
 static inline void __add_to_runqueue_sort(struct vcpu *v)
 {
-    PRINT(3,"Adding domain %i.%i (deadl= %"PRIu64") to runq\n",
-          v->domain->domain_id, v->vcpu_id, EDOM_INFO(v)->deadl_abs);
     list_insert_sort(RUNQ(v->processor), LIST(v), runq_comp);
 }
 
@@ -361,12 +321,12 @@
 
     inf->vcpu = v;
 
-    /* Every VCPU gets an equal share of extratime by default. */
+    /* Every VCPU gets an equal share of extratime by default */
     inf->deadl_abs   = 0;
     inf->latency     = 0;
     inf->status      = EXTRA_AWARE | SEDF_ASLEEP;
     inf->extraweight = 1;
-    /* Upon creation all domain are best-effort. */
+    /* Upon creation all domain are best-effort */
     inf->period      = WEIGHT_PERIOD;
     inf->slice       = 0;
 
@@ -450,21 +410,19 @@
 {
     struct sedf_vcpu_info* inf = EDOM_INFO(d);
 
-    /* Current domain is running in real time mode. */
+    /* Current domain is running in real time mode */
     ASSERT(__task_on_queue(d));
 
-    /* Update the domain's cputime. */
+    /* Update the domain's cputime */
     inf->cputime += now - inf->sched_start_abs;
 
-    /*
-     * Scheduling decisions which don't remove the running domain from the
-     * runq. 
-     */
+    /* Scheduling decisions which don't remove the running domain from
+     * the runq */
     if ( (inf->cputime < inf->slice) && sedf_runnable(d) )
         return;
   
     __del_from_queue(d);
-  
+
     /*
      * Manage bookkeeping (i.e. calculate next deadline, memorise
      * overrun-time of slice) of finished domains.
@@ -475,30 +433,30 @@
   
         if ( inf->period < inf->period_orig )
         {
-            /* This domain runs in latency scaling or burst mode. */
+            /* This domain runs in latency scaling or burst mode */
             inf->period *= 2;
             inf->slice  *= 2;
             if ( (inf->period > inf->period_orig) ||
                  (inf->slice > inf->slice_orig) )
             {
-                /* Reset slice and period. */
+                /* Reset slice and period */
                 inf->period = inf->period_orig;
                 inf->slice = inf->slice_orig;
             }
         }
 
-        /* Set next deadline. */
+        /* Set next deadline */
         inf->deadl_abs += inf->period;
     }
  
-    /* Add a runnable domain to the waitqueue. */
+    /* Add a runnable domain to the waitqueue */
     if ( sedf_runnable(d) )
     {
         __add_to_waitqueue_sort(d);
     }
     else
     {
-        /* We have a blocked realtime task -> remove it from exqs too. */
+        /* We have a blocked realtime task -> remove it from exqs too */
         if ( extraq_on(d, EXTRA_PEN_Q) )
             extraq_del(d, EXTRA_PEN_Q);
         if ( extraq_on(d, EXTRA_UTIL_Q) )
@@ -518,8 +476,6 @@
     struct list_head     *cur, *tmp;
     struct sedf_vcpu_info *curinf;
  
-    PRINT(3,"Updating waitq..\n");
-
     /*
      * Check for the first elements of the waitqueue, whether their
      * next period has already started.
@@ -527,41 +483,32 @@
     list_for_each_safe ( cur, tmp, waitq )
     {
         curinf = list_entry(cur, struct sedf_vcpu_info, list);
-        PRINT(4,"\tLooking @ dom %i.%i\n",
-              curinf->vcpu->domain->domain_id, curinf->vcpu->vcpu_id);
         if ( PERIOD_BEGIN(curinf) > now )
             break;
         __del_from_queue(curinf->vcpu);
         __add_to_runqueue_sort(curinf->vcpu);
     }
  
-    PRINT(3,"Updating runq..\n");
-
-    /* Process the runq, find domains that are on the runq that shouldn't. */
+    /* Process the runq, find domains that are on the runq that shouldn't */
     list_for_each_safe ( cur, tmp, runq )
     {
         curinf = list_entry(cur,struct sedf_vcpu_info,list);
-        PRINT(4,"\tLooking @ dom %i.%i\n",
-              curinf->vcpu->domain->domain_id, curinf->vcpu->vcpu_id);
 
         if ( unlikely(curinf->slice == 0) )
         {
-            /* Ignore domains with empty slice. */
-            PRINT(4,"\tUpdating zero-slice domain %i.%i\n",
-                  curinf->vcpu->domain->domain_id,
-                  curinf->vcpu->vcpu_id);
+            /* Ignore domains with empty slice */
             __del_from_queue(curinf->vcpu);
 
-            /* Move them to their next period. */
+            /* Move them to their next period */
             curinf->deadl_abs += curinf->period;
 
-            /* Ensure that the start of the next period is in the future. */
+            /* Ensure that the start of the next period is in the future */
             if ( unlikely(PERIOD_BEGIN(curinf) < now) )
                 curinf->deadl_abs += 
                     (DIV_UP(now - PERIOD_BEGIN(curinf),
                             curinf->period)) * curinf->period;
 
-            /* Put them back into the queue. */
+            /* Put them back into the queue */
             __add_to_waitqueue_sort(curinf->vcpu);
         }
         else if ( unlikely((curinf->deadl_abs < now) ||
@@ -571,18 +518,18 @@
              * We missed the deadline or the slice was already finished.
              * Might hapen because of dom_adj.
              */
-            PRINT(4,"\tDomain %i.%i exceeded it's deadline/"
-                  "slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
-                  " cputime: %"PRIu64"\n",
-                  curinf->vcpu->domain->domain_id,
-                  curinf->vcpu->vcpu_id,
-                  curinf->deadl_abs, curinf->slice, now,
-                  curinf->cputime);
+            printk("\tDomain %i.%i exceeded it's deadline/"
+                   "slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
+                   " cputime: %"PRIu64"\n",
+                   curinf->vcpu->domain->domain_id,
+                   curinf->vcpu->vcpu_id,
+                   curinf->deadl_abs, curinf->slice, now,
+                   curinf->cputime);
             __del_from_queue(curinf->vcpu);
 
-            /* Common case: we miss one period. */
+            /* Common case: we miss one period */
             curinf->deadl_abs += curinf->period;
-   
+
             /*
              * If we are still behind: modulo arithmetic, force deadline
              * to be in future and aligned to period borders.
@@ -593,7 +540,7 @@
                            curinf->period) * curinf->period;
             ASSERT(curinf->deadl_abs >= now);
 
-            /* Give a fresh slice. */
+            /* Give a fresh slice */
             curinf->cputime = 0;
             if ( PERIOD_BEGIN(curinf) > now )
                 __add_to_waitqueue_sort(curinf->vcpu);
@@ -603,17 +550,17 @@
         else
             break;
     }
-
-    PRINT(3,"done updating the queues\n");
 }
 
 
-/* removes a domain from the head of the according extraQ and
-   requeues it at a specified position:
-     round-robin extratime: end of extraQ
-     weighted ext.: insert in sorted list by score
-   if the domain is blocked / has regained its short-block-loss
-   time it is not put on any queue */
+/*
+ * removes a domain from the head of the according extraQ and
+ * requeues it at a specified position:
+ *   round-robin extratime: end of extraQ
+ *   weighted ext.: insert in sorted list by score
+ * if the domain is blocked / has regained its short-block-loss
+ * time it is not put on any queue.
+ */
 static void desched_extra_dom(s_time_t now, struct vcpu *d)
 {
     struct sedf_vcpu_info *inf = EDOM_INFO(d);
@@ -622,29 +569,25 @@
 
     ASSERT(extraq_on(d, i));
 
-    /* Unset all running flags. */
+    /* Unset all running flags */
     inf->status  &= ~(EXTRA_RUN_PEN | EXTRA_RUN_UTIL);
-    /* Fresh slice for the next run. */
+    /* Fresh slice for the next run */
     inf->cputime = 0;
-    /* Accumulate total extratime. */
+    /* Accumulate total extratime */
     inf->extra_time_tot += now - inf->sched_start_abs;
     /* Remove extradomain from head of the queue. */
     extraq_del(d, i);
 
-    /* Update the score. */
+    /* Update the score */
     oldscore = inf->score[i];
     if ( i == EXTRA_PEN_Q )
     {
-        /*domain was running in L0 extraq*/
-        /*reduce block lost, probably more sophistication here!*/
+        /* Domain was running in L0 extraq */
+        /* reduce block lost, probably more sophistication here!*/
         /*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
         inf->short_block_lost_tot -= now - inf->sched_start_abs;
-        PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
-              inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id,
-              inf->short_block_lost_tot);
 #if 0
-        /*
-         * KAF: If we don't exit short-blocking state at this point
+        /* KAF: If we don't exit short-blocking state at this point
          * domain0 can steal all CPU for up to 10 seconds before
          * scheduling settles down (when competing against another
          * CPU-bound domain). Doing this seems to make things behave
@@ -653,51 +596,59 @@
         if ( inf->short_block_lost_tot <= 0 )
 #endif
         {
-            PRINT(4,"Domain %i.%i compensated short block loss!\n",
-                  inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id);
-            /*we have (over-)compensated our block penalty*/
+            /* We have (over-)compensated our block penalty */
             inf->short_block_lost_tot = 0;
-            /*we don't want a place on the penalty queue anymore!*/
+            /* We don't want a place on the penalty queue anymore! */
             inf->status &= ~EXTRA_WANT_PEN_Q;
             goto check_extra_queues;
         }
 
-        /*we have to go again for another try in the block-extraq,
-          the score is not used incremantally here, as this is
-          already done by recalculating the block_lost*/
+        /*
+         * We have to go again for another try in the block-extraq,
+         * the score is not used incremantally here, as this is
+         * already done by recalculating the block_lost
+         */
         inf->score[EXTRA_PEN_Q] = (inf->period << 10) /
             inf->short_block_lost_tot;
         oldscore = 0;
     }
     else
     {
-        /*domain was running in L1 extraq => score is inverse of
-          utilization and is used somewhat incremental!*/
+        /*
+         * Domain was running in L1 extraq => score is inverse of
+         * utilization and is used somewhat incremental!
+         */
         if ( !inf->extraweight )
-            /*NB: use fixed point arithmetic with 10 bits*/
+        {
+            /* NB: use fixed point arithmetic with 10 bits */
             inf->score[EXTRA_UTIL_Q] = (inf->period << 10) /
                 inf->slice;
+        }
         else
-            /*conversion between realtime utilisation and extrawieght:
-              full (ie 100%) utilization is equivalent to 128 extraweight*/
+        {
+            /*
+             * Conversion between realtime utilisation and extrawieght:
+             * full (ie 100%) utilization is equivalent to 128 extraweight
+             */
             inf->score[EXTRA_UTIL_Q] = (1<<17) / inf->extraweight;
+        }
     }
 
  check_extra_queues:
-    /* Adding a runnable domain to the right queue and removing blocked ones*/
+    /* Adding a runnable domain to the right queue and removing blocked ones */
     if ( sedf_runnable(d) )
     {
-        /*add according to score: weighted round robin*/
+        /* Add according to score: weighted round robin */
         if (((inf->status & EXTRA_AWARE) && (i == EXTRA_UTIL_Q)) ||
             ((inf->status & EXTRA_WANT_PEN_Q) && (i == EXTRA_PEN_Q)))
             extraq_add_sort_update(d, i, oldscore);
     }
     else
     {
-        /*remove this blocked domain from the waitq!*/
+        /* Remove this blocked domain from the waitq! */
         __del_from_queue(d);
-        /*make sure that we remove a blocked domain from the other
-          extraq too*/
+        /* Make sure that we remove a blocked domain from the other
+         * extraq too. */
         if ( i == EXTRA_PEN_Q )
         {
             if ( extraq_on(d, EXTRA_UTIL_Q) )
@@ -729,8 +680,10 @@
 
     if ( !list_empty(extraq[EXTRA_PEN_Q]) )
     {
-        /*we still have elements on the level 0 extraq 
-          => let those run first!*/
+        /*
+         * We still have elements on the level 0 extraq
+         * => let those run first!
+         */
         runinf   = list_entry(extraq[EXTRA_PEN_Q]->next, 
                               struct sedf_vcpu_info, extralist[EXTRA_PEN_Q]);
         runinf->status |= EXTRA_RUN_PEN;
@@ -744,7 +697,7 @@
     {
         if ( !list_empty(extraq[EXTRA_UTIL_Q]) )
         {
-            /*use elements from the normal extraqueue*/
+            /* Use elements from the normal extraqueue */
             runinf   = list_entry(extraq[EXTRA_UTIL_Q]->next,
                                   struct sedf_vcpu_info,
                                   extralist[EXTRA_UTIL_Q]);
@@ -794,11 +747,13 @@
 }
 
 
-/* Main scheduling function
-   Reasons for calling this function are:
-   -timeslice for the current period used up
-   -domain on waitqueue has started it's period
-   -and various others ;) in general: determine which domain to run next*/
+/*
+ * Main scheduling function
+ * Reasons for calling this function are:
+ * -timeslice for the current period used up
+ * -domain on waitqueue has started it's period
+ * -and various others ;) in general: determine which domain to run next
+ */
 static struct task_slice sedf_do_schedule(
     const struct scheduler *ops, s_time_t now, bool_t tasklet_work_scheduled)
 {
@@ -811,13 +766,15 @@
     struct sedf_vcpu_info *runinf, *waitinf;
     struct task_slice      ret;
 
-    /*idle tasks don't need any of the following stuf*/
+    /* Idle tasks don't need any of the following stuf */
     if ( is_idle_vcpu(current) )
         goto check_waitq;
- 
-    /* create local state of the status of the domain, in order to avoid
-       inconsistent state during scheduling decisions, because data for
-       vcpu_runnable is not protected by the scheduling lock!*/
+
+    /*
+     * Create local state of the status of the domain, in order to avoid
+     * inconsistent state during scheduling decisions, because data for
+     * vcpu_runnable is not protected by the scheduling lock!
+     */
     if ( !vcpu_runnable(current) )
         inf->status |= SEDF_ASLEEP;
  
@@ -826,7 +783,7 @@
 
     if ( unlikely(extra_runs(inf)) )
     {
-        /*special treatment of domains running in extra time*/
+        /* Special treatment of domains running in extra time */
         desched_extra_dom(now, current);
     }
     else 
@@ -836,10 +793,12 @@
  check_waitq:
     update_queues(now, runq, waitq);
 
-    /*now simply pick the first domain from the runqueue, which has the
-      earliest deadline, because the list is sorted*/
- 
-    /* Tasklet work (which runs in idle VCPU context) overrides all else. */
+    /*
+     * Now simply pick the first domain from the runqueue, which has the
+     * earliest deadline, because the list is sorted
+     *
+     * Tasklet work (which runs in idle VCPU context) overrides all else.
+     */
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
          unlikely(!cpumask_test_cpu(cpu, SEDF_CPUONLINE(per_cpu(cpupool, cpu)))) )
@@ -855,9 +814,11 @@
         {
             waitinf  = list_entry(waitq->next,
                                   struct sedf_vcpu_info,list);
-            /*rerun scheduler, when scheduled domain reaches it's
-              end of slice or the first domain from the waitqueue
-              gets ready*/
+            /*
+             * Rerun scheduler, when scheduled domain reaches it's
+             * end of slice or the first domain from the waitqueue
+             * gets ready.
+             */
             ret.time = MIN(now + runinf->slice - runinf->cputime,
                            PERIOD_BEGIN(waitinf)) - now;
         }
@@ -869,14 +830,18 @@
     else
     {
         waitinf  = list_entry(waitq->next,struct sedf_vcpu_info, list);
-        /*we could not find any suitable domain 
-          => look for domains that are aware of extratime*/
+        /*
+         * We could not find any suitable domain 
+         * => look for domains that are aware of extratime
+         */
         ret = sedf_do_extra_schedule(now, PERIOD_BEGIN(waitinf),
                                      extraq, cpu);
     }
 
-    /*TODO: Do something USEFUL when this happens and find out, why it
-      still can happen!!!*/
+    /*
+     * TODO: Do something USEFUL when this happens and find out, why it
+     * still can happen!!!
+     */
     if ( ret.time < 0)
     {
         printk("Ouch! We are seriously BEHIND schedule! %"PRIi64"\n",
@@ -896,9 +861,6 @@
 
 static void sedf_sleep(const struct scheduler *ops, struct vcpu *d)
 {
-    PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",
-          d->domain->domain_id, d->vcpu_id);
- 
     if ( is_idle_vcpu(d) )
         return;
 
@@ -920,7 +882,8 @@
 }
 
 
-/* This function wakes up a domain, i.e. moves them into the waitqueue
+/*
+ * This function wakes up a domain, i.e. moves them into the waitqueue
  * things to mention are: admission control is taking place nowhere at
  * the moment, so we can't be sure, whether it is safe to wake the domain
  * up at all. Anyway, even if it is safe (total cpu usage <=100%) there are
@@ -994,27 +957,31 @@
 static void unblock_short_extra_support(
     struct sedf_vcpu_info* inf, s_time_t now)
 {
-    /*this unblocking scheme tries to support the domain, by assigning it
-    a priority in extratime distribution according to the loss of time
-    in this slice due to blocking*/
+    /*
+     * This unblocking scheme tries to support the domain, by assigning it
+     * a priority in extratime distribution according to the loss of time
+     * in this slice due to blocking
+     */
     s_time_t pen;
  
-    /*no more realtime execution in this period!*/
+    /* No more realtime execution in this period! */
     inf->deadl_abs += inf->period;
     if ( likely(inf->block_abs) )
     {
-        //treat blocked time as consumed by the domain*/
+        /* Treat blocked time as consumed by the domain */
         /*inf->cputime += now - inf->block_abs;*/
-        /*penalty is time the domain would have
-          had if it continued to run */
+        /*
+         * Penalty is time the domain would have
+         * had if it continued to run.
+         */
         pen = (inf->slice - inf->cputime);
         if ( pen < 0 )
             pen = 0;
-        /*accumulate all penalties over the periods*/
+        /* Accumulate all penalties over the periods */
         /*inf->short_block_lost_tot += pen;*/
-        /*set penalty to the current value*/
+        /* Set penalty to the current value */
         inf->short_block_lost_tot = pen;
-        /*not sure which one is better.. but seems to work well...*/
+        /* Not sure which one is better.. but seems to work well... */
   
         if ( inf->short_block_lost_tot )
         {
@@ -1024,28 +991,31 @@
             inf->pen_extra_blocks++;
 #endif
             if ( extraq_on(inf->vcpu, EXTRA_PEN_Q) )
-                /*remove domain for possible resorting!*/
+                /* Remove domain for possible resorting! */
                 extraq_del(inf->vcpu, EXTRA_PEN_Q);
             else
-                /*remember that we want to be on the penalty q
-                  so that we can continue when we (un-)block
-                  in penalty-extratime*/
+                /*
+                 * Remember that we want to be on the penalty q
+                 * so that we can continue when we (un-)block
+                 * in penalty-extratime
+                 */
                 inf->status |= EXTRA_WANT_PEN_Q;
    
-            /*(re-)add domain to the penalty extraq*/
+            /* (re-)add domain to the penalty extraq */
             extraq_add_sort_update(inf->vcpu, EXTRA_PEN_Q, 0);
         }
     }
 
-    /*give it a fresh slice in the next period!*/
+    /* Give it a fresh slice in the next period! */
     inf->cputime = 0;
 }
 
 
 static void unblock_long_cons_b(struct sedf_vcpu_info* inf,s_time_t now)
 {
-    /*Conservative 2b*/
-    /*Treat the unblocking time as a start of a new period */
+    /* Conservative 2b */
+
+    /* Treat the unblocking time as a start of a new period */
     inf->deadl_abs = now + inf->period;
     inf->cputime = 0;
 }
@@ -1068,15 +1038,17 @@
 }
 
 
-/*Compares two domains in the relation of whether the one is allowed to
-  interrupt the others execution.
-  It returns true (!=0) if a switch to the other domain is good.
-  Current Priority scheme is as follows:
-   EDF > L0 (penalty based) extra-time > 
-   L1 (utilization) extra-time > idle-domain
-  In the same class priorities are assigned as following:
-   EDF: early deadline > late deadline
-   L0 extra-time: lower score > higher score*/
+/*
+ * Compares two domains in the relation of whether the one is allowed to
+ * interrupt the others execution.
+ * It returns true (!=0) if a switch to the other domain is good.
+ * Current Priority scheme is as follows:
+ *  EDF > L0 (penalty based) extra-time > 
+ *  L1 (utilization) extra-time > idle-domain
+ * In the same class priorities are assigned as following:
+ *  EDF: early deadline > late deadline
+ *  L0 extra-time: lower score > higher score
+ */
 static inline int should_switch(struct vcpu *cur,
                                 struct vcpu *other,
                                 s_time_t now)
@@ -1085,26 +1057,25 @@
     cur_inf   = EDOM_INFO(cur);
     other_inf = EDOM_INFO(other);
  
-    /* Check whether we need to make an earlier scheduling decision. */
+    /* Check whether we need to make an earlier scheduling decision */
     if ( PERIOD_BEGIN(other_inf) < 
          CPU_INFO(other->processor)->current_slice_expires )
         return 1;
 
-    /* No timing-based switches need to be taken into account here. */
+    /* No timing-based switches need to be taken into account here */
     switch ( get_run_type(cur) )
     {
     case DOMAIN_EDF:
-        /* Do not interrupt a running EDF domain. */
+        /* Do not interrupt a running EDF domain */
         return 0;
     case DOMAIN_EXTRA_PEN:
-        /* Check whether we also want the L0 ex-q with lower score. */
+        /* Check whether we also want the L0 ex-q with lower score */
         return ((other_inf->status & EXTRA_WANT_PEN_Q) &&
                 (other_inf->score[EXTRA_PEN_Q] < 
                  cur_inf->score[EXTRA_PEN_Q]));
     case DOMAIN_EXTRA_UTIL:
         /* Check whether we want the L0 extraq. Don't
-         * switch if both domains want L1 extraq.
-         */
+         * switch if both domains want L1 extraq. */
         return !!(other_inf->status & EXTRA_WANT_PEN_Q);
     case DOMAIN_IDLE:
         return 1;
@@ -1118,18 +1089,11 @@
     s_time_t              now = NOW();
     struct sedf_vcpu_info* inf = EDOM_INFO(d);
 
-    PRINT(3, "sedf_wake was called, domain-id %i.%i\n",d->domain->domain_id,
-          d->vcpu_id);
-
     if ( unlikely(is_idle_vcpu(d)) )
         return;
    
     if ( unlikely(__task_on_queue(d)) )
-    {
-        PRINT(3,"\tdomain %i.%i is already in some queue\n",
-              d->domain->domain_id, d->vcpu_id);
         return;
-    }
 
     ASSERT(!sedf_runnable(d));
     inf->status &= ~SEDF_ASLEEP;
@@ -1138,28 +1102,25 @@
  
     if ( unlikely(inf->deadl_abs == 0) )
     {
-        /*initial setup of the deadline*/
+        /* Initial setup of the deadline */
         inf->deadl_abs = now + inf->slice;
     }
   
-    PRINT(3, "waking up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64
-          "now= %"PRIu64")\n",
-          d->domain->domain_id, d->vcpu_id, inf->deadl_abs, inf->period, now);
-
 #ifdef SEDF_STATS 
     inf->block_tot++;
 #endif
 
     if ( unlikely(now < PERIOD_BEGIN(inf)) )
     {
-        PRINT(4,"extratime unblock\n");
-        /* unblocking in extra-time! */
+        /* Unblocking in extra-time! */
         if ( inf->status & EXTRA_WANT_PEN_Q )
         {
-            /*we have a domain that wants compensation
-              for block penalty and did just block in
-              its compensation time. Give it another
-              chance!*/
+            /*
+             * We have a domain that wants compensation
+             * for block penalty and did just block in
+             * its compensation time. Give it another
+             * chance!
+             */
             extraq_add_sort_update(d, EXTRA_PEN_Q, 0);
         }
         extraq_check_add_unblocked(d, 0);
@@ -1168,8 +1129,7 @@
     {  
         if ( now < inf->deadl_abs )
         {
-            PRINT(4,"short unblocking\n");
-            /*short blocking*/
+            /* Short blocking */
 #ifdef SEDF_STATS
             inf->short_block_tot++;
 #endif
@@ -1179,8 +1139,7 @@
         }
         else
         {
-            PRINT(4,"long unblocking\n");
-            /*long unblocking*/
+            /* Long unblocking */
 #ifdef SEDF_STATS
             inf->long_block_tot++;
 #endif
@@ -1190,24 +1149,13 @@
         }
     }
 
-    PRINT(3, "woke up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64
-          "now= %"PRIu64")\n",
-          d->domain->domain_id, d->vcpu_id, inf->deadl_abs,
-          inf->period, now);
-
     if ( PERIOD_BEGIN(inf) > now )
-    {
         __add_to_waitqueue_sort(d);
-        PRINT(3,"added to waitq\n");
-    }
     else
-    {
         __add_to_runqueue_sort(d);
-        PRINT(3,"added to runq\n");
-    }
  
 #ifdef SEDF_STATS
-    /*do some statistics here...*/
+    /* Do some statistics here... */
     if ( inf->block_abs != 0 )
     {
         inf->block_time_tot += now - inf->block_abs;
@@ -1216,12 +1164,14 @@
     }
 #endif
 
-    /*sanity check: make sure each extra-aware domain IS on the util-q!*/
+    /* Sanity check: make sure each extra-aware domain IS on the util-q! */
     ASSERT(IMPLY(inf->status & EXTRA_AWARE, extraq_on(d, EXTRA_UTIL_Q)));
     ASSERT(__task_on_queue(d));
-    /*check whether the awakened task needs to invoke the do_schedule
-      routine. Try to avoid unnecessary runs but:
-      Save approximation: Always switch to scheduler!*/
+    /*
+     * Check whether the awakened task needs to invoke the do_schedule
+     * routine. Try to avoid unnecessary runs but:
+     * Save approximation: Always switch to scheduler!
+     */
     ASSERT(d->processor >= 0);
     ASSERT(d->processor < nr_cpu_ids);
     ASSERT(per_cpu(schedule_data, d->processor).curr);
@@ -1266,7 +1216,7 @@
 }
 
 
-/* dumps all domains on the specified cpu */
+/* Dumps all domains on the specified cpu */
 static void sedf_dump_cpu_state(const struct scheduler *ops, int i)
 {
     struct list_head      *list, *queue, *tmp;
@@ -1341,16 +1291,18 @@
 }
 
 
-/* Adjusts periods and slices of the domains accordingly to their weights. */
+/* Adjusts periods and slices of the domains accordingly to their weights */
 static int sedf_adjust_weights(struct cpupool *c, int nr_cpus, int *sumw, s_time_t *sumt)
 {
     struct vcpu *p;
     struct domain      *d;
     unsigned int        cpu;
 
-    /* Sum across all weights. Notice that no runq locking is needed
+    /*
+     * Sum across all weights. Notice that no runq locking is needed
      * here: the caller holds sedf_priv_info.lock and we're not changing
-     * anything that is accessed during scheduling. */
+     * anything that is accessed during scheduling.
+     */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1365,11 +1317,14 @@
             }
             else
             {
-                /*don't modify domains who don't have a weight, but sum
-                  up the time they need, projected to a WEIGHT_PERIOD,
-                  so that this time is not given to the weight-driven
-                  domains*/
-                /*check for overflows*/
+                /*
+                 * Don't modify domains who don't have a weight, but sum
+                 * up the time they need, projected to a WEIGHT_PERIOD,
+                 * so that this time is not given to the weight-driven
+                 *  domains
+                 */
+
+                /* Check for overflows */
                 ASSERT((WEIGHT_PERIOD < ULONG_MAX) 
                        && (EDOM_INFO(p)->slice_orig < ULONG_MAX));
                 sumt[cpu] += 
@@ -1380,9 +1335,11 @@
     }
     rcu_read_unlock(&domlist_read_lock);
 
-    /* Adjust all slices (and periods) to the new weight. Unlike above, we
+    /*
+     * Adjust all slices (and periods) to the new weight. Unlike above, we
      * need to take thr runq lock for the various VCPUs: we're modyfing
-     * slice and period which are referenced during scheduling. */
+     * slice and period which are referenced during scheduling.
+     */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1410,7 +1367,7 @@
 }
 
 
-/* set or fetch domain scheduling parameters */
+/* Set or fetch domain scheduling parameters */
 static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen_domctl_scheduler_op *op)
 {
     struct sedf_priv_info *prv = SEDF_PRIV(ops);
@@ -1421,23 +1378,22 @@
     struct vcpu *v;
     int rc = 0;
 
-    PRINT(2,"sedf_adjust was called, domain-id %i new period %"PRIu64" "
-          "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
-          p->domain_id, op->u.sedf.period, op->u.sedf.slice,
-          op->u.sedf.latency, (op->u.sedf.extratime)?"yes":"no");
-
-    /* Serialize against the pluggable scheduler lock to protect from
+    /*
+     * Serialize against the pluggable scheduler lock to protect from
      * concurrent updates. We need to take the runq lock for the VCPUs
      * as well, since we are touching extraweight, weight, slice and
      * period. As in sched_credit2.c, runq locks nest inside the
-     * pluggable scheduler lock. */
+     * pluggable scheduler lock.
+     */
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_putinfo )
     {
-        /* These are used in sedf_adjust_weights() but have to be allocated in
+        /*
+         * These are used in sedf_adjust_weights() but have to be allocated in
          * this function, as we need to avoid nesting xmem_pool_alloc's lock
-         * within our prv->lock. */
+         * within our prv->lock.
+         */
         if ( !sumw || !sumt )
         {
             /* Check for errors here, the _getinfo branch doesn't care */
@@ -1445,7 +1401,7 @@
             goto out;
         }
 
-        /* Check for sane parameters. */
+        /* Check for sane parameters */
         if ( !op->u.sedf.period && !op->u.sedf.weight )
         {
             rc = -EINVAL;
@@ -1457,7 +1413,7 @@
             if ( (op->u.sedf.extratime & EXTRA_AWARE) &&
                  (!op->u.sedf.period) )
             {
-                /* Weight-driven domains with extratime only. */
+                /* Weight-driven domains with extratime only */
                 for_each_vcpu ( p, v )
                 {
                     /* (Here and everywhere in the following) IRQs are already off,
@@ -1472,7 +1428,7 @@
             }
             else
             {
-                /* Weight-driven domains with real-time execution. */
+                /* Weight-driven domains with real-time execution */
                 for_each_vcpu ( p, v ) {
                     vcpu_schedule_lock(v);
                     EDOM_INFO(v)->weight = op->u.sedf.weight;
@@ -1495,7 +1451,7 @@
                 goto out;
             }
 
-            /* Time-driven domains. */
+            /* Time-driven domains */
             for_each_vcpu ( p, v )
             {
                 vcpu_schedule_lock(v);
@@ -1545,7 +1501,6 @@
     xfree(sumt);
     xfree(sumw);
 
-    PRINT(2,"sedf_adjust_finished with return code %d\n", rc);
     return rc;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:40 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001A3-1g; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-00012L-88
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1327010066!61729797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,DIET_1
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10280 invoked from network); 19 Jan 2012 21:54:27 -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;
	19 Jan 2012 21:54:27 -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 1RnzxF-0007Sd-2e
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxF-0000kT-0S
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Message-Id: <E1RnzxF-0000kT-0S@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] sedf: remove useless tracing printk
	and harmonize comments style.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1326665112 0
# Node ID ffe158446c79a318a2f878dc938c0e61f46694e0
# Parent  a141f6d64916e3006cca13403d1b449d087893b8
sedf: remove useless tracing printk and harmonize comments style.

sched_sedf.c used o have its own mechanism for producing tracing-alike
kind of information (domain block, wakeup, etc.). Nowadays, with an
even not so high number of pCPUs/vCPUs, just trying to enable this
makes the serial console completely unusable, produces tons of very
hard to parse and interpreet logging and can easily livelock
Dom0. Moreover, pretty much the same result this is struggling to get
to, is better achieved by enabling the scheduler-related tracing
events, as it is for the other schedulers (say, credit or credit2).

For all these reasons, this removes that machinery completely. While
at it, check in some cosmetics that harmonize the comments withim
themself and with the rest of the code base.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---


diff -r a141f6d64916 -r ffe158446c79 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Sun Jan 15 22:02:35 2012 +0000
+++ b/xen/common/sched_sedf.c	Sun Jan 15 22:05:12 2012 +0000
@@ -13,14 +13,6 @@
 #include <xen/time.h>
 #include <xen/errno.h>
 
-/*verbosity settings*/
-#define SEDFLEVEL 0
-#define PRINT(_f, _a...)                        \
-    do {                                        \
-        if ( (_f) <= SEDFLEVEL )                \
-            printk(_a );                        \
-    } while ( 0 )
-
 #define SEDF_CPUONLINE(_pool)                                             \
     (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 
@@ -71,34 +63,35 @@
     struct list_head list;
     struct list_head extralist[2];
  
-    /*Parameters for EDF*/
-    s_time_t  period;  /*=(relative deadline)*/
-    s_time_t  slice;  /*=worst case execution time*/
+    /* Parameters for EDF */
+    s_time_t  period;  /* = relative deadline */
+    s_time_t  slice;   /* = worst case execution time */
  
-    /*Advaced Parameters*/
-    /*Latency Scaling*/
+    /* Advaced Parameters */
+
+    /* Latency Scaling */
     s_time_t  period_orig;
     s_time_t  slice_orig;
     s_time_t  latency;
  
-    /*status of domain*/
+    /* Status of domain */
     int       status;
-    /*weights for "Scheduling for beginners/ lazy/ etc." ;)*/
+    /* Weights for "Scheduling for beginners/ lazy/ etc." ;) */
     short     weight;
     short     extraweight;
-    /*Bookkeeping*/
+    /* Bookkeeping */
     s_time_t  deadl_abs;
     s_time_t  sched_start_abs;
     s_time_t  cputime;
-    /* times the domain un-/blocked */
+    /* Times the domain un-/blocked */
     s_time_t  block_abs;
     s_time_t  unblock_abs;
  
-    /*scores for {util, block penalty}-weighted extratime distribution*/
+    /* Scores for {util, block penalty}-weighted extratime distribution */
     int   score[2];
     s_time_t  short_block_lost_tot;
  
-    /*Statistics*/
+    /* Statistics */
     s_time_t  extra_time_tot;
 
 #ifdef SEDF_STATS
@@ -165,18 +158,17 @@
 {
     struct list_head *list = EXTRALIST(d,i);
     ASSERT(extraq_on(d,i));
-    PRINT(3, "Removing domain %i.%i from L%i extraq\n",
-          d->domain->domain_id, d->vcpu_id, i);
     list_del(list);
     list->next = NULL;
     ASSERT(!extraq_on(d, i));
 }
 
-/* adds a domain to the queue of processes which are aware of extra time. List
-   is sorted by score, where a lower score means higher priority for an extra
-   slice. It also updates the score, by simply subtracting a fixed value from
-   each entry, in order to avoid overflow. The algorithm works by simply
-   charging each domain that recieved extratime with an inverse of its weight.
+/*
+ * Adds a domain to the queue of processes which are aware of extra time. List
+ * is sorted by score, where a lower score means higher priority for an extra
+ * slice. It also updates the score, by simply subtracting a fixed value from
+ * each entry, in order to avoid overflow. The algorithm works by simply
+ * charging each domain that recieved extratime with an inverse of its weight.
  */ 
 static inline void extraq_add_sort_update(struct vcpu *d, int i, int sub)
 {
@@ -185,11 +177,6 @@
  
     ASSERT(!extraq_on(d,i));
 
-    PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %"PRIi64")"
-          " to L%i extraq\n",
-          d->domain->domain_id, d->vcpu_id, EDOM_INFO(d)->score[i],
-          EDOM_INFO(d)->short_block_lost_tot, i);
-
     /*
      * Iterate through all elements to find our "hole" and on our way
      * update all the other scores.
@@ -200,25 +187,18 @@
         curinf->score[i] -= sub;
         if ( EDOM_INFO(d)->score[i] < curinf->score[i] )
             break;
-        PRINT(4,"\tbehind domain %i.%i (score= %i)\n",
-              curinf->vcpu->domain->domain_id,
-              curinf->vcpu->vcpu_id, curinf->score[i]);
     }
 
-    /* cur now contains the element, before which we'll enqueue. */
-    PRINT(3, "\tlist_add to %p\n", cur->prev);
+    /* cur now contains the element, before which we'll enqueue */
     list_add(EXTRALIST(d,i),cur->prev);
  
-    /* Continue updating the extraq. */
+    /* Continue updating the extraq */
     if ( (cur != EXTRAQ(d->processor,i)) && sub )
     {
         for ( cur = cur->next; cur != EXTRAQ(d->processor,i); cur = cur->next )
         {
             curinf = list_entry(cur,struct sedf_vcpu_info, extralist[i]);
             curinf->score[i] -= sub;
-            PRINT(4, "\tupdating domain %i.%i (score= %u)\n",
-                  curinf->vcpu->domain->domain_id, 
-                  curinf->vcpu->vcpu_id, curinf->score[i]);
         }
     }
 
@@ -228,29 +208,14 @@
 {
     if ( extraq_on(d, EXTRA_UTIL_Q) )
     {
-        PRINT(2,"Dom %i.%i is on L1 extraQ\n",
-              d->domain->domain_id, d->vcpu_id);
-
         if ( !(EDOM_INFO(d)->status & EXTRA_AWARE) &&
              !extra_runs(EDOM_INFO(d)) )
-        {
             extraq_del(d, EXTRA_UTIL_Q);
-            PRINT(2,"Removed dom %i.%i from L1 extraQ\n",
-                  d->domain->domain_id, d->vcpu_id);
-        }
     }
     else
     {
-        PRINT(2, "Dom %i.%i is NOT on L1 extraQ\n",
-              d->domain->domain_id,
-              d->vcpu_id);
-
         if ( (EDOM_INFO(d)->status & EXTRA_AWARE) && sedf_runnable(d) )
-        {
             extraq_add_sort_update(d, EXTRA_UTIL_Q, 0);
-            PRINT(2,"Added dom %i.%i to L1 extraQ\n",
-                  d->domain->domain_id, d->vcpu_id);
-        }
     }
 }
 
@@ -259,7 +224,7 @@
     struct sedf_vcpu_info *inf = EDOM_INFO(d);
 
     if ( inf->status & EXTRA_AWARE )
-        /* Put on the weighted extraq without updating any scores. */
+        /* Put on the weighted extraq without updating any scores */
         extraq_add_sort_update(d, EXTRA_UTIL_Q, 0);
 }
 
@@ -272,8 +237,6 @@
 {
     struct list_head *list = LIST(d);
     ASSERT(__task_on_queue(d));
-    PRINT(3,"Removing domain %i.%i (bop= %"PRIu64") from runq/waitq\n",
-          d->domain->domain_id, d->vcpu_id, PERIOD_BEGIN(EDOM_INFO(d)));
     list_del(list);
     list->next = NULL;
     ASSERT(!__task_on_queue(d));
@@ -286,13 +249,12 @@
 {
     struct list_head     *cur;
 
-    /* Iterate through all elements to find our "hole". */
+    /* Iterate through all elements to find our "hole" */
     list_for_each( cur, list )
         if ( comp(element, cur) < 0 )
             break;
 
-    /* cur now contains the element, before which we'll enqueue. */
-    PRINT(3,"\tlist_add to %p\n",cur->prev);
+    /* cur now contains the element, before which we'll enqueue */
     list_add(element, cur->prev);
 }
 
@@ -310,30 +272,28 @@
         return 1;                                                       \
 }
 
-/* adds a domain to the queue of processes which wait for the beginning of the
-   next period; this list is therefore sortet by this time, which is simply
-   absol. deadline - period
+/*
+ * Adds a domain to the queue of processes which wait for the beginning of the
+ * next period; this list is therefore sortet by this time, which is simply
+ * absol. deadline - period.
  */ 
 DOMAIN_COMPARER(waitq, list, PERIOD_BEGIN(d1), PERIOD_BEGIN(d2));
 static inline void __add_to_waitqueue_sort(struct vcpu *v)
 {
     ASSERT(!__task_on_queue(v));
-    PRINT(3,"Adding domain %i.%i (bop= %"PRIu64") to waitq\n",
-          v->domain->domain_id, v->vcpu_id, PERIOD_BEGIN(EDOM_INFO(v)));
     list_insert_sort(WAITQ(v->processor), LIST(v), waitq_comp);
     ASSERT(__task_on_queue(v));
 }
 
-/* adds a domain to the queue of processes which have started their current
-   period and are runnable (i.e. not blocked, dieing,...). The first element
-   on this list is running on the processor, if the list is empty the idle
-   task will run. As we are implementing EDF, this list is sorted by deadlines.
+/*
+ * Adds a domain to the queue of processes which have started their current
+ * period and are runnable (i.e. not blocked, dieing,...). The first element
+ * on this list is running on the processor, if the list is empty the idle
+ * task will run. As we are implementing EDF, this list is sorted by deadlines.
  */ 
 DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs);
 static inline void __add_to_runqueue_sort(struct vcpu *v)
 {
-    PRINT(3,"Adding domain %i.%i (deadl= %"PRIu64") to runq\n",
-          v->domain->domain_id, v->vcpu_id, EDOM_INFO(v)->deadl_abs);
     list_insert_sort(RUNQ(v->processor), LIST(v), runq_comp);
 }
 
@@ -361,12 +321,12 @@
 
     inf->vcpu = v;
 
-    /* Every VCPU gets an equal share of extratime by default. */
+    /* Every VCPU gets an equal share of extratime by default */
     inf->deadl_abs   = 0;
     inf->latency     = 0;
     inf->status      = EXTRA_AWARE | SEDF_ASLEEP;
     inf->extraweight = 1;
-    /* Upon creation all domain are best-effort. */
+    /* Upon creation all domain are best-effort */
     inf->period      = WEIGHT_PERIOD;
     inf->slice       = 0;
 
@@ -450,21 +410,19 @@
 {
     struct sedf_vcpu_info* inf = EDOM_INFO(d);
 
-    /* Current domain is running in real time mode. */
+    /* Current domain is running in real time mode */
     ASSERT(__task_on_queue(d));
 
-    /* Update the domain's cputime. */
+    /* Update the domain's cputime */
     inf->cputime += now - inf->sched_start_abs;
 
-    /*
-     * Scheduling decisions which don't remove the running domain from the
-     * runq. 
-     */
+    /* Scheduling decisions which don't remove the running domain from
+     * the runq */
     if ( (inf->cputime < inf->slice) && sedf_runnable(d) )
         return;
   
     __del_from_queue(d);
-  
+
     /*
      * Manage bookkeeping (i.e. calculate next deadline, memorise
      * overrun-time of slice) of finished domains.
@@ -475,30 +433,30 @@
   
         if ( inf->period < inf->period_orig )
         {
-            /* This domain runs in latency scaling or burst mode. */
+            /* This domain runs in latency scaling or burst mode */
             inf->period *= 2;
             inf->slice  *= 2;
             if ( (inf->period > inf->period_orig) ||
                  (inf->slice > inf->slice_orig) )
             {
-                /* Reset slice and period. */
+                /* Reset slice and period */
                 inf->period = inf->period_orig;
                 inf->slice = inf->slice_orig;
             }
         }
 
-        /* Set next deadline. */
+        /* Set next deadline */
         inf->deadl_abs += inf->period;
     }
  
-    /* Add a runnable domain to the waitqueue. */
+    /* Add a runnable domain to the waitqueue */
     if ( sedf_runnable(d) )
     {
         __add_to_waitqueue_sort(d);
     }
     else
     {
-        /* We have a blocked realtime task -> remove it from exqs too. */
+        /* We have a blocked realtime task -> remove it from exqs too */
         if ( extraq_on(d, EXTRA_PEN_Q) )
             extraq_del(d, EXTRA_PEN_Q);
         if ( extraq_on(d, EXTRA_UTIL_Q) )
@@ -518,8 +476,6 @@
     struct list_head     *cur, *tmp;
     struct sedf_vcpu_info *curinf;
  
-    PRINT(3,"Updating waitq..\n");
-
     /*
      * Check for the first elements of the waitqueue, whether their
      * next period has already started.
@@ -527,41 +483,32 @@
     list_for_each_safe ( cur, tmp, waitq )
     {
         curinf = list_entry(cur, struct sedf_vcpu_info, list);
-        PRINT(4,"\tLooking @ dom %i.%i\n",
-              curinf->vcpu->domain->domain_id, curinf->vcpu->vcpu_id);
         if ( PERIOD_BEGIN(curinf) > now )
             break;
         __del_from_queue(curinf->vcpu);
         __add_to_runqueue_sort(curinf->vcpu);
     }
  
-    PRINT(3,"Updating runq..\n");
-
-    /* Process the runq, find domains that are on the runq that shouldn't. */
+    /* Process the runq, find domains that are on the runq that shouldn't */
     list_for_each_safe ( cur, tmp, runq )
     {
         curinf = list_entry(cur,struct sedf_vcpu_info,list);
-        PRINT(4,"\tLooking @ dom %i.%i\n",
-              curinf->vcpu->domain->domain_id, curinf->vcpu->vcpu_id);
 
         if ( unlikely(curinf->slice == 0) )
         {
-            /* Ignore domains with empty slice. */
-            PRINT(4,"\tUpdating zero-slice domain %i.%i\n",
-                  curinf->vcpu->domain->domain_id,
-                  curinf->vcpu->vcpu_id);
+            /* Ignore domains with empty slice */
             __del_from_queue(curinf->vcpu);
 
-            /* Move them to their next period. */
+            /* Move them to their next period */
             curinf->deadl_abs += curinf->period;
 
-            /* Ensure that the start of the next period is in the future. */
+            /* Ensure that the start of the next period is in the future */
             if ( unlikely(PERIOD_BEGIN(curinf) < now) )
                 curinf->deadl_abs += 
                     (DIV_UP(now - PERIOD_BEGIN(curinf),
                             curinf->period)) * curinf->period;
 
-            /* Put them back into the queue. */
+            /* Put them back into the queue */
             __add_to_waitqueue_sort(curinf->vcpu);
         }
         else if ( unlikely((curinf->deadl_abs < now) ||
@@ -571,18 +518,18 @@
              * We missed the deadline or the slice was already finished.
              * Might hapen because of dom_adj.
              */
-            PRINT(4,"\tDomain %i.%i exceeded it's deadline/"
-                  "slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
-                  " cputime: %"PRIu64"\n",
-                  curinf->vcpu->domain->domain_id,
-                  curinf->vcpu->vcpu_id,
-                  curinf->deadl_abs, curinf->slice, now,
-                  curinf->cputime);
+            printk("\tDomain %i.%i exceeded it's deadline/"
+                   "slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
+                   " cputime: %"PRIu64"\n",
+                   curinf->vcpu->domain->domain_id,
+                   curinf->vcpu->vcpu_id,
+                   curinf->deadl_abs, curinf->slice, now,
+                   curinf->cputime);
             __del_from_queue(curinf->vcpu);
 
-            /* Common case: we miss one period. */
+            /* Common case: we miss one period */
             curinf->deadl_abs += curinf->period;
-   
+
             /*
              * If we are still behind: modulo arithmetic, force deadline
              * to be in future and aligned to period borders.
@@ -593,7 +540,7 @@
                            curinf->period) * curinf->period;
             ASSERT(curinf->deadl_abs >= now);
 
-            /* Give a fresh slice. */
+            /* Give a fresh slice */
             curinf->cputime = 0;
             if ( PERIOD_BEGIN(curinf) > now )
                 __add_to_waitqueue_sort(curinf->vcpu);
@@ -603,17 +550,17 @@
         else
             break;
     }
-
-    PRINT(3,"done updating the queues\n");
 }
 
 
-/* removes a domain from the head of the according extraQ and
-   requeues it at a specified position:
-     round-robin extratime: end of extraQ
-     weighted ext.: insert in sorted list by score
-   if the domain is blocked / has regained its short-block-loss
-   time it is not put on any queue */
+/*
+ * removes a domain from the head of the according extraQ and
+ * requeues it at a specified position:
+ *   round-robin extratime: end of extraQ
+ *   weighted ext.: insert in sorted list by score
+ * if the domain is blocked / has regained its short-block-loss
+ * time it is not put on any queue.
+ */
 static void desched_extra_dom(s_time_t now, struct vcpu *d)
 {
     struct sedf_vcpu_info *inf = EDOM_INFO(d);
@@ -622,29 +569,25 @@
 
     ASSERT(extraq_on(d, i));
 
-    /* Unset all running flags. */
+    /* Unset all running flags */
     inf->status  &= ~(EXTRA_RUN_PEN | EXTRA_RUN_UTIL);
-    /* Fresh slice for the next run. */
+    /* Fresh slice for the next run */
     inf->cputime = 0;
-    /* Accumulate total extratime. */
+    /* Accumulate total extratime */
     inf->extra_time_tot += now - inf->sched_start_abs;
     /* Remove extradomain from head of the queue. */
     extraq_del(d, i);
 
-    /* Update the score. */
+    /* Update the score */
     oldscore = inf->score[i];
     if ( i == EXTRA_PEN_Q )
     {
-        /*domain was running in L0 extraq*/
-        /*reduce block lost, probably more sophistication here!*/
+        /* Domain was running in L0 extraq */
+        /* reduce block lost, probably more sophistication here!*/
         /*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
         inf->short_block_lost_tot -= now - inf->sched_start_abs;
-        PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
-              inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id,
-              inf->short_block_lost_tot);
 #if 0
-        /*
-         * KAF: If we don't exit short-blocking state at this point
+        /* KAF: If we don't exit short-blocking state at this point
          * domain0 can steal all CPU for up to 10 seconds before
          * scheduling settles down (when competing against another
          * CPU-bound domain). Doing this seems to make things behave
@@ -653,51 +596,59 @@
         if ( inf->short_block_lost_tot <= 0 )
 #endif
         {
-            PRINT(4,"Domain %i.%i compensated short block loss!\n",
-                  inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id);
-            /*we have (over-)compensated our block penalty*/
+            /* We have (over-)compensated our block penalty */
             inf->short_block_lost_tot = 0;
-            /*we don't want a place on the penalty queue anymore!*/
+            /* We don't want a place on the penalty queue anymore! */
             inf->status &= ~EXTRA_WANT_PEN_Q;
             goto check_extra_queues;
         }
 
-        /*we have to go again for another try in the block-extraq,
-          the score is not used incremantally here, as this is
-          already done by recalculating the block_lost*/
+        /*
+         * We have to go again for another try in the block-extraq,
+         * the score is not used incremantally here, as this is
+         * already done by recalculating the block_lost
+         */
         inf->score[EXTRA_PEN_Q] = (inf->period << 10) /
             inf->short_block_lost_tot;
         oldscore = 0;
     }
     else
     {
-        /*domain was running in L1 extraq => score is inverse of
-          utilization and is used somewhat incremental!*/
+        /*
+         * Domain was running in L1 extraq => score is inverse of
+         * utilization and is used somewhat incremental!
+         */
         if ( !inf->extraweight )
-            /*NB: use fixed point arithmetic with 10 bits*/
+        {
+            /* NB: use fixed point arithmetic with 10 bits */
             inf->score[EXTRA_UTIL_Q] = (inf->period << 10) /
                 inf->slice;
+        }
         else
-            /*conversion between realtime utilisation and extrawieght:
-              full (ie 100%) utilization is equivalent to 128 extraweight*/
+        {
+            /*
+             * Conversion between realtime utilisation and extrawieght:
+             * full (ie 100%) utilization is equivalent to 128 extraweight
+             */
             inf->score[EXTRA_UTIL_Q] = (1<<17) / inf->extraweight;
+        }
     }
 
  check_extra_queues:
-    /* Adding a runnable domain to the right queue and removing blocked ones*/
+    /* Adding a runnable domain to the right queue and removing blocked ones */
     if ( sedf_runnable(d) )
     {
-        /*add according to score: weighted round robin*/
+        /* Add according to score: weighted round robin */
         if (((inf->status & EXTRA_AWARE) && (i == EXTRA_UTIL_Q)) ||
             ((inf->status & EXTRA_WANT_PEN_Q) && (i == EXTRA_PEN_Q)))
             extraq_add_sort_update(d, i, oldscore);
     }
     else
     {
-        /*remove this blocked domain from the waitq!*/
+        /* Remove this blocked domain from the waitq! */
         __del_from_queue(d);
-        /*make sure that we remove a blocked domain from the other
-          extraq too*/
+        /* Make sure that we remove a blocked domain from the other
+         * extraq too. */
         if ( i == EXTRA_PEN_Q )
         {
             if ( extraq_on(d, EXTRA_UTIL_Q) )
@@ -729,8 +680,10 @@
 
     if ( !list_empty(extraq[EXTRA_PEN_Q]) )
     {
-        /*we still have elements on the level 0 extraq 
-          => let those run first!*/
+        /*
+         * We still have elements on the level 0 extraq
+         * => let those run first!
+         */
         runinf   = list_entry(extraq[EXTRA_PEN_Q]->next, 
                               struct sedf_vcpu_info, extralist[EXTRA_PEN_Q]);
         runinf->status |= EXTRA_RUN_PEN;
@@ -744,7 +697,7 @@
     {
         if ( !list_empty(extraq[EXTRA_UTIL_Q]) )
         {
-            /*use elements from the normal extraqueue*/
+            /* Use elements from the normal extraqueue */
             runinf   = list_entry(extraq[EXTRA_UTIL_Q]->next,
                                   struct sedf_vcpu_info,
                                   extralist[EXTRA_UTIL_Q]);
@@ -794,11 +747,13 @@
 }
 
 
-/* Main scheduling function
-   Reasons for calling this function are:
-   -timeslice for the current period used up
-   -domain on waitqueue has started it's period
-   -and various others ;) in general: determine which domain to run next*/
+/*
+ * Main scheduling function
+ * Reasons for calling this function are:
+ * -timeslice for the current period used up
+ * -domain on waitqueue has started it's period
+ * -and various others ;) in general: determine which domain to run next
+ */
 static struct task_slice sedf_do_schedule(
     const struct scheduler *ops, s_time_t now, bool_t tasklet_work_scheduled)
 {
@@ -811,13 +766,15 @@
     struct sedf_vcpu_info *runinf, *waitinf;
     struct task_slice      ret;
 
-    /*idle tasks don't need any of the following stuf*/
+    /* Idle tasks don't need any of the following stuf */
     if ( is_idle_vcpu(current) )
         goto check_waitq;
- 
-    /* create local state of the status of the domain, in order to avoid
-       inconsistent state during scheduling decisions, because data for
-       vcpu_runnable is not protected by the scheduling lock!*/
+
+    /*
+     * Create local state of the status of the domain, in order to avoid
+     * inconsistent state during scheduling decisions, because data for
+     * vcpu_runnable is not protected by the scheduling lock!
+     */
     if ( !vcpu_runnable(current) )
         inf->status |= SEDF_ASLEEP;
  
@@ -826,7 +783,7 @@
 
     if ( unlikely(extra_runs(inf)) )
     {
-        /*special treatment of domains running in extra time*/
+        /* Special treatment of domains running in extra time */
         desched_extra_dom(now, current);
     }
     else 
@@ -836,10 +793,12 @@
  check_waitq:
     update_queues(now, runq, waitq);
 
-    /*now simply pick the first domain from the runqueue, which has the
-      earliest deadline, because the list is sorted*/
- 
-    /* Tasklet work (which runs in idle VCPU context) overrides all else. */
+    /*
+     * Now simply pick the first domain from the runqueue, which has the
+     * earliest deadline, because the list is sorted
+     *
+     * Tasklet work (which runs in idle VCPU context) overrides all else.
+     */
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
          unlikely(!cpumask_test_cpu(cpu, SEDF_CPUONLINE(per_cpu(cpupool, cpu)))) )
@@ -855,9 +814,11 @@
         {
             waitinf  = list_entry(waitq->next,
                                   struct sedf_vcpu_info,list);
-            /*rerun scheduler, when scheduled domain reaches it's
-              end of slice or the first domain from the waitqueue
-              gets ready*/
+            /*
+             * Rerun scheduler, when scheduled domain reaches it's
+             * end of slice or the first domain from the waitqueue
+             * gets ready.
+             */
             ret.time = MIN(now + runinf->slice - runinf->cputime,
                            PERIOD_BEGIN(waitinf)) - now;
         }
@@ -869,14 +830,18 @@
     else
     {
         waitinf  = list_entry(waitq->next,struct sedf_vcpu_info, list);
-        /*we could not find any suitable domain 
-          => look for domains that are aware of extratime*/
+        /*
+         * We could not find any suitable domain 
+         * => look for domains that are aware of extratime
+         */
         ret = sedf_do_extra_schedule(now, PERIOD_BEGIN(waitinf),
                                      extraq, cpu);
     }
 
-    /*TODO: Do something USEFUL when this happens and find out, why it
-      still can happen!!!*/
+    /*
+     * TODO: Do something USEFUL when this happens and find out, why it
+     * still can happen!!!
+     */
     if ( ret.time < 0)
     {
         printk("Ouch! We are seriously BEHIND schedule! %"PRIi64"\n",
@@ -896,9 +861,6 @@
 
 static void sedf_sleep(const struct scheduler *ops, struct vcpu *d)
 {
-    PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",
-          d->domain->domain_id, d->vcpu_id);
- 
     if ( is_idle_vcpu(d) )
         return;
 
@@ -920,7 +882,8 @@
 }
 
 
-/* This function wakes up a domain, i.e. moves them into the waitqueue
+/*
+ * This function wakes up a domain, i.e. moves them into the waitqueue
  * things to mention are: admission control is taking place nowhere at
  * the moment, so we can't be sure, whether it is safe to wake the domain
  * up at all. Anyway, even if it is safe (total cpu usage <=100%) there are
@@ -994,27 +957,31 @@
 static void unblock_short_extra_support(
     struct sedf_vcpu_info* inf, s_time_t now)
 {
-    /*this unblocking scheme tries to support the domain, by assigning it
-    a priority in extratime distribution according to the loss of time
-    in this slice due to blocking*/
+    /*
+     * This unblocking scheme tries to support the domain, by assigning it
+     * a priority in extratime distribution according to the loss of time
+     * in this slice due to blocking
+     */
     s_time_t pen;
  
-    /*no more realtime execution in this period!*/
+    /* No more realtime execution in this period! */
     inf->deadl_abs += inf->period;
     if ( likely(inf->block_abs) )
     {
-        //treat blocked time as consumed by the domain*/
+        /* Treat blocked time as consumed by the domain */
         /*inf->cputime += now - inf->block_abs;*/
-        /*penalty is time the domain would have
-          had if it continued to run */
+        /*
+         * Penalty is time the domain would have
+         * had if it continued to run.
+         */
         pen = (inf->slice - inf->cputime);
         if ( pen < 0 )
             pen = 0;
-        /*accumulate all penalties over the periods*/
+        /* Accumulate all penalties over the periods */
         /*inf->short_block_lost_tot += pen;*/
-        /*set penalty to the current value*/
+        /* Set penalty to the current value */
         inf->short_block_lost_tot = pen;
-        /*not sure which one is better.. but seems to work well...*/
+        /* Not sure which one is better.. but seems to work well... */
   
         if ( inf->short_block_lost_tot )
         {
@@ -1024,28 +991,31 @@
             inf->pen_extra_blocks++;
 #endif
             if ( extraq_on(inf->vcpu, EXTRA_PEN_Q) )
-                /*remove domain for possible resorting!*/
+                /* Remove domain for possible resorting! */
                 extraq_del(inf->vcpu, EXTRA_PEN_Q);
             else
-                /*remember that we want to be on the penalty q
-                  so that we can continue when we (un-)block
-                  in penalty-extratime*/
+                /*
+                 * Remember that we want to be on the penalty q
+                 * so that we can continue when we (un-)block
+                 * in penalty-extratime
+                 */
                 inf->status |= EXTRA_WANT_PEN_Q;
    
-            /*(re-)add domain to the penalty extraq*/
+            /* (re-)add domain to the penalty extraq */
             extraq_add_sort_update(inf->vcpu, EXTRA_PEN_Q, 0);
         }
     }
 
-    /*give it a fresh slice in the next period!*/
+    /* Give it a fresh slice in the next period! */
     inf->cputime = 0;
 }
 
 
 static void unblock_long_cons_b(struct sedf_vcpu_info* inf,s_time_t now)
 {
-    /*Conservative 2b*/
-    /*Treat the unblocking time as a start of a new period */
+    /* Conservative 2b */
+
+    /* Treat the unblocking time as a start of a new period */
     inf->deadl_abs = now + inf->period;
     inf->cputime = 0;
 }
@@ -1068,15 +1038,17 @@
 }
 
 
-/*Compares two domains in the relation of whether the one is allowed to
-  interrupt the others execution.
-  It returns true (!=0) if a switch to the other domain is good.
-  Current Priority scheme is as follows:
-   EDF > L0 (penalty based) extra-time > 
-   L1 (utilization) extra-time > idle-domain
-  In the same class priorities are assigned as following:
-   EDF: early deadline > late deadline
-   L0 extra-time: lower score > higher score*/
+/*
+ * Compares two domains in the relation of whether the one is allowed to
+ * interrupt the others execution.
+ * It returns true (!=0) if a switch to the other domain is good.
+ * Current Priority scheme is as follows:
+ *  EDF > L0 (penalty based) extra-time > 
+ *  L1 (utilization) extra-time > idle-domain
+ * In the same class priorities are assigned as following:
+ *  EDF: early deadline > late deadline
+ *  L0 extra-time: lower score > higher score
+ */
 static inline int should_switch(struct vcpu *cur,
                                 struct vcpu *other,
                                 s_time_t now)
@@ -1085,26 +1057,25 @@
     cur_inf   = EDOM_INFO(cur);
     other_inf = EDOM_INFO(other);
  
-    /* Check whether we need to make an earlier scheduling decision. */
+    /* Check whether we need to make an earlier scheduling decision */
     if ( PERIOD_BEGIN(other_inf) < 
          CPU_INFO(other->processor)->current_slice_expires )
         return 1;
 
-    /* No timing-based switches need to be taken into account here. */
+    /* No timing-based switches need to be taken into account here */
     switch ( get_run_type(cur) )
     {
     case DOMAIN_EDF:
-        /* Do not interrupt a running EDF domain. */
+        /* Do not interrupt a running EDF domain */
         return 0;
     case DOMAIN_EXTRA_PEN:
-        /* Check whether we also want the L0 ex-q with lower score. */
+        /* Check whether we also want the L0 ex-q with lower score */
         return ((other_inf->status & EXTRA_WANT_PEN_Q) &&
                 (other_inf->score[EXTRA_PEN_Q] < 
                  cur_inf->score[EXTRA_PEN_Q]));
     case DOMAIN_EXTRA_UTIL:
         /* Check whether we want the L0 extraq. Don't
-         * switch if both domains want L1 extraq.
-         */
+         * switch if both domains want L1 extraq. */
         return !!(other_inf->status & EXTRA_WANT_PEN_Q);
     case DOMAIN_IDLE:
         return 1;
@@ -1118,18 +1089,11 @@
     s_time_t              now = NOW();
     struct sedf_vcpu_info* inf = EDOM_INFO(d);
 
-    PRINT(3, "sedf_wake was called, domain-id %i.%i\n",d->domain->domain_id,
-          d->vcpu_id);
-
     if ( unlikely(is_idle_vcpu(d)) )
         return;
    
     if ( unlikely(__task_on_queue(d)) )
-    {
-        PRINT(3,"\tdomain %i.%i is already in some queue\n",
-              d->domain->domain_id, d->vcpu_id);
         return;
-    }
 
     ASSERT(!sedf_runnable(d));
     inf->status &= ~SEDF_ASLEEP;
@@ -1138,28 +1102,25 @@
  
     if ( unlikely(inf->deadl_abs == 0) )
     {
-        /*initial setup of the deadline*/
+        /* Initial setup of the deadline */
         inf->deadl_abs = now + inf->slice;
     }
   
-    PRINT(3, "waking up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64
-          "now= %"PRIu64")\n",
-          d->domain->domain_id, d->vcpu_id, inf->deadl_abs, inf->period, now);
-
 #ifdef SEDF_STATS 
     inf->block_tot++;
 #endif
 
     if ( unlikely(now < PERIOD_BEGIN(inf)) )
     {
-        PRINT(4,"extratime unblock\n");
-        /* unblocking in extra-time! */
+        /* Unblocking in extra-time! */
         if ( inf->status & EXTRA_WANT_PEN_Q )
         {
-            /*we have a domain that wants compensation
-              for block penalty and did just block in
-              its compensation time. Give it another
-              chance!*/
+            /*
+             * We have a domain that wants compensation
+             * for block penalty and did just block in
+             * its compensation time. Give it another
+             * chance!
+             */
             extraq_add_sort_update(d, EXTRA_PEN_Q, 0);
         }
         extraq_check_add_unblocked(d, 0);
@@ -1168,8 +1129,7 @@
     {  
         if ( now < inf->deadl_abs )
         {
-            PRINT(4,"short unblocking\n");
-            /*short blocking*/
+            /* Short blocking */
 #ifdef SEDF_STATS
             inf->short_block_tot++;
 #endif
@@ -1179,8 +1139,7 @@
         }
         else
         {
-            PRINT(4,"long unblocking\n");
-            /*long unblocking*/
+            /* Long unblocking */
 #ifdef SEDF_STATS
             inf->long_block_tot++;
 #endif
@@ -1190,24 +1149,13 @@
         }
     }
 
-    PRINT(3, "woke up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64
-          "now= %"PRIu64")\n",
-          d->domain->domain_id, d->vcpu_id, inf->deadl_abs,
-          inf->period, now);
-
     if ( PERIOD_BEGIN(inf) > now )
-    {
         __add_to_waitqueue_sort(d);
-        PRINT(3,"added to waitq\n");
-    }
     else
-    {
         __add_to_runqueue_sort(d);
-        PRINT(3,"added to runq\n");
-    }
  
 #ifdef SEDF_STATS
-    /*do some statistics here...*/
+    /* Do some statistics here... */
     if ( inf->block_abs != 0 )
     {
         inf->block_time_tot += now - inf->block_abs;
@@ -1216,12 +1164,14 @@
     }
 #endif
 
-    /*sanity check: make sure each extra-aware domain IS on the util-q!*/
+    /* Sanity check: make sure each extra-aware domain IS on the util-q! */
     ASSERT(IMPLY(inf->status & EXTRA_AWARE, extraq_on(d, EXTRA_UTIL_Q)));
     ASSERT(__task_on_queue(d));
-    /*check whether the awakened task needs to invoke the do_schedule
-      routine. Try to avoid unnecessary runs but:
-      Save approximation: Always switch to scheduler!*/
+    /*
+     * Check whether the awakened task needs to invoke the do_schedule
+     * routine. Try to avoid unnecessary runs but:
+     * Save approximation: Always switch to scheduler!
+     */
     ASSERT(d->processor >= 0);
     ASSERT(d->processor < nr_cpu_ids);
     ASSERT(per_cpu(schedule_data, d->processor).curr);
@@ -1266,7 +1216,7 @@
 }
 
 
-/* dumps all domains on the specified cpu */
+/* Dumps all domains on the specified cpu */
 static void sedf_dump_cpu_state(const struct scheduler *ops, int i)
 {
     struct list_head      *list, *queue, *tmp;
@@ -1341,16 +1291,18 @@
 }
 
 
-/* Adjusts periods and slices of the domains accordingly to their weights. */
+/* Adjusts periods and slices of the domains accordingly to their weights */
 static int sedf_adjust_weights(struct cpupool *c, int nr_cpus, int *sumw, s_time_t *sumt)
 {
     struct vcpu *p;
     struct domain      *d;
     unsigned int        cpu;
 
-    /* Sum across all weights. Notice that no runq locking is needed
+    /*
+     * Sum across all weights. Notice that no runq locking is needed
      * here: the caller holds sedf_priv_info.lock and we're not changing
-     * anything that is accessed during scheduling. */
+     * anything that is accessed during scheduling.
+     */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1365,11 +1317,14 @@
             }
             else
             {
-                /*don't modify domains who don't have a weight, but sum
-                  up the time they need, projected to a WEIGHT_PERIOD,
-                  so that this time is not given to the weight-driven
-                  domains*/
-                /*check for overflows*/
+                /*
+                 * Don't modify domains who don't have a weight, but sum
+                 * up the time they need, projected to a WEIGHT_PERIOD,
+                 * so that this time is not given to the weight-driven
+                 *  domains
+                 */
+
+                /* Check for overflows */
                 ASSERT((WEIGHT_PERIOD < ULONG_MAX) 
                        && (EDOM_INFO(p)->slice_orig < ULONG_MAX));
                 sumt[cpu] += 
@@ -1380,9 +1335,11 @@
     }
     rcu_read_unlock(&domlist_read_lock);
 
-    /* Adjust all slices (and periods) to the new weight. Unlike above, we
+    /*
+     * Adjust all slices (and periods) to the new weight. Unlike above, we
      * need to take thr runq lock for the various VCPUs: we're modyfing
-     * slice and period which are referenced during scheduling. */
+     * slice and period which are referenced during scheduling.
+     */
     rcu_read_lock(&domlist_read_lock);
     for_each_domain_in_cpupool( d, c )
     {
@@ -1410,7 +1367,7 @@
 }
 
 
-/* set or fetch domain scheduling parameters */
+/* Set or fetch domain scheduling parameters */
 static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen_domctl_scheduler_op *op)
 {
     struct sedf_priv_info *prv = SEDF_PRIV(ops);
@@ -1421,23 +1378,22 @@
     struct vcpu *v;
     int rc = 0;
 
-    PRINT(2,"sedf_adjust was called, domain-id %i new period %"PRIu64" "
-          "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
-          p->domain_id, op->u.sedf.period, op->u.sedf.slice,
-          op->u.sedf.latency, (op->u.sedf.extratime)?"yes":"no");
-
-    /* Serialize against the pluggable scheduler lock to protect from
+    /*
+     * Serialize against the pluggable scheduler lock to protect from
      * concurrent updates. We need to take the runq lock for the VCPUs
      * as well, since we are touching extraweight, weight, slice and
      * period. As in sched_credit2.c, runq locks nest inside the
-     * pluggable scheduler lock. */
+     * pluggable scheduler lock.
+     */
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( op->cmd == XEN_DOMCTL_SCHEDOP_putinfo )
     {
-        /* These are used in sedf_adjust_weights() but have to be allocated in
+        /*
+         * These are used in sedf_adjust_weights() but have to be allocated in
          * this function, as we need to avoid nesting xmem_pool_alloc's lock
-         * within our prv->lock. */
+         * within our prv->lock.
+         */
         if ( !sumw || !sumt )
         {
             /* Check for errors here, the _getinfo branch doesn't care */
@@ -1445,7 +1401,7 @@
             goto out;
         }
 
-        /* Check for sane parameters. */
+        /* Check for sane parameters */
         if ( !op->u.sedf.period && !op->u.sedf.weight )
         {
             rc = -EINVAL;
@@ -1457,7 +1413,7 @@
             if ( (op->u.sedf.extratime & EXTRA_AWARE) &&
                  (!op->u.sedf.period) )
             {
-                /* Weight-driven domains with extratime only. */
+                /* Weight-driven domains with extratime only */
                 for_each_vcpu ( p, v )
                 {
                     /* (Here and everywhere in the following) IRQs are already off,
@@ -1472,7 +1428,7 @@
             }
             else
             {
-                /* Weight-driven domains with real-time execution. */
+                /* Weight-driven domains with real-time execution */
                 for_each_vcpu ( p, v ) {
                     vcpu_schedule_lock(v);
                     EDOM_INFO(v)->weight = op->u.sedf.weight;
@@ -1495,7 +1451,7 @@
                 goto out;
             }
 
-            /* Time-driven domains. */
+            /* Time-driven domains */
             for_each_vcpu ( p, v )
             {
                 vcpu_schedule_lock(v);
@@ -1545,7 +1501,6 @@
     xfree(sumt);
     xfree(sumw);
 
-    PRINT(2,"sedf_adjust_finished with return code %d\n", rc);
     return rc;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:40 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001BN-GL; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-00013s-Tt
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1327010100!49150401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5273 invoked from network); 19 Jan 2012 21:55:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:01 -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 1RnzxH-0007T7-MK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000lj-LA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Message-Id: <E1RnzxH-0000lj-LA@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Move IOMMU faults handling into
	softirq for VT-d.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1326798686 0
# Node ID a7ae457c327cd790704643e0ed4def3e717b47b3
# Parent  2913ccc6d70f15ffcc15c7e066c9269b15a30a09
Move IOMMU faults handling into softirq for VT-d.

Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2913ccc6d70f -r a7ae457c327c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Mon Jan 16 17:56:07 2012 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Tue Jan 17 11:11:26 2012 +0000
@@ -53,6 +53,8 @@
 
 int nr_iommus;
 
+static struct tasklet vtd_fault_tasklet;
+
 static void setup_dom0_device(struct pci_dev *);
 static void setup_dom0_rmrr(struct domain *d);
 
@@ -918,10 +920,8 @@
 }
 
 #define PRIMARY_FAULT_REG_LEN (16)
-static void iommu_page_fault(int irq, void *dev_id,
-                             struct cpu_user_regs *regs)
+static void __do_iommu_page_fault(struct iommu *iommu)
 {
-    struct iommu *iommu = dev_id;
     int reg, fault_index;
     u32 fault_status;
     unsigned long flags;
@@ -996,6 +996,37 @@
     }
 }
 
+static void do_iommu_page_fault(unsigned long data)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( list_empty(&acpi_drhd_units) )
+    {
+       INTEL_IOMMU_DEBUG("no device found, something must be very wrong!\n");
+       return;
+    }
+
+    /*
+     * No matter from whom the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs) and should be more than
+     * fine, considering how rare the event of a fault should be.
+     */
+    for_each_drhd_unit ( drhd )
+        __do_iommu_page_fault(drhd->iommu);
+}
+
+static void iommu_page_fault(int irq, void *dev_id,
+                             struct cpu_user_regs *regs)
+{
+    /*
+     * Just flag the tasklet as runnable. This is fine, according to VT-d
+     * specs since a new interrupt won't be generated until we clear all
+     * the faults that caused this one to happen.
+     */
+    tasklet_schedule(&vtd_fault_tasklet);
+}
+
 static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
@@ -2144,6 +2175,8 @@
         iommu->irq = ret;
     }
 
+    softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
+
     if ( !iommu_qinval && iommu_intremap )
     {
         iommu_intremap = 0;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:40 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001BN-GL; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-00013s-Tt
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1327010100!49150401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5273 invoked from network); 19 Jan 2012 21:55:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:01 -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 1RnzxH-0007T7-MK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000lj-LA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Message-Id: <E1RnzxH-0000lj-LA@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Move IOMMU faults handling into
	softirq for VT-d.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1326798686 0
# Node ID a7ae457c327cd790704643e0ed4def3e717b47b3
# Parent  2913ccc6d70f15ffcc15c7e066c9269b15a30a09
Move IOMMU faults handling into softirq for VT-d.

Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2913ccc6d70f -r a7ae457c327c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Mon Jan 16 17:56:07 2012 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Tue Jan 17 11:11:26 2012 +0000
@@ -53,6 +53,8 @@
 
 int nr_iommus;
 
+static struct tasklet vtd_fault_tasklet;
+
 static void setup_dom0_device(struct pci_dev *);
 static void setup_dom0_rmrr(struct domain *d);
 
@@ -918,10 +920,8 @@
 }
 
 #define PRIMARY_FAULT_REG_LEN (16)
-static void iommu_page_fault(int irq, void *dev_id,
-                             struct cpu_user_regs *regs)
+static void __do_iommu_page_fault(struct iommu *iommu)
 {
-    struct iommu *iommu = dev_id;
     int reg, fault_index;
     u32 fault_status;
     unsigned long flags;
@@ -996,6 +996,37 @@
     }
 }
 
+static void do_iommu_page_fault(unsigned long data)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( list_empty(&acpi_drhd_units) )
+    {
+       INTEL_IOMMU_DEBUG("no device found, something must be very wrong!\n");
+       return;
+    }
+
+    /*
+     * No matter from whom the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs) and should be more than
+     * fine, considering how rare the event of a fault should be.
+     */
+    for_each_drhd_unit ( drhd )
+        __do_iommu_page_fault(drhd->iommu);
+}
+
+static void iommu_page_fault(int irq, void *dev_id,
+                             struct cpu_user_regs *regs)
+{
+    /*
+     * Just flag the tasklet as runnable. This is fine, according to VT-d
+     * specs since a new interrupt won't be generated until we clear all
+     * the faults that caused this one to happen.
+     */
+    tasklet_schedule(&vtd_fault_tasklet);
+}
+
 static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
@@ -2144,6 +2175,8 @@
         iommu->irq = ret;
     }
 
+    softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
+
     if ( !iommu_qinval && iommu_intremap )
     {
         iommu_intremap = 0;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:41 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001Bx-M9; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000r0-DW
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1327010130!2968839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 565 invoked from network); 19 Jan 2012 21:55: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;
	19 Jan 2012 21:55:31 -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 1RnzxB-0007Ro-SA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxB-0000j1-Ql
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Message-Id: <E1RnzxB-0000j1-Ql@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make LIBXL_INIT_GC a
	statement, not an initialiser
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473651 0
# Node ID 5eba2a0c61a25beb162aea984a37589d481cf09d
# Parent  5ac7713e7f5d9711770ec9d2e555bf82e086dc98
libxl: make LIBXL_INIT_GC a statement, not an initialiser

Previously LIBXL_INIT_GC was an initialiser, which you were expected
to use like this:
    libxl__gc gc = LIBXL_INIT_GC(ctx);

But we are going to want to put things in the gc which are to be
initialised using other macros.  That means that LIBXL_INIT_GC has to
become a statement too.  So instead, we make it so that it's used like this:
    libxl_gc gc;
    LIBXL_INIT_GC(gc,ctx);

In fact there are only a couple of callers now,
including GC_INIT which uses this trick:
    libxl_gc gc[1];
    LIBXL_INIT_GC(gc[0],ctx);

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 5ac7713e7f5d -r 5eba2a0c61a2 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:09 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:11 2012 +0000
@@ -147,7 +147,12 @@
     libxl_ctx *owner;
 } libxl__gc;
 
-#define LIBXL_INIT_GC(ctx) (libxl__gc){ .alloc_maxsize = 0, .alloc_ptrs = 0, .owner = ctx }
+#define LIBXL_INIT_GC(gc,ctx) do{               \
+        (gc).alloc_maxsize = 0;                 \
+        (gc).alloc_ptrs = 0;                    \
+        (gc).owner = (ctx);                     \
+    } while(0)
+
 static inline libxl_ctx *libxl__gc_owner(libxl__gc *gc)
 {
     return gc->owner;
@@ -725,7 +730,7 @@
  * as a local variable.
  */
 
-#define GC_INIT(ctx)  libxl__gc gc[1] = { LIBXL_INIT_GC(ctx) }
+#define GC_INIT(ctx)  libxl__gc gc[1]; LIBXL_INIT_GC(gc[0],ctx)
 #define GC_FREE       libxl__free_all(gc)
 #define CTX           libxl__gc_owner(gc)
 
diff -r 5ac7713e7f5d -r 5eba2a0c61a2 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:09 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:11 2012 +0000
@@ -513,7 +513,7 @@
 {
     char *buf = NULL;
     int rc = -1;
-    libxl__gc gc = LIBXL_INIT_GC(qmp->ctx);
+    libxl__gc gc; LIBXL_INIT_GC(gc,qmp->ctx);
 
     buf = qmp_send_prepare(&gc, qmp, cmd, args, callback, opaque, context);
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:41 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001Bx-M9; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000r0-DW
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1327010130!2968839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 565 invoked from network); 19 Jan 2012 21:55: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;
	19 Jan 2012 21:55:31 -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 1RnzxB-0007Ro-SA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxB-0000j1-Ql
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:29 +0000
Message-Id: <E1RnzxB-0000j1-Ql@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make LIBXL_INIT_GC a
	statement, not an initialiser
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473651 0
# Node ID 5eba2a0c61a25beb162aea984a37589d481cf09d
# Parent  5ac7713e7f5d9711770ec9d2e555bf82e086dc98
libxl: make LIBXL_INIT_GC a statement, not an initialiser

Previously LIBXL_INIT_GC was an initialiser, which you were expected
to use like this:
    libxl__gc gc = LIBXL_INIT_GC(ctx);

But we are going to want to put things in the gc which are to be
initialised using other macros.  That means that LIBXL_INIT_GC has to
become a statement too.  So instead, we make it so that it's used like this:
    libxl_gc gc;
    LIBXL_INIT_GC(gc,ctx);

In fact there are only a couple of callers now,
including GC_INIT which uses this trick:
    libxl_gc gc[1];
    LIBXL_INIT_GC(gc[0],ctx);

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 5ac7713e7f5d -r 5eba2a0c61a2 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:09 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:11 2012 +0000
@@ -147,7 +147,12 @@
     libxl_ctx *owner;
 } libxl__gc;
 
-#define LIBXL_INIT_GC(ctx) (libxl__gc){ .alloc_maxsize = 0, .alloc_ptrs = 0, .owner = ctx }
+#define LIBXL_INIT_GC(gc,ctx) do{               \
+        (gc).alloc_maxsize = 0;                 \
+        (gc).alloc_ptrs = 0;                    \
+        (gc).owner = (ctx);                     \
+    } while(0)
+
 static inline libxl_ctx *libxl__gc_owner(libxl__gc *gc)
 {
     return gc->owner;
@@ -725,7 +730,7 @@
  * as a local variable.
  */
 
-#define GC_INIT(ctx)  libxl__gc gc[1] = { LIBXL_INIT_GC(ctx) }
+#define GC_INIT(ctx)  libxl__gc gc[1]; LIBXL_INIT_GC(gc[0],ctx)
 #define GC_FREE       libxl__free_all(gc)
 #define CTX           libxl__gc_owner(gc)
 
diff -r 5ac7713e7f5d -r 5eba2a0c61a2 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:09 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:11 2012 +0000
@@ -513,7 +513,7 @@
 {
     char *buf = NULL;
     int rc = -1;
-    libxl__gc gc = LIBXL_INIT_GC(qmp->ctx);
+    libxl__gc gc; LIBXL_INIT_GC(gc,qmp->ctx);
 
     buf = qmp_send_prepare(&gc, qmp, cmd, args, callback, opaque, context);
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:41 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001Ca-Sq; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-0000sU-A9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327010130!9722091!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22380 invoked from network); 19 Jan 2012 21:55:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:31 -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 1RnzxC-0007Rs-Cf
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxC-0000jG-BN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Message-Id: <E1RnzxC-0000jG-BN@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstore: New function
	xs_path_is_subpath
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473651 0
# Node ID 19a0a2e26137f3f1d436f84a55c24d473eef21fd
# Parent  5eba2a0c61a25beb162aea984a37589d481cf09d
xenstore: New function xs_path_is_subpath

This utility function compares two paths, textually and reports
whether one is a subpath (a child path) of the other.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 5eba2a0c61a2 -r 19a0a2e26137 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/xenstore/xs.c	Fri Jan 13 16:54:11 2012 +0000
@@ -950,6 +950,23 @@
 	return xs_single(h, XBT_NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
 }
 
+bool xs_path_is_subpath(const char *parent, const char *child)
+{
+        size_t childlen = strlen(child);
+        size_t parentlen = strlen(parent);
+
+	if (childlen < parentlen)
+		return false;
+
+	if (memcmp(child, parent, parentlen))
+		return false;
+
+	if (childlen > parentlen && child[parentlen] != '/')
+		return false;
+
+	return true;
+}
+
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
 {
 	char *domain = single_with_domid(h, XS_IS_DOMAIN_INTRODUCED, domid);
diff -r 5eba2a0c61a2 -r 19a0a2e26137 tools/xenstore/xs.h
--- a/tools/xenstore/xs.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/xenstore/xs.h	Fri Jan 13 16:54:11 2012 +0000
@@ -207,6 +207,13 @@
  */
 char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
 
+/* Returns true if child is either equal to parent, or a node underneath
+ * parent; or false otherwise.  Done by string comparison, so relative and
+ * absolute pathnames never in a parent/child relationship by this
+ * definition.  Cannot fail.
+ */
+bool xs_path_is_subpath(const char *parent, const char *child);
+
 /* Return whether the domain specified has been introduced to xenstored.
  */
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:41 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxM-0001Ca-Sq; Thu, 19 Jan 2012 21:55:40 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-0000sU-A9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327010130!9722091!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22380 invoked from network); 19 Jan 2012 21:55:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:31 -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 1RnzxC-0007Rs-Cf
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxC-0000jG-BN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Message-Id: <E1RnzxC-0000jG-BN@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstore: New function
	xs_path_is_subpath
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473651 0
# Node ID 19a0a2e26137f3f1d436f84a55c24d473eef21fd
# Parent  5eba2a0c61a25beb162aea984a37589d481cf09d
xenstore: New function xs_path_is_subpath

This utility function compares two paths, textually and reports
whether one is a subpath (a child path) of the other.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 5eba2a0c61a2 -r 19a0a2e26137 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/xenstore/xs.c	Fri Jan 13 16:54:11 2012 +0000
@@ -950,6 +950,23 @@
 	return xs_single(h, XBT_NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
 }
 
+bool xs_path_is_subpath(const char *parent, const char *child)
+{
+        size_t childlen = strlen(child);
+        size_t parentlen = strlen(parent);
+
+	if (childlen < parentlen)
+		return false;
+
+	if (memcmp(child, parent, parentlen))
+		return false;
+
+	if (childlen > parentlen && child[parentlen] != '/')
+		return false;
+
+	return true;
+}
+
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
 {
 	char *domain = single_with_domid(h, XS_IS_DOMAIN_INTRODUCED, domid);
diff -r 5eba2a0c61a2 -r 19a0a2e26137 tools/xenstore/xs.h
--- a/tools/xenstore/xs.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/xenstore/xs.h	Fri Jan 13 16:54:11 2012 +0000
@@ -207,6 +207,13 @@
  */
 char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
 
+/* Returns true if child is either equal to parent, or a node underneath
+ * parent; or false otherwise.  Done by string comparison, so relative and
+ * absolute pathnames never in a parent/child relationship by this
+ * definition.  Cannot fail.
+ */
+bool xs_path_is_subpath(const char *parent, const char *child);
+
 /* Return whether the domain specified has been introduced to xenstored.
  */
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:42 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxN-0001EM-LB; Thu, 19 Jan 2012 21:55:41 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-00016N-Qn
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327010007!49303004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11696 invoked from network); 19 Jan 2012 21:53:28 -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;
	19 Jan 2012 21:53:28 -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 1RnzxI-0007TH-Ln
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxI-0000mD-Kd
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Message-Id: <E1RnzxI-0000mD-Kd@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: VM generation ID: Add missing
	gate for HVM domain.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1326804052 0
# Node ID 15ab61865ecbd146f6ce65fbea5bf49bfd9c6cb1
# Parent  44c2856b19524e7984bfb91bf690181b5f4d1d30
libxl: VM generation ID: Add missing gate for HVM domain.

This will fix localhost migrate failures found by the automatic tests.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 44c2856b1952 -r 15ab61865ecb tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Jan 17 11:18:48 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Jan 17 12:40:52 2012 +0000
@@ -1580,7 +1580,9 @@
         }
     }
 
-    d_config.b_info.u.hvm.no_incr_generationid = dom_info->no_incr_generationid;
+    if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
+        d_config.b_info.u.hvm.no_incr_generationid =
+            dom_info->no_incr_generationid;
 
     if (debug || dom_info->dryrun)
         printf_info(-1, &d_config, &d_config.dm_info);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:42 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxN-0001EM-LB; Thu, 19 Jan 2012 21:55:41 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-00016N-Qn
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327010007!49303004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11696 invoked from network); 19 Jan 2012 21:53:28 -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;
	19 Jan 2012 21:53:28 -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 1RnzxI-0007TH-Ln
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxI-0000mD-Kd
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Message-Id: <E1RnzxI-0000mD-Kd@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: VM generation ID: Add missing
	gate for HVM domain.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1326804052 0
# Node ID 15ab61865ecbd146f6ce65fbea5bf49bfd9c6cb1
# Parent  44c2856b19524e7984bfb91bf690181b5f4d1d30
libxl: VM generation ID: Add missing gate for HVM domain.

This will fix localhost migrate failures found by the automatic tests.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 44c2856b1952 -r 15ab61865ecb tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Jan 17 11:18:48 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Jan 17 12:40:52 2012 +0000
@@ -1580,7 +1580,9 @@
         }
     }
 
-    d_config.b_info.u.hvm.no_incr_generationid = dom_info->no_incr_generationid;
+    if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
+        d_config.b_info.u.hvm.no_incr_generationid =
+            dom_info->no_incr_generationid;
 
     if (debug || dom_info->dryrun)
         printf_info(-1, &d_config, &d_config.dm_info);

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:42 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxO-0001Fy-3j; Thu, 19 Jan 2012 21:55:42 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000uY-6Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1327010131!11728792!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 314 invoked from network); 19 Jan 2012 21:55:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:32 -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 1RnzxD-0007SC-FN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000jk-EB
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Message-Id: <E1RnzxD-0000jk-EB@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Provide more formal
	libxl__ctx_lock and _unlock
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473667 0
# Node ID cc969d75176039ea14c373f36e6f214e4b23e73b
# Parent  2231bc032192d9fdada4a6415f8814dff3bdd14d
libxl: Provide more formal libxl__ctx_lock and _unlock

Previously the only official interface for the ctx lock was the
CTX_LOCK and CTX_UNLOCK convenience macros, which assume and use "ctx"
from the surrounding scope.

Instead, provide libxl__ctx_lock and _unlock functions which can be
used by these convenience macros, and other callers who have
nonstandard requirements.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 2231bc032192 -r cc969d751760 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:19 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:27 2012 +0000
@@ -115,7 +115,8 @@
     struct xs_handle *xsh;
 
     pthread_mutex_t lock; /* protects data structures hanging off the ctx */
-      /* Always use CTX_LOCK and CTX_UNLOCK to manipulate this.
+      /* Always use libxl__ctx_lock and _unlock (or the convenience
+       * macors CTX_LOCK and CTX_UNLOCK) to manipulate this.
        *
        * You may acquire this mutex recursively if it is convenient to
        * do so.  You may not acquire this lock at the same time as any
@@ -753,16 +754,18 @@
 
 /* Locking functions.  See comment for "lock" member of libxl__ctx. */
 
-#define CTX_LOCK do {                                   \
-        int mutex_r = pthread_mutex_lock(&CTX->lock);   \
-        assert(!mutex_r);                               \
-    } while(0)
+static inline void libxl__ctx_lock(libxl_ctx *ctx) {
+    int r = pthread_mutex_lock(&ctx->lock);
+    assert(!r);
+}
 
-#define CTX_UNLOCK do {                                 \
-        int mutex_r = pthread_mutex_unlock(&CTX->lock); \
-        assert(!mutex_r);                               \
-    } while(0)
-        
+static inline void libxl__ctx_unlock(libxl_ctx *ctx) {
+    int r = pthread_mutex_unlock(&ctx->lock);
+    assert(!r);
+}
+
+#define CTX_LOCK (libxl__ctx_lock(CTX))
+#define CTX_UNLOCK (libxl__ctx_unlock(CTX))
 
 
 /*

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:42 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxO-0001Fy-3j; Thu, 19 Jan 2012 21:55:42 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000uY-6Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1327010131!11728792!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 314 invoked from network); 19 Jan 2012 21:55:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:32 -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 1RnzxD-0007SC-FN
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000jk-EB
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Message-Id: <E1RnzxD-0000jk-EB@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Provide more formal
	libxl__ctx_lock and _unlock
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473667 0
# Node ID cc969d75176039ea14c373f36e6f214e4b23e73b
# Parent  2231bc032192d9fdada4a6415f8814dff3bdd14d
libxl: Provide more formal libxl__ctx_lock and _unlock

Previously the only official interface for the ctx lock was the
CTX_LOCK and CTX_UNLOCK convenience macros, which assume and use "ctx"
from the surrounding scope.

Instead, provide libxl__ctx_lock and _unlock functions which can be
used by these convenience macros, and other callers who have
nonstandard requirements.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 2231bc032192 -r cc969d751760 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:19 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:27 2012 +0000
@@ -115,7 +115,8 @@
     struct xs_handle *xsh;
 
     pthread_mutex_t lock; /* protects data structures hanging off the ctx */
-      /* Always use CTX_LOCK and CTX_UNLOCK to manipulate this.
+      /* Always use libxl__ctx_lock and _unlock (or the convenience
+       * macors CTX_LOCK and CTX_UNLOCK) to manipulate this.
        *
        * You may acquire this mutex recursively if it is convenient to
        * do so.  You may not acquire this lock at the same time as any
@@ -753,16 +754,18 @@
 
 /* Locking functions.  See comment for "lock" member of libxl__ctx. */
 
-#define CTX_LOCK do {                                   \
-        int mutex_r = pthread_mutex_lock(&CTX->lock);   \
-        assert(!mutex_r);                               \
-    } while(0)
+static inline void libxl__ctx_lock(libxl_ctx *ctx) {
+    int r = pthread_mutex_lock(&ctx->lock);
+    assert(!r);
+}
 
-#define CTX_UNLOCK do {                                 \
-        int mutex_r = pthread_mutex_unlock(&CTX->lock); \
-        assert(!mutex_r);                               \
-    } while(0)
-        
+static inline void libxl__ctx_unlock(libxl_ctx *ctx) {
+    int r = pthread_mutex_unlock(&ctx->lock);
+    assert(!r);
+}
+
+#define CTX_LOCK (libxl__ctx_lock(CTX))
+#define CTX_UNLOCK (libxl__ctx_unlock(CTX))
 
 
 /*

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:42 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxO-0001Gq-B2; Thu, 19 Jan 2012 21:55:42 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000vP-Lw
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1327010132!11604454!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17796 invoked from network); 19 Jan 2012 21:55:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:33 -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 1RnzxD-0007SM-VI
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000jz-U9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Message-Id: <E1RnzxD-0000jz-U9@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Fix leaks on context init
	failure
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473667 0
# Node ID 6d8888519e3aae056956d41d77b53d22e132fbca
# Parent  cc969d75176039ea14c373f36e6f214e4b23e73b
libxl: Fix leaks on context init failure

Several of the error exits from libxl_ctx_alloc leaked the context
struct itself and sometimes other resources too.

Fix this by using the standard "rc = ERROR_FOO; goto out" error
handling style throughout.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r cc969d751760 -r 6d8888519e3a tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/tools/libxl/libxl.c	Fri Jan 13 16:54:27 2012 +0000
@@ -24,17 +24,17 @@
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags, xentoollog_logger * lg)
 {
-    libxl_ctx *ctx;
+    libxl_ctx *ctx = NULL;
     struct stat stat_buf;
     const pthread_mutex_t mutex_value = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-
-    if (version != LIBXL_VERSION)
-        return ERROR_VERSION;
+    int rc;
+
+    if (version != LIBXL_VERSION) { rc = ERROR_VERSION; goto out; }
 
     ctx = malloc(sizeof(*ctx));
     if (!ctx) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to allocate context\n");
-        return ERROR_NOMEM;
+        rc = ERROR_NOMEM; goto out;
     }
 
     memset(ctx, 0, sizeof(libxl_ctx));
@@ -48,14 +48,14 @@
     if ( stat(XENSTORE_PID_FILE, &stat_buf) != 0 ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Is xenstore daemon running?\n"
                      "failed to stat %s", XENSTORE_PID_FILE);
-        return ERROR_FAIL;
+        rc = ERROR_FAIL; goto out;
     }
 
     ctx->xch = xc_interface_open(lg,lg,0);
     if (!ctx->xch) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot open libxc handle");
-        return ERROR_FAIL;
+        rc = ERROR_FAIL; goto out;
     }
 
     ctx->xsh = xs_daemon_open();
@@ -64,12 +64,16 @@
     if (!ctx->xsh) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot connect to xenstore");
-        xc_interface_close(ctx->xch);
-        return ERROR_FAIL;
+        rc = ERROR_FAIL; goto out;
     }
 
     *pctx = ctx;
     return 0;
+
+ out:
+    libxl_ctx_free(ctx);
+    *pctx = NULL;
+    return rc;
 }
 
 int libxl_ctx_free(libxl_ctx *ctx)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:42 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxO-0001Gq-B2; Thu, 19 Jan 2012 21:55:42 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000vP-Lw
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1327010132!11604454!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17796 invoked from network); 19 Jan 2012 21:55:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:33 -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 1RnzxD-0007SM-VI
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxD-0000jz-U9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:31 +0000
Message-Id: <E1RnzxD-0000jz-U9@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Fix leaks on context init
	failure
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473667 0
# Node ID 6d8888519e3aae056956d41d77b53d22e132fbca
# Parent  cc969d75176039ea14c373f36e6f214e4b23e73b
libxl: Fix leaks on context init failure

Several of the error exits from libxl_ctx_alloc leaked the context
struct itself and sometimes other resources too.

Fix this by using the standard "rc = ERROR_FOO; goto out" error
handling style throughout.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r cc969d751760 -r 6d8888519e3a tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/tools/libxl/libxl.c	Fri Jan 13 16:54:27 2012 +0000
@@ -24,17 +24,17 @@
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags, xentoollog_logger * lg)
 {
-    libxl_ctx *ctx;
+    libxl_ctx *ctx = NULL;
     struct stat stat_buf;
     const pthread_mutex_t mutex_value = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-
-    if (version != LIBXL_VERSION)
-        return ERROR_VERSION;
+    int rc;
+
+    if (version != LIBXL_VERSION) { rc = ERROR_VERSION; goto out; }
 
     ctx = malloc(sizeof(*ctx));
     if (!ctx) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to allocate context\n");
-        return ERROR_NOMEM;
+        rc = ERROR_NOMEM; goto out;
     }
 
     memset(ctx, 0, sizeof(libxl_ctx));
@@ -48,14 +48,14 @@
     if ( stat(XENSTORE_PID_FILE, &stat_buf) != 0 ) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Is xenstore daemon running?\n"
                      "failed to stat %s", XENSTORE_PID_FILE);
-        return ERROR_FAIL;
+        rc = ERROR_FAIL; goto out;
     }
 
     ctx->xch = xc_interface_open(lg,lg,0);
     if (!ctx->xch) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot open libxc handle");
-        return ERROR_FAIL;
+        rc = ERROR_FAIL; goto out;
     }
 
     ctx->xsh = xs_daemon_open();
@@ -64,12 +64,16 @@
     if (!ctx->xsh) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot connect to xenstore");
-        xc_interface_close(ctx->xch);
-        return ERROR_FAIL;
+        rc = ERROR_FAIL; goto out;
     }
 
     *pctx = ctx;
     return 0;
+
+ out:
+    libxl_ctx_free(ctx);
+    *pctx = NULL;
+    return rc;
 }
 
 int libxl_ctx_free(libxl_ctx *ctx)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:43 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxO-0001HF-Jf; Thu, 19 Jan 2012 21:55:42 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000vF-L2
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327010131!9722092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22407 invoked from network); 19 Jan 2012 21:55:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:32 -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 1RnzxC-0007S1-VE
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxC-0000jV-Tl
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Message-Id: <E1RnzxC-0000jV-Tl@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: move a lot more includes into
	libxl_internal.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473659 0
# Node ID 2231bc032192d9fdada4a6415f8814dff3bdd14d
# Parent  19a0a2e26137f3f1d436f84a55c24d473eef21fd
libxl: move a lot more includes into libxl_internal.h

Move a lot of
  #include <stdfoo.h>
from individual files into libxl_internal.h.  This helps avoid
portability mistakes where necessary system headers are omitted from
individual files, and is also of course a convenience when developing.

Also add
  #include "libxl_osdeps.h" /* must come before any other headers */
to the top of most libxl*.c files, so that anyone who adds any headers
before libxl_internal.h will put the in the right place.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl.c	Fri Jan 13 16:54:19 2012 +0000
@@ -16,21 +16,6 @@
 
 #include "libxl_osdeps.h"
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/select.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <unistd.h> /* for write, unlink and close */
-#include <stdint.h>
-#include <inttypes.h>
-#include <assert.h>
-
 #include "libxl_internal.h"
 
 #define PAGE_TO_MEMKB(pages) ((pages) * 4)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,13 +12,11 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxl_internal.h"
 
 #include "tap-ctl.h"
 
-#include <string.h>
-
 int libxl__blktap_enabled(libxl__gc *gc)
 {
     const char *msg;
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,15 +12,10 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <unistd.h>
-#include <fcntl.h>
 #include <termios.h>
 
-#include <sys/stat.h>
-#include <sys/types.h>
-
 #include "libxl_internal.h"
 
 #define XENCONSOLED_BUF_SIZE 16
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_cpuid.c
--- a/tools/libxl/libxl_cpuid.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_cpuid.c	Fri Jan 13 16:54:19 2012 +0000
@@ -10,6 +10,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxl_internal.h"
 
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_create.c	Fri Jan 13 16:54:19 2012 +0000
@@ -15,19 +15,12 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <xenctrl.h>
+#include "libxl_internal.h"
+
 #include <xc_dom.h>
 #include <xenguest.h>
-#include <assert.h>
-
-#include "libxl_internal.h"
 
 void libxl_domain_config_dispose(libxl_domain_config *d_config)
 {
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_device.c	Fri Jan 13 16:54:19 2012 +0000
@@ -14,15 +14,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <sys/time.h> /* for struct timeval */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Fri Jan 13 16:54:19 2012 +0000
@@ -15,15 +15,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <assert.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,22 +13,13 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <stdio.h>
-#include <assert.h>
 #include <glob.h>
-#include <inttypes.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/time.h> /* for struct timeval */
-#include <sys/stat.h> /* for stat */
-#include <unistd.h> /* for sleep(2) */
 
 #include <xenctrl.h>
 #include <xc_dom.h>
 #include <xenguest.h>
-#include <fcntl.h>
 
 #include <xen/hvm/hvm_info_table.h>
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_exec.c	Fri Jan 13 16:54:19 2012 +0000
@@ -15,18 +15,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <assert.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h> /* for SIGKILL */
-#include <fcntl.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_flask.c
--- a/tools/libxl/libxl_flask.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_flask.c	Fri Jan 13 16:54:19 2012 +0000
@@ -7,13 +7,7 @@
  *  as published by the Free Software Foundation.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <xenctrl.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_internal.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,15 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <unistd.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:19 2012 +0000
@@ -17,17 +17,33 @@
 #ifndef LIBXL_INTERNAL_H
 #define LIBXL_INTERNAL_H
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
+#include <assert.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stddef.h>
 #include <stdint.h>
-#include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
+#include <unistd.h>
+
+#include <sys/mman.h>
+#include <sys/select.h>
+#include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 
 #include <xs.h>
 #include <xenctrl.h>
+
 #include "xentoollog.h"
 
 #include <xen/io/xenbus.h>
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_json.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,10 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <assert.h>
-#include <string.h>
 #include <math.h>
 
 #include <yajl/yajl_parse.h>
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_linux.c
--- a/tools/libxl/libxl_linux.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_linux.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,7 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
  
-#include <sys/stat.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
  
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_netbsd.c
--- a/tools/libxl/libxl_netbsd.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_netbsd.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,7 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
  
-#include <sys/stat.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_noblktap2.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,6 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxl_internal.h"
 
 int libxl__blktap_enabled(libxl__gc *gc)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_nocpuid.c
--- a/tools/libxl/libxl_nocpuid.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_nocpuid.c	Fri Jan 13 16:54:19 2012 +0000
@@ -10,6 +10,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxl_internal.h"
 
 void libxl_cpuid_destroy(libxl_cpuid_policy_list *p_cpuid_list)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_paths.c
--- a/tools/libxl/libxl_paths.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_paths.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,6 +12,7 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxl_internal.h"
 #include "_libxl_paths.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Fri Jan 13 16:54:19 2012 +0000
@@ -14,21 +14,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/select.h>
-#include <sys/mman.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <unistd.h> /* for write, unlink and close */
-#include <inttypes.h>
-#include <dirent.h>
-#include <assert.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:19 2012 +0000
@@ -18,12 +18,10 @@
  * Specification, see in the QEMU repository.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <unistd.h>
 #include <sys/un.h>
 #include <sys/queue.h>
-#include <fcntl.h>
 
 #include <yajl/yajl_gen.h>
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,20 +13,9 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <xs.h>
-#include <xenctrl.h>
 #include <ctype.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <assert.h>
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_uuid.c
--- a/tools/libxl/libxl_uuid.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_uuid.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,7 +12,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <libxl_uuid.h>
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_xshelp.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,13 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <string.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <inttypes.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_cfg.c	Fri Jan 13 16:54:19 2012 +0000
@@ -16,6 +16,8 @@
  */
 
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include <limits.h>
 
 #include "libxlu_internal.h"
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_cfg_i.h
--- a/tools/libxl/libxlu_cfg_i.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_cfg_i.h	Fri Jan 13 16:54:19 2012 +0000
@@ -18,6 +18,7 @@
 #ifndef LIBXLU_CFG_I_H
 #define LIBXLU_CFG_I_H
 
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxlu_internal.h"
 #include "libxlu_cfg_y.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_disk.c
--- a/tools/libxl/libxlu_disk.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_disk.c	Fri Jan 13 16:54:19 2012 +0000
@@ -1,3 +1,4 @@
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxlu_internal.h"
 #include "libxlu_disk_l.h"
 #include "libxlu_disk_i.h"
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_disk_i.h
--- a/tools/libxl/libxlu_disk_i.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_disk_i.h	Fri Jan 13 16:54:19 2012 +0000
@@ -1,6 +1,8 @@
 #ifndef LIBXLU_DISK_I_H
 #define LIBXLU_DISK_I_H
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxlu_internal.h"
 
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:43 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxO-0001HF-Jf; Thu, 19 Jan 2012 21:55:42 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000vF-L2
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327010131!9722092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22407 invoked from network); 19 Jan 2012 21:55:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:32 -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 1RnzxC-0007S1-VE
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxC-0000jV-Tl
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:30 +0000
Message-Id: <E1RnzxC-0000jV-Tl@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: move a lot more includes into
	libxl_internal.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1326473659 0
# Node ID 2231bc032192d9fdada4a6415f8814dff3bdd14d
# Parent  19a0a2e26137f3f1d436f84a55c24d473eef21fd
libxl: move a lot more includes into libxl_internal.h

Move a lot of
  #include <stdfoo.h>
from individual files into libxl_internal.h.  This helps avoid
portability mistakes where necessary system headers are omitted from
individual files, and is also of course a convenience when developing.

Also add
  #include "libxl_osdeps.h" /* must come before any other headers */
to the top of most libxl*.c files, so that anyone who adds any headers
before libxl_internal.h will put the in the right place.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---


diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl.c	Fri Jan 13 16:54:19 2012 +0000
@@ -16,21 +16,6 @@
 
 #include "libxl_osdeps.h"
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/select.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <unistd.h> /* for write, unlink and close */
-#include <stdint.h>
-#include <inttypes.h>
-#include <assert.h>
-
 #include "libxl_internal.h"
 
 #define PAGE_TO_MEMKB(pages) ((pages) * 4)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,13 +12,11 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxl_internal.h"
 
 #include "tap-ctl.h"
 
-#include <string.h>
-
 int libxl__blktap_enabled(libxl__gc *gc)
 {
     const char *msg;
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,15 +12,10 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <unistd.h>
-#include <fcntl.h>
 #include <termios.h>
 
-#include <sys/stat.h>
-#include <sys/types.h>
-
 #include "libxl_internal.h"
 
 #define XENCONSOLED_BUF_SIZE 16
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_cpuid.c
--- a/tools/libxl/libxl_cpuid.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_cpuid.c	Fri Jan 13 16:54:19 2012 +0000
@@ -10,6 +10,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxl_internal.h"
 
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_create.c	Fri Jan 13 16:54:19 2012 +0000
@@ -15,19 +15,12 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <xenctrl.h>
+#include "libxl_internal.h"
+
 #include <xc_dom.h>
 #include <xenguest.h>
-#include <assert.h>
-
-#include "libxl_internal.h"
 
 void libxl_domain_config_dispose(libxl_domain_config *d_config)
 {
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_device.c	Fri Jan 13 16:54:19 2012 +0000
@@ -14,15 +14,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <sys/time.h> /* for struct timeval */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Fri Jan 13 16:54:19 2012 +0000
@@ -15,15 +15,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <assert.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,22 +13,13 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <stdio.h>
-#include <assert.h>
 #include <glob.h>
-#include <inttypes.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/time.h> /* for struct timeval */
-#include <sys/stat.h> /* for stat */
-#include <unistd.h> /* for sleep(2) */
 
 #include <xenctrl.h>
 #include <xc_dom.h>
 #include <xenguest.h>
-#include <fcntl.h>
 
 #include <xen/hvm/hvm_info_table.h>
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_exec.c	Fri Jan 13 16:54:19 2012 +0000
@@ -15,18 +15,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <assert.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h> /* for SIGKILL */
-#include <fcntl.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_flask.c
--- a/tools/libxl/libxl_flask.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_flask.c	Fri Jan 13 16:54:19 2012 +0000
@@ -7,13 +7,7 @@
  *  as published by the Free Software Foundation.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <xenctrl.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_internal.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,15 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <unistd.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 13 16:54:19 2012 +0000
@@ -17,17 +17,33 @@
 #ifndef LIBXL_INTERNAL_H
 #define LIBXL_INTERNAL_H
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
+#include <assert.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stddef.h>
 #include <stdint.h>
-#include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
+#include <unistd.h>
+
+#include <sys/mman.h>
+#include <sys/select.h>
+#include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 
 #include <xs.h>
 #include <xenctrl.h>
+
 #include "xentoollog.h"
 
 #include <xen/io/xenbus.h>
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_json.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,10 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <assert.h>
-#include <string.h>
 #include <math.h>
 
 #include <yajl/yajl_parse.h>
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_linux.c
--- a/tools/libxl/libxl_linux.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_linux.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,7 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
  
-#include <sys/stat.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
  
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_netbsd.c
--- a/tools/libxl/libxl_netbsd.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_netbsd.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,7 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
  
-#include <sys/stat.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_noblktap2.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,6 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxl_internal.h"
 
 int libxl__blktap_enabled(libxl__gc *gc)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_nocpuid.c
--- a/tools/libxl/libxl_nocpuid.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_nocpuid.c	Fri Jan 13 16:54:19 2012 +0000
@@ -10,6 +10,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxl_internal.h"
 
 void libxl_cpuid_destroy(libxl_cpuid_policy_list *p_cpuid_list)
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_paths.c
--- a/tools/libxl/libxl_paths.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_paths.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,6 +12,7 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxl_internal.h"
 #include "_libxl_paths.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Fri Jan 13 16:54:19 2012 +0000
@@ -14,21 +14,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/select.h>
-#include <sys/mman.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <unistd.h> /* for write, unlink and close */
-#include <inttypes.h>
-#include <dirent.h>
-#include <assert.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Fri Jan 13 16:54:19 2012 +0000
@@ -18,12 +18,10 @@
  * Specification, see in the QEMU repository.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <unistd.h>
 #include <sys/un.h>
 #include <sys/queue.h>
-#include <fcntl.h>
 
 #include <yajl/yajl_gen.h>
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,20 +13,9 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <xs.h>
-#include <xenctrl.h>
 #include <ctype.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <assert.h>
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_uuid.c
--- a/tools/libxl/libxl_uuid.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_uuid.c	Fri Jan 13 16:54:19 2012 +0000
@@ -12,7 +12,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <libxl_uuid.h>
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxl_xshelp.c	Fri Jan 13 16:54:19 2012 +0000
@@ -13,13 +13,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl_osdeps.h"
-
-#include <string.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <inttypes.h>
+#include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_cfg.c	Fri Jan 13 16:54:19 2012 +0000
@@ -16,6 +16,8 @@
  */
 
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include <limits.h>
 
 #include "libxlu_internal.h"
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_cfg_i.h
--- a/tools/libxl/libxlu_cfg_i.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_cfg_i.h	Fri Jan 13 16:54:19 2012 +0000
@@ -18,6 +18,7 @@
 #ifndef LIBXLU_CFG_I_H
 #define LIBXLU_CFG_I_H
 
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxlu_internal.h"
 #include "libxlu_cfg_y.h"
 
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_disk.c
--- a/tools/libxl/libxlu_disk.c	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_disk.c	Fri Jan 13 16:54:19 2012 +0000
@@ -1,3 +1,4 @@
+#include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxlu_internal.h"
 #include "libxlu_disk_l.h"
 #include "libxlu_disk_i.h"
diff -r 19a0a2e26137 -r 2231bc032192 tools/libxl/libxlu_disk_i.h
--- a/tools/libxl/libxlu_disk_i.h	Fri Jan 13 16:54:11 2012 +0000
+++ b/tools/libxl/libxlu_disk_i.h	Fri Jan 13 16:54:19 2012 +0000
@@ -1,6 +1,8 @@
 #ifndef LIBXLU_DISK_I_H
 #define LIBXLU_DISK_I_H
 
+#include "libxl_osdeps.h" /* must come before any other headers */
+
 #include "libxlu_internal.h"
 
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:43 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxP-0001Iv-9g; Thu, 19 Jan 2012 21:55:43 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxM-00012c-Ay
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1327010068!61729801!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10305 invoked from network); 19 Jan 2012 21:54: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;
	19 Jan 2012 21:54:29 -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 1RnzxH-0007T1-6J
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000lU-1u
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Message-Id: <E1RnzxH-0000lU-1u@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: drop vfs path -- fsback/front
	were deleted some time ago
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1326736567 0
# Node ID 2913ccc6d70f15ffcc15c7e066c9269b15a30a09
# Parent  37e7efaf8f3c1d890d3a40fdd608f4f46318df91
libxl: drop vfs path -- fsback/front were deleted some time ago

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 37e7efaf8f3c -r 2913ccc6d70f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Jan 10 16:19:09 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Mon Jan 16 17:56:07 2012 +0000
@@ -669,8 +669,6 @@
     t = xs_transaction_start(ctx->xsh);
     xs_mkdir(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid));
     xs_set_permissions(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid), perm, ARRAY_SIZE(perm));
-    xs_mkdir(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/%d/device/vfs", domid));
-    xs_set_permissions(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/%d/device/vfs",domid), perm, ARRAY_SIZE(perm));
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:43 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21: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.xensource.com>)
	id 1RnzxP-0001Iv-9g; Thu, 19 Jan 2012 21:55:43 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxM-00012c-Ay
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:40 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1327010068!61729801!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10305 invoked from network); 19 Jan 2012 21:54: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;
	19 Jan 2012 21:54:29 -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 1RnzxH-0007T1-6J
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxH-0000lU-1u
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:35 +0000
Message-Id: <E1RnzxH-0000lU-1u@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: drop vfs path -- fsback/front
	were deleted some time ago
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1326736567 0
# Node ID 2913ccc6d70f15ffcc15c7e066c9269b15a30a09
# Parent  37e7efaf8f3c1d890d3a40fdd608f4f46318df91
libxl: drop vfs path -- fsback/front were deleted some time ago

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 37e7efaf8f3c -r 2913ccc6d70f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Jan 10 16:19:09 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Mon Jan 16 17:56:07 2012 +0000
@@ -669,8 +669,6 @@
     t = xs_transaction_start(ctx->xsh);
     xs_mkdir(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid));
     xs_set_permissions(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid), perm, ARRAY_SIZE(perm));
-    xs_mkdir(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/%d/device/vfs", domid));
-    xs_set_permissions(ctx->xsh, t, libxl__sprintf(gc, "/local/domain/%d/device/vfs",domid), perm, ARRAY_SIZE(perm));
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:44 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxQ-0001Lc-75; Thu, 19 Jan 2012 21:55:44 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxN-0000zc-8r
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1327010133!11758962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14837 invoked from network); 19 Jan 2012 21:55:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:34 -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 1RnzxF-0007Sk-IK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxF-0000ki-H9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Message-Id: <E1RnzxF-0000ki-H9@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] fix compat header generation after
	24503:86b8a1e3a419
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326704105 -3600
# Node ID 0d4a60bf37b95b58bbae7019e0c263c556999131
# Parent  ffe158446c79a318a2f878dc938c0e61f46694e0
fix compat header generation after 24503:86b8a1e3a419

At once also remove the duplicate forced inclusion of
public/xen-compat.h there (it's already done through cppflags-y) and
convert --include to the canonical -include in said c/s' adjustments
to CFLAGS-y and AFLAGS-y.

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


diff -r ffe158446c79 -r 0d4a60bf37b9 xen/Rules.mk
--- a/xen/Rules.mk	Sun Jan 15 22:05:12 2012 +0000
+++ b/xen/Rules.mk	Mon Jan 16 09:55:05 2012 +0100
@@ -41,7 +41,7 @@
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS-y                += -g -D__XEN__ --include $(BASEDIR)/include/xen/config.h
+CFLAGS-y                += -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
@@ -59,7 +59,7 @@
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
 
-AFLAGS-y                += -D__ASSEMBLY__ --include $(BASEDIR)/include/xen/config.h
+AFLAGS-y                += -D__ASSEMBLY__ -include $(BASEDIR)/include/xen/config.h
 
 # Clang's built-in assembler can't handle .code16/.code32/.code64 yet
 AFLAGS-$(clang)         += -no-integrated-as
diff -r ffe158446c79 -r 0d4a60bf37b9 xen/include/Makefile
--- a/xen/include/Makefile	Sun Jan 15 22:05:12 2012 +0000
+++ b/xen/include/Makefile	Mon Jan 16 09:55:05 2012 +0100
@@ -57,7 +57,7 @@
 	mv -f $@.new $@
 
 compat/%.i: compat/%.c Makefile
-	$(CPP) -include public/xen-compat.h $(filter-out -M% .%.d,$(CFLAGS)) $(cppflags-y) -o $@ $<
+	$(CPP) $(filter-out -M% .%.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
 
 compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py
 	mkdir -p $(@D)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:44 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxQ-0001Lc-75; Thu, 19 Jan 2012 21:55:44 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxN-0000zc-8r
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1327010133!11758962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14837 invoked from network); 19 Jan 2012 21:55:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:34 -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 1RnzxF-0007Sk-IK
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxF-0000ki-H9
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:33 +0000
Message-Id: <E1RnzxF-0000ki-H9@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] fix compat header generation after
	24503:86b8a1e3a419
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326704105 -3600
# Node ID 0d4a60bf37b95b58bbae7019e0c263c556999131
# Parent  ffe158446c79a318a2f878dc938c0e61f46694e0
fix compat header generation after 24503:86b8a1e3a419

At once also remove the duplicate forced inclusion of
public/xen-compat.h there (it's already done through cppflags-y) and
convert --include to the canonical -include in said c/s' adjustments
to CFLAGS-y and AFLAGS-y.

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


diff -r ffe158446c79 -r 0d4a60bf37b9 xen/Rules.mk
--- a/xen/Rules.mk	Sun Jan 15 22:05:12 2012 +0000
+++ b/xen/Rules.mk	Mon Jan 16 09:55:05 2012 +0100
@@ -41,7 +41,7 @@
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS-y                += -g -D__XEN__ --include $(BASEDIR)/include/xen/config.h
+CFLAGS-y                += -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
@@ -59,7 +59,7 @@
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
 
-AFLAGS-y                += -D__ASSEMBLY__ --include $(BASEDIR)/include/xen/config.h
+AFLAGS-y                += -D__ASSEMBLY__ -include $(BASEDIR)/include/xen/config.h
 
 # Clang's built-in assembler can't handle .code16/.code32/.code64 yet
 AFLAGS-$(clang)         += -no-integrated-as
diff -r ffe158446c79 -r 0d4a60bf37b9 xen/include/Makefile
--- a/xen/include/Makefile	Sun Jan 15 22:05:12 2012 +0000
+++ b/xen/include/Makefile	Mon Jan 16 09:55:05 2012 +0100
@@ -57,7 +57,7 @@
 	mv -f $@.new $@
 
 compat/%.i: compat/%.c Makefile
-	$(CPP) -include public/xen-compat.h $(filter-out -M% .%.d,$(CFLAGS)) $(cppflags-y) -o $@ $<
+	$(CPP) $(filter-out -M% .%.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
 
 compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py
 	mkdir -p $(@D)

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:45 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxQ-0001Mz-QG; Thu, 19 Jan 2012 21:55:44 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxN-0000zM-8o
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1327010132!9872186!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2195 invoked from network); 19 Jan 2012 21:55:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:34 -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 1RnzxE-0007Sa-Hb
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxE-0000kE-GU
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
Message-Id: <E1RnzxE-0000kE-GU@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Make asmlinkage explicitly a
	no-op, and avoid usage in arch/x86
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1326664955 0
# Node ID a141f6d64916e3006cca13403d1b449d087893b8
# Parent  6d8888519e3aae056956d41d77b53d22e132fbca
x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/acpi/power.c	Sun Jan 15 22:02:35 2012 +0000
@@ -311,7 +311,7 @@
 }
 
 /* System is really put into sleep state by this stub */
-acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
+acpi_status acpi_enter_sleep_state(u8 sleep_state)
 {
     acpi_status status;
 
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/asid.c
--- a/xen/arch/x86/hvm/svm/asid.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/asid.c	Sun Jan 15 22:02:35 2012 +0000
@@ -39,7 +39,7 @@
  * Called directly before VMRUN.  Checks if the VCPU needs a new ASID,
  * assigns it, and if required, issues required TLB flushes.
  */
-asmlinkage void svm_asid_handle_vmrun(void)
+void svm_asid_handle_vmrun(void)
 {
     struct vcpu *curr = current;
     struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/intr.c	Sun Jan 15 22:02:35 2012 +0000
@@ -132,7 +132,7 @@
         vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR);
 }
 
-asmlinkage void svm_intr_assist(void) 
+void svm_intr_assist(void) 
 {
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Sun Jan 15 22:02:35 2012 +0000
@@ -1404,7 +1404,7 @@
 }
 
 /* VCPU switch */
-asmlinkage void nsvm_vcpu_switch(struct cpu_user_regs *regs)
+void nsvm_vcpu_switch(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nv;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Sun Jan 15 22:02:35 2012 +0000
@@ -1843,7 +1843,7 @@
     .nhvm_intr_blocked = nsvm_intr_blocked,
 };
 
-asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
+void svm_vmexit_handler(struct cpu_user_regs *regs)
 {
     uint64_t exit_reason;
     struct vcpu *v = current;
@@ -2249,7 +2249,7 @@
     vmcb_set_vintr(vmcb, intr);
 }
 
-asmlinkage void svm_trace_vmentry(void)
+void svm_trace_vmentry(void)
 {
     struct vcpu *curr = current;
     HVMTRACE_ND(VMENTRY,
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/intr.c	Sun Jan 15 22:02:35 2012 +0000
@@ -200,7 +200,7 @@
     return 0;
 }
 
-asmlinkage void vmx_intr_assist(void)
+void vmx_intr_assist(void)
 {
     struct hvm_intack intack;
     struct vcpu *v = current;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Sun Jan 15 22:02:35 2012 +0000
@@ -2169,7 +2169,7 @@
     domain_crash(curr->domain);
 }
 
-asmlinkage void vmx_enter_realmode(struct cpu_user_regs *regs)
+void vmx_enter_realmode(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -2251,7 +2251,7 @@
     }
 }
 
-asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
+void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
     unsigned long exit_qualification, inst_len = 0;
@@ -2718,7 +2718,7 @@
         nvmx_idtv_handling();
 }
 
-asmlinkage void vmx_vmenter_helper(void)
+void vmx_vmenter_helper(void)
 {
     struct vcpu *curr = current;
     u32 new_asid, old_asid;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Sun Jan 15 22:02:35 2012 +0000
@@ -968,7 +968,7 @@
     vmreturn(regs, VMSUCCEED);
 }
 
-asmlinkage void nvmx_switch_guest(void)
+void nvmx_switch_guest(void)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/irq.c	Sun Jan 15 22:02:35 2012 +0000
@@ -757,7 +757,7 @@
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
-asmlinkage void do_IRQ(struct cpu_user_regs *regs)
+void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
     uint32_t          tsc_in;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/trace.c	Sun Jan 15 22:02:35 2012 +0000
@@ -11,7 +11,7 @@
 #define TRC_64_FLAG 0
 #endif
 
-asmlinkage void trace_hypercall(void)
+void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
 
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/traps.c	Sun Jan 15 22:02:35 2012 +0000
@@ -425,7 +425,7 @@
  * are disabled). In such situations we can't do much that is safe. We try to
  * print out some tracing and then we just spin.
  */
-asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
+void fatal_trap(int trapnr, struct cpu_user_regs *regs)
 {
     static DEFINE_PER_CPU(char, depth);
 
@@ -539,7 +539,7 @@
  * Called from asm to set up the MCE trapbounce info.
  * Returns 0 if no callback is set up, else 1.
  */
-asmlinkage int set_guest_machinecheck_trapbounce(void)
+int set_guest_machinecheck_trapbounce(void)
 {
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
@@ -553,7 +553,7 @@
  * Called from asm to set up the NMI trapbounce info.
  * Returns 0 if no callback is set up, else 1.
  */
-asmlinkage int set_guest_nmi_trapbounce(void)
+int set_guest_nmi_trapbounce(void)
 {
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
@@ -601,13 +601,13 @@
 }
 
 #define DO_ERROR_NOCODE(trapnr, name)                   \
-asmlinkage void do_##name(struct cpu_user_regs *regs)   \
+void do_##name(struct cpu_user_regs *regs)   \
 {                                                       \
     do_trap(trapnr, regs, 0);                           \
 }
 
 #define DO_ERROR(trapnr, name)                          \
-asmlinkage void do_##name(struct cpu_user_regs *regs)   \
+void do_##name(struct cpu_user_regs *regs)   \
 {                                                       \
     do_trap(trapnr, regs, 1);                           \
 }
@@ -977,7 +977,7 @@
     return EXCRET_fault_fixed;
 }
 
-asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
+void do_invalid_op(struct cpu_user_regs *regs)
 {
     struct bug_frame bug;
     struct bug_frame_str bug_str;
@@ -1071,7 +1071,7 @@
     panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
 }
 
-asmlinkage void do_int3(struct cpu_user_regs *regs)
+void do_int3(struct cpu_user_regs *regs)
 {
     DEBUGGER_trap_entry(TRAP_int3, regs);
 
@@ -1084,7 +1084,7 @@
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-asmlinkage void do_machine_check(struct cpu_user_regs *regs)
+void do_machine_check(struct cpu_user_regs *regs)
 {
     machine_check_vector(regs, regs->error_code);
 }
@@ -1385,7 +1385,7 @@
  *  Bit 3: Reserved bit violation
  *  Bit 4: Instruction fetch
  */
-asmlinkage void do_page_fault(struct cpu_user_regs *regs)
+void do_page_fault(struct cpu_user_regs *regs)
 {
     unsigned long addr, fixup;
     unsigned int error_code;
@@ -1451,7 +1451,7 @@
  * during early boot (an issue was seen once, but was most likely a hardware 
  * problem).
  */
-asmlinkage void __init do_early_page_fault(struct cpu_user_regs *regs)
+void __init do_early_page_fault(struct cpu_user_regs *regs)
 {
     static int stuck;
     static unsigned long prev_eip, prev_cr2;
@@ -3049,7 +3049,7 @@
 #endif
 }
 
-asmlinkage void do_general_protection(struct cpu_user_regs *regs)
+void do_general_protection(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     unsigned long fixup;
@@ -3307,7 +3307,7 @@
  
 static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
-asmlinkage void do_nmi(struct cpu_user_regs *regs)
+void do_nmi(struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
@@ -3343,7 +3343,7 @@
     nmi_callback = dummy_nmi_callback;
 }
 
-asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
+void do_device_not_available(struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
 
@@ -3384,7 +3384,7 @@
     wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | 1);
 }
 
-asmlinkage void do_debug(struct cpu_user_regs *regs)
+void do_debug(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -3435,7 +3435,7 @@
     return;
 }
 
-asmlinkage void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
+void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
 {
 }
 
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/x86_32/traps.c	Sun Jan 15 22:02:35 2012 +0000
@@ -231,7 +231,7 @@
     .notifier_call = cpu_doublefault_tss_callback
 };
 
-asmlinkage void do_double_fault(void)
+void do_double_fault(void)
 {
     struct tss_struct *tss;
     unsigned int cpu;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/x86_64/traps.c	Sun Jan 15 22:02:35 2012 +0000
@@ -216,8 +216,8 @@
            l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
 }
 
-asmlinkage void double_fault(void);
-asmlinkage void do_double_fault(struct cpu_user_regs *regs)
+void double_fault(void);
+void do_double_fault(struct cpu_user_regs *regs)
 {
     unsigned int cpu;
 
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/config.h	Sun Jan 15 22:02:35 2012 +0000
@@ -119,13 +119,13 @@
 extern unsigned char boot_edid_info[128];
 #endif
 
+#define asmlinkage
+
 #if defined(__x86_64__)
 
 #define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
-#define asmlinkage
-
 #define PML4_ENTRY_BITS  39
 #ifndef __ASSEMBLY__
 #define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
@@ -289,8 +289,6 @@
 #define CONFIG_X86_32      1
 #define CONFIG_DOMAIN_PAGE 1
 
-#define asmlinkage __attribute__((regparm(0)))
-
 /*
  * Memory layout (high to low):                          PAE-SIZE
  *                                                       ------
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h	Sun Jan 15 22:02:35 2012 +0000
@@ -172,7 +172,7 @@
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                         unsigned long value);
 void nvmx_update_exception_bitmap(struct vcpu *v, unsigned long value);
-asmlinkage void nvmx_switch_guest(void);
+void nvmx_switch_guest(void);
 void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/irq.h	Sun Jan 15 22:02:35 2012 +0000
@@ -101,7 +101,7 @@
 fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
 fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
-asmlinkage void do_IRQ(struct cpu_user_regs *regs);
+void do_IRQ(struct cpu_user_regs *regs);
 
 void disable_8259A_irq(struct irq_desc *);
 void enable_8259A_irq(struct irq_desc *);
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Sun Jan 15 22:02:35 2012 +0000
@@ -549,7 +549,7 @@
 void show_execution_state(struct cpu_user_regs *regs);
 #define dump_execution_state() run_in_exception_handler(show_execution_state)
 void show_page_walk(unsigned long addr);
-asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
+void fatal_trap(int trapnr, struct cpu_user_regs *regs);
 
 #ifdef CONFIG_COMPAT
 void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
@@ -563,8 +563,8 @@
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 #define DECLARE_TRAP_HANDLER(_name)                     \
-asmlinkage void _name(void);                            \
-asmlinkage void do_ ## _name(struct cpu_user_regs *regs)
+void _name(void);                            \
+void do_ ## _name(struct cpu_user_regs *regs)
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
 DECLARE_TRAP_HANDLER(nmi);
@@ -586,13 +586,13 @@
 DECLARE_TRAP_HANDLER(spurious_interrupt_bug);
 #undef DECLARE_TRAP_HANDLER
 
-asmlinkage void syscall_enter(void);
-asmlinkage void sysenter_entry(void);
-asmlinkage void sysenter_eflags_saved(void);
-asmlinkage void compat_hypercall(void);
-asmlinkage void int80_direct_trap(void);
+void syscall_enter(void);
+void sysenter_entry(void);
+void sysenter_eflags_saved(void);
+void compat_hypercall(void);
+void int80_direct_trap(void);
 
-extern asmlinkage int hypercall(void);
+extern int hypercall(void);
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/x86_32/asm_defns.h
--- a/xen/include/asm-x86/x86_32/asm_defns.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/x86_32/asm_defns.h	Sun Jan 15 22:02:35 2012 +0000
@@ -138,7 +138,7 @@
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
 
 #define BUILD_IRQ(nr)                           \
-asmlinkage void IRQ_NAME(nr);                   \
+void IRQ_NAME(nr);                   \
 __asm__(                                        \
 "\n"__ALIGN_STR"\n"                             \
 STR(IRQ) #nr "_interrupt:\n\t"                  \
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Sun Jan 15 22:02:35 2012 +0000
@@ -116,7 +116,7 @@
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
 
 #define BUILD_IRQ(nr)                           \
-asmlinkage void IRQ_NAME(nr);                   \
+void IRQ_NAME(nr);                   \
 __asm__(                                        \
 "\n"__ALIGN_STR"\n"                             \
 STR(IRQ) #nr "_interrupt:\n\t"                  \

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:45 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxQ-0001Mz-QG; Thu, 19 Jan 2012 21:55:44 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxN-0000zM-8o
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1327010132!9872186!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2195 invoked from network); 19 Jan 2012 21:55:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:34 -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 1RnzxE-0007Sa-Hb
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxE-0000kE-GU
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:32 +0000
Message-Id: <E1RnzxE-0000kE-GU@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Make asmlinkage explicitly a
	no-op, and avoid usage in arch/x86
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1326664955 0
# Node ID a141f6d64916e3006cca13403d1b449d087893b8
# Parent  6d8888519e3aae056956d41d77b53d22e132fbca
x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/acpi/power.c	Sun Jan 15 22:02:35 2012 +0000
@@ -311,7 +311,7 @@
 }
 
 /* System is really put into sleep state by this stub */
-acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
+acpi_status acpi_enter_sleep_state(u8 sleep_state)
 {
     acpi_status status;
 
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/asid.c
--- a/xen/arch/x86/hvm/svm/asid.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/asid.c	Sun Jan 15 22:02:35 2012 +0000
@@ -39,7 +39,7 @@
  * Called directly before VMRUN.  Checks if the VCPU needs a new ASID,
  * assigns it, and if required, issues required TLB flushes.
  */
-asmlinkage void svm_asid_handle_vmrun(void)
+void svm_asid_handle_vmrun(void)
 {
     struct vcpu *curr = current;
     struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/intr.c	Sun Jan 15 22:02:35 2012 +0000
@@ -132,7 +132,7 @@
         vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR);
 }
 
-asmlinkage void svm_intr_assist(void) 
+void svm_intr_assist(void) 
 {
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Sun Jan 15 22:02:35 2012 +0000
@@ -1404,7 +1404,7 @@
 }
 
 /* VCPU switch */
-asmlinkage void nsvm_vcpu_switch(struct cpu_user_regs *regs)
+void nsvm_vcpu_switch(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nv;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Sun Jan 15 22:02:35 2012 +0000
@@ -1843,7 +1843,7 @@
     .nhvm_intr_blocked = nsvm_intr_blocked,
 };
 
-asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
+void svm_vmexit_handler(struct cpu_user_regs *regs)
 {
     uint64_t exit_reason;
     struct vcpu *v = current;
@@ -2249,7 +2249,7 @@
     vmcb_set_vintr(vmcb, intr);
 }
 
-asmlinkage void svm_trace_vmentry(void)
+void svm_trace_vmentry(void)
 {
     struct vcpu *curr = current;
     HVMTRACE_ND(VMENTRY,
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/intr.c	Sun Jan 15 22:02:35 2012 +0000
@@ -200,7 +200,7 @@
     return 0;
 }
 
-asmlinkage void vmx_intr_assist(void)
+void vmx_intr_assist(void)
 {
     struct hvm_intack intack;
     struct vcpu *v = current;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Sun Jan 15 22:02:35 2012 +0000
@@ -2169,7 +2169,7 @@
     domain_crash(curr->domain);
 }
 
-asmlinkage void vmx_enter_realmode(struct cpu_user_regs *regs)
+void vmx_enter_realmode(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -2251,7 +2251,7 @@
     }
 }
 
-asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
+void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
     unsigned long exit_qualification, inst_len = 0;
@@ -2718,7 +2718,7 @@
         nvmx_idtv_handling();
 }
 
-asmlinkage void vmx_vmenter_helper(void)
+void vmx_vmenter_helper(void)
 {
     struct vcpu *curr = current;
     u32 new_asid, old_asid;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Sun Jan 15 22:02:35 2012 +0000
@@ -968,7 +968,7 @@
     vmreturn(regs, VMSUCCEED);
 }
 
-asmlinkage void nvmx_switch_guest(void)
+void nvmx_switch_guest(void)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/irq.c	Sun Jan 15 22:02:35 2012 +0000
@@ -757,7 +757,7 @@
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
-asmlinkage void do_IRQ(struct cpu_user_regs *regs)
+void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
     uint32_t          tsc_in;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/trace.c	Sun Jan 15 22:02:35 2012 +0000
@@ -11,7 +11,7 @@
 #define TRC_64_FLAG 0
 #endif
 
-asmlinkage void trace_hypercall(void)
+void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
 
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/traps.c	Sun Jan 15 22:02:35 2012 +0000
@@ -425,7 +425,7 @@
  * are disabled). In such situations we can't do much that is safe. We try to
  * print out some tracing and then we just spin.
  */
-asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
+void fatal_trap(int trapnr, struct cpu_user_regs *regs)
 {
     static DEFINE_PER_CPU(char, depth);
 
@@ -539,7 +539,7 @@
  * Called from asm to set up the MCE trapbounce info.
  * Returns 0 if no callback is set up, else 1.
  */
-asmlinkage int set_guest_machinecheck_trapbounce(void)
+int set_guest_machinecheck_trapbounce(void)
 {
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
@@ -553,7 +553,7 @@
  * Called from asm to set up the NMI trapbounce info.
  * Returns 0 if no callback is set up, else 1.
  */
-asmlinkage int set_guest_nmi_trapbounce(void)
+int set_guest_nmi_trapbounce(void)
 {
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
@@ -601,13 +601,13 @@
 }
 
 #define DO_ERROR_NOCODE(trapnr, name)                   \
-asmlinkage void do_##name(struct cpu_user_regs *regs)   \
+void do_##name(struct cpu_user_regs *regs)   \
 {                                                       \
     do_trap(trapnr, regs, 0);                           \
 }
 
 #define DO_ERROR(trapnr, name)                          \
-asmlinkage void do_##name(struct cpu_user_regs *regs)   \
+void do_##name(struct cpu_user_regs *regs)   \
 {                                                       \
     do_trap(trapnr, regs, 1);                           \
 }
@@ -977,7 +977,7 @@
     return EXCRET_fault_fixed;
 }
 
-asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
+void do_invalid_op(struct cpu_user_regs *regs)
 {
     struct bug_frame bug;
     struct bug_frame_str bug_str;
@@ -1071,7 +1071,7 @@
     panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
 }
 
-asmlinkage void do_int3(struct cpu_user_regs *regs)
+void do_int3(struct cpu_user_regs *regs)
 {
     DEBUGGER_trap_entry(TRAP_int3, regs);
 
@@ -1084,7 +1084,7 @@
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-asmlinkage void do_machine_check(struct cpu_user_regs *regs)
+void do_machine_check(struct cpu_user_regs *regs)
 {
     machine_check_vector(regs, regs->error_code);
 }
@@ -1385,7 +1385,7 @@
  *  Bit 3: Reserved bit violation
  *  Bit 4: Instruction fetch
  */
-asmlinkage void do_page_fault(struct cpu_user_regs *regs)
+void do_page_fault(struct cpu_user_regs *regs)
 {
     unsigned long addr, fixup;
     unsigned int error_code;
@@ -1451,7 +1451,7 @@
  * during early boot (an issue was seen once, but was most likely a hardware 
  * problem).
  */
-asmlinkage void __init do_early_page_fault(struct cpu_user_regs *regs)
+void __init do_early_page_fault(struct cpu_user_regs *regs)
 {
     static int stuck;
     static unsigned long prev_eip, prev_cr2;
@@ -3049,7 +3049,7 @@
 #endif
 }
 
-asmlinkage void do_general_protection(struct cpu_user_regs *regs)
+void do_general_protection(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     unsigned long fixup;
@@ -3307,7 +3307,7 @@
  
 static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
-asmlinkage void do_nmi(struct cpu_user_regs *regs)
+void do_nmi(struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
@@ -3343,7 +3343,7 @@
     nmi_callback = dummy_nmi_callback;
 }
 
-asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
+void do_device_not_available(struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
 
@@ -3384,7 +3384,7 @@
     wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | 1);
 }
 
-asmlinkage void do_debug(struct cpu_user_regs *regs)
+void do_debug(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -3435,7 +3435,7 @@
     return;
 }
 
-asmlinkage void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
+void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
 {
 }
 
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/x86_32/traps.c	Sun Jan 15 22:02:35 2012 +0000
@@ -231,7 +231,7 @@
     .notifier_call = cpu_doublefault_tss_callback
 };
 
-asmlinkage void do_double_fault(void)
+void do_double_fault(void)
 {
     struct tss_struct *tss;
     unsigned int cpu;
diff -r 6d8888519e3a -r a141f6d64916 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/arch/x86/x86_64/traps.c	Sun Jan 15 22:02:35 2012 +0000
@@ -216,8 +216,8 @@
            l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
 }
 
-asmlinkage void double_fault(void);
-asmlinkage void do_double_fault(struct cpu_user_regs *regs)
+void double_fault(void);
+void do_double_fault(struct cpu_user_regs *regs)
 {
     unsigned int cpu;
 
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/config.h	Sun Jan 15 22:02:35 2012 +0000
@@ -119,13 +119,13 @@
 extern unsigned char boot_edid_info[128];
 #endif
 
+#define asmlinkage
+
 #if defined(__x86_64__)
 
 #define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
-#define asmlinkage
-
 #define PML4_ENTRY_BITS  39
 #ifndef __ASSEMBLY__
 #define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
@@ -289,8 +289,6 @@
 #define CONFIG_X86_32      1
 #define CONFIG_DOMAIN_PAGE 1
 
-#define asmlinkage __attribute__((regparm(0)))
-
 /*
  * Memory layout (high to low):                          PAE-SIZE
  *                                                       ------
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h	Sun Jan 15 22:02:35 2012 +0000
@@ -172,7 +172,7 @@
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                         unsigned long value);
 void nvmx_update_exception_bitmap(struct vcpu *v, unsigned long value);
-asmlinkage void nvmx_switch_guest(void);
+void nvmx_switch_guest(void);
 void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/irq.h	Sun Jan 15 22:02:35 2012 +0000
@@ -101,7 +101,7 @@
 fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
 fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
-asmlinkage void do_IRQ(struct cpu_user_regs *regs);
+void do_IRQ(struct cpu_user_regs *regs);
 
 void disable_8259A_irq(struct irq_desc *);
 void enable_8259A_irq(struct irq_desc *);
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Sun Jan 15 22:02:35 2012 +0000
@@ -549,7 +549,7 @@
 void show_execution_state(struct cpu_user_regs *regs);
 #define dump_execution_state() run_in_exception_handler(show_execution_state)
 void show_page_walk(unsigned long addr);
-asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
+void fatal_trap(int trapnr, struct cpu_user_regs *regs);
 
 #ifdef CONFIG_COMPAT
 void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
@@ -563,8 +563,8 @@
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 #define DECLARE_TRAP_HANDLER(_name)                     \
-asmlinkage void _name(void);                            \
-asmlinkage void do_ ## _name(struct cpu_user_regs *regs)
+void _name(void);                            \
+void do_ ## _name(struct cpu_user_regs *regs)
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
 DECLARE_TRAP_HANDLER(nmi);
@@ -586,13 +586,13 @@
 DECLARE_TRAP_HANDLER(spurious_interrupt_bug);
 #undef DECLARE_TRAP_HANDLER
 
-asmlinkage void syscall_enter(void);
-asmlinkage void sysenter_entry(void);
-asmlinkage void sysenter_eflags_saved(void);
-asmlinkage void compat_hypercall(void);
-asmlinkage void int80_direct_trap(void);
+void syscall_enter(void);
+void sysenter_entry(void);
+void sysenter_eflags_saved(void);
+void compat_hypercall(void);
+void int80_direct_trap(void);
 
-extern asmlinkage int hypercall(void);
+extern int hypercall(void);
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/x86_32/asm_defns.h
--- a/xen/include/asm-x86/x86_32/asm_defns.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/x86_32/asm_defns.h	Sun Jan 15 22:02:35 2012 +0000
@@ -138,7 +138,7 @@
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
 
 #define BUILD_IRQ(nr)                           \
-asmlinkage void IRQ_NAME(nr);                   \
+void IRQ_NAME(nr);                   \
 __asm__(                                        \
 "\n"__ALIGN_STR"\n"                             \
 STR(IRQ) #nr "_interrupt:\n\t"                  \
diff -r 6d8888519e3a -r a141f6d64916 xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Fri Jan 13 16:54:27 2012 +0000
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Sun Jan 15 22:02:35 2012 +0000
@@ -116,7 +116,7 @@
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
 
 #define BUILD_IRQ(nr)                           \
-asmlinkage void IRQ_NAME(nr);                   \
+void IRQ_NAME(nr);                   \
 __asm__(                                        \
 "\n"__ALIGN_STR"\n"                             \
 STR(IRQ) #nr "_interrupt:\n\t"                  \

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:45 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxR-0001O2-7S; Thu, 19 Jan 2012 21:55:45 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxO-00012p-FA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327010134!9722097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22463 invoked from network); 19 Jan 2012 21:55:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:35 -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 1RnzxG-0007Sx-KC
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000lC-Fh
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Message-Id: <E1RnzxG-0000lC-Fh@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ocaml: Correct ocaml type name for
	Aggregate types.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1326212349 0
# Node ID 37e7efaf8f3c1d890d3a40fdd608f4f46318df91
# Parent  6f8d5e8fdf1f77915c8b8c3b740a9eeec6ce869d
ocaml: Correct ocaml type name for Aggregate types.

No change to the generated code because this path isn't used yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 6f8d5e8fdf1f -r 37e7efaf8f3c tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Mon Jan 16 16:36:15 2012 +0100
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Jan 10 16:19:09 2012 +0000
@@ -59,6 +59,8 @@
         if not typename:
             raise NotImplementedError("No typename for Builtin %s (%s)" % (ty.typename, type(ty)))
         return typename
+    elif isinstance(ty,libxltypes.Aggregate):
+        return ty.rawname.capitalize() + ".t"
     else:
         return ty.rawname
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:45 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxR-0001O2-7S; Thu, 19 Jan 2012 21:55:45 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxO-00012p-FA
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327010134!9722097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22463 invoked from network); 19 Jan 2012 21:55:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:35 -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 1RnzxG-0007Sx-KC
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxG-0000lC-Fh
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:34 +0000
Message-Id: <E1RnzxG-0000lC-Fh@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ocaml: Correct ocaml type name for
	Aggregate types.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1326212349 0
# Node ID 37e7efaf8f3c1d890d3a40fdd608f4f46318df91
# Parent  6f8d5e8fdf1f77915c8b8c3b740a9eeec6ce869d
ocaml: Correct ocaml type name for Aggregate types.

No change to the generated code because this path isn't used yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 6f8d5e8fdf1f -r 37e7efaf8f3c tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Mon Jan 16 16:36:15 2012 +0100
+++ b/tools/ocaml/libs/xl/genwrap.py	Tue Jan 10 16:19:09 2012 +0000
@@ -59,6 +59,8 @@
         if not typename:
             raise NotImplementedError("No typename for Builtin %s (%s)" % (ty.typename, type(ty)))
         return typename
+    elif isinstance(ty,libxltypes.Aggregate):
+        return ty.rawname.capitalize() + ".t"
     else:
         return ty.rawname
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:47 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxS-0001R3-On; Thu, 19 Jan 2012 21:55:46 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxP-00016R-Qo
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327010136!9875118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 557 invoked from network); 19 Jan 2012 21:55:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:37 -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 1RnzxI-0007TA-5Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxI-0000ly-4N
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Message-Id: <E1RnzxI-0000ly-4N@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] sched_credit: Use delay to control
	scheduling frequency
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Hui Lv <hui.lv@intel.com>
# Date 1326799128 0
# Node ID 44c2856b19524e7984bfb91bf690181b5f4d1d30
# Parent  a7ae457c327cd790704643e0ed4def3e717b47b3
sched_credit: Use delay to control scheduling frequency

This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a7ae457c327c -r 44c2856b1952 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Jan 17 11:18:48 2012 +0000
@@ -173,6 +173,7 @@
     uint32_t credit;
     int credit_balance;
     uint32_t runq_sort;
+    unsigned ratelimit_us;
     /* Period of master and tick in milliseconds */
     unsigned tslice_ms, tick_period_us, ticks_per_tslice;
     unsigned credits_per_tslice;
@@ -1301,10 +1302,15 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_vcpu *snext;
     struct task_slice ret;
+    s_time_t runtime, tslice;
 
     CSCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
+    runtime = now - current->runstate.state_entry_time;
+    if ( runtime < 0 ) /* Does this ever happen? */
+        runtime = 0;
+
     if ( !is_idle_vcpu(scurr->vcpu) )
     {
         /* Update credits of a non-idle VCPU. */
@@ -1317,6 +1323,35 @@
         scurr->pri = CSCHED_PRI_IDLE;
     }
 
+    /* Choices, choices:
+     * - If we have a tasklet, we need to run the idle vcpu no matter what.
+     * - If sched rate limiting is in effect, and the current vcpu has
+     *   run for less than that amount of time, continue the current one,
+     *   but with a shorter timeslice and return it immediately
+     * - Otherwise, chose the one with the highest priority (which may
+     *   be the one currently running)
+     * - If the currently running one is TS_OVER, see if there
+     *   is a higher priority one waiting on the runqueue of another
+     *   cpu and steal it.
+     */
+
+    /* If we have schedule rate limiting enabled, check to see
+     * how long we've run for. */
+    if ( !tasklet_work_scheduled
+         && prv->ratelimit_us
+         && vcpu_runnable(current)
+         && !is_idle_vcpu(current)
+         && runtime < MICROSECS(prv->ratelimit_us) )
+    {
+        snext = scurr;
+        snext->start_time += now;
+        perfc_incr(delay_ms);
+        tslice = MICROSECS(prv->ratelimit_us);
+        ret.migrated = 0;
+        goto out;
+    }
+    tslice = MILLISECS(prv->tslice_ms);
+
     /*
      * Select next runnable local VCPU (ie top of local runq)
      */
@@ -1371,11 +1406,12 @@
     if ( !is_idle_vcpu(snext->vcpu) )
         snext->start_time += now;
 
+out:
     /*
      * Return task to run next...
      */
     ret.time = (is_idle_vcpu(snext->vcpu) ?
-                -1 : MILLISECS(prv->tslice_ms));
+                -1 : tslice);
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
@@ -1537,6 +1573,15 @@
     prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
     prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
 
+    if ( MICROSECS(sched_ratelimit_us) > MILLISECS(sched_credit_tslice_ms) )
+    {
+        printk("WARNING: sched_ratelimit_us >" 
+               "sched_credit_tslice_ms is undefined\n"
+               "Setting ratelimit_us to 1000 * tslice_ms\n");
+        prv->ratelimit_us = 1000 * prv->tslice_ms;
+    }
+    else
+        prv->ratelimit_us = sched_ratelimit_us;
     return 0;
 }
 
diff -r a7ae457c327c -r 44c2856b1952 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/common/schedule.c	Tue Jan 17 11:18:48 2012 +0000
@@ -47,6 +47,11 @@
 bool_t sched_smt_power_savings = 0;
 boolean_param("sched_smt_power_savings", sched_smt_power_savings);
 
+/* Default scheduling rate limit: 1ms 
+ * The behavior when sched_ratelimit_us is greater than sched_credit_tslice_ms is undefined
+ * */
+int sched_ratelimit_us = 1000;
+integer_param("sched_ratelimit_us", sched_ratelimit_us);
 /* Various timer handlers. */
 static void s_timer_fn(void *unused);
 static void vcpu_periodic_timer_fn(void *data);
diff -r a7ae457c327c -r 44c2856b1952 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/include/xen/perfc_defn.h	Tue Jan 17 11:18:48 2012 +0000
@@ -16,6 +16,7 @@
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
 
+PERFCOUNTER(delay_ms,               "csched: delay")
 PERFCOUNTER(vcpu_check,             "csched: vcpu_check")
 PERFCOUNTER(schedule,               "csched: schedule")
 PERFCOUNTER(acct_run,               "csched: acct_run")
diff -r a7ae457c327c -r 44c2856b1952 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/include/xen/sched-if.h	Tue Jan 17 11:18:48 2012 +0000
@@ -16,6 +16,11 @@
 /* cpus currently in no cpupool */
 extern cpumask_t cpupool_free_cpus;
 
+/* Scheduler generic parameters
+ * */
+extern int sched_ratelimit_us;
+
+
 /*
  * In order to allow a scheduler to remap the lock->cpu mapping,
  * we have a per-cpu pointer, along with a pre-allocated set of

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:47 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxS-0001R3-On; Thu, 19 Jan 2012 21:55:46 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxP-00016R-Qo
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327010136!9875118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 557 invoked from network); 19 Jan 2012 21:55:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:37 -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 1RnzxI-0007TA-5Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxI-0000ly-4N
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:36 +0000
Message-Id: <E1RnzxI-0000ly-4N@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] sched_credit: Use delay to control
	scheduling frequency
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Hui Lv <hui.lv@intel.com>
# Date 1326799128 0
# Node ID 44c2856b19524e7984bfb91bf690181b5f4d1d30
# Parent  a7ae457c327cd790704643e0ed4def3e717b47b3
sched_credit: Use delay to control scheduling frequency

This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a7ae457c327c -r 44c2856b1952 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Jan 17 11:18:48 2012 +0000
@@ -173,6 +173,7 @@
     uint32_t credit;
     int credit_balance;
     uint32_t runq_sort;
+    unsigned ratelimit_us;
     /* Period of master and tick in milliseconds */
     unsigned tslice_ms, tick_period_us, ticks_per_tslice;
     unsigned credits_per_tslice;
@@ -1301,10 +1302,15 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_vcpu *snext;
     struct task_slice ret;
+    s_time_t runtime, tslice;
 
     CSCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
+    runtime = now - current->runstate.state_entry_time;
+    if ( runtime < 0 ) /* Does this ever happen? */
+        runtime = 0;
+
     if ( !is_idle_vcpu(scurr->vcpu) )
     {
         /* Update credits of a non-idle VCPU. */
@@ -1317,6 +1323,35 @@
         scurr->pri = CSCHED_PRI_IDLE;
     }
 
+    /* Choices, choices:
+     * - If we have a tasklet, we need to run the idle vcpu no matter what.
+     * - If sched rate limiting is in effect, and the current vcpu has
+     *   run for less than that amount of time, continue the current one,
+     *   but with a shorter timeslice and return it immediately
+     * - Otherwise, chose the one with the highest priority (which may
+     *   be the one currently running)
+     * - If the currently running one is TS_OVER, see if there
+     *   is a higher priority one waiting on the runqueue of another
+     *   cpu and steal it.
+     */
+
+    /* If we have schedule rate limiting enabled, check to see
+     * how long we've run for. */
+    if ( !tasklet_work_scheduled
+         && prv->ratelimit_us
+         && vcpu_runnable(current)
+         && !is_idle_vcpu(current)
+         && runtime < MICROSECS(prv->ratelimit_us) )
+    {
+        snext = scurr;
+        snext->start_time += now;
+        perfc_incr(delay_ms);
+        tslice = MICROSECS(prv->ratelimit_us);
+        ret.migrated = 0;
+        goto out;
+    }
+    tslice = MILLISECS(prv->tslice_ms);
+
     /*
      * Select next runnable local VCPU (ie top of local runq)
      */
@@ -1371,11 +1406,12 @@
     if ( !is_idle_vcpu(snext->vcpu) )
         snext->start_time += now;
 
+out:
     /*
      * Return task to run next...
      */
     ret.time = (is_idle_vcpu(snext->vcpu) ?
-                -1 : MILLISECS(prv->tslice_ms));
+                -1 : tslice);
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
@@ -1537,6 +1573,15 @@
     prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
     prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
 
+    if ( MICROSECS(sched_ratelimit_us) > MILLISECS(sched_credit_tslice_ms) )
+    {
+        printk("WARNING: sched_ratelimit_us >" 
+               "sched_credit_tslice_ms is undefined\n"
+               "Setting ratelimit_us to 1000 * tslice_ms\n");
+        prv->ratelimit_us = 1000 * prv->tslice_ms;
+    }
+    else
+        prv->ratelimit_us = sched_ratelimit_us;
     return 0;
 }
 
diff -r a7ae457c327c -r 44c2856b1952 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/common/schedule.c	Tue Jan 17 11:18:48 2012 +0000
@@ -47,6 +47,11 @@
 bool_t sched_smt_power_savings = 0;
 boolean_param("sched_smt_power_savings", sched_smt_power_savings);
 
+/* Default scheduling rate limit: 1ms 
+ * The behavior when sched_ratelimit_us is greater than sched_credit_tslice_ms is undefined
+ * */
+int sched_ratelimit_us = 1000;
+integer_param("sched_ratelimit_us", sched_ratelimit_us);
 /* Various timer handlers. */
 static void s_timer_fn(void *unused);
 static void vcpu_periodic_timer_fn(void *data);
diff -r a7ae457c327c -r 44c2856b1952 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/include/xen/perfc_defn.h	Tue Jan 17 11:18:48 2012 +0000
@@ -16,6 +16,7 @@
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
 
+PERFCOUNTER(delay_ms,               "csched: delay")
 PERFCOUNTER(vcpu_check,             "csched: vcpu_check")
 PERFCOUNTER(schedule,               "csched: schedule")
 PERFCOUNTER(acct_run,               "csched: acct_run")
diff -r a7ae457c327c -r 44c2856b1952 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue Jan 17 11:11:26 2012 +0000
+++ b/xen/include/xen/sched-if.h	Tue Jan 17 11:18:48 2012 +0000
@@ -16,6 +16,11 @@
 /* cpus currently in no cpupool */
 extern cpumask_t cpupool_free_cpus;
 
+/* Scheduler generic parameters
+ * */
+extern int sched_ratelimit_us;
+
+
 /*
  * In order to allow a scheduler to remap the lock->cpu mapping,
  * we have a per-cpu pointer, along with a pre-allocated set of

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:47 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxT-0001Ri-7G; Thu, 19 Jan 2012 21:55:47 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxQ-00018O-Ix
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1327010137!9892838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27254 invoked from network); 19 Jan 2012 21:55:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:38 -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 1RnzxJ-0007TQ-5N
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000mS-3z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Message-Id: <E1RnzxJ-0000mS-3z@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add NULL checks in code added by
	24492:6c104b46ef89
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326964092 -3600
# Node ID 9a967990b4d2ce4a740662c2ad6b1e5d2adec984
# Parent  15ab61865ecbd146f6ce65fbea5bf49bfd9c6cb1
add NULL checks in code added by 24492:6c104b46ef89

Also a couple of missing is_hvm_domain() checks.

Further properly pass the PCI segment in a call to pci_get_pdev().

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


diff -r 15ab61865ecb -r 9a967990b4d2 xen/drivers/passthrough/amd/iommu_guest.c
--- a/xen/drivers/passthrough/amd/iommu_guest.c	Tue Jan 17 12:40:52 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_guest.c	Thu Jan 19 10:08:12 2012 +0100
@@ -182,7 +182,13 @@
     ppr_entry_t *log, *log_base;
     struct guest_iommu *iommu;
 
+    if ( !is_hvm_domain(d) )
+        return;
+
     iommu = domain_iommu(d);
+    if ( !iommu )
+        return;
+
     tail = iommu_get_rb_pointer(iommu->ppr_log.reg_tail.lo);
     head = iommu_get_rb_pointer(iommu->ppr_log.reg_head.lo);
 
@@ -225,7 +231,13 @@
     event_entry_t *log, *log_base;
     struct guest_iommu *iommu;
 
+    if ( !is_hvm_domain(d) )
+        return;
+
     iommu = domain_iommu(d);
+    if ( !iommu )
+        return;
+
     tail = iommu_get_rb_pointer(iommu->event_log.reg_tail.lo);
     head = iommu_get_rb_pointer(iommu->event_log.reg_head.lo);
 
@@ -793,6 +805,9 @@
     p2m_type_t t;
     struct guest_iommu *iommu = domain_iommu(d);
 
+    if ( !iommu )
+        return -EACCES;
+
     iommu->mmio_base = base;
     base >>= PAGE_SHIFT;
 
@@ -882,6 +897,8 @@
         return;
 
     iommu = domain_iommu(d);
+    if ( !iommu )
+        return;
 
     tasklet_kill(&iommu->cmd_buffer_tasklet);
     xfree(iommu);
@@ -893,7 +910,7 @@
 {
     struct guest_iommu *iommu = vcpu_iommu(v);
 
-    return addr >= iommu->mmio_base &&
+    return iommu && addr >= iommu->mmio_base &&
            addr < iommu->mmio_base + IOMMU_MMIO_SIZE;
 }
 
diff -r 15ab61865ecb -r 9a967990b4d2 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Jan 17 12:40:52 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 19 10:08:12 2012 +0100
@@ -651,7 +651,7 @@
     local_irq_enable();
 
     spin_lock(&pcidevs_lock);
-    pdev = pci_get_pdev(0, bus, devfn);
+    pdev = pci_get_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
     local_irq_disable();

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:47 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxT-0001Ri-7G; Thu, 19 Jan 2012 21:55:47 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxQ-00018O-Ix
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1327010137!9892838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27254 invoked from network); 19 Jan 2012 21:55:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:38 -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 1RnzxJ-0007TQ-5N
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000mS-3z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Message-Id: <E1RnzxJ-0000mS-3z@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add NULL checks in code added by
	24492:6c104b46ef89
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1326964092 -3600
# Node ID 9a967990b4d2ce4a740662c2ad6b1e5d2adec984
# Parent  15ab61865ecbd146f6ce65fbea5bf49bfd9c6cb1
add NULL checks in code added by 24492:6c104b46ef89

Also a couple of missing is_hvm_domain() checks.

Further properly pass the PCI segment in a call to pci_get_pdev().

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


diff -r 15ab61865ecb -r 9a967990b4d2 xen/drivers/passthrough/amd/iommu_guest.c
--- a/xen/drivers/passthrough/amd/iommu_guest.c	Tue Jan 17 12:40:52 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_guest.c	Thu Jan 19 10:08:12 2012 +0100
@@ -182,7 +182,13 @@
     ppr_entry_t *log, *log_base;
     struct guest_iommu *iommu;
 
+    if ( !is_hvm_domain(d) )
+        return;
+
     iommu = domain_iommu(d);
+    if ( !iommu )
+        return;
+
     tail = iommu_get_rb_pointer(iommu->ppr_log.reg_tail.lo);
     head = iommu_get_rb_pointer(iommu->ppr_log.reg_head.lo);
 
@@ -225,7 +231,13 @@
     event_entry_t *log, *log_base;
     struct guest_iommu *iommu;
 
+    if ( !is_hvm_domain(d) )
+        return;
+
     iommu = domain_iommu(d);
+    if ( !iommu )
+        return;
+
     tail = iommu_get_rb_pointer(iommu->event_log.reg_tail.lo);
     head = iommu_get_rb_pointer(iommu->event_log.reg_head.lo);
 
@@ -793,6 +805,9 @@
     p2m_type_t t;
     struct guest_iommu *iommu = domain_iommu(d);
 
+    if ( !iommu )
+        return -EACCES;
+
     iommu->mmio_base = base;
     base >>= PAGE_SHIFT;
 
@@ -882,6 +897,8 @@
         return;
 
     iommu = domain_iommu(d);
+    if ( !iommu )
+        return;
 
     tasklet_kill(&iommu->cmd_buffer_tasklet);
     xfree(iommu);
@@ -893,7 +910,7 @@
 {
     struct guest_iommu *iommu = vcpu_iommu(v);
 
-    return addr >= iommu->mmio_base &&
+    return iommu && addr >= iommu->mmio_base &&
            addr < iommu->mmio_base + IOMMU_MMIO_SIZE;
 }
 
diff -r 15ab61865ecb -r 9a967990b4d2 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Tue Jan 17 12:40:52 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Jan 19 10:08:12 2012 +0100
@@ -651,7 +651,7 @@
     local_irq_enable();
 
     spin_lock(&pcidevs_lock);
-    pdev = pci_get_pdev(0, bus, devfn);
+    pdev = pci_get_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
     local_irq_disable();

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:48 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxT-0001T2-MX; Thu, 19 Jan 2012 21:55:47 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxR-0001BJ-QP
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1327010138!9140194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13104 invoked from network); 19 Jan 2012 21:55:39 -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;
	19 Jan 2012 21:55:39 -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 1RnzxK-0007Td-7Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-0000mx-5T
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Message-Id: <E1RnzxK-0000mx-5T@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Don't ASSERT() for a valid
	mfn on paged p2m entries in guest_physmap_ad
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326969762 0
# Node ID 2049e165b73c5311851c03fc14f379286d0972ef
# Parent  06ffb6b41df985b9382bbc9a5e85d54f23e5f784
x86/mm: Don't ASSERT() for a valid mfn on paged p2m entries in guest_physmap_ad

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 06ffb6b41df9 -r 2049e165b73c xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:38:47 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:42:42 2012 +0000
@@ -489,7 +489,7 @@
             
             return -EINVAL;
         }
-        else if ( p2m_is_ram(ot) )
+        else if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
         {
             ASSERT(mfn_valid(omfn));
             set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
@@ -514,7 +514,7 @@
             P2M_DEBUG("aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
                       mfn + i, ogfn, gfn + i);
             omfn = p2m->get_entry(p2m, ogfn, &ot, &a, p2m_query, NULL);
-            if ( p2m_is_ram(ot) )
+            if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
             {
                 ASSERT(mfn_valid(omfn));
                 P2M_DEBUG("old gfn=%#lx -> mfn %#lx\n",

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:48 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxT-0001T2-MX; Thu, 19 Jan 2012 21:55:47 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxR-0001BJ-QP
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1327010138!9140194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13104 invoked from network); 19 Jan 2012 21:55:39 -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;
	19 Jan 2012 21:55:39 -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 1RnzxK-0007Td-7Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-0000mx-5T
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Message-Id: <E1RnzxK-0000mx-5T@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Don't ASSERT() for a valid
	mfn on paged p2m entries in guest_physmap_ad
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326969762 0
# Node ID 2049e165b73c5311851c03fc14f379286d0972ef
# Parent  06ffb6b41df985b9382bbc9a5e85d54f23e5f784
x86/mm: Don't ASSERT() for a valid mfn on paged p2m entries in guest_physmap_ad

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 06ffb6b41df9 -r 2049e165b73c xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:38:47 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:42:42 2012 +0000
@@ -489,7 +489,7 @@
             
             return -EINVAL;
         }
-        else if ( p2m_is_ram(ot) )
+        else if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
         {
             ASSERT(mfn_valid(omfn));
             set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
@@ -514,7 +514,7 @@
             P2M_DEBUG("aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
                       mfn + i, ogfn, gfn + i);
             omfn = p2m->get_entry(p2m, ogfn, &ot, &a, p2m_query, NULL);
-            if ( p2m_is_ram(ot) )
+            if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
             {
                 ASSERT(mfn_valid(omfn));
                 P2M_DEBUG("old gfn=%#lx -> mfn %#lx\n",

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:49 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxV-0001WJ-7X; Thu, 19 Jan 2012 21:55:49 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxS-0001C6-63
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1327010138!9899673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14439 invoked from network); 19 Jan 2012 21:55:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:39 -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 1RnzxK-0007Ti-Ni
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-0000nC-MS
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Message-Id: <E1RnzxK-0000nC-MS@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Correct p2m unlocking during grant
	table map
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326969762 0
# Node ID f5b366c6c4c6a19f93f0c68dc9fc939f172ec908
# Parent  2049e165b73c5311851c03fc14f379286d0972ef
Correct p2m unlocking during grant table map

We were not putting gfn's consistently.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 2049e165b73c -r f5b366c6c4c6 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Jan 19 10:42:42 2012 +0000
+++ b/xen/common/grant_table.c	Thu Jan 19 10:42:42 2012 +0000
@@ -141,7 +141,7 @@
 #define active_entry(t, e) \
     ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE])
 
-/* Check if the page has been paged out */
+/* Check if the page has been paged out. If rc == GNTST_okay, caller must do put_gfn(rd, gfn) */
 static int __get_paged_frame(unsigned long gfn, unsigned long *frame, int readonly, struct domain *rd)
 {
     int rc = GNTST_okay;
@@ -573,7 +573,10 @@
             gfn = sha1 ? sha1->frame : sha2->full_page.frame;
             rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd);
             if ( rc != GNTST_okay )
+            {
+                gfn = INVALID_GFN;
                 goto unlock_out;
+            }
             act->gfn = gfn;
             act->domid = ld->domain_id;
             act->frame = frame;
@@ -700,7 +703,8 @@
     op->handle       = handle;
     op->status       = GNTST_okay;
 
-    put_gfn(rd, gfn);
+    if ( gfn != INVALID_GFN )
+        put_gfn(rd, gfn);
     rcu_unlock_domain(rd);
     return;
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:49 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxV-0001WJ-7X; Thu, 19 Jan 2012 21:55:49 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxS-0001C6-63
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1327010138!9899673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14439 invoked from network); 19 Jan 2012 21:55:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:39 -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 1RnzxK-0007Ti-Ni
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxK-0000nC-MS
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:38 +0000
Message-Id: <E1RnzxK-0000nC-MS@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Correct p2m unlocking during grant
	table map
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326969762 0
# Node ID f5b366c6c4c6a19f93f0c68dc9fc939f172ec908
# Parent  2049e165b73c5311851c03fc14f379286d0972ef
Correct p2m unlocking during grant table map

We were not putting gfn's consistently.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 2049e165b73c -r f5b366c6c4c6 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Jan 19 10:42:42 2012 +0000
+++ b/xen/common/grant_table.c	Thu Jan 19 10:42:42 2012 +0000
@@ -141,7 +141,7 @@
 #define active_entry(t, e) \
     ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE])
 
-/* Check if the page has been paged out */
+/* Check if the page has been paged out. If rc == GNTST_okay, caller must do put_gfn(rd, gfn) */
 static int __get_paged_frame(unsigned long gfn, unsigned long *frame, int readonly, struct domain *rd)
 {
     int rc = GNTST_okay;
@@ -573,7 +573,10 @@
             gfn = sha1 ? sha1->frame : sha2->full_page.frame;
             rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd);
             if ( rc != GNTST_okay )
+            {
+                gfn = INVALID_GFN;
                 goto unlock_out;
+            }
             act->gfn = gfn;
             act->domid = ld->domain_id;
             act->frame = frame;
@@ -700,7 +703,8 @@
     op->handle       = handle;
     op->status       = GNTST_okay;
 
-    put_gfn(rd, gfn);
+    if ( gfn != INVALID_GFN )
+        put_gfn(rd, gfn);
     rcu_unlock_domain(rd);
     return;
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:50 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxV-0001Ww-IR; Thu, 19 Jan 2012 21:55:49 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxS-0001DB-Fx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1327010138!9428221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19697 invoked from network); 19 Jan 2012 21:55:38 -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;
	19 Jan 2012 21:55:38 -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 1RnzxJ-0007TY-MY
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000mi-LG
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Message-Id: <E1RnzxJ-0000mi-LG@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Improve ring management for
	memory events. Do not lose guest events
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326969527 0
# Node ID 06ffb6b41df985b9382bbc9a5e85d54f23e5f784
# Parent  9a967990b4d2ce4a740662c2ad6b1e5d2adec984
x86/mm: Improve ring management for memory events. Do not lose guest events

This patch is an amalgamation of the work done by Olaf Hering <olaf@aepfle.de>
and our work.

It combines logic changes to simplify the memory event API, as well as
leveraging wait queues to deal with extreme conditions in which too many
events are generated by a guest vcpu.

In order to generate a new event, a slot in the ring is claimed. If a
guest vcpu is generating the event and there is no space, it is put on a
wait queue. If a foreign vcpu is generating the event and there is no
space, the vcpu is expected to retry its operation. If an error happens
later, the function returns the claimed slot via a cancel operation.

Thus, the API has only four calls: claim slot, cancel claimed slot, put
request in the ring, consume the response.

With all these mechanisms, no guest events are lost.
Our testing includes 1. ballooning down 512 MiBs; 2. using mem access n2rwx, in
which every page access in a four-vCPU guest results in an event, with no vCPU
pausing, and the four vCPUs touching all RAM. No guest events were lost in
either case, and qemu-dm had no mapping problems.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Thu Jan 19 10:38:47 2012 +0000
@@ -4198,15 +4198,21 @@
 
     if ( (p & HVMPME_onchangeonly) && (value == old) )
         return 1;
-    
-    rc = mem_event_check_ring(d, &d->mem_event->access);
-    if ( rc )
+
+    rc = mem_event_claim_slot(d, &d->mem_event->access);
+    if ( rc == -ENOSYS )
+    {
+        /* If there was no ring to handle the event, then
+         * simple continue executing normally. */
+        return 1;
+    }
+    else if ( rc < 0 )
         return rc;
-    
+
     memset(&req, 0, sizeof(req));
     req.type = MEM_EVENT_TYPE_ACCESS;
     req.reason = reason;
-    
+
     if ( (p & HVMPME_MODE_MASK) == HVMPME_mode_sync ) 
     {
         req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;    
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Jan 19 10:38:47 2012 +0000
@@ -23,6 +23,7 @@
 
 #include <asm/domain.h>
 #include <xen/event.h>
+#include <xen/wait.h>
 #include <asm/p2m.h>
 #include <asm/mem_event.h>
 #include <asm/mem_paging.h>
@@ -41,6 +42,7 @@
     struct domain *d,
     xen_domctl_mem_event_op_t *mec,
     struct mem_event_domain *med,
+    int pause_flag,
     xen_event_channel_notification_t notification_fn)
 {
     int rc;
@@ -75,6 +77,8 @@
         return -EINVAL;
     }
 
+    mem_event_ring_lock_init(med);
+
     /* Get MFN of shared page */
     guest_get_eff_l1e(v, shared_addr, &l1e);
     shared_gfn = l1e_get_pfn(l1e);
@@ -93,6 +97,9 @@
     put_gfn(dom_mem_event, ring_gfn);
     put_gfn(dom_mem_event, shared_gfn); 
 
+    /* Set the number of currently blocked vCPUs to 0. */
+    med->blocked = 0;
+
     /* Allocate event channel */
     rc = alloc_unbound_xen_event_channel(d->vcpu[0],
                                          current->domain->domain_id,
@@ -108,10 +115,11 @@
                     (mem_event_sring_t *)med->ring_page,
                     PAGE_SIZE);
 
-    mem_event_ring_lock_init(med);
+    /* Save the pause flag for this particular ring. */
+    med->pause_flag = pause_flag;
 
-    /* Wake any VCPUs paused for memory events */
-    mem_event_unpause_vcpus(d);
+    /* Initialize the last-chance wait queue. */
+    init_waitqueue_head(&med->wq);
 
     return 0;
 
@@ -125,48 +133,216 @@
     return rc;
 }
 
-static int mem_event_disable(struct mem_event_domain *med)
+static unsigned int mem_event_ring_available(struct mem_event_domain *med)
 {
-    unmap_domain_page(med->ring_page);
-    med->ring_page = NULL;
+    int avail_req = RING_FREE_REQUESTS(&med->front_ring);
+    avail_req -= med->target_producers;
+    avail_req -= med->foreign_producers;
 
-    unmap_domain_page(med->shared_page);
-    med->shared_page = NULL;
+    BUG_ON(avail_req < 0);
+
+    return avail_req;
+}
+
+/*
+ * mem_event_wake_blocked() will wakeup vcpus waiting for room in the
+ * ring. These vCPUs were paused on their way out after placing an event,
+ * but need to be resumed where the ring is capable of processing at least
+ * one event from them.
+ */
+static void mem_event_wake_blocked(struct domain *d, struct mem_event_domain *med)
+{
+    struct vcpu *v;
+    int online = d->max_vcpus;
+    unsigned int avail_req = mem_event_ring_available(med);
+
+    if ( avail_req == 0 || med->blocked == 0 )
+        return;
+
+    /*
+     * We ensure that we only have vCPUs online if there are enough free slots
+     * for their memory events to be processed.  This will ensure that no
+     * memory events are lost (due to the fact that certain types of events
+     * cannot be replayed, we need to ensure that there is space in the ring
+     * for when they are hit).
+     * See comment below in mem_event_put_request().
+     */
+    for_each_vcpu ( d, v )
+        if ( test_bit(med->pause_flag, &v->pause_flags) )
+            online--;
+
+    ASSERT(online == (d->max_vcpus - med->blocked));
+
+    /* We remember which vcpu last woke up to avoid scanning always linearly
+     * from zero and starving higher-numbered vcpus under high load */
+    if ( d->vcpu )
+    {
+        int i, j, k;
+
+        for (i = med->last_vcpu_wake_up + 1, j = 0; j < d->max_vcpus; i++, j++)
+        {
+            k = i % d->max_vcpus;
+            v = d->vcpu[k];
+            if ( !v )
+                continue;
+
+            if ( !(med->blocked) || online >= avail_req )
+               break;
+
+            if ( test_and_clear_bit(med->pause_flag, &v->pause_flags) )
+            {
+                vcpu_unpause(v);
+                online++;
+                med->blocked--;
+                med->last_vcpu_wake_up = k;
+            }
+        }
+    }
+}
+
+/*
+ * In the event that a vCPU attempted to place an event in the ring and
+ * was unable to do so, it is queued on a wait queue.  These are woken as
+ * needed, and take precedence over the blocked vCPUs.
+ */
+static void mem_event_wake_queued(struct domain *d, struct mem_event_domain *med)
+{
+    unsigned int avail_req = mem_event_ring_available(med);
+
+    if ( avail_req > 0 )
+        wake_up_nr(&med->wq, avail_req);
+}
+
+/*
+ * mem_event_wake() will wakeup all vcpus waiting for the ring to
+ * become available.  If we have queued vCPUs, they get top priority. We
+ * are guaranteed that they will go through code paths that will eventually
+ * call mem_event_wake() again, ensuring that any blocked vCPUs will get
+ * unpaused once all the queued vCPUs have made it through.
+ */
+void mem_event_wake(struct domain *d, struct mem_event_domain *med)
+{
+    if (!list_empty(&med->wq.list))
+        mem_event_wake_queued(d, med);
+    else
+        mem_event_wake_blocked(d, med);
+}
+
+static int mem_event_disable(struct domain *d, struct mem_event_domain *med)
+{
+    if ( med->ring_page )
+    {
+        struct vcpu *v;
+
+        mem_event_ring_lock(med);
+
+        if ( !list_empty(&med->wq.list) )
+        {
+            mem_event_ring_unlock(med);
+            return -EBUSY;
+        }
+
+        unmap_domain_page(med->ring_page);
+        med->ring_page = NULL;
+
+        unmap_domain_page(med->shared_page);
+        med->shared_page = NULL;
+
+        /* Unblock all vCPUs */
+        for_each_vcpu ( d, v )
+        {
+            if ( test_and_clear_bit(med->pause_flag, &v->pause_flags) )
+            {
+                vcpu_unpause(v);
+                med->blocked--;
+            }
+        }
+
+        mem_event_ring_unlock(med);
+    }
 
     return 0;
 }
 
-void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req)
+static inline void mem_event_release_slot(struct domain *d,
+                                          struct mem_event_domain *med)
+{
+    /* Update the accounting */
+    if ( current->domain == d )
+        med->target_producers--;
+    else
+        med->foreign_producers--;
+
+    /* Kick any waiters */
+    mem_event_wake(d, med);
+}
+
+/*
+ * mem_event_mark_and_pause() tags vcpu and put it to sleep.
+ * The vcpu will resume execution in mem_event_wake_waiters().
+ */
+void mem_event_mark_and_pause(struct vcpu *v, struct mem_event_domain *med)
+{
+    if ( !test_and_set_bit(med->pause_flag, &v->pause_flags) )
+    {
+        vcpu_pause_nosync(v);
+        med->blocked++;
+    }
+}
+
+/*
+ * This must be preceded by a call to claim_slot(), and is guaranteed to
+ * succeed.  As a side-effect however, the vCPU may be paused if the ring is
+ * overly full and its continued execution would cause stalling and excessive
+ * waiting.  The vCPU will be automatically unpaused when the ring clears.
+ */
+void mem_event_put_request(struct domain *d,
+                           struct mem_event_domain *med,
+                           mem_event_request_t *req)
 {
     mem_event_front_ring_t *front_ring;
+    int free_req;
+    unsigned int avail_req;
     RING_IDX req_prod;
 
-    mem_event_ring_lock(med);
-
-    front_ring = &med->front_ring;
-    req_prod = front_ring->req_prod_pvt;
-
     if ( current->domain != d )
     {
         req->flags |= MEM_EVENT_FLAG_FOREIGN;
         ASSERT( !(req->flags & MEM_EVENT_FLAG_VCPU_PAUSED) );
     }
 
+    mem_event_ring_lock(med);
+
+    /* Due to the reservations, this step must succeed. */
+    front_ring = &med->front_ring;
+    free_req = RING_FREE_REQUESTS(front_ring);
+    ASSERT(free_req > 0);
+
     /* Copy request */
+    req_prod = front_ring->req_prod_pvt;
     memcpy(RING_GET_REQUEST(front_ring, req_prod), req, sizeof(*req));
     req_prod++;
 
     /* Update ring */
-    med->req_producers--;
     front_ring->req_prod_pvt = req_prod;
     RING_PUSH_REQUESTS(front_ring);
 
+    /* We've actually *used* our reservation, so release the slot. */
+    mem_event_release_slot(d, med);
+
+    /* Give this vCPU a black eye if necessary, on the way out.
+     * See the comments above wake_blocked() for more information
+     * on how this mechanism works to avoid waiting. */
+    avail_req = mem_event_ring_available(med);
+    if( current->domain == d && avail_req < d->max_vcpus )
+        mem_event_mark_and_pause(current, med);
+
     mem_event_ring_unlock(med);
 
     notify_via_xen_event_channel(d, med->xen_port);
 }
 
-int mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp)
+int mem_event_get_response(struct domain *d, struct mem_event_domain *med, mem_event_response_t *rsp)
 {
     mem_event_front_ring_t *front_ring;
     RING_IDX rsp_cons;
@@ -190,57 +366,81 @@
     front_ring->rsp_cons = rsp_cons;
     front_ring->sring->rsp_event = rsp_cons + 1;
 
+    /* Kick any waiters -- since we've just consumed an event,
+     * there may be additional space available in the ring. */
+    mem_event_wake(d, med);
+
     mem_event_ring_unlock(med);
 
     return 1;
 }
 
-void mem_event_unpause_vcpus(struct domain *d)
-{
-    struct vcpu *v;
-
-    for_each_vcpu ( d, v )
-        if ( test_and_clear_bit(_VPF_mem_event, &v->pause_flags) )
-            vcpu_wake(v);
-}
-
-void mem_event_mark_and_pause(struct vcpu *v)
-{
-    set_bit(_VPF_mem_event, &v->pause_flags);
-    vcpu_sleep_nosync(v);
-}
-
-void mem_event_put_req_producers(struct mem_event_domain *med)
+void mem_event_cancel_slot(struct domain *d, struct mem_event_domain *med)
 {
     mem_event_ring_lock(med);
-    med->req_producers--;
+    mem_event_release_slot(d, med);
     mem_event_ring_unlock(med);
 }
 
-int mem_event_check_ring(struct domain *d, struct mem_event_domain *med)
+static int mem_event_grab_slot(struct mem_event_domain *med, int foreign)
 {
-    struct vcpu *curr = current;
-    int free_requests;
-    int ring_full = 1;
+    unsigned int avail_req;
 
     if ( !med->ring_page )
-        return -1;
+        return -ENOSYS;
 
     mem_event_ring_lock(med);
 
-    free_requests = RING_FREE_REQUESTS(&med->front_ring);
-    if ( med->req_producers < free_requests )
+    avail_req = mem_event_ring_available(med);
+    if ( avail_req == 0 )
     {
-        med->req_producers++;
-        ring_full = 0;
+        mem_event_ring_unlock(med);
+        return -EBUSY;
     }
 
-    if ( ring_full && (curr->domain == d) )
-        mem_event_mark_and_pause(curr);
+    if ( !foreign )
+        med->target_producers++;
+    else
+        med->foreign_producers++;
 
     mem_event_ring_unlock(med);
 
-    return ring_full;
+    return 0;
+}
+
+/* Simple try_grab wrapper for use in the wait_event() macro. */
+static int mem_event_wait_try_grab(struct mem_event_domain *med, int *rc)
+{
+    *rc = mem_event_grab_slot(med, 0);
+    return *rc;
+}
+
+/* Call mem_event_grab_slot() until the ring doesn't exist, or is available. */
+static int mem_event_wait_slot(struct mem_event_domain *med)
+{
+    int rc = -EBUSY;
+    wait_event(med->wq, mem_event_wait_try_grab(med, &rc) != -EBUSY);
+    return rc;
+}
+
+/*
+ * Determines whether or not the current vCPU belongs to the target domain,
+ * and calls the appropriate wait function.  If it is a guest vCPU, then we
+ * use mem_event_wait_slot() to reserve a slot.  As long as there is a ring,
+ * this function will always return 0 for a guest.  For a non-guest, we check
+ * for space and return -EBUSY if the ring is not available.
+ *
+ * Return codes: -ENOSYS: the ring is not yet configured
+ *               -EBUSY: the ring is busy
+ *               0: a spot has been reserved
+ *
+ */
+int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med)
+{
+    if ( current->domain == d )
+        return mem_event_wait_slot(med);
+    else
+        return mem_event_grab_slot(med, 1);
 }
 
 /* Registered with Xen-bound event channel for incoming notifications. */
@@ -316,14 +516,14 @@
             if ( p2m->pod.entry_count )
                 break;
 
-            rc = mem_event_enable(d, mec, med, mem_paging_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_paging, mem_paging_notification);
         }
         break;
 
         case XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE:
         {
             if ( med->ring_page )
-                rc = mem_event_disable(med);
+                rc = mem_event_disable(d, med);
         }
         break;
 
@@ -355,14 +555,14 @@
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 break;
 
-            rc = mem_event_enable(d, mec, med, mem_access_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_access, mem_access_notification);
         }
         break;
 
         case XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE:
         {
             if ( med->ring_page )
-                rc = mem_event_disable(med);
+                rc = mem_event_disable(d, med);
         }
         break;
 
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 19 10:38:47 2012 +0000
@@ -253,18 +253,10 @@
 #endif
 
 
-static struct page_info* mem_sharing_alloc_page(struct domain *d, 
-                                                unsigned long gfn)
+static void mem_sharing_notify_helper(struct domain *d, unsigned long gfn)
 {
-    struct page_info* page;
     struct vcpu *v = current;
-    mem_event_request_t req;
-
-    page = alloc_domheap_page(d, 0); 
-    if(page != NULL) return page;
-
-    memset(&req, 0, sizeof(req));
-    req.type = MEM_EVENT_TYPE_SHARED;
+    mem_event_request_t req = { .type = MEM_EVENT_TYPE_SHARED };
 
     if ( v->domain != d )
     {
@@ -275,20 +267,21 @@
         gdprintk(XENLOG_ERR, 
                  "Failed alloc on unshare path for foreign (%d) lookup\n",
                  d->domain_id);
-        return page;
+        return;
     }
 
+    if (mem_event_claim_slot(d, &d->mem_event->share) < 0)
+    {
+        return;
+    }
+
+    req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
     vcpu_pause_nosync(v);
-    req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
-
-    if(mem_event_check_ring(d, &d->mem_event->share)) return page;
 
     req.gfn = gfn;
     req.p2mt = p2m_ram_shared;
     req.vcpu_id = v->vcpu_id;
     mem_event_put_request(d, &d->mem_event->share, &req);
-
-    return page;
 }
 
 unsigned int mem_sharing_get_nr_saved_mfns(void)
@@ -301,7 +294,7 @@
     mem_event_response_t rsp;
 
     /* Get all requests off the ring */
-    while ( mem_event_get_response(&d->mem_event->share, &rsp) )
+    while ( mem_event_get_response(d, &d->mem_event->share, &rsp) )
     {
         if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
             continue;
@@ -658,13 +651,14 @@
     if(ret == 0) goto private_page_found;
         
     old_page = page;
-    page = mem_sharing_alloc_page(d, gfn);
+    page = alloc_domheap_page(d, 0);
     if(!page) 
     {
         /* We've failed to obtain memory for private page. Need to re-add the
          * gfn_info to relevant list */
         list_add(&gfn_info->list, &hash_entry->gfns);
         put_gfn(d, gfn);
+        mem_sharing_notify_helper(d, gfn);
         shr_unlock();
         return -ENOMEM;
     }
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:38:47 2012 +0000
@@ -861,20 +861,23 @@
  */
 void p2m_mem_paging_drop_page(struct domain *d, unsigned long gfn)
 {
-    struct vcpu *v = current;
     mem_event_request_t req;
 
-    /* Check that there's space on the ring for this request */
-    if ( mem_event_check_ring(d, &d->mem_event->paging) == 0)
-    {
-        /* Send release notification to pager */
-        memset(&req, 0, sizeof(req));
-        req.flags |= MEM_EVENT_FLAG_DROP_PAGE;
-        req.gfn = gfn;
-        req.vcpu_id = v->vcpu_id;
+    /* We allow no ring in this unique case, because it won't affect
+     * correctness of the guest execution at this point.  If this is the only
+     * page that happens to be paged-out, we'll be okay..  but it's likely the
+     * guest will crash shortly anyways. */
+    int rc = mem_event_claim_slot(d, &d->mem_event->paging);
+    if ( rc < 0 )
+        return;
 
-        mem_event_put_request(d, &d->mem_event->paging, &req);
-    }
+    /* Send release notification to pager */
+    memset(&req, 0, sizeof(req));
+    req.type = MEM_EVENT_TYPE_PAGING;
+    req.gfn = gfn;
+    req.flags = MEM_EVENT_FLAG_DROP_PAGE;
+
+    mem_event_put_request(d, &d->mem_event->paging, &req);
 }
 
 /**
@@ -907,8 +910,16 @@
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
-    /* Check that there's space on the ring for this request */
-    if ( mem_event_check_ring(d, &d->mem_event->paging) )
+    /* We're paging. There should be a ring */
+    int rc = mem_event_claim_slot(d, &d->mem_event->paging);
+    if ( rc == -ENOSYS )
+    {
+        gdprintk(XENLOG_ERR, "Domain %hu paging gfn %lx yet no ring "
+                             "in place\n", d->domain_id, gfn);
+        domain_crash(d);
+        return;
+    }
+    else if ( rc < 0 )
         return;
 
     memset(&req, 0, sizeof(req));
@@ -929,7 +940,7 @@
     p2m_unlock(p2m);
 
     /* Pause domain if request came from guest and gfn has paging type */
-    if (  p2m_is_paging(p2mt) && v->domain == d )
+    if ( p2m_is_paging(p2mt) && v->domain == d )
     {
         vcpu_pause_nosync(v);
         req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
@@ -938,7 +949,7 @@
     else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
     {
         /* gfn is already on its way back and vcpu is not paused */
-        mem_event_put_req_producers(&d->mem_event->paging);
+        mem_event_cancel_slot(d, &d->mem_event->paging);
         return;
     }
 
@@ -1065,7 +1076,7 @@
     mfn_t mfn;
 
     /* Pull all responses off the ring */
-    while( mem_event_get_response(&d->mem_event->paging, &rsp) )
+    while( mem_event_get_response(d, &d->mem_event->paging, &rsp) )
     {
         if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
             continue;
@@ -1090,9 +1101,6 @@
         if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
             vcpu_unpause(d->vcpu[rsp.vcpu_id]);
     }
-
-    /* Unpause any domains that were paused because the ring was full */
-    mem_event_unpause_vcpus(d);
 }
 
 bool_t p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla, 
@@ -1103,7 +1111,6 @@
     unsigned long gfn = gpa >> PAGE_SHIFT;
     struct domain *d = v->domain;    
     struct p2m_domain* p2m = p2m_get_hostp2m(d);
-    int res;
     mfn_t mfn;
     p2m_type_t p2mt;
     p2m_access_t p2ma;
@@ -1126,17 +1133,16 @@
     p2m_unlock(p2m);
 
     /* Otherwise, check if there is a memory event listener, and send the message along */
-    res = mem_event_check_ring(d, &d->mem_event->access);
-    if ( res < 0 ) 
+    if ( mem_event_claim_slot(d, &d->mem_event->access) == -ENOSYS )
     {
         /* No listener */
         if ( p2m->access_required ) 
         {
-            printk(XENLOG_INFO 
-                   "Memory access permissions failure, no mem_event listener: pausing VCPU %d, dom %d\n",
-                   v->vcpu_id, d->domain_id);
-
-            mem_event_mark_and_pause(v);
+            gdprintk(XENLOG_INFO, "Memory access permissions failure, "
+                                  "no mem_event listener VCPU %d, dom %d\n",
+                                  v->vcpu_id, d->domain_id);
+            domain_crash(v->domain);
+            return 0;
         }
         else
         {
@@ -1149,11 +1155,7 @@
             }
             return 1;
         }
-
-        return 0;
     }
-    else if ( res > 0 )
-        return 0;  /* No space in buffer; VCPU paused */
 
     memset(&req, 0, sizeof(req));
     req.type = MEM_EVENT_TYPE_ACCESS;
@@ -1188,7 +1190,7 @@
     mem_event_response_t rsp;
 
     /* Pull all responses off the ring */
-    while( mem_event_get_response(&d->mem_event->access, &rsp) )
+    while( mem_event_get_response(d, &d->mem_event->access, &rsp) )
     {
         if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
             continue;
@@ -1196,13 +1198,8 @@
         if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
             vcpu_unpause(d->vcpu[rsp.vcpu_id]);
     }
-
-    /* Unpause any domains that were paused because the ring was full or no listener 
-     * was available */
-    mem_event_unpause_vcpus(d);
 }
 
-
 /* Set access type for a region of pfns.
  * If start_pfn == -1ul, sets the default access type */
 int p2m_set_mem_access(struct domain *d, unsigned long start_pfn, 
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/include/asm-x86/mem_event.h
--- a/xen/include/asm-x86/mem_event.h	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/include/asm-x86/mem_event.h	Thu Jan 19 10:38:47 2012 +0000
@@ -24,18 +24,24 @@
 #ifndef __MEM_EVENT_H__
 #define __MEM_EVENT_H__
 
-/* Pauses VCPU while marking pause flag for mem event */
-void mem_event_mark_and_pause(struct vcpu *v);
-int mem_event_check_ring(struct domain *d, struct mem_event_domain *med);
-void mem_event_put_req_producers(struct mem_event_domain *med);
-void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req);
-int mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp);
-void mem_event_unpause_vcpus(struct domain *d);
+/* Returns 0 on success, -ENOSYS if there is no ring, -EBUSY if there is no
+ * available space. For success or -EBUSY, the vCPU may be left blocked
+ * temporarily to ensure that the ring does not lose future events.  In
+ * general, you must follow a claim_slot() call with either put_request() or
+ * cancel_slot(), both of which are guaranteed to succeed. */
+int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med);
+
+void mem_event_cancel_slot(struct domain *d, struct mem_event_domain *med);
+
+void mem_event_put_request(struct domain *d, struct mem_event_domain *med,
+                            mem_event_request_t *req);
+
+int mem_event_get_response(struct domain *d, struct mem_event_domain *med,
+                           mem_event_response_t *rsp);
 
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE(void) u_domctl);
 
-
 #endif /* __MEM_EVENT_H__ */
 
 
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/include/xen/mm.h	Thu Jan 19 10:38:47 2012 +0000
@@ -317,6 +317,8 @@
 
 void scrub_one_page(struct page_info *);
 
+/* Returns 1 on success, 0 on error, negative if the ring
+ * for event propagation is full in the presence of paging */
 int guest_remove_page(struct domain *d, unsigned long gmfn);
 
 #define RAM_TYPE_CONVENTIONAL 0x00000001
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/include/xen/sched.h	Thu Jan 19 10:38:47 2012 +0000
@@ -13,6 +13,7 @@
 #include <xen/nodemask.h>
 #include <xen/radix-tree.h>
 #include <xen/multicall.h>
+#include <xen/wait.h>
 #include <public/xen.h>
 #include <public/domctl.h>
 #include <public/sysctl.h>
@@ -182,7 +183,9 @@
 {
     /* ring lock */
     spinlock_t ring_lock;
-    unsigned int req_producers;
+    /* The ring has 64 entries */
+    unsigned char foreign_producers;
+    unsigned char target_producers;
     /* shared page */
     mem_event_shared_page_t *shared_page;
     /* shared ring page */
@@ -191,6 +194,14 @@
     mem_event_front_ring_t front_ring;
     /* event channel port (vcpu0 only) */
     int xen_port;
+    /* mem_event bit for vcpu->pause_flags */
+    int pause_flag;
+    /* list of vcpus waiting for room in the ring */
+    struct waitqueue_head wq;
+    /* the number of vCPUs blocked */
+    unsigned int blocked;
+    /* The last vcpu woken up */
+    unsigned int last_vcpu_wake_up;
 };
 
 struct mem_event_per_domain
@@ -614,9 +625,12 @@
  /* VCPU affinity has changed: migrating to a new CPU. */
 #define _VPF_migrating       3
 #define VPF_migrating        (1UL<<_VPF_migrating)
- /* VCPU is blocked on memory-event ring. */
-#define _VPF_mem_event       4
-#define VPF_mem_event        (1UL<<_VPF_mem_event)
+ /* VCPU is blocked due to missing mem_paging ring. */
+#define _VPF_mem_paging      4
+#define VPF_mem_paging       (1UL<<_VPF_mem_paging)
+ /* VCPU is blocked due to missing mem_access ring. */
+#define _VPF_mem_access      5
+#define VPF_mem_access       (1UL<<_VPF_mem_access)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:50 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxV-0001Ww-IR; Thu, 19 Jan 2012 21:55:49 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxS-0001DB-Fx
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:46 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1327010138!9428221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19697 invoked from network); 19 Jan 2012 21:55:38 -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;
	19 Jan 2012 21:55:38 -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 1RnzxJ-0007TY-MY
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxJ-0000mi-LG
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:37 +0000
Message-Id: <E1RnzxJ-0000mi-LG@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Improve ring management for
	memory events. Do not lose guest events
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1326969527 0
# Node ID 06ffb6b41df985b9382bbc9a5e85d54f23e5f784
# Parent  9a967990b4d2ce4a740662c2ad6b1e5d2adec984
x86/mm: Improve ring management for memory events. Do not lose guest events

This patch is an amalgamation of the work done by Olaf Hering <olaf@aepfle.de>
and our work.

It combines logic changes to simplify the memory event API, as well as
leveraging wait queues to deal with extreme conditions in which too many
events are generated by a guest vcpu.

In order to generate a new event, a slot in the ring is claimed. If a
guest vcpu is generating the event and there is no space, it is put on a
wait queue. If a foreign vcpu is generating the event and there is no
space, the vcpu is expected to retry its operation. If an error happens
later, the function returns the claimed slot via a cancel operation.

Thus, the API has only four calls: claim slot, cancel claimed slot, put
request in the ring, consume the response.

With all these mechanisms, no guest events are lost.
Our testing includes 1. ballooning down 512 MiBs; 2. using mem access n2rwx, in
which every page access in a four-vCPU guest results in an event, with no vCPU
pausing, and the four vCPUs touching all RAM. No guest events were lost in
either case, and qemu-dm had no mapping problems.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Thu Jan 19 10:38:47 2012 +0000
@@ -4198,15 +4198,21 @@
 
     if ( (p & HVMPME_onchangeonly) && (value == old) )
         return 1;
-    
-    rc = mem_event_check_ring(d, &d->mem_event->access);
-    if ( rc )
+
+    rc = mem_event_claim_slot(d, &d->mem_event->access);
+    if ( rc == -ENOSYS )
+    {
+        /* If there was no ring to handle the event, then
+         * simple continue executing normally. */
+        return 1;
+    }
+    else if ( rc < 0 )
         return rc;
-    
+
     memset(&req, 0, sizeof(req));
     req.type = MEM_EVENT_TYPE_ACCESS;
     req.reason = reason;
-    
+
     if ( (p & HVMPME_MODE_MASK) == HVMPME_mode_sync ) 
     {
         req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;    
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Jan 19 10:38:47 2012 +0000
@@ -23,6 +23,7 @@
 
 #include <asm/domain.h>
 #include <xen/event.h>
+#include <xen/wait.h>
 #include <asm/p2m.h>
 #include <asm/mem_event.h>
 #include <asm/mem_paging.h>
@@ -41,6 +42,7 @@
     struct domain *d,
     xen_domctl_mem_event_op_t *mec,
     struct mem_event_domain *med,
+    int pause_flag,
     xen_event_channel_notification_t notification_fn)
 {
     int rc;
@@ -75,6 +77,8 @@
         return -EINVAL;
     }
 
+    mem_event_ring_lock_init(med);
+
     /* Get MFN of shared page */
     guest_get_eff_l1e(v, shared_addr, &l1e);
     shared_gfn = l1e_get_pfn(l1e);
@@ -93,6 +97,9 @@
     put_gfn(dom_mem_event, ring_gfn);
     put_gfn(dom_mem_event, shared_gfn); 
 
+    /* Set the number of currently blocked vCPUs to 0. */
+    med->blocked = 0;
+
     /* Allocate event channel */
     rc = alloc_unbound_xen_event_channel(d->vcpu[0],
                                          current->domain->domain_id,
@@ -108,10 +115,11 @@
                     (mem_event_sring_t *)med->ring_page,
                     PAGE_SIZE);
 
-    mem_event_ring_lock_init(med);
+    /* Save the pause flag for this particular ring. */
+    med->pause_flag = pause_flag;
 
-    /* Wake any VCPUs paused for memory events */
-    mem_event_unpause_vcpus(d);
+    /* Initialize the last-chance wait queue. */
+    init_waitqueue_head(&med->wq);
 
     return 0;
 
@@ -125,48 +133,216 @@
     return rc;
 }
 
-static int mem_event_disable(struct mem_event_domain *med)
+static unsigned int mem_event_ring_available(struct mem_event_domain *med)
 {
-    unmap_domain_page(med->ring_page);
-    med->ring_page = NULL;
+    int avail_req = RING_FREE_REQUESTS(&med->front_ring);
+    avail_req -= med->target_producers;
+    avail_req -= med->foreign_producers;
 
-    unmap_domain_page(med->shared_page);
-    med->shared_page = NULL;
+    BUG_ON(avail_req < 0);
+
+    return avail_req;
+}
+
+/*
+ * mem_event_wake_blocked() will wakeup vcpus waiting for room in the
+ * ring. These vCPUs were paused on their way out after placing an event,
+ * but need to be resumed where the ring is capable of processing at least
+ * one event from them.
+ */
+static void mem_event_wake_blocked(struct domain *d, struct mem_event_domain *med)
+{
+    struct vcpu *v;
+    int online = d->max_vcpus;
+    unsigned int avail_req = mem_event_ring_available(med);
+
+    if ( avail_req == 0 || med->blocked == 0 )
+        return;
+
+    /*
+     * We ensure that we only have vCPUs online if there are enough free slots
+     * for their memory events to be processed.  This will ensure that no
+     * memory events are lost (due to the fact that certain types of events
+     * cannot be replayed, we need to ensure that there is space in the ring
+     * for when they are hit).
+     * See comment below in mem_event_put_request().
+     */
+    for_each_vcpu ( d, v )
+        if ( test_bit(med->pause_flag, &v->pause_flags) )
+            online--;
+
+    ASSERT(online == (d->max_vcpus - med->blocked));
+
+    /* We remember which vcpu last woke up to avoid scanning always linearly
+     * from zero and starving higher-numbered vcpus under high load */
+    if ( d->vcpu )
+    {
+        int i, j, k;
+
+        for (i = med->last_vcpu_wake_up + 1, j = 0; j < d->max_vcpus; i++, j++)
+        {
+            k = i % d->max_vcpus;
+            v = d->vcpu[k];
+            if ( !v )
+                continue;
+
+            if ( !(med->blocked) || online >= avail_req )
+               break;
+
+            if ( test_and_clear_bit(med->pause_flag, &v->pause_flags) )
+            {
+                vcpu_unpause(v);
+                online++;
+                med->blocked--;
+                med->last_vcpu_wake_up = k;
+            }
+        }
+    }
+}
+
+/*
+ * In the event that a vCPU attempted to place an event in the ring and
+ * was unable to do so, it is queued on a wait queue.  These are woken as
+ * needed, and take precedence over the blocked vCPUs.
+ */
+static void mem_event_wake_queued(struct domain *d, struct mem_event_domain *med)
+{
+    unsigned int avail_req = mem_event_ring_available(med);
+
+    if ( avail_req > 0 )
+        wake_up_nr(&med->wq, avail_req);
+}
+
+/*
+ * mem_event_wake() will wakeup all vcpus waiting for the ring to
+ * become available.  If we have queued vCPUs, they get top priority. We
+ * are guaranteed that they will go through code paths that will eventually
+ * call mem_event_wake() again, ensuring that any blocked vCPUs will get
+ * unpaused once all the queued vCPUs have made it through.
+ */
+void mem_event_wake(struct domain *d, struct mem_event_domain *med)
+{
+    if (!list_empty(&med->wq.list))
+        mem_event_wake_queued(d, med);
+    else
+        mem_event_wake_blocked(d, med);
+}
+
+static int mem_event_disable(struct domain *d, struct mem_event_domain *med)
+{
+    if ( med->ring_page )
+    {
+        struct vcpu *v;
+
+        mem_event_ring_lock(med);
+
+        if ( !list_empty(&med->wq.list) )
+        {
+            mem_event_ring_unlock(med);
+            return -EBUSY;
+        }
+
+        unmap_domain_page(med->ring_page);
+        med->ring_page = NULL;
+
+        unmap_domain_page(med->shared_page);
+        med->shared_page = NULL;
+
+        /* Unblock all vCPUs */
+        for_each_vcpu ( d, v )
+        {
+            if ( test_and_clear_bit(med->pause_flag, &v->pause_flags) )
+            {
+                vcpu_unpause(v);
+                med->blocked--;
+            }
+        }
+
+        mem_event_ring_unlock(med);
+    }
 
     return 0;
 }
 
-void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req)
+static inline void mem_event_release_slot(struct domain *d,
+                                          struct mem_event_domain *med)
+{
+    /* Update the accounting */
+    if ( current->domain == d )
+        med->target_producers--;
+    else
+        med->foreign_producers--;
+
+    /* Kick any waiters */
+    mem_event_wake(d, med);
+}
+
+/*
+ * mem_event_mark_and_pause() tags vcpu and put it to sleep.
+ * The vcpu will resume execution in mem_event_wake_waiters().
+ */
+void mem_event_mark_and_pause(struct vcpu *v, struct mem_event_domain *med)
+{
+    if ( !test_and_set_bit(med->pause_flag, &v->pause_flags) )
+    {
+        vcpu_pause_nosync(v);
+        med->blocked++;
+    }
+}
+
+/*
+ * This must be preceded by a call to claim_slot(), and is guaranteed to
+ * succeed.  As a side-effect however, the vCPU may be paused if the ring is
+ * overly full and its continued execution would cause stalling and excessive
+ * waiting.  The vCPU will be automatically unpaused when the ring clears.
+ */
+void mem_event_put_request(struct domain *d,
+                           struct mem_event_domain *med,
+                           mem_event_request_t *req)
 {
     mem_event_front_ring_t *front_ring;
+    int free_req;
+    unsigned int avail_req;
     RING_IDX req_prod;
 
-    mem_event_ring_lock(med);
-
-    front_ring = &med->front_ring;
-    req_prod = front_ring->req_prod_pvt;
-
     if ( current->domain != d )
     {
         req->flags |= MEM_EVENT_FLAG_FOREIGN;
         ASSERT( !(req->flags & MEM_EVENT_FLAG_VCPU_PAUSED) );
     }
 
+    mem_event_ring_lock(med);
+
+    /* Due to the reservations, this step must succeed. */
+    front_ring = &med->front_ring;
+    free_req = RING_FREE_REQUESTS(front_ring);
+    ASSERT(free_req > 0);
+
     /* Copy request */
+    req_prod = front_ring->req_prod_pvt;
     memcpy(RING_GET_REQUEST(front_ring, req_prod), req, sizeof(*req));
     req_prod++;
 
     /* Update ring */
-    med->req_producers--;
     front_ring->req_prod_pvt = req_prod;
     RING_PUSH_REQUESTS(front_ring);
 
+    /* We've actually *used* our reservation, so release the slot. */
+    mem_event_release_slot(d, med);
+
+    /* Give this vCPU a black eye if necessary, on the way out.
+     * See the comments above wake_blocked() for more information
+     * on how this mechanism works to avoid waiting. */
+    avail_req = mem_event_ring_available(med);
+    if( current->domain == d && avail_req < d->max_vcpus )
+        mem_event_mark_and_pause(current, med);
+
     mem_event_ring_unlock(med);
 
     notify_via_xen_event_channel(d, med->xen_port);
 }
 
-int mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp)
+int mem_event_get_response(struct domain *d, struct mem_event_domain *med, mem_event_response_t *rsp)
 {
     mem_event_front_ring_t *front_ring;
     RING_IDX rsp_cons;
@@ -190,57 +366,81 @@
     front_ring->rsp_cons = rsp_cons;
     front_ring->sring->rsp_event = rsp_cons + 1;
 
+    /* Kick any waiters -- since we've just consumed an event,
+     * there may be additional space available in the ring. */
+    mem_event_wake(d, med);
+
     mem_event_ring_unlock(med);
 
     return 1;
 }
 
-void mem_event_unpause_vcpus(struct domain *d)
-{
-    struct vcpu *v;
-
-    for_each_vcpu ( d, v )
-        if ( test_and_clear_bit(_VPF_mem_event, &v->pause_flags) )
-            vcpu_wake(v);
-}
-
-void mem_event_mark_and_pause(struct vcpu *v)
-{
-    set_bit(_VPF_mem_event, &v->pause_flags);
-    vcpu_sleep_nosync(v);
-}
-
-void mem_event_put_req_producers(struct mem_event_domain *med)
+void mem_event_cancel_slot(struct domain *d, struct mem_event_domain *med)
 {
     mem_event_ring_lock(med);
-    med->req_producers--;
+    mem_event_release_slot(d, med);
     mem_event_ring_unlock(med);
 }
 
-int mem_event_check_ring(struct domain *d, struct mem_event_domain *med)
+static int mem_event_grab_slot(struct mem_event_domain *med, int foreign)
 {
-    struct vcpu *curr = current;
-    int free_requests;
-    int ring_full = 1;
+    unsigned int avail_req;
 
     if ( !med->ring_page )
-        return -1;
+        return -ENOSYS;
 
     mem_event_ring_lock(med);
 
-    free_requests = RING_FREE_REQUESTS(&med->front_ring);
-    if ( med->req_producers < free_requests )
+    avail_req = mem_event_ring_available(med);
+    if ( avail_req == 0 )
     {
-        med->req_producers++;
-        ring_full = 0;
+        mem_event_ring_unlock(med);
+        return -EBUSY;
     }
 
-    if ( ring_full && (curr->domain == d) )
-        mem_event_mark_and_pause(curr);
+    if ( !foreign )
+        med->target_producers++;
+    else
+        med->foreign_producers++;
 
     mem_event_ring_unlock(med);
 
-    return ring_full;
+    return 0;
+}
+
+/* Simple try_grab wrapper for use in the wait_event() macro. */
+static int mem_event_wait_try_grab(struct mem_event_domain *med, int *rc)
+{
+    *rc = mem_event_grab_slot(med, 0);
+    return *rc;
+}
+
+/* Call mem_event_grab_slot() until the ring doesn't exist, or is available. */
+static int mem_event_wait_slot(struct mem_event_domain *med)
+{
+    int rc = -EBUSY;
+    wait_event(med->wq, mem_event_wait_try_grab(med, &rc) != -EBUSY);
+    return rc;
+}
+
+/*
+ * Determines whether or not the current vCPU belongs to the target domain,
+ * and calls the appropriate wait function.  If it is a guest vCPU, then we
+ * use mem_event_wait_slot() to reserve a slot.  As long as there is a ring,
+ * this function will always return 0 for a guest.  For a non-guest, we check
+ * for space and return -EBUSY if the ring is not available.
+ *
+ * Return codes: -ENOSYS: the ring is not yet configured
+ *               -EBUSY: the ring is busy
+ *               0: a spot has been reserved
+ *
+ */
+int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med)
+{
+    if ( current->domain == d )
+        return mem_event_wait_slot(med);
+    else
+        return mem_event_grab_slot(med, 1);
 }
 
 /* Registered with Xen-bound event channel for incoming notifications. */
@@ -316,14 +516,14 @@
             if ( p2m->pod.entry_count )
                 break;
 
-            rc = mem_event_enable(d, mec, med, mem_paging_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_paging, mem_paging_notification);
         }
         break;
 
         case XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE:
         {
             if ( med->ring_page )
-                rc = mem_event_disable(med);
+                rc = mem_event_disable(d, med);
         }
         break;
 
@@ -355,14 +555,14 @@
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 break;
 
-            rc = mem_event_enable(d, mec, med, mem_access_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_access, mem_access_notification);
         }
         break;
 
         case XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE:
         {
             if ( med->ring_page )
-                rc = mem_event_disable(med);
+                rc = mem_event_disable(d, med);
         }
         break;
 
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 19 10:38:47 2012 +0000
@@ -253,18 +253,10 @@
 #endif
 
 
-static struct page_info* mem_sharing_alloc_page(struct domain *d, 
-                                                unsigned long gfn)
+static void mem_sharing_notify_helper(struct domain *d, unsigned long gfn)
 {
-    struct page_info* page;
     struct vcpu *v = current;
-    mem_event_request_t req;
-
-    page = alloc_domheap_page(d, 0); 
-    if(page != NULL) return page;
-
-    memset(&req, 0, sizeof(req));
-    req.type = MEM_EVENT_TYPE_SHARED;
+    mem_event_request_t req = { .type = MEM_EVENT_TYPE_SHARED };
 
     if ( v->domain != d )
     {
@@ -275,20 +267,21 @@
         gdprintk(XENLOG_ERR, 
                  "Failed alloc on unshare path for foreign (%d) lookup\n",
                  d->domain_id);
-        return page;
+        return;
     }
 
+    if (mem_event_claim_slot(d, &d->mem_event->share) < 0)
+    {
+        return;
+    }
+
+    req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
     vcpu_pause_nosync(v);
-    req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
-
-    if(mem_event_check_ring(d, &d->mem_event->share)) return page;
 
     req.gfn = gfn;
     req.p2mt = p2m_ram_shared;
     req.vcpu_id = v->vcpu_id;
     mem_event_put_request(d, &d->mem_event->share, &req);
-
-    return page;
 }
 
 unsigned int mem_sharing_get_nr_saved_mfns(void)
@@ -301,7 +294,7 @@
     mem_event_response_t rsp;
 
     /* Get all requests off the ring */
-    while ( mem_event_get_response(&d->mem_event->share, &rsp) )
+    while ( mem_event_get_response(d, &d->mem_event->share, &rsp) )
     {
         if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
             continue;
@@ -658,13 +651,14 @@
     if(ret == 0) goto private_page_found;
         
     old_page = page;
-    page = mem_sharing_alloc_page(d, gfn);
+    page = alloc_domheap_page(d, 0);
     if(!page) 
     {
         /* We've failed to obtain memory for private page. Need to re-add the
          * gfn_info to relevant list */
         list_add(&gfn_info->list, &hash_entry->gfns);
         put_gfn(d, gfn);
+        mem_sharing_notify_helper(d, gfn);
         shr_unlock();
         return -ENOMEM;
     }
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 19 10:38:47 2012 +0000
@@ -861,20 +861,23 @@
  */
 void p2m_mem_paging_drop_page(struct domain *d, unsigned long gfn)
 {
-    struct vcpu *v = current;
     mem_event_request_t req;
 
-    /* Check that there's space on the ring for this request */
-    if ( mem_event_check_ring(d, &d->mem_event->paging) == 0)
-    {
-        /* Send release notification to pager */
-        memset(&req, 0, sizeof(req));
-        req.flags |= MEM_EVENT_FLAG_DROP_PAGE;
-        req.gfn = gfn;
-        req.vcpu_id = v->vcpu_id;
+    /* We allow no ring in this unique case, because it won't affect
+     * correctness of the guest execution at this point.  If this is the only
+     * page that happens to be paged-out, we'll be okay..  but it's likely the
+     * guest will crash shortly anyways. */
+    int rc = mem_event_claim_slot(d, &d->mem_event->paging);
+    if ( rc < 0 )
+        return;
 
-        mem_event_put_request(d, &d->mem_event->paging, &req);
-    }
+    /* Send release notification to pager */
+    memset(&req, 0, sizeof(req));
+    req.type = MEM_EVENT_TYPE_PAGING;
+    req.gfn = gfn;
+    req.flags = MEM_EVENT_FLAG_DROP_PAGE;
+
+    mem_event_put_request(d, &d->mem_event->paging, &req);
 }
 
 /**
@@ -907,8 +910,16 @@
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
-    /* Check that there's space on the ring for this request */
-    if ( mem_event_check_ring(d, &d->mem_event->paging) )
+    /* We're paging. There should be a ring */
+    int rc = mem_event_claim_slot(d, &d->mem_event->paging);
+    if ( rc == -ENOSYS )
+    {
+        gdprintk(XENLOG_ERR, "Domain %hu paging gfn %lx yet no ring "
+                             "in place\n", d->domain_id, gfn);
+        domain_crash(d);
+        return;
+    }
+    else if ( rc < 0 )
         return;
 
     memset(&req, 0, sizeof(req));
@@ -929,7 +940,7 @@
     p2m_unlock(p2m);
 
     /* Pause domain if request came from guest and gfn has paging type */
-    if (  p2m_is_paging(p2mt) && v->domain == d )
+    if ( p2m_is_paging(p2mt) && v->domain == d )
     {
         vcpu_pause_nosync(v);
         req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
@@ -938,7 +949,7 @@
     else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
     {
         /* gfn is already on its way back and vcpu is not paused */
-        mem_event_put_req_producers(&d->mem_event->paging);
+        mem_event_cancel_slot(d, &d->mem_event->paging);
         return;
     }
 
@@ -1065,7 +1076,7 @@
     mfn_t mfn;
 
     /* Pull all responses off the ring */
-    while( mem_event_get_response(&d->mem_event->paging, &rsp) )
+    while( mem_event_get_response(d, &d->mem_event->paging, &rsp) )
     {
         if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
             continue;
@@ -1090,9 +1101,6 @@
         if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
             vcpu_unpause(d->vcpu[rsp.vcpu_id]);
     }
-
-    /* Unpause any domains that were paused because the ring was full */
-    mem_event_unpause_vcpus(d);
 }
 
 bool_t p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long gla, 
@@ -1103,7 +1111,6 @@
     unsigned long gfn = gpa >> PAGE_SHIFT;
     struct domain *d = v->domain;    
     struct p2m_domain* p2m = p2m_get_hostp2m(d);
-    int res;
     mfn_t mfn;
     p2m_type_t p2mt;
     p2m_access_t p2ma;
@@ -1126,17 +1133,16 @@
     p2m_unlock(p2m);
 
     /* Otherwise, check if there is a memory event listener, and send the message along */
-    res = mem_event_check_ring(d, &d->mem_event->access);
-    if ( res < 0 ) 
+    if ( mem_event_claim_slot(d, &d->mem_event->access) == -ENOSYS )
     {
         /* No listener */
         if ( p2m->access_required ) 
         {
-            printk(XENLOG_INFO 
-                   "Memory access permissions failure, no mem_event listener: pausing VCPU %d, dom %d\n",
-                   v->vcpu_id, d->domain_id);
-
-            mem_event_mark_and_pause(v);
+            gdprintk(XENLOG_INFO, "Memory access permissions failure, "
+                                  "no mem_event listener VCPU %d, dom %d\n",
+                                  v->vcpu_id, d->domain_id);
+            domain_crash(v->domain);
+            return 0;
         }
         else
         {
@@ -1149,11 +1155,7 @@
             }
             return 1;
         }
-
-        return 0;
     }
-    else if ( res > 0 )
-        return 0;  /* No space in buffer; VCPU paused */
 
     memset(&req, 0, sizeof(req));
     req.type = MEM_EVENT_TYPE_ACCESS;
@@ -1188,7 +1190,7 @@
     mem_event_response_t rsp;
 
     /* Pull all responses off the ring */
-    while( mem_event_get_response(&d->mem_event->access, &rsp) )
+    while( mem_event_get_response(d, &d->mem_event->access, &rsp) )
     {
         if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
             continue;
@@ -1196,13 +1198,8 @@
         if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
             vcpu_unpause(d->vcpu[rsp.vcpu_id]);
     }
-
-    /* Unpause any domains that were paused because the ring was full or no listener 
-     * was available */
-    mem_event_unpause_vcpus(d);
 }
 
-
 /* Set access type for a region of pfns.
  * If start_pfn == -1ul, sets the default access type */
 int p2m_set_mem_access(struct domain *d, unsigned long start_pfn, 
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/include/asm-x86/mem_event.h
--- a/xen/include/asm-x86/mem_event.h	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/include/asm-x86/mem_event.h	Thu Jan 19 10:38:47 2012 +0000
@@ -24,18 +24,24 @@
 #ifndef __MEM_EVENT_H__
 #define __MEM_EVENT_H__
 
-/* Pauses VCPU while marking pause flag for mem event */
-void mem_event_mark_and_pause(struct vcpu *v);
-int mem_event_check_ring(struct domain *d, struct mem_event_domain *med);
-void mem_event_put_req_producers(struct mem_event_domain *med);
-void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req);
-int mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp);
-void mem_event_unpause_vcpus(struct domain *d);
+/* Returns 0 on success, -ENOSYS if there is no ring, -EBUSY if there is no
+ * available space. For success or -EBUSY, the vCPU may be left blocked
+ * temporarily to ensure that the ring does not lose future events.  In
+ * general, you must follow a claim_slot() call with either put_request() or
+ * cancel_slot(), both of which are guaranteed to succeed. */
+int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med);
+
+void mem_event_cancel_slot(struct domain *d, struct mem_event_domain *med);
+
+void mem_event_put_request(struct domain *d, struct mem_event_domain *med,
+                            mem_event_request_t *req);
+
+int mem_event_get_response(struct domain *d, struct mem_event_domain *med,
+                           mem_event_response_t *rsp);
 
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE(void) u_domctl);
 
-
 #endif /* __MEM_EVENT_H__ */
 
 
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/include/xen/mm.h	Thu Jan 19 10:38:47 2012 +0000
@@ -317,6 +317,8 @@
 
 void scrub_one_page(struct page_info *);
 
+/* Returns 1 on success, 0 on error, negative if the ring
+ * for event propagation is full in the presence of paging */
 int guest_remove_page(struct domain *d, unsigned long gmfn);
 
 #define RAM_TYPE_CONVENTIONAL 0x00000001
diff -r 9a967990b4d2 -r 06ffb6b41df9 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Jan 19 10:08:12 2012 +0100
+++ b/xen/include/xen/sched.h	Thu Jan 19 10:38:47 2012 +0000
@@ -13,6 +13,7 @@
 #include <xen/nodemask.h>
 #include <xen/radix-tree.h>
 #include <xen/multicall.h>
+#include <xen/wait.h>
 #include <public/xen.h>
 #include <public/domctl.h>
 #include <public/sysctl.h>
@@ -182,7 +183,9 @@
 {
     /* ring lock */
     spinlock_t ring_lock;
-    unsigned int req_producers;
+    /* The ring has 64 entries */
+    unsigned char foreign_producers;
+    unsigned char target_producers;
     /* shared page */
     mem_event_shared_page_t *shared_page;
     /* shared ring page */
@@ -191,6 +194,14 @@
     mem_event_front_ring_t front_ring;
     /* event channel port (vcpu0 only) */
     int xen_port;
+    /* mem_event bit for vcpu->pause_flags */
+    int pause_flag;
+    /* list of vcpus waiting for room in the ring */
+    struct waitqueue_head wq;
+    /* the number of vCPUs blocked */
+    unsigned int blocked;
+    /* The last vcpu woken up */
+    unsigned int last_vcpu_wake_up;
 };
 
 struct mem_event_per_domain
@@ -614,9 +625,12 @@
  /* VCPU affinity has changed: migrating to a new CPU. */
 #define _VPF_migrating       3
 #define VPF_migrating        (1UL<<_VPF_migrating)
- /* VCPU is blocked on memory-event ring. */
-#define _VPF_mem_event       4
-#define VPF_mem_event        (1UL<<_VPF_mem_event)
+ /* VCPU is blocked due to missing mem_paging ring. */
+#define _VPF_mem_paging      4
+#define VPF_mem_paging       (1UL<<_VPF_mem_paging)
+ /* VCPU is blocked due to missing mem_access ring. */
+#define _VPF_mem_access      5
+#define VPF_mem_access       (1UL<<_VPF_mem_access)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:50 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxW-0001Y3-3Q; Thu, 19 Jan 2012 21:55:50 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxS-0001Ef-Vz
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:47 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1327010139!11624698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15310 invoked from network); 19 Jan 2012 21:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:40 -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 1RnzxL-0007Tq-7A
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000nS-5n
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
Message-Id: <E1RnzxL-0000nS-5n@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: refine epte_present test
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1326978563 0
# Node ID 2273ef2083d4a369044bdd8677635e0c0c3ae594
# Parent  f5b366c6c4c6a19f93f0c68dc9fc939f172ec908
x86/mm: refine epte_present test

The current test for a present ept entry checks for a permission bit
to be set.

While this is valid in contexts in which we want to know whether an entry
will fault, it is not correct when it comes to testing whether an entry is
valid. Specifically, in the ept_change_entry_type_page function which is
used to set entries to the log dirty type.

In combination with a p2m access type like n or n2rwx, log dirty will not be
set for ept entries for which it should.

Reported-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f5b366c6c4c6 -r 2273ef2083d4 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Thu Jan 19 10:42:42 2012 +0000
+++ b/xen/arch/x86/mm/p2m-ept.c	Thu Jan 19 13:09:23 2012 +0000
@@ -41,6 +41,10 @@
 
 #define is_epte_present(ept_entry)      ((ept_entry)->epte & 0x7)
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
+static inline bool_t is_epte_valid(ept_entry_t *e)
+{
+    return (e->epte != 0 && e->sa_p2mt != p2m_invalid);
+}
 
 /* Non-ept "lock-and-check" wrapper */
 static int ept_pod_check_and_populate(struct p2m_domain *p2m, unsigned long gfn,
@@ -777,7 +781,7 @@
 
     for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
     {
-        if ( !is_epte_present(epte + i) )
+        if ( !is_epte_valid(epte + i) )
             continue;
 
         if ( (ept_page_level > 0) && !is_epte_superpage(epte + i) )

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 19 21:55:50 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jan 2012 21:55: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.xensource.com>)
	id 1RnzxW-0001Y3-3Q; Thu, 19 Jan 2012 21:55:50 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxS-0001Ef-Vz
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:47 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1327010139!11624698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15310 invoked from network); 19 Jan 2012 21:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2012 21:55:40 -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 1RnzxL-0007Tq-7A
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RnzxL-0000nS-5n
	for xen-changelog@lists.xensource.com; Thu, 19 Jan 2012 21:55:39 +0000
Message-Id: <E1RnzxL-0000nS-5n@xenbits.xen.org>
Date: Thu, 19 Jan 2012 21:55:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: refine epte_present test
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1326978563 0
# Node ID 2273ef2083d4a369044bdd8677635e0c0c3ae594
# Parent  f5b366c6c4c6a19f93f0c68dc9fc939f172ec908
x86/mm: refine epte_present test

The current test for a present ept entry checks for a permission bit
to be set.

While this is valid in contexts in which we want to know whether an entry
will fault, it is not correct when it comes to testing whether an entry is
valid. Specifically, in the ept_change_entry_type_page function which is
used to set entries to the log dirty type.

In combination with a p2m access type like n or n2rwx, log dirty will not be
set for ept entries for which it should.

Reported-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f5b366c6c4c6 -r 2273ef2083d4 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Thu Jan 19 10:42:42 2012 +0000
+++ b/xen/arch/x86/mm/p2m-ept.c	Thu Jan 19 13:09:23 2012 +0000
@@ -41,6 +41,10 @@
 
 #define is_epte_present(ept_entry)      ((ept_entry)->epte & 0x7)
 #define is_epte_superpage(ept_entry)    ((ept_entry)->sp)
+static inline bool_t is_epte_valid(ept_entry_t *e)
+{
+    return (e->epte != 0 && e->sa_p2mt != p2m_invalid);
+}
 
 /* Non-ept "lock-and-check" wrapper */
 static int ept_pod_check_and_populate(struct p2m_domain *p2m, unsigned long gfn,
@@ -777,7 +781,7 @@
 
     for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
     {
-        if ( !is_epte_present(epte + i) )
+        if ( !is_epte_valid(epte + i) )
             continue;
 
         if ( (ept_page_level > 0) && !is_epte_superpage(epte + i) )

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 20 13:22:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jan 2012 13: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.xensource.com>)
	id 1RoEQ1-0001mD-Ur; Fri, 20 Jan 2012 13:22:13 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEPz-0001lt-QM
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327065724!11643914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28041 invoked from network); 20 Jan 2012 13:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2012 13:22:05 -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 1RoEPs-00023D-AI
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEPs-0007se-8n
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:04 +0000
Message-Id: <E1RoEPs-0007se-8n@xenbits.xen.org>
Date: Fri, 20 Jan 2012 13:22: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] drivers/xen/: remove stray
	inclusion of various headers
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327065192 -3600
# Node ID 712106b6b4d7cee855dcee46c34e9822da908a5f
# Parent  ee73c29182d54b739fc89d0cdceb2d6885422eb2
drivers/xen/: remove stray inclusion of various headers

More than once (perhaps through copy-and-paste) occurring were
- mman.h
- pagemap.h
- smp_lock.h
- vmalloc.h

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


diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/balloon/balloon.c
--- a/drivers/xen/balloon/balloon.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/balloon/balloon.c	Fri Jan 20 14:13:12 2012 +0100
@@ -36,13 +36,10 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
+#include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
-#include <linux/smp_lock.h>
-#include <linux/pagemap.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
-#include <linux/vmalloc.h>
 #include <linux/mutex.h>
 #include <xen/xen_proc.h>
 #include <asm/hypervisor.h>
@@ -54,8 +51,6 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
-#include <linux/highmem.h>
-#include <linux/list.h>
 #include <xen/xenbus.h>
 #include "common.h"
 
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/char/mem.c
--- a/drivers/xen/char/mem.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/char/mem.c	Fri Jan 20 14:13:12 2012 +0100
@@ -9,19 +9,10 @@
  */
 
 #include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/mman.h>
-#include <linux/random.h>
 #include <linux/init.h>
-#include <linux/raw.h>
-#include <linux/tty.h>
+#include <linux/fs.h>
 #include <linux/capability.h>
-#include <linux/smp_lock.h>
 #include <linux/ptrace.h>
-#include <linux/device.h>
-#include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hypervisor.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/core/smpboot.c
--- a/drivers/xen/core/smpboot.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/core/smpboot.c	Fri Jan 20 14:13:12 2012 +0100
@@ -11,9 +11,7 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
-#include <linux/smp_lock.h>
 #include <linux/irq.h>
-#include <linux/bootmem.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <linux/percpu.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/gntdev/gntdev.c	Fri Jan 20 14:13:12 2012 +0100
@@ -23,7 +23,6 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <xen/gnttab.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/pciback/xenbus.c
--- a/drivers/xen/pciback/xenbus.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/pciback/xenbus.c	Fri Jan 20 14:13:12 2012 +0100
@@ -6,7 +6,6 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/list.h>
-#include <linux/vmalloc.h>
 #include <xen/xenbus.h>
 #include <xen/evtchn.h>
 #include "pciback.h"
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/privcmd/privcmd.c
--- a/drivers/xen/privcmd/privcmd.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/privcmd/privcmd.c	Fri Jan 20 14:13:12 2012 +0100
@@ -12,12 +12,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
-#include <linux/swap.h>
-#include <linux/smp_lock.h>
-#include <linux/highmem.h>
-#include <linux/pagemap.h>
-#include <linux/seq_file.h>
 #include <asm/hypervisor.h>
 
 #include <asm/pgalloc.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/scsiback/common.h
--- a/drivers/xen/scsiback/common.h	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/scsiback/common.h	Fri Jan 20 14:13:12 2012 +0100
@@ -34,7 +34,6 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
-#include <linux/vmalloc.h>
 #include <linux/wait.h>
 #include <linux/sched.h>
 #include <linux/kthread.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/usbback/usbback.h
--- a/drivers/xen/usbback/usbback.h	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/usbback/usbback.h	Fri Jan 20 14:13:12 2012 +0100
@@ -50,7 +50,6 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
-#include <linux/vmalloc.h>
 #include <linux/kthread.h>
 #include <linux/wait.h>
 #include <linux/list.h>

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 20 13:22:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jan 2012 13: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.xensource.com>)
	id 1RoEQ1-0001mD-Ur; Fri, 20 Jan 2012 13:22:13 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEPz-0001lt-QM
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327065724!11643914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28041 invoked from network); 20 Jan 2012 13:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2012 13:22:05 -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 1RoEPs-00023D-AI
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEPs-0007se-8n
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:04 +0000
Message-Id: <E1RoEPs-0007se-8n@xenbits.xen.org>
Date: Fri, 20 Jan 2012 13:22: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] drivers/xen/: remove stray
	inclusion of various headers
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327065192 -3600
# Node ID 712106b6b4d7cee855dcee46c34e9822da908a5f
# Parent  ee73c29182d54b739fc89d0cdceb2d6885422eb2
drivers/xen/: remove stray inclusion of various headers

More than once (perhaps through copy-and-paste) occurring were
- mman.h
- pagemap.h
- smp_lock.h
- vmalloc.h

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


diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/balloon/balloon.c
--- a/drivers/xen/balloon/balloon.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/balloon/balloon.c	Fri Jan 20 14:13:12 2012 +0100
@@ -36,13 +36,10 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
+#include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
-#include <linux/smp_lock.h>
-#include <linux/pagemap.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
-#include <linux/vmalloc.h>
 #include <linux/mutex.h>
 #include <xen/xen_proc.h>
 #include <asm/hypervisor.h>
@@ -54,8 +51,6 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
-#include <linux/highmem.h>
-#include <linux/list.h>
 #include <xen/xenbus.h>
 #include "common.h"
 
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/char/mem.c
--- a/drivers/xen/char/mem.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/char/mem.c	Fri Jan 20 14:13:12 2012 +0100
@@ -9,19 +9,10 @@
  */
 
 #include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/mman.h>
-#include <linux/random.h>
 #include <linux/init.h>
-#include <linux/raw.h>
-#include <linux/tty.h>
+#include <linux/fs.h>
 #include <linux/capability.h>
-#include <linux/smp_lock.h>
 #include <linux/ptrace.h>
-#include <linux/device.h>
-#include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hypervisor.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/core/smpboot.c
--- a/drivers/xen/core/smpboot.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/core/smpboot.c	Fri Jan 20 14:13:12 2012 +0100
@@ -11,9 +11,7 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
-#include <linux/smp_lock.h>
 #include <linux/irq.h>
-#include <linux/bootmem.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <linux/percpu.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/gntdev/gntdev.c	Fri Jan 20 14:13:12 2012 +0100
@@ -23,7 +23,6 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <xen/gnttab.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/pciback/xenbus.c
--- a/drivers/xen/pciback/xenbus.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/pciback/xenbus.c	Fri Jan 20 14:13:12 2012 +0100
@@ -6,7 +6,6 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/list.h>
-#include <linux/vmalloc.h>
 #include <xen/xenbus.h>
 #include <xen/evtchn.h>
 #include "pciback.h"
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/privcmd/privcmd.c
--- a/drivers/xen/privcmd/privcmd.c	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/privcmd/privcmd.c	Fri Jan 20 14:13:12 2012 +0100
@@ -12,12 +12,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/mman.h>
-#include <linux/swap.h>
-#include <linux/smp_lock.h>
-#include <linux/highmem.h>
-#include <linux/pagemap.h>
-#include <linux/seq_file.h>
 #include <asm/hypervisor.h>
 
 #include <asm/pgalloc.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/scsiback/common.h
--- a/drivers/xen/scsiback/common.h	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/scsiback/common.h	Fri Jan 20 14:13:12 2012 +0100
@@ -34,7 +34,6 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
-#include <linux/vmalloc.h>
 #include <linux/wait.h>
 #include <linux/sched.h>
 #include <linux/kthread.h>
diff -r ee73c29182d5 -r 712106b6b4d7 drivers/xen/usbback/usbback.h
--- a/drivers/xen/usbback/usbback.h	Fri Jan 20 13:54:43 2012 +0100
+++ b/drivers/xen/usbback/usbback.h	Fri Jan 20 14:13:12 2012 +0100
@@ -50,7 +50,6 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
-#include <linux/vmalloc.h>
 #include <linux/kthread.h>
 #include <linux/wait.h>
 #include <linux/list.h>

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 20 13:22:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jan 2012 13: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.xensource.com>)
	id 1RoEQ2-0001mI-1L; Fri, 20 Jan 2012 13:22:14 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEQ0-0001lu-96
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327065724!11763426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5006 invoked from network); 20 Jan 2012 13:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2012 13:22:05 -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 1RoEPs-00023B-9c
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEPr-0007sP-S7
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:03 +0000
Message-Id: <E1RoEPr-0007sP-S7@xenbits.xen.org>
Date: Fri, 20 Jan 2012 13:22: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] gntdev: switch from char-dev to
	misc-dev
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327064083 -3600
# Node ID ee73c29182d54b739fc89d0cdceb2d6885422eb2
# Parent  348f3f385b3bfbd5fe9d5e2acc30481573c5d1fa
gntdev: switch from char-dev to misc-dev

Rather than consuming a major (using just a single minor under it)
register a dynamic-minor misc-dev (as has been the case in the pv-ops
code from the very beginning).

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


diff -r 348f3f385b3b -r ee73c29182d5 drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c	Thu Jan 19 13:24:23 2012 +0100
+++ b/drivers/xen/gntdev/gntdev.c	Fri Jan 20 13:54:43 2012 +0100
@@ -21,7 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-#include <linux/device.h>
+#include <linux/miscdevice.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <asm/uaccess.h>
@@ -30,9 +30,6 @@
 #include <asm/hypervisor.h>
 #include <xen/balloon.h>
 #include <xen/evtchn.h>
-#include <xen/driver_util.h>
-
-#include <linux/types.h>
 #include <xen/public/gntdev.h>
 
 
@@ -156,11 +153,6 @@
 	.zap_pte = gntdev_clear_pte
 };
 
-/* Global variables. */
-
-/* The driver major number, for use when unregistering the driver. */
-static int gntdev_major;
-
 #define GNTDEV_NAME "gntdev"
 
 /* Memory mapping functions
@@ -371,42 +363,27 @@
 
 /* Interface functions. */
 
+static struct miscdevice gntdev_miscdev = {
+	.minor        = MISC_DYNAMIC_MINOR,
+	.name         = GNTDEV_NAME,
+	.fops         = &gntdev_fops,
+};
+
 /* Initialises the driver. Called when the module is loaded. */
 static int __init gntdev_init(void)
 {
-	struct class *class;
-	struct class_device *device;
+	int err;
 
 	if (!is_running_on_xen()) {
 		printk(KERN_ERR "You must be running Xen to use gntdev\n");
 		return -ENODEV;
 	}
 
-	gntdev_major = register_chrdev(0, GNTDEV_NAME, &gntdev_fops);
-	if (gntdev_major < 0)
+	err = misc_register(&gntdev_miscdev);
+	if (err)
 	{
 		printk(KERN_ERR "Could not register gntdev device\n");
-		return -ENOMEM;
-	}
-
-	/* Note that if the sysfs code fails, we will still initialise the
-	 * device, and output the major number so that the device can be
-	 * created manually using mknod.
-	 */
-	if ((class = get_xen_class()) == NULL) {
-		printk(KERN_ERR "Error setting up xen_class\n");
-		printk(KERN_ERR "gntdev created with major number = %d\n", 
-		       gntdev_major);
-		return 0;
-	}
-
-	device = class_device_create(class, NULL, MKDEV(gntdev_major, 0),
-				     NULL, GNTDEV_NAME);
-	if (IS_ERR(device)) {
-		printk(KERN_ERR "Error creating gntdev device in xen_class\n");
-		printk(KERN_ERR "gntdev created with major number = %d\n",
-		       gntdev_major);
-		return 0;
+		return err;
 	}
 
 	return 0;
@@ -416,10 +393,7 @@
  */
 static void __exit gntdev_exit(void)
 {
-	struct class *class;
-	if ((class = get_xen_class()) != NULL)
-		class_device_destroy(class, MKDEV(gntdev_major, 0));
-	unregister_chrdev(gntdev_major, GNTDEV_NAME);
+	misc_deregister(&gntdev_miscdev);
 }
 
 /* Called when the device is opened. */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 20 13:22:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jan 2012 13: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.xensource.com>)
	id 1RoEQ2-0001mI-1L; Fri, 20 Jan 2012 13:22:14 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEQ0-0001lu-96
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327065724!11763426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5006 invoked from network); 20 Jan 2012 13:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2012 13:22:05 -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 1RoEPs-00023B-9c
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoEPr-0007sP-S7
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 13:22:03 +0000
Message-Id: <E1RoEPr-0007sP-S7@xenbits.xen.org>
Date: Fri, 20 Jan 2012 13:22: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] gntdev: switch from char-dev to
	misc-dev
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327064083 -3600
# Node ID ee73c29182d54b739fc89d0cdceb2d6885422eb2
# Parent  348f3f385b3bfbd5fe9d5e2acc30481573c5d1fa
gntdev: switch from char-dev to misc-dev

Rather than consuming a major (using just a single minor under it)
register a dynamic-minor misc-dev (as has been the case in the pv-ops
code from the very beginning).

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


diff -r 348f3f385b3b -r ee73c29182d5 drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c	Thu Jan 19 13:24:23 2012 +0100
+++ b/drivers/xen/gntdev/gntdev.c	Fri Jan 20 13:54:43 2012 +0100
@@ -21,7 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-#include <linux/device.h>
+#include <linux/miscdevice.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <asm/uaccess.h>
@@ -30,9 +30,6 @@
 #include <asm/hypervisor.h>
 #include <xen/balloon.h>
 #include <xen/evtchn.h>
-#include <xen/driver_util.h>
-
-#include <linux/types.h>
 #include <xen/public/gntdev.h>
 
 
@@ -156,11 +153,6 @@
 	.zap_pte = gntdev_clear_pte
 };
 
-/* Global variables. */
-
-/* The driver major number, for use when unregistering the driver. */
-static int gntdev_major;
-
 #define GNTDEV_NAME "gntdev"
 
 /* Memory mapping functions
@@ -371,42 +363,27 @@
 
 /* Interface functions. */
 
+static struct miscdevice gntdev_miscdev = {
+	.minor        = MISC_DYNAMIC_MINOR,
+	.name         = GNTDEV_NAME,
+	.fops         = &gntdev_fops,
+};
+
 /* Initialises the driver. Called when the module is loaded. */
 static int __init gntdev_init(void)
 {
-	struct class *class;
-	struct class_device *device;
+	int err;
 
 	if (!is_running_on_xen()) {
 		printk(KERN_ERR "You must be running Xen to use gntdev\n");
 		return -ENODEV;
 	}
 
-	gntdev_major = register_chrdev(0, GNTDEV_NAME, &gntdev_fops);
-	if (gntdev_major < 0)
+	err = misc_register(&gntdev_miscdev);
+	if (err)
 	{
 		printk(KERN_ERR "Could not register gntdev device\n");
-		return -ENOMEM;
-	}
-
-	/* Note that if the sysfs code fails, we will still initialise the
-	 * device, and output the major number so that the device can be
-	 * created manually using mknod.
-	 */
-	if ((class = get_xen_class()) == NULL) {
-		printk(KERN_ERR "Error setting up xen_class\n");
-		printk(KERN_ERR "gntdev created with major number = %d\n", 
-		       gntdev_major);
-		return 0;
-	}
-
-	device = class_device_create(class, NULL, MKDEV(gntdev_major, 0),
-				     NULL, GNTDEV_NAME);
-	if (IS_ERR(device)) {
-		printk(KERN_ERR "Error creating gntdev device in xen_class\n");
-		printk(KERN_ERR "gntdev created with major number = %d\n",
-		       gntdev_major);
-		return 0;
+		return err;
 	}
 
 	return 0;
@@ -416,10 +393,7 @@
  */
 static void __exit gntdev_exit(void)
 {
-	struct class *class;
-	if ((class = get_xen_class()) != NULL)
-		class_device_destroy(class, MKDEV(gntdev_major, 0));
-	unregister_chrdev(gntdev_major, GNTDEV_NAME);
+	misc_deregister(&gntdev_miscdev);
 }
 
 /* Called when the device is opened. */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 20 15:44:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jan 2012 15:44: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.xensource.com>)
	id 1RoGdU-0005nn-Eu; Fri, 20 Jan 2012 15:44:16 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoGdT-0005ni-Ix
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 15:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327074248!11665554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21283 invoked from network); 20 Jan 2012 15:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2012 15:44:09 -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 1RoGdL-0003gS-PX
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 15:44:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoGdL-0002i8-BC
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 15:44:07 +0000
Message-Id: <E1RoGdL-0002i8-BC@xenbits.xen.org>
Date: Fri, 20 Jan 2012 15:44:06 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen/xsm: Add missing dummy
	operation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User James Carter <jwcart2@tycho.nsa.gov>
# Date 1327054937 0
# Node ID 49bf114c23f50e459b76e29d8882a2e0ad4d2a87
# Parent  27e959546916b9fab304ba3885d51c79442a27b3
xen/xsm: Add missing dummy operation

This patch adds a dummy op for the xsm_vcpuextstate operation.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
xen-unstable changeset:   23608:1a20a8586048
xen-unstable date:        Tue Jun 28 09:10:43 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 27e959546916 -r 49bf114c23f5 xen/xsm/dummy.c
--- a/xen/xsm/dummy.c	Tue Jan 17 11:32:46 2012 +0000
+++ b/xen/xsm/dummy.c	Fri Jan 20 10:22:17 2012 +0000
@@ -462,6 +462,11 @@
     return 0;
 }
 
+static int dummy_vcpuextstate (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
 #endif
 
 struct xsm_operations dummy_xsm_ops;
@@ -577,5 +582,6 @@
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, pin_mem_cacheattr);
     set_to_dummy_if_null(ops, ext_vcpucontext);
+    set_to_dummy_if_null(ops, vcpuextstate);
 #endif
 }

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 20 15:44:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jan 2012 15:44: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.xensource.com>)
	id 1RoGdU-0005nn-Eu; Fri, 20 Jan 2012 15:44:16 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoGdT-0005ni-Ix
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 15:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327074248!11665554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21283 invoked from network); 20 Jan 2012 15:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2012 15:44:09 -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 1RoGdL-0003gS-PX
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 15:44:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoGdL-0002i8-BC
	for xen-changelog@lists.xensource.com; Fri, 20 Jan 2012 15:44:07 +0000
Message-Id: <E1RoGdL-0002i8-BC@xenbits.xen.org>
Date: Fri, 20 Jan 2012 15:44:06 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen/xsm: Add missing dummy
	operation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User James Carter <jwcart2@tycho.nsa.gov>
# Date 1327054937 0
# Node ID 49bf114c23f50e459b76e29d8882a2e0ad4d2a87
# Parent  27e959546916b9fab304ba3885d51c79442a27b3
xen/xsm: Add missing dummy operation

This patch adds a dummy op for the xsm_vcpuextstate operation.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
xen-unstable changeset:   23608:1a20a8586048
xen-unstable date:        Tue Jun 28 09:10:43 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 27e959546916 -r 49bf114c23f5 xen/xsm/dummy.c
--- a/xen/xsm/dummy.c	Tue Jan 17 11:32:46 2012 +0000
+++ b/xen/xsm/dummy.c	Fri Jan 20 10:22:17 2012 +0000
@@ -462,6 +462,11 @@
     return 0;
 }
 
+static int dummy_vcpuextstate (struct domain *d, uint32_t cmd)
+{
+    return 0;
+}
+
 #endif
 
 struct xsm_operations dummy_xsm_ops;
@@ -577,5 +582,6 @@
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, pin_mem_cacheattr);
     set_to_dummy_if_null(ops, ext_vcpucontext);
+    set_to_dummy_if_null(ops, vcpuextstate);
 #endif
 }

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkL-0007D2-Rj; Sat, 21 Jan 2012 05:44:13 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkL-0007Cw-Ch
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327124603!51164011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27487 invoked from network); 21 Jan 2012 05:43:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2012 05:43:24 -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 1RoTkI-0006C1-W4
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkI-00018C-Ur
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Message-Id: <E1RoTkI-00018C-Ur@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: Fix earlier
	hvm_load_cpu_ctxt() breakage.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327083479 0
# Node ID ef8374dfe9bfe400d6ebd087b68884382bcc80be
# Parent  87854d3bed930a7f33fee126da943d044a144e12
x86/hvm: Fix earlier hvm_load_cpu_ctxt() breakage.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 87854d3bed93 -r ef8374dfe9bf xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Jan 20 18:17:59 2012 +0000
@@ -686,7 +686,7 @@
 
     /* Need to init this vcpu before loading its contents */
     rc = boot_vcpu(d, vcpuid, NULL);
-    if ( rc != 0 )
+    if ( (rc != 0) && (rc != -EEXIST) )
         return rc;
 
     if ( hvm_load_entry(CPU, h, &ctxt) != 0 ) 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkL-0007D2-Rj; Sat, 21 Jan 2012 05:44:13 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkL-0007Cw-Ch
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327124603!51164011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27487 invoked from network); 21 Jan 2012 05:43:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2012 05:43:24 -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 1RoTkI-0006C1-W4
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkI-00018C-Ur
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Message-Id: <E1RoTkI-00018C-Ur@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: Fix earlier
	hvm_load_cpu_ctxt() breakage.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327083479 0
# Node ID ef8374dfe9bfe400d6ebd087b68884382bcc80be
# Parent  87854d3bed930a7f33fee126da943d044a144e12
x86/hvm: Fix earlier hvm_load_cpu_ctxt() breakage.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 87854d3bed93 -r ef8374dfe9bf xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Jan 20 18:17:59 2012 +0000
@@ -686,7 +686,7 @@
 
     /* Need to init this vcpu before loading its contents */
     rc = boot_vcpu(d, vcpuid, NULL);
-    if ( rc != 0 )
+    if ( (rc != 0) && (rc != -EEXIST) )
         return rc;
 
     if ( hvm_load_entry(CPU, h, &ctxt) != 0 ) 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkQ-0007Db-2w; Sat, 21 Jan 2012 05:44:18 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkP-0007Cu-AC
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327124650!8001201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27532 invoked from network); 21 Jan 2012 05:44:11 -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;
	21 Jan 2012 05:44:11 -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 1RoTkH-0006Bs-JW
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkH-00017T-Aw
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Message-Id: <E1RoTkH-00017T-Aw@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] iommu: Move IOMMU faults handling
	into softirq for AMD-Vi.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1327054832 0
# Node ID 028230eb2359f33da48b3b7f85173a1b49b9c7d6
# Parent  d600a3d7faeeee3cf947bf1658b873e966fc0f16
iommu: Move IOMMU faults handling into softirq for AMD-Vi.

Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. To avoid more
interrupts being generated (because of further faults), they must be
masked in the IOMMU within the low level IRQ handler and enabled back
in the tasklet body. Notice that this may cause the log to overflow,
but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d600a3d7faee -r 028230eb2359 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Jan 20 10:17:12 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Jan 20 10:20:32 2012 +0000
@@ -32,6 +32,8 @@
 
 static int __initdata nr_amd_iommus;
 
+static struct tasklet amd_iommu_irq_tasklet;
+
 unsigned short ivrs_bdf_entries;
 static struct radix_tree_root ivrs_maps;
 struct list_head amd_iommu_head;
@@ -689,14 +691,48 @@
     spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
+static void do_amd_iommu_irq(unsigned long data)
+{
+    struct amd_iommu *iommu;
+
+    if ( !iommu_found() )
+    {
+        AMD_IOMMU_DEBUG("no device found, something must be very wrong!\n");
+        return;
+    }
+
+    /*
+     * No matter from where the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs).
+     */
+    for_each_amd_iommu ( iommu ) {
+        iommu_check_event_log(iommu);
+
+        if ( iommu->ppr_log.buffer != NULL )
+            iommu_check_ppr_log(iommu);
+    }
+}
+
 static void iommu_interrupt_handler(int irq, void *dev_id,
                                     struct cpu_user_regs *regs)
 {
+    u32 entry;
+    unsigned long flags;
     struct amd_iommu *iommu = dev_id;
-    iommu_check_event_log(iommu);
 
-    if ( iommu->ppr_log.buffer != NULL )
-        iommu_check_ppr_log(iommu);
+    spin_lock_irqsave(&iommu->lock, flags);
+
+    /* Silence interrupts from both event and PPR logging */
+    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+    iommu_clear_bit(&entry, IOMMU_STATUS_EVENT_LOG_INT_SHIFT);
+    iommu_clear_bit(&entry, IOMMU_STATUS_PPR_LOG_INT_SHIFT);
+    writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+
+    spin_unlock_irqrestore(&iommu->lock, flags);
+
+    /* It is the tasklet that will clear the logs and re-enable interrupts */
+    tasklet_schedule(&amd_iommu_irq_tasklet);
 }
 
 static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
@@ -876,6 +912,8 @@
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
 
+    softirq_tasklet_init(&amd_iommu_irq_tasklet, do_amd_iommu_irq, 0);
+
     return 0;
 
 error_out:

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkQ-0007Db-2w; Sat, 21 Jan 2012 05:44:18 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkP-0007Cu-AC
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327124650!8001201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27532 invoked from network); 21 Jan 2012 05:44:11 -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;
	21 Jan 2012 05:44:11 -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 1RoTkH-0006Bs-JW
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkH-00017T-Aw
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Message-Id: <E1RoTkH-00017T-Aw@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] iommu: Move IOMMU faults handling
	into softirq for AMD-Vi.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1327054832 0
# Node ID 028230eb2359f33da48b3b7f85173a1b49b9c7d6
# Parent  d600a3d7faeeee3cf947bf1658b873e966fc0f16
iommu: Move IOMMU faults handling into softirq for AMD-Vi.

Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. To avoid more
interrupts being generated (because of further faults), they must be
masked in the IOMMU within the low level IRQ handler and enabled back
in the tasklet body. Notice that this may cause the log to overflow,
but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d600a3d7faee -r 028230eb2359 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Jan 20 10:17:12 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Jan 20 10:20:32 2012 +0000
@@ -32,6 +32,8 @@
 
 static int __initdata nr_amd_iommus;
 
+static struct tasklet amd_iommu_irq_tasklet;
+
 unsigned short ivrs_bdf_entries;
 static struct radix_tree_root ivrs_maps;
 struct list_head amd_iommu_head;
@@ -689,14 +691,48 @@
     spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
+static void do_amd_iommu_irq(unsigned long data)
+{
+    struct amd_iommu *iommu;
+
+    if ( !iommu_found() )
+    {
+        AMD_IOMMU_DEBUG("no device found, something must be very wrong!\n");
+        return;
+    }
+
+    /*
+     * No matter from where the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs).
+     */
+    for_each_amd_iommu ( iommu ) {
+        iommu_check_event_log(iommu);
+
+        if ( iommu->ppr_log.buffer != NULL )
+            iommu_check_ppr_log(iommu);
+    }
+}
+
 static void iommu_interrupt_handler(int irq, void *dev_id,
                                     struct cpu_user_regs *regs)
 {
+    u32 entry;
+    unsigned long flags;
     struct amd_iommu *iommu = dev_id;
-    iommu_check_event_log(iommu);
 
-    if ( iommu->ppr_log.buffer != NULL )
-        iommu_check_ppr_log(iommu);
+    spin_lock_irqsave(&iommu->lock, flags);
+
+    /* Silence interrupts from both event and PPR logging */
+    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+    iommu_clear_bit(&entry, IOMMU_STATUS_EVENT_LOG_INT_SHIFT);
+    iommu_clear_bit(&entry, IOMMU_STATUS_PPR_LOG_INT_SHIFT);
+    writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+
+    spin_unlock_irqrestore(&iommu->lock, flags);
+
+    /* It is the tasklet that will clear the logs and re-enable interrupts */
+    tasklet_schedule(&amd_iommu_irq_tasklet);
 }
 
 static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
@@ -876,6 +912,8 @@
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
 
+    softirq_tasklet_init(&amd_iommu_irq_tasklet, do_amd_iommu_irq, 0);
+
     return 0;
 
 error_out:

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkR-0007Dq-5Q; Sat, 21 Jan 2012 05:44:19 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkP-0007Cv-Op
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1327124649!10051358!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12363 invoked from network); 21 Jan 2012 05:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2012 05:44:10 -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 1RoTkG-0006Bp-Ro
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkG-00017D-N2
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Message-Id: <E1RoTkG-00017D-N2@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: Allow wake up of offline
	vcpu via nmi-ipi
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327054632 0
# Node ID d600a3d7faeeee3cf947bf1658b873e966fc0f16
# Parent  a3f67482c3216681394c857729e0f08315cbe46a
x86/hvm: Allow wake up of offline vcpu via nmi-ipi

On a real machine a cpu disabled via hlt with interrupts disabled can
be reactivated via a nmi ipi. Enable the hypervisor to do this for
hvm, too.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a3f67482c321 -r d600a3d7faee xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Fri Jan 20 10:13:55 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Jan 20 10:17:12 2012 +0000
@@ -323,7 +323,16 @@
 
     case APIC_DM_NMI:
         if ( !test_and_set_bool(v->nmi_pending) )
+        {
+            bool_t wake = 0;
+            domain_lock(v->domain);
+            if ( v->is_initialised )
+                wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
+            domain_unlock(v->domain);
+            if ( wake )
+                vcpu_wake(v);
             vcpu_kick(v);
+        }
         break;
 
     case APIC_DM_INIT:

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkR-0007Dq-5Q; Sat, 21 Jan 2012 05:44:19 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkP-0007Cv-Op
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1327124649!10051358!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12363 invoked from network); 21 Jan 2012 05:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2012 05:44:10 -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 1RoTkG-0006Bp-Ro
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkG-00017D-N2
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Message-Id: <E1RoTkG-00017D-N2@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: Allow wake up of offline
	vcpu via nmi-ipi
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327054632 0
# Node ID d600a3d7faeeee3cf947bf1658b873e966fc0f16
# Parent  a3f67482c3216681394c857729e0f08315cbe46a
x86/hvm: Allow wake up of offline vcpu via nmi-ipi

On a real machine a cpu disabled via hlt with interrupts disabled can
be reactivated via a nmi ipi. Enable the hypervisor to do this for
hvm, too.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a3f67482c321 -r d600a3d7faee xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Fri Jan 20 10:13:55 2012 +0000
+++ b/xen/arch/x86/hvm/vlapic.c	Fri Jan 20 10:17:12 2012 +0000
@@ -323,7 +323,16 @@
 
     case APIC_DM_NMI:
         if ( !test_and_set_bool(v->nmi_pending) )
+        {
+            bool_t wake = 0;
+            domain_lock(v->domain);
+            if ( v->is_initialised )
+                wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
+            domain_unlock(v->domain);
+            if ( wake )
+                vcpu_wake(v);
             vcpu_kick(v);
+        }
         break;
 
     case APIC_DM_INIT:

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkQ-0007DS-0U; Sat, 21 Jan 2012 05:44:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkP-0007Ct-70
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1327124650!11933860!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20111 invoked from network); 21 Jan 2012 05:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2012 05:44:11 -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 1RoTkH-0006Bv-Vb
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkH-00017i-UR
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Message-Id: <E1RoTkH-00017i-UR@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: Remove unnecessary packed
	attribute from hvm_hw_cpu_xsave struct.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327055217 0
# Node ID 3d58058fc7a2ebda9c2add654c917b9f2c1b12e6
# Parent  028230eb2359f33da48b3b7f85173a1b49b9c7d6
x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 028230eb2359 -r 3d58058fc7a2 xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Fri Jan 20 10:20:32 2012 +0000
+++ b/xen/include/public/arch-x86/hvm/save.h	Fri Jan 20 10:26:57 2012 +0000
@@ -564,7 +564,7 @@
 
         struct { char x[0]; } ymm;    /* YMM */
     } save_area;
-} __attribute__((packed));
+};
 
 #define CPU_XSAVE_CODE  16
 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkQ-0007DS-0U; Sat, 21 Jan 2012 05:44:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkP-0007Ct-70
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1327124650!11933860!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20111 invoked from network); 21 Jan 2012 05:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2012 05:44:11 -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 1RoTkH-0006Bv-Vb
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkH-00017i-UR
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:09 +0000
Message-Id: <E1RoTkH-00017i-UR@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: Remove unnecessary packed
	attribute from hvm_hw_cpu_xsave struct.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327055217 0
# Node ID 3d58058fc7a2ebda9c2add654c917b9f2c1b12e6
# Parent  028230eb2359f33da48b3b7f85173a1b49b9c7d6
x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 028230eb2359 -r 3d58058fc7a2 xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Fri Jan 20 10:20:32 2012 +0000
+++ b/xen/include/public/arch-x86/hvm/save.h	Fri Jan 20 10:26:57 2012 +0000
@@ -564,7 +564,7 @@
 
         struct { char x[0]; } ymm;    /* YMM */
     } save_area;
-} __attribute__((packed));
+};
 
 #define CPU_XSAVE_CODE  16
 

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkP-0007DN-Uc; Sat, 21 Jan 2012 05:44:17 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkO-0007Cs-Jf
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1327124649!9316637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14656 invoked from network); 21 Jan 2012 05:44:10 -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;
	21 Jan 2012 05:44:10 -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 1RoTkG-0006Bm-If
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkG-00016y-66
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Message-Id: <E1RoTkG-00016y-66@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Simplify callers of
	boot_vcpu(). In VCPUOP_up, check
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327054435 0
# Node ID a3f67482c3216681394c857729e0f08315cbe46a
# Parent  2273ef2083d4a369044bdd8677635e0c0c3ae594
xen: Simplify callers of boot_vcpu(). In VCPUOP_up, check
is_initialised under the per-domain lock.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 2273ef2083d4 -r a3f67482c321 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Jan 19 13:09:23 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Jan 20 10:13:55 2012 +0000
@@ -685,11 +685,7 @@
     }
 
     /* Need to init this vcpu before loading its contents */
-    rc = 0;
-    domain_lock(d);
-    if ( !v->is_initialised )
-        rc = boot_vcpu(d, vcpuid, NULL);
-    domain_unlock(d);
+    rc = boot_vcpu(d, vcpuid, NULL);
     if ( rc != 0 )
         return rc;
 
diff -r 2273ef2083d4 -r a3f67482c321 xen/common/compat/domain.c
--- a/xen/common/compat/domain.c	Thu Jan 19 13:09:23 2012 +0000
+++ b/xen/common/compat/domain.c	Fri Jan 20 10:13:55 2012 +0000
@@ -46,11 +46,7 @@
             break;
         }
 
-        domain_lock(d);
-        rc = -EEXIST;
-        if ( !v->is_initialised )
-            rc = boot_vcpu(d, vcpuid, cmp_ctxt);
-        domain_unlock(d);
+        rc = boot_vcpu(d, vcpuid, cmp_ctxt);
 
         xfree(cmp_ctxt);
         break;
diff -r 2273ef2083d4 -r a3f67482c321 xen/common/domain.c
--- a/xen/common/domain.c	Thu Jan 19 13:09:23 2012 +0000
+++ b/xen/common/domain.c	Fri Jan 20 10:13:55 2012 +0000
@@ -781,10 +781,13 @@
 int boot_vcpu(struct domain *d, int vcpuid, vcpu_guest_context_u ctxt)
 {
     struct vcpu *v = d->vcpu[vcpuid];
+    int rc;
 
-    BUG_ON(v->is_initialised);
+    domain_lock(d);
+    rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt);
+    domain_unlock(d);
 
-    return arch_set_info_guest(v, ctxt);
+    return rc;
 }
 
 void vcpu_reset(struct vcpu *v)
@@ -844,23 +847,23 @@
             return -EFAULT;
         }
 
-        domain_lock(d);
-        rc = -EEXIST;
-        if ( !v->is_initialised )
-            rc = boot_vcpu(d, vcpuid, ctxt);
-        domain_unlock(d);
+        rc = boot_vcpu(d, vcpuid, ctxt);
 
         free_vcpu_guest_context(ctxt);
         break;
 
-    case VCPUOP_up:
+    case VCPUOP_up: {
+        bool_t wake = 0;
+        domain_lock(d);
         if ( !v->is_initialised )
-            return -EINVAL;
-
-        if ( test_and_clear_bit(_VPF_down, &v->pause_flags) )
+            rc = -EINVAL;
+        else
+            wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
+        domain_unlock(d);
+        if ( wake )
             vcpu_wake(v);
-
         break;
+    }
 
     case VCPUOP_down:
         if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkP-0007DN-Uc; Sat, 21 Jan 2012 05:44:17 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkO-0007Cs-Jf
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1327124649!9316637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14656 invoked from network); 21 Jan 2012 05:44:10 -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;
	21 Jan 2012 05:44:10 -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 1RoTkG-0006Bm-If
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkG-00016y-66
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:08 +0000
Message-Id: <E1RoTkG-00016y-66@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Simplify callers of
	boot_vcpu(). In VCPUOP_up, check
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327054435 0
# Node ID a3f67482c3216681394c857729e0f08315cbe46a
# Parent  2273ef2083d4a369044bdd8677635e0c0c3ae594
xen: Simplify callers of boot_vcpu(). In VCPUOP_up, check
is_initialised under the per-domain lock.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 2273ef2083d4 -r a3f67482c321 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Jan 19 13:09:23 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Jan 20 10:13:55 2012 +0000
@@ -685,11 +685,7 @@
     }
 
     /* Need to init this vcpu before loading its contents */
-    rc = 0;
-    domain_lock(d);
-    if ( !v->is_initialised )
-        rc = boot_vcpu(d, vcpuid, NULL);
-    domain_unlock(d);
+    rc = boot_vcpu(d, vcpuid, NULL);
     if ( rc != 0 )
         return rc;
 
diff -r 2273ef2083d4 -r a3f67482c321 xen/common/compat/domain.c
--- a/xen/common/compat/domain.c	Thu Jan 19 13:09:23 2012 +0000
+++ b/xen/common/compat/domain.c	Fri Jan 20 10:13:55 2012 +0000
@@ -46,11 +46,7 @@
             break;
         }
 
-        domain_lock(d);
-        rc = -EEXIST;
-        if ( !v->is_initialised )
-            rc = boot_vcpu(d, vcpuid, cmp_ctxt);
-        domain_unlock(d);
+        rc = boot_vcpu(d, vcpuid, cmp_ctxt);
 
         xfree(cmp_ctxt);
         break;
diff -r 2273ef2083d4 -r a3f67482c321 xen/common/domain.c
--- a/xen/common/domain.c	Thu Jan 19 13:09:23 2012 +0000
+++ b/xen/common/domain.c	Fri Jan 20 10:13:55 2012 +0000
@@ -781,10 +781,13 @@
 int boot_vcpu(struct domain *d, int vcpuid, vcpu_guest_context_u ctxt)
 {
     struct vcpu *v = d->vcpu[vcpuid];
+    int rc;
 
-    BUG_ON(v->is_initialised);
+    domain_lock(d);
+    rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt);
+    domain_unlock(d);
 
-    return arch_set_info_guest(v, ctxt);
+    return rc;
 }
 
 void vcpu_reset(struct vcpu *v)
@@ -844,23 +847,23 @@
             return -EFAULT;
         }
 
-        domain_lock(d);
-        rc = -EEXIST;
-        if ( !v->is_initialised )
-            rc = boot_vcpu(d, vcpuid, ctxt);
-        domain_unlock(d);
+        rc = boot_vcpu(d, vcpuid, ctxt);
 
         free_vcpu_guest_context(ctxt);
         break;
 
-    case VCPUOP_up:
+    case VCPUOP_up: {
+        bool_t wake = 0;
+        domain_lock(d);
         if ( !v->is_initialised )
-            return -EINVAL;
-
-        if ( test_and_clear_bit(_VPF_down, &v->pause_flags) )
+            rc = -EINVAL;
+        else
+            wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
+        domain_unlock(d);
+        if ( wake )
             vcpu_wake(v);
-
         break;
+    }
 
     case VCPUOP_down:
         if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkR-0007Dv-7n; Sat, 21 Jan 2012 05:44:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkQ-0007Cx-6z
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1327124605!50998780!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28082 invoked from network); 21 Jan 2012 05:43:26 -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;
	21 Jan 2012 05:43:26 -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 1RoTkI-0006By-Rd
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkI-00017x-EB
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Message-Id: <E1RoTkI-00017x-EB@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vpmu: separate architecture specific
	PMU initialisation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1327056016 0
# Node ID 87854d3bed930a7f33fee126da943d044a144e12
# Parent  3d58058fc7a2ebda9c2add654c917b9f2c1b12e6
vpmu: separate architecture specific PMU initialisation

This patch moves the architecture specific initialisation of the PMU
into the archicture specific directory.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3d58058fc7a2 -r 87854d3bed93 xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Fri Jan 20 10:40:16 2012 +0000
@@ -296,7 +296,7 @@
 {
     struct amd_vpmu_context *ctxt = NULL;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    __u8 family = current_cpu_data.x86;
+    uint8_t family = current_cpu_data.x86;
 
     if ( vpmu->flags & VPMU_CONTEXT_ALLOCATED )
         return;
@@ -362,3 +362,25 @@
     .arch_vpmu_save = amd_vpmu_save,
     .arch_vpmu_load = amd_vpmu_restore
 };
+
+int svm_vpmu_initialise(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    uint8_t family = current_cpu_data.x86;
+
+    switch ( family )
+    {
+    case 0x10:
+    case 0x12:
+    case 0x14:
+    case 0x15:
+        vpmu->arch_vpmu_ops = &amd_vpmu_ops;
+        return 0;
+    }
+
+    printk("VPMU: Initialization failed. "
+           "AMD processor family %d has not "
+           "been supported\n", family);
+    return -EINVAL;
+}
+
diff -r 3d58058fc7a2 -r 87854d3bed93 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Jan 20 10:40:16 2012 +0000
@@ -607,3 +607,32 @@
     .arch_vpmu_save = core2_vpmu_save,
     .arch_vpmu_load = core2_vpmu_load
 };
+
+int vmx_vpmu_initialise(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    uint8_t family = current_cpu_data.x86;
+    uint8_t cpu_model = current_cpu_data.x86_model;
+
+    if ( family == 6 )
+    {
+        switch ( cpu_model )
+        {
+        case 15:
+        case 23:
+        case 26:
+        case 29:
+        case 42:
+        case 46:
+        case 47:
+            vpmu->arch_vpmu_ops = &core2_vpmu_ops;
+            return 0;
+        }
+    }
+
+    printk("VPMU: Initialization failed. "
+           "Intel processor family %d model %d has not "
+           "been supported\n", family, cpu_model);
+    return -EINVAL;
+}
+
diff -r 3d58058fc7a2 -r 87854d3bed93 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/arch/x86/hvm/vpmu.c	Fri Jan 20 10:40:16 2012 +0000
@@ -81,9 +81,7 @@
 void vpmu_initialise(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    __u8 vendor = current_cpu_data.x86_vendor;
-    __u8 family = current_cpu_data.x86;
-    __u8 cpu_model = current_cpu_data.x86_model;
+    uint8_t vendor = current_cpu_data.x86_vendor;
 
     if ( !opt_vpmu_enabled )
         return;
@@ -94,47 +92,19 @@
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
-        switch ( family )
-        {
-        case 0x10:
-        case 0x12:
-        case 0x14:
-        case 0x15:
-            vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-            break;
-        default:
-            printk("VPMU: Initialization failed. "
-                   "AMD processor family %d has not "
-                   "been supported\n", family);
-            return;
-        }
+        if ( svm_vpmu_initialise(v) != 0 )
+            opt_vpmu_enabled = 0;
         break;
 
     case X86_VENDOR_INTEL:
-        if ( family == 6 )
-        {
-            switch ( cpu_model )
-            {
-            case 15:
-            case 23:
-            case 26:
-            case 29:
-            case 42:
-            case 46:
-            case 47:
-                vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-                break;
-            }
-        }
-        if ( vpmu->arch_vpmu_ops == NULL )
-            printk("VPMU: Initialization failed. "
-                   "Intel processor family %d model %d has not "
-                   "been supported\n", family, cpu_model);
+        if ( vmx_vpmu_initialise(v) != 0 )
+            opt_vpmu_enabled = 0;
         break;
 
     default:
         printk("VPMU: Initialization failed. "
                "Unknown CPU vendor %d\n", vendor);
+        opt_vpmu_enabled = 0;
         break;
     }
 
diff -r 3d58058fc7a2 -r 87854d3bed93 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpmu.h	Fri Jan 20 10:40:16 2012 +0000
@@ -56,8 +56,8 @@
     void (*arch_vpmu_load)(struct vcpu *v);
 };
 
-extern struct arch_vpmu_ops core2_vpmu_ops;
-extern struct arch_vpmu_ops amd_vpmu_ops;
+int vmx_vpmu_initialise(struct vcpu *v);
+int svm_vpmu_initialise(struct vcpu *v);
 
 struct vpmu_struct {
     u32 flags;

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

From xen-changelog-bounces@lists.xensource.com Sat Jan 21 05:44:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jan 2012 05:44: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.xensource.com>)
	id 1RoTkR-0007Dv-7n; Sat, 21 Jan 2012 05:44:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkQ-0007Cx-6z
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1327124605!50998780!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28082 invoked from network); 21 Jan 2012 05:43:26 -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;
	21 Jan 2012 05:43:26 -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 1RoTkI-0006By-Rd
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RoTkI-00017x-EB
	for xen-changelog@lists.xensource.com; Sat, 21 Jan 2012 05:44:10 +0000
Message-Id: <E1RoTkI-00017x-EB@xenbits.xen.org>
Date: Sat, 21 Jan 2012 05:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vpmu: separate architecture specific
	PMU initialisation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1327056016 0
# Node ID 87854d3bed930a7f33fee126da943d044a144e12
# Parent  3d58058fc7a2ebda9c2add654c917b9f2c1b12e6
vpmu: separate architecture specific PMU initialisation

This patch moves the architecture specific initialisation of the PMU
into the archicture specific directory.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3d58058fc7a2 -r 87854d3bed93 xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Fri Jan 20 10:40:16 2012 +0000
@@ -296,7 +296,7 @@
 {
     struct amd_vpmu_context *ctxt = NULL;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    __u8 family = current_cpu_data.x86;
+    uint8_t family = current_cpu_data.x86;
 
     if ( vpmu->flags & VPMU_CONTEXT_ALLOCATED )
         return;
@@ -362,3 +362,25 @@
     .arch_vpmu_save = amd_vpmu_save,
     .arch_vpmu_load = amd_vpmu_restore
 };
+
+int svm_vpmu_initialise(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    uint8_t family = current_cpu_data.x86;
+
+    switch ( family )
+    {
+    case 0x10:
+    case 0x12:
+    case 0x14:
+    case 0x15:
+        vpmu->arch_vpmu_ops = &amd_vpmu_ops;
+        return 0;
+    }
+
+    printk("VPMU: Initialization failed. "
+           "AMD processor family %d has not "
+           "been supported\n", family);
+    return -EINVAL;
+}
+
diff -r 3d58058fc7a2 -r 87854d3bed93 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Jan 20 10:40:16 2012 +0000
@@ -607,3 +607,32 @@
     .arch_vpmu_save = core2_vpmu_save,
     .arch_vpmu_load = core2_vpmu_load
 };
+
+int vmx_vpmu_initialise(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    uint8_t family = current_cpu_data.x86;
+    uint8_t cpu_model = current_cpu_data.x86_model;
+
+    if ( family == 6 )
+    {
+        switch ( cpu_model )
+        {
+        case 15:
+        case 23:
+        case 26:
+        case 29:
+        case 42:
+        case 46:
+        case 47:
+            vpmu->arch_vpmu_ops = &core2_vpmu_ops;
+            return 0;
+        }
+    }
+
+    printk("VPMU: Initialization failed. "
+           "Intel processor family %d model %d has not "
+           "been supported\n", family, cpu_model);
+    return -EINVAL;
+}
+
diff -r 3d58058fc7a2 -r 87854d3bed93 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/arch/x86/hvm/vpmu.c	Fri Jan 20 10:40:16 2012 +0000
@@ -81,9 +81,7 @@
 void vpmu_initialise(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    __u8 vendor = current_cpu_data.x86_vendor;
-    __u8 family = current_cpu_data.x86;
-    __u8 cpu_model = current_cpu_data.x86_model;
+    uint8_t vendor = current_cpu_data.x86_vendor;
 
     if ( !opt_vpmu_enabled )
         return;
@@ -94,47 +92,19 @@
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
-        switch ( family )
-        {
-        case 0x10:
-        case 0x12:
-        case 0x14:
-        case 0x15:
-            vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-            break;
-        default:
-            printk("VPMU: Initialization failed. "
-                   "AMD processor family %d has not "
-                   "been supported\n", family);
-            return;
-        }
+        if ( svm_vpmu_initialise(v) != 0 )
+            opt_vpmu_enabled = 0;
         break;
 
     case X86_VENDOR_INTEL:
-        if ( family == 6 )
-        {
-            switch ( cpu_model )
-            {
-            case 15:
-            case 23:
-            case 26:
-            case 29:
-            case 42:
-            case 46:
-            case 47:
-                vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-                break;
-            }
-        }
-        if ( vpmu->arch_vpmu_ops == NULL )
-            printk("VPMU: Initialization failed. "
-                   "Intel processor family %d model %d has not "
-                   "been supported\n", family, cpu_model);
+        if ( vmx_vpmu_initialise(v) != 0 )
+            opt_vpmu_enabled = 0;
         break;
 
     default:
         printk("VPMU: Initialization failed. "
                "Unknown CPU vendor %d\n", vendor);
+        opt_vpmu_enabled = 0;
         break;
     }
 
diff -r 3d58058fc7a2 -r 87854d3bed93 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Fri Jan 20 10:26:57 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpmu.h	Fri Jan 20 10:40:16 2012 +0000
@@ -56,8 +56,8 @@
     void (*arch_vpmu_load)(struct vcpu *v);
 };
 
-extern struct arch_vpmu_ops core2_vpmu_ops;
-extern struct arch_vpmu_ops amd_vpmu_ops;
+int vmx_vpmu_initialise(struct vcpu *v);
+int svm_vpmu_initialise(struct vcpu *v);
 
 struct vpmu_struct {
     u32 flags;

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

From xen-changelog-bounces@lists.xensource.com Sun Jan 22 03:33:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jan 2012 03:33: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.xensource.com>)
	id 1RooBC-0004DP-Pp; Sun, 22 Jan 2012 03:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooBB-0004D1-HB
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1327203190!4450834!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17619 invoked from network); 22 Jan 2012 03:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2012 03:33:11 -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 1RooB3-0005AV-Tm
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooB3-0008Kl-PE
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Message-Id: <E1RooB3-0008Kl-PE@xenbits.xen.org>
Date: Sun, 22 Jan 2012 03:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/libvchan: Beef up the CPU
	barriers in libvchan.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327166140 0
# Node ID 80fdf2182bc62ca358ba2f1a3513b47a4f8d9dfd
# Parent  475d73479663b7bf85da84a7794df762aa2289a3
tools/libvchan: Beef up the CPU barriers in libvchan.

Although they were sufficient for x86, they weren't safe more generally.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 475d73479663 -r 80fdf2182bc6 tools/libvchan/io.c
--- a/tools/libvchan/io.c	Sat Jan 21 17:14:37 2012 +0000
+++ b/tools/libvchan/io.c	Sat Jan 21 17:15:40 2012 +0000
@@ -55,9 +55,6 @@
 #define VCHAN_DEBUG 0
 #endif
 
-#define barrier() asm volatile("" ::: "memory")
-
-
 static inline uint32_t rd_prod(struct libxenvchan *ctrl)
 {
 	return ctrl->read.shr->prod;
@@ -104,12 +101,15 @@
 {
 	uint8_t *notify = ctrl->is_server ? &ctrl->ring->cli_notify : &ctrl->ring->srv_notify;
 	__sync_or_and_fetch(notify, bit);
+	xen_mb(); /* post the request /before/ caller re-reads any indexes */
 }
 
 static inline int send_notify(struct libxenvchan *ctrl, uint8_t bit)
 {
-	uint8_t *notify = ctrl->is_server ? &ctrl->ring->srv_notify : &ctrl->ring->cli_notify;
-	uint8_t prev = __sync_fetch_and_and(notify, ~bit);
+	uint8_t *notify, prev;
+	xen_mb(); /* caller updates indexes /before/ we decode to notify */
+	notify = ctrl->is_server ? &ctrl->ring->srv_notify : &ctrl->ring->cli_notify;
+	prev = __sync_fetch_and_and(notify, ~bit);
 	if (prev & bit)
 		return xc_evtchn_notify(ctrl->event, ctrl->event_port);
 	else
@@ -197,15 +197,15 @@
 	}
 	if (avail_contig > size)
 		avail_contig = size;
+	xen_mb(); /* read indexes /then/ write data */
 	memcpy(wr_ring(ctrl) + real_idx, data, avail_contig);
 	if (avail_contig < size)
 	{
 		// we rolled across the end of the ring
 		memcpy(wr_ring(ctrl), data + avail_contig, size - avail_contig);
 	}
-	barrier(); // data must be in the ring prior to increment
+	xen_wmb(); /* write data /then/ notify */
 	wr_prod(ctrl) += size;
-	barrier(); // increment must happen prior to notify
 	if (send_notify(ctrl, VCHAN_NOTIFY_WRITE))
 		return -1;
 	return size;
@@ -268,13 +268,14 @@
 	int avail_contig = rd_ring_size(ctrl) - real_idx;
 	if (avail_contig > size)
 		avail_contig = size;
-	barrier(); // data read must happen after rd_cons read
+	xen_rmb(); /* data read must happen /after/ rd_cons read */
 	memcpy(data, rd_ring(ctrl) + real_idx, avail_contig);
 	if (avail_contig < size)
 	{
 		// we rolled across the end of the ring
 		memcpy(data + avail_contig, rd_ring(ctrl), size - avail_contig);
 	}
+	xen_mb(); /* consume /then/ notify */
 	rd_cons(ctrl) += size;
 	if (VCHAN_DEBUG) {
 		char metainfo[32];
@@ -285,7 +286,6 @@
 		iov[1].iov_len = size;
 		writev(-1, iov, 2);
 	}
-	barrier(); // consumption must happen prior to notify of newly freed space
 	if (send_notify(ctrl, VCHAN_NOTIFY_READ))
 		return -1;
 	return size;

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

From xen-changelog-bounces@lists.xensource.com Sun Jan 22 03:33:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jan 2012 03:33: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.xensource.com>)
	id 1RooBC-0004DP-Pp; Sun, 22 Jan 2012 03:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooBB-0004D1-HB
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1327203190!4450834!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17619 invoked from network); 22 Jan 2012 03:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2012 03:33:11 -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 1RooB3-0005AV-Tm
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooB3-0008Kl-PE
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Message-Id: <E1RooB3-0008Kl-PE@xenbits.xen.org>
Date: Sun, 22 Jan 2012 03:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/libvchan: Beef up the CPU
	barriers in libvchan.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327166140 0
# Node ID 80fdf2182bc62ca358ba2f1a3513b47a4f8d9dfd
# Parent  475d73479663b7bf85da84a7794df762aa2289a3
tools/libvchan: Beef up the CPU barriers in libvchan.

Although they were sufficient for x86, they weren't safe more generally.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 475d73479663 -r 80fdf2182bc6 tools/libvchan/io.c
--- a/tools/libvchan/io.c	Sat Jan 21 17:14:37 2012 +0000
+++ b/tools/libvchan/io.c	Sat Jan 21 17:15:40 2012 +0000
@@ -55,9 +55,6 @@
 #define VCHAN_DEBUG 0
 #endif
 
-#define barrier() asm volatile("" ::: "memory")
-
-
 static inline uint32_t rd_prod(struct libxenvchan *ctrl)
 {
 	return ctrl->read.shr->prod;
@@ -104,12 +101,15 @@
 {
 	uint8_t *notify = ctrl->is_server ? &ctrl->ring->cli_notify : &ctrl->ring->srv_notify;
 	__sync_or_and_fetch(notify, bit);
+	xen_mb(); /* post the request /before/ caller re-reads any indexes */
 }
 
 static inline int send_notify(struct libxenvchan *ctrl, uint8_t bit)
 {
-	uint8_t *notify = ctrl->is_server ? &ctrl->ring->srv_notify : &ctrl->ring->cli_notify;
-	uint8_t prev = __sync_fetch_and_and(notify, ~bit);
+	uint8_t *notify, prev;
+	xen_mb(); /* caller updates indexes /before/ we decode to notify */
+	notify = ctrl->is_server ? &ctrl->ring->srv_notify : &ctrl->ring->cli_notify;
+	prev = __sync_fetch_and_and(notify, ~bit);
 	if (prev & bit)
 		return xc_evtchn_notify(ctrl->event, ctrl->event_port);
 	else
@@ -197,15 +197,15 @@
 	}
 	if (avail_contig > size)
 		avail_contig = size;
+	xen_mb(); /* read indexes /then/ write data */
 	memcpy(wr_ring(ctrl) + real_idx, data, avail_contig);
 	if (avail_contig < size)
 	{
 		// we rolled across the end of the ring
 		memcpy(wr_ring(ctrl), data + avail_contig, size - avail_contig);
 	}
-	barrier(); // data must be in the ring prior to increment
+	xen_wmb(); /* write data /then/ notify */
 	wr_prod(ctrl) += size;
-	barrier(); // increment must happen prior to notify
 	if (send_notify(ctrl, VCHAN_NOTIFY_WRITE))
 		return -1;
 	return size;
@@ -268,13 +268,14 @@
 	int avail_contig = rd_ring_size(ctrl) - real_idx;
 	if (avail_contig > size)
 		avail_contig = size;
-	barrier(); // data read must happen after rd_cons read
+	xen_rmb(); /* data read must happen /after/ rd_cons read */
 	memcpy(data, rd_ring(ctrl) + real_idx, avail_contig);
 	if (avail_contig < size)
 	{
 		// we rolled across the end of the ring
 		memcpy(data + avail_contig, rd_ring(ctrl), size - avail_contig);
 	}
+	xen_mb(); /* consume /then/ notify */
 	rd_cons(ctrl) += size;
 	if (VCHAN_DEBUG) {
 		char metainfo[32];
@@ -285,7 +286,6 @@
 		iov[1].iov_len = size;
 		writev(-1, iov, 2);
 	}
-	barrier(); // consumption must happen prior to notify of newly freed space
 	if (send_notify(ctrl, VCHAN_NOTIFY_READ))
 		return -1;
 	return size;

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

From xen-changelog-bounces@lists.xensource.com Sun Jan 22 03:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jan 2012 03: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.xensource.com>)
	id 1RooBC-0004DK-Mz; Sun, 22 Jan 2012 03:33:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooBB-0004D2-Ea
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1327203189!12052008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23000 invoked from network); 22 Jan 2012 03:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2012 03:33:10 -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 1RooB3-0005AP-4Z
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooB2-0008Jq-N4
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:08 +0000
Message-Id: <E1RooB2-0008Jq-N4@xenbits.xen.org>
Date: Sun, 22 Jan 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: libxl_qmp.c should use
	libxl's own list macros, since they
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327164420 0
# Node ID 7f71f0b4b8e66d2c4c95ae7419cd8fb858d6b3df
# Parent  ef8374dfe9bfe400d6ebd087b68884382bcc80be
libxl: libxl_qmp.c should use libxl's own list macros, since they
exist. Also, older Linux versions do not have SIMPLEQ macros in
sys/queue.h.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r ef8374dfe9bf -r 7f71f0b4b8e6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Jan 20 18:17:59 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Sat Jan 21 16:47:00 2012 +0000
@@ -21,10 +21,10 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <sys/un.h>
-#include <sys/queue.h>
 
 #include <yajl/yajl_gen.h>
 
+#include "_libxl_list.h"
 #include "libxl_internal.h"
 
 /* #define DEBUG_RECEIVED */
@@ -56,7 +56,7 @@
     qmp_callback_t callback;
     void *opaque;
     qmp_request_context *context;
-    SIMPLEQ_ENTRY(callback_id_pair) next;
+    LIBXL_STAILQ_ENTRY(struct callback_id_pair) next;
 } callback_id_pair;
 
 struct libxl__qmp_handler {
@@ -74,7 +74,7 @@
     uint32_t domid;
 
     int last_id_used;
-    SIMPLEQ_HEAD(callback_list, callback_id_pair) callback_list;
+    LIBXL_STAILQ_HEAD(callback_list, callback_id_pair) callback_list;
 };
 
 static int qmp_send(libxl__qmp_handler *qmp,
@@ -202,7 +202,7 @@
     if (id_object) {
         id = libxl__json_object_get_integer(id_object);
 
-        SIMPLEQ_FOREACH(pp, &qmp->callback_list, next) {
+        LIBXL_STAILQ_FOREACH(pp, &qmp->callback_list, next) {
             if (pp->id == id) {
                 return pp;
             }
@@ -230,7 +230,7 @@
             /* tell that the id have been processed */
             qmp->wait_for_id = 0;
         }
-        SIMPLEQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
+        LIBXL_STAILQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
         free(pp);
     }
 
@@ -268,7 +268,8 @@
                 /* tell that the id have been processed */
                 qmp->wait_for_id = 0;
             }
-            SIMPLEQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
+            LIBXL_STAILQ_REMOVE(
+                &qmp->callback_list, pp, callback_id_pair, next);
             free(pp);
         }
         return 0;
@@ -302,7 +303,7 @@
     qmp->domid = domid;
     qmp->timeout = 5;
 
-    SIMPLEQ_INIT(&qmp->callback_list);
+    LIBXL_STAILQ_INIT(&qmp->callback_list);
 
     return qmp;
 }
@@ -353,7 +354,7 @@
     callback_id_pair *tmp = NULL;
 
     close(qmp->qmp_fd);
-    SIMPLEQ_FOREACH(pp, &qmp->callback_list, next) {
+    LIBXL_STAILQ_FOREACH(pp, &qmp->callback_list, next) {
         if (tmp)
             free(tmp);
         tmp = pp;
@@ -493,7 +494,7 @@
     elm->callback = callback;
     elm->opaque = opaque;
     elm->context = context;
-    SIMPLEQ_INSERT_TAIL(&qmp->callback_list, elm, next);
+    LIBXL_STAILQ_INSERT_TAIL(&qmp->callback_list, elm, next);
 
     ret = libxl__strndup(gc, (const char*)buf, len);
 

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

From xen-changelog-bounces@lists.xensource.com Sun Jan 22 03:33:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jan 2012 03: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.xensource.com>)
	id 1RooBC-0004DK-Mz; Sun, 22 Jan 2012 03:33:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooBB-0004D2-Ea
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1327203189!12052008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23000 invoked from network); 22 Jan 2012 03:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2012 03:33:10 -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 1RooB3-0005AP-4Z
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooB2-0008Jq-N4
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:08 +0000
Message-Id: <E1RooB2-0008Jq-N4@xenbits.xen.org>
Date: Sun, 22 Jan 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: libxl_qmp.c should use
	libxl's own list macros, since they
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327164420 0
# Node ID 7f71f0b4b8e66d2c4c95ae7419cd8fb858d6b3df
# Parent  ef8374dfe9bfe400d6ebd087b68884382bcc80be
libxl: libxl_qmp.c should use libxl's own list macros, since they
exist. Also, older Linux versions do not have SIMPLEQ macros in
sys/queue.h.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r ef8374dfe9bf -r 7f71f0b4b8e6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Jan 20 18:17:59 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Sat Jan 21 16:47:00 2012 +0000
@@ -21,10 +21,10 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <sys/un.h>
-#include <sys/queue.h>
 
 #include <yajl/yajl_gen.h>
 
+#include "_libxl_list.h"
 #include "libxl_internal.h"
 
 /* #define DEBUG_RECEIVED */
@@ -56,7 +56,7 @@
     qmp_callback_t callback;
     void *opaque;
     qmp_request_context *context;
-    SIMPLEQ_ENTRY(callback_id_pair) next;
+    LIBXL_STAILQ_ENTRY(struct callback_id_pair) next;
 } callback_id_pair;
 
 struct libxl__qmp_handler {
@@ -74,7 +74,7 @@
     uint32_t domid;
 
     int last_id_used;
-    SIMPLEQ_HEAD(callback_list, callback_id_pair) callback_list;
+    LIBXL_STAILQ_HEAD(callback_list, callback_id_pair) callback_list;
 };
 
 static int qmp_send(libxl__qmp_handler *qmp,
@@ -202,7 +202,7 @@
     if (id_object) {
         id = libxl__json_object_get_integer(id_object);
 
-        SIMPLEQ_FOREACH(pp, &qmp->callback_list, next) {
+        LIBXL_STAILQ_FOREACH(pp, &qmp->callback_list, next) {
             if (pp->id == id) {
                 return pp;
             }
@@ -230,7 +230,7 @@
             /* tell that the id have been processed */
             qmp->wait_for_id = 0;
         }
-        SIMPLEQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
+        LIBXL_STAILQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
         free(pp);
     }
 
@@ -268,7 +268,8 @@
                 /* tell that the id have been processed */
                 qmp->wait_for_id = 0;
             }
-            SIMPLEQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
+            LIBXL_STAILQ_REMOVE(
+                &qmp->callback_list, pp, callback_id_pair, next);
             free(pp);
         }
         return 0;
@@ -302,7 +303,7 @@
     qmp->domid = domid;
     qmp->timeout = 5;
 
-    SIMPLEQ_INIT(&qmp->callback_list);
+    LIBXL_STAILQ_INIT(&qmp->callback_list);
 
     return qmp;
 }
@@ -353,7 +354,7 @@
     callback_id_pair *tmp = NULL;
 
     close(qmp->qmp_fd);
-    SIMPLEQ_FOREACH(pp, &qmp->callback_list, next) {
+    LIBXL_STAILQ_FOREACH(pp, &qmp->callback_list, next) {
         if (tmp)
             free(tmp);
         tmp = pp;
@@ -493,7 +494,7 @@
     elm->callback = callback;
     elm->opaque = opaque;
     elm->context = context;
-    SIMPLEQ_INSERT_TAIL(&qmp->callback_list, elm, next);
+    LIBXL_STAILQ_INSERT_TAIL(&qmp->callback_list, elm, next);
 
     ret = libxl__strndup(gc, (const char*)buf, len);
 

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

From xen-changelog-bounces@lists.xensource.com Sun Jan 22 03:33:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jan 2012 03:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RooBC-0004DF-Jl; Sun, 22 Jan 2012 03:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooBB-0004D0-6D
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327203189!11877530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25019 invoked from network); 22 Jan 2012 03:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2012 03:33:10 -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 1RooB3-0005AR-JS
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooB3-0008KJ-8z
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Message-Id: <E1RooB3-0008KJ-8z@xenbits.xen.org>
Date: Sun, 22 Jan 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: Update rmb/wmb for x86.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327166077 0
# Node ID 475d73479663b7bf85da84a7794df762aa2289a3
# Parent  7f71f0b4b8e66d2c4c95ae7419cd8fb858d6b3df
libxc: Update rmb/wmb for x86.

Only the compiler needs to see the barriers; not the CPU.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 7f71f0b4b8e6 -r 475d73479663 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Sat Jan 21 16:47:00 2012 +0000
+++ b/tools/libxc/xenctrl.h	Sat Jan 21 17:14:37 2012 +0000
@@ -69,14 +69,16 @@
  *  DEFINITIONS FOR CPU BARRIERS
  */
 
+#define xen_barrier() asm volatile ( "" : : : "memory")
+
 #if defined(__i386__)
 #define xen_mb()  asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define xen_rmb() asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define xen_wmb() asm volatile ( "" : : : "memory")
+#define xen_rmb() xen_barrier()
+#define xen_wmb() xen_barrier()
 #elif defined(__x86_64__)
 #define xen_mb()  asm volatile ( "mfence" : : : "memory")
-#define xen_rmb() asm volatile ( "lfence" : : : "memory")
-#define xen_wmb() asm volatile ( "" : : : "memory")
+#define xen_rmb() xen_barrier()
+#define xen_wmb() xen_barrier()
 #elif defined(__ia64__)
 #define xen_mb()   asm volatile ("mf" ::: "memory")
 #define xen_rmb()  asm volatile ("mf" ::: "memory")

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

From xen-changelog-bounces@lists.xensource.com Sun Jan 22 03:33:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jan 2012 03:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1RooBC-0004DF-Jl; Sun, 22 Jan 2012 03:33:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooBB-0004D0-6D
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327203189!11877530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25019 invoked from network); 22 Jan 2012 03:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2012 03:33:10 -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 1RooB3-0005AR-JS
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RooB3-0008KJ-8z
	for xen-changelog@lists.xensource.com; Sun, 22 Jan 2012 03:33:09 +0000
Message-Id: <E1RooB3-0008KJ-8z@xenbits.xen.org>
Date: Sun, 22 Jan 2012 03:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: Update rmb/wmb for x86.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327166077 0
# Node ID 475d73479663b7bf85da84a7794df762aa2289a3
# Parent  7f71f0b4b8e66d2c4c95ae7419cd8fb858d6b3df
libxc: Update rmb/wmb for x86.

Only the compiler needs to see the barriers; not the CPU.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 7f71f0b4b8e6 -r 475d73479663 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Sat Jan 21 16:47:00 2012 +0000
+++ b/tools/libxc/xenctrl.h	Sat Jan 21 17:14:37 2012 +0000
@@ -69,14 +69,16 @@
  *  DEFINITIONS FOR CPU BARRIERS
  */
 
+#define xen_barrier() asm volatile ( "" : : : "memory")
+
 #if defined(__i386__)
 #define xen_mb()  asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define xen_rmb() asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
-#define xen_wmb() asm volatile ( "" : : : "memory")
+#define xen_rmb() xen_barrier()
+#define xen_wmb() xen_barrier()
 #elif defined(__x86_64__)
 #define xen_mb()  asm volatile ( "mfence" : : : "memory")
-#define xen_rmb() asm volatile ( "lfence" : : : "memory")
-#define xen_wmb() asm volatile ( "" : : : "memory")
+#define xen_rmb() xen_barrier()
+#define xen_wmb() xen_barrier()
 #elif defined(__ia64__)
 #define xen_mb()   asm volatile ("mf" ::: "memory")
 #define xen_rmb()  asm volatile ("mf" ::: "memory")

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQP9-0005yJ-Db; Mon, 23 Jan 2012 20:22:15 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP8-0005xv-HY
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327349999!49753104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18978 invoked from network); 23 Jan 2012 20:20:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:20:00 -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 1RpQP2-0001OA-Pw
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP2-0000iy-Ce
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:08 +0000
Message-Id: <E1RpQP2-0000iy-Ce@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: No need to
	arch_set_info_guest() before restoring per-vcpu HVM state.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327227603 0
# Node ID eca719b621a1201528bfec25fb1786ec21c0c9d3
# Parent  80fdf2182bc62ca358ba2f1a3513b47a4f8d9dfd
x86/hvm: No need to arch_set_info_guest() before restoring per-vcpu HVM state.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 80fdf2182bc6 -r eca719b621a1 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/arch/x86/domain.c	Sun Jan 22 10:20:03 2012 +0000
@@ -709,13 +709,7 @@
 #undef xen_vcpu_guest_context
 #endif
 
-/*
- * This is called by do_domctl(XEN_DOMCTL_setvcpucontext, ...), boot_vcpu(),
- * and hvm_load_cpu_ctxt().
- *
- * Note that for a HVM guest NULL may be passed for the context pointer,
- * meaning "use current values".
- */
+/* Called by XEN_DOMCTL_setvcpucontext and VCPUOP_initialise. */
 int arch_set_info_guest(
     struct vcpu *v, vcpu_guest_context_u c)
 {
@@ -735,7 +729,7 @@
 #else
 #define c(fld) (c.nat->fld)
 #endif
-    flags = c.nat ? c(flags) : v->arch.vgc_flags;
+    flags = c(flags);
 
     if ( !is_hvm_vcpu(v) )
     {
@@ -791,28 +785,25 @@
 
     v->arch.vgc_flags = flags;
 
-    if ( c.nat )
+    memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+    if ( !compat )
     {
-        memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
-        if ( !compat )
-        {
-            memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs));
-            if ( !is_hvm_vcpu(v) )
-                memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt,
-                       sizeof(c.nat->trap_ctxt));
-        }
+        memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs));
+        if ( !is_hvm_vcpu(v) )
+            memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt,
+                   sizeof(c.nat->trap_ctxt));
+    }
 #ifdef CONFIG_COMPAT
-        else
-        {
-            XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs);
-            for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
-                XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
-                               c.cmp->trap_ctxt + i);
-        }
+    else
+    {
+        XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs);
+        for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
+            XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
+                           c.cmp->trap_ctxt + i);
+    }
 #endif
-        for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
-            v->arch.debugreg[i] = c(debugreg[i]);
-    }
+    for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
+        v->arch.debugreg[i] = c(debugreg[i]);
 
     v->arch.user_regs.eflags |= 2;
 
diff -r 80fdf2182bc6 -r eca719b621a1 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Sun Jan 22 10:20:03 2012 +0000
@@ -670,7 +670,7 @@
 
 static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 {
-    int vcpuid, rc;
+    int vcpuid;
     struct vcpu *v;
     struct hvm_hw_cpu ctxt;
     struct segment_register seg;
@@ -684,11 +684,6 @@
         return -EINVAL;
     }
 
-    /* Need to init this vcpu before loading its contents */
-    rc = boot_vcpu(d, vcpuid, NULL);
-    if ( (rc != 0) && (rc != -EEXIST) )
-        return rc;
-
     if ( hvm_load_entry(CPU, h, &ctxt) != 0 ) 
         return -EINVAL;
 
diff -r 80fdf2182bc6 -r eca719b621a1 xen/common/compat/domain.c
--- a/xen/common/compat/domain.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/common/compat/domain.c	Sun Jan 22 10:20:03 2012 +0000
@@ -46,7 +46,9 @@
             break;
         }
 
-        rc = boot_vcpu(d, vcpuid, cmp_ctxt);
+        domain_lock(d);
+        rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, cmp_ctxt);
+        domain_unlock(d);
 
         xfree(cmp_ctxt);
         break;
diff -r 80fdf2182bc6 -r eca719b621a1 xen/common/domain.c
--- a/xen/common/domain.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/common/domain.c	Sun Jan 22 10:20:03 2012 +0000
@@ -778,18 +778,6 @@
         domain_unpause(d);
 }
 
-int boot_vcpu(struct domain *d, int vcpuid, vcpu_guest_context_u ctxt)
-{
-    struct vcpu *v = d->vcpu[vcpuid];
-    int rc;
-
-    domain_lock(d);
-    rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt);
-    domain_unlock(d);
-
-    return rc;
-}
-
 void vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -847,7 +835,9 @@
             return -EFAULT;
         }
 
-        rc = boot_vcpu(d, vcpuid, ctxt);
+        domain_lock(d);
+        rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt);
+        domain_unlock(d);
 
         free_vcpu_guest_context(ctxt);
         break;
diff -r 80fdf2182bc6 -r eca719b621a1 xen/include/xen/domain.h
--- a/xen/include/xen/domain.h	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/include/xen/domain.h	Sun Jan 22 10:20:03 2012 +0000
@@ -12,8 +12,6 @@
 
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
-int boot_vcpu(
-    struct domain *d, int vcpuid, vcpu_guest_context_u ctxt);
 struct vcpu *alloc_dom0_vcpu0(void);
 void vcpu_reset(struct vcpu *v);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQP9-0005yJ-Db; Mon, 23 Jan 2012 20:22:15 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP8-0005xv-HY
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327349999!49753104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18978 invoked from network); 23 Jan 2012 20:20:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:20:00 -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 1RpQP2-0001OA-Pw
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP2-0000iy-Ce
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:08 +0000
Message-Id: <E1RpQP2-0000iy-Ce@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: No need to
	arch_set_info_guest() before restoring per-vcpu HVM state.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327227603 0
# Node ID eca719b621a1201528bfec25fb1786ec21c0c9d3
# Parent  80fdf2182bc62ca358ba2f1a3513b47a4f8d9dfd
x86/hvm: No need to arch_set_info_guest() before restoring per-vcpu HVM state.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 80fdf2182bc6 -r eca719b621a1 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/arch/x86/domain.c	Sun Jan 22 10:20:03 2012 +0000
@@ -709,13 +709,7 @@
 #undef xen_vcpu_guest_context
 #endif
 
-/*
- * This is called by do_domctl(XEN_DOMCTL_setvcpucontext, ...), boot_vcpu(),
- * and hvm_load_cpu_ctxt().
- *
- * Note that for a HVM guest NULL may be passed for the context pointer,
- * meaning "use current values".
- */
+/* Called by XEN_DOMCTL_setvcpucontext and VCPUOP_initialise. */
 int arch_set_info_guest(
     struct vcpu *v, vcpu_guest_context_u c)
 {
@@ -735,7 +729,7 @@
 #else
 #define c(fld) (c.nat->fld)
 #endif
-    flags = c.nat ? c(flags) : v->arch.vgc_flags;
+    flags = c(flags);
 
     if ( !is_hvm_vcpu(v) )
     {
@@ -791,28 +785,25 @@
 
     v->arch.vgc_flags = flags;
 
-    if ( c.nat )
+    memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+    if ( !compat )
     {
-        memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
-        if ( !compat )
-        {
-            memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs));
-            if ( !is_hvm_vcpu(v) )
-                memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt,
-                       sizeof(c.nat->trap_ctxt));
-        }
+        memcpy(&v->arch.user_regs, &c.nat->user_regs, sizeof(c.nat->user_regs));
+        if ( !is_hvm_vcpu(v) )
+            memcpy(v->arch.pv_vcpu.trap_ctxt, c.nat->trap_ctxt,
+                   sizeof(c.nat->trap_ctxt));
+    }
 #ifdef CONFIG_COMPAT
-        else
-        {
-            XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs);
-            for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
-                XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
-                               c.cmp->trap_ctxt + i);
-        }
+    else
+    {
+        XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs);
+        for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
+            XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
+                           c.cmp->trap_ctxt + i);
+    }
 #endif
-        for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
-            v->arch.debugreg[i] = c(debugreg[i]);
-    }
+    for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
+        v->arch.debugreg[i] = c(debugreg[i]);
 
     v->arch.user_regs.eflags |= 2;
 
diff -r 80fdf2182bc6 -r eca719b621a1 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Sun Jan 22 10:20:03 2012 +0000
@@ -670,7 +670,7 @@
 
 static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 {
-    int vcpuid, rc;
+    int vcpuid;
     struct vcpu *v;
     struct hvm_hw_cpu ctxt;
     struct segment_register seg;
@@ -684,11 +684,6 @@
         return -EINVAL;
     }
 
-    /* Need to init this vcpu before loading its contents */
-    rc = boot_vcpu(d, vcpuid, NULL);
-    if ( (rc != 0) && (rc != -EEXIST) )
-        return rc;
-
     if ( hvm_load_entry(CPU, h, &ctxt) != 0 ) 
         return -EINVAL;
 
diff -r 80fdf2182bc6 -r eca719b621a1 xen/common/compat/domain.c
--- a/xen/common/compat/domain.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/common/compat/domain.c	Sun Jan 22 10:20:03 2012 +0000
@@ -46,7 +46,9 @@
             break;
         }
 
-        rc = boot_vcpu(d, vcpuid, cmp_ctxt);
+        domain_lock(d);
+        rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, cmp_ctxt);
+        domain_unlock(d);
 
         xfree(cmp_ctxt);
         break;
diff -r 80fdf2182bc6 -r eca719b621a1 xen/common/domain.c
--- a/xen/common/domain.c	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/common/domain.c	Sun Jan 22 10:20:03 2012 +0000
@@ -778,18 +778,6 @@
         domain_unpause(d);
 }
 
-int boot_vcpu(struct domain *d, int vcpuid, vcpu_guest_context_u ctxt)
-{
-    struct vcpu *v = d->vcpu[vcpuid];
-    int rc;
-
-    domain_lock(d);
-    rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt);
-    domain_unlock(d);
-
-    return rc;
-}
-
 void vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -847,7 +835,9 @@
             return -EFAULT;
         }
 
-        rc = boot_vcpu(d, vcpuid, ctxt);
+        domain_lock(d);
+        rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, ctxt);
+        domain_unlock(d);
 
         free_vcpu_guest_context(ctxt);
         break;
diff -r 80fdf2182bc6 -r eca719b621a1 xen/include/xen/domain.h
--- a/xen/include/xen/domain.h	Sat Jan 21 17:15:40 2012 +0000
+++ b/xen/include/xen/domain.h	Sun Jan 22 10:20:03 2012 +0000
@@ -12,8 +12,6 @@
 
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
-int boot_vcpu(
-    struct domain *d, int vcpuid, vcpu_guest_context_u ctxt);
 struct vcpu *alloc_dom0_vcpu0(void);
 void vcpu_reset(struct vcpu *v);
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPD-0005zM-Ll; Mon, 23 Jan 2012 20:22:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPC-0005y0-0N
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327350001!49753107!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19195 invoked from network); 23 Jan 2012 20:20:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:20:02 -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 1RpQP4-0001OM-Mw
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP4-0000kk-Hi
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Message-Id: <E1RpQP4-0000kk-Hi@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Make the escape code
	consistent across 32 and 64-bit xen
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327311414 0
# Node ID 5bb22a6871f6c2a0dcd8573135abdf8c91af6f17
# Parent  3c0a533d3af06839ef3d90d67b01171498d9e572
xenoprof: Make the escape code consistent across 32 and 64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3c0a533d3af0 -r 5bb22a6871f6 xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Mon Jan 23 09:36:29 2012 +0000
+++ b/xen/include/public/xenoprof.h	Mon Jan 23 09:36:54 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE ~0UL
+#define XENOPROF_ESCAPE_CODE (~0ULL)
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPD-0005zM-Ll; Mon, 23 Jan 2012 20:22:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPC-0005y0-0N
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327350001!49753107!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19195 invoked from network); 23 Jan 2012 20:20:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:20:02 -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 1RpQP4-0001OM-Mw
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP4-0000kk-Hi
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Message-Id: <E1RpQP4-0000kk-Hi@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Make the escape code
	consistent across 32 and 64-bit xen
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327311414 0
# Node ID 5bb22a6871f6c2a0dcd8573135abdf8c91af6f17
# Parent  3c0a533d3af06839ef3d90d67b01171498d9e572
xenoprof: Make the escape code consistent across 32 and 64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3c0a533d3af0 -r 5bb22a6871f6 xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Mon Jan 23 09:36:29 2012 +0000
+++ b/xen/include/public/xenoprof.h	Mon Jan 23 09:36:54 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE ~0UL
+#define XENOPROF_ESCAPE_CODE (~0ULL)
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPD-0005zR-OH; Mon, 23 Jan 2012 20:22:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPC-0005y2-A2
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327350130!12090031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18336 invoked from network); 23 Jan 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:11 -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 1RpQP3-0001OG-OG
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP3-0000jt-Gm
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Message-Id: <E1RpQP3-0000jt-Gm@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Adjust indentation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327311361 0
# Node ID 212cf37d50e13e4f13bb6e239d1c3e1808bcfdfd
# Parent  fb81b807c1540eb5797b3daa4bddff99363b20ef
xenoprof: Adjust indentation

Bring indentation into Xen hypervisor standard coding style.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r fb81b807c154 -r 212cf37d50e1 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:35:17 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:36:01 2012 +0000
@@ -16,48 +16,48 @@
 #include<asm/guest_access.h>
 
 struct frame_head {
-	struct frame_head * ebp;
-	unsigned long ret;
+    struct frame_head * ebp;
+    unsigned long ret;
 } __attribute__((packed));
 
 static struct frame_head *
 dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
 			  struct frame_head * head, int mode)
 {
-	if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
-		return 0;
-
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= head->ebp)
-		return NULL;
-
-	return head->ebp;
+    if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= head->ebp)
+        return NULL;
+    
+    return head->ebp;
 }
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
 		     struct frame_head * head, int mode)
 {
-	struct frame_head bufhead[2];
-	XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
+    struct frame_head bufhead[2];
+    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
 	
-	/* Also check accessibility of one struct frame_head beyond */
-	if (!guest_handle_okay(guest_head, sizeof(bufhead)))
-		return 0;
-	if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-	    sizeof(bufhead)))
-		return 0;
-
-	if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
-	    return 0;
-
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= bufhead[0].ebp)
-		return NULL;
-
-	return bufhead[0].ebp;
+    /* Also check accessibility of one struct frame_head beyond */
+    if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+        return 0;
+    if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
+                                 sizeof(bufhead)))
+        return 0;
+    
+    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= bufhead[0].ebp)
+        return NULL;
+    
+    return bufhead[0].ebp;
 }
 
 /*
@@ -94,22 +94,22 @@
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	unsigned long headaddr = (unsigned long)head;
+    unsigned long headaddr = (unsigned long)head;
 #ifdef CONFIG_X86_64
-	unsigned long stack = (unsigned long)regs->rsp;
+    unsigned long stack = (unsigned long)regs->rsp;
 #else
-	unsigned long stack = (unsigned long)regs;
+    unsigned long stack = (unsigned long)regs;
 #endif
-	unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
+    unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
 
-	return headaddr > stack && headaddr < stack_base;
+    return headaddr > stack && headaddr < stack_base;
 }
 #else
 /* without fp, it's just junk */
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	return 0;
+    return 0;
 }
 #endif
 
@@ -117,16 +117,16 @@
 			struct cpu_user_regs * const regs,
 			unsigned long depth, int mode)
 {
-	struct frame_head *head;
+    struct frame_head *head;
 
-	head = (struct frame_head *)regs->ebp;
+    head = (struct frame_head *)regs->ebp;
 
-	if (mode > 1) {
-		while (depth-- && valid_hypervisor_stack(head, regs))
-		    head = dump_hypervisor_backtrace(d, vcpu, head, mode);
-		return;
-	}
+    if (mode > 1) {
+        while (depth-- && valid_hypervisor_stack(head, regs))
+            head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+        return;
+    }
 
-	while (depth-- && head)
-	    head = dump_guest_backtrace(d, vcpu, head, mode);
+    while (depth-- && head)
+        head = dump_guest_backtrace(d, vcpu, head, mode);
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPD-0005zR-OH; Mon, 23 Jan 2012 20:22:19 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPC-0005y2-A2
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327350130!12090031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18336 invoked from network); 23 Jan 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:11 -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 1RpQP3-0001OG-OG
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP3-0000jt-Gm
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Message-Id: <E1RpQP3-0000jt-Gm@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Adjust indentation
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327311361 0
# Node ID 212cf37d50e13e4f13bb6e239d1c3e1808bcfdfd
# Parent  fb81b807c1540eb5797b3daa4bddff99363b20ef
xenoprof: Adjust indentation

Bring indentation into Xen hypervisor standard coding style.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r fb81b807c154 -r 212cf37d50e1 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:35:17 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:36:01 2012 +0000
@@ -16,48 +16,48 @@
 #include<asm/guest_access.h>
 
 struct frame_head {
-	struct frame_head * ebp;
-	unsigned long ret;
+    struct frame_head * ebp;
+    unsigned long ret;
 } __attribute__((packed));
 
 static struct frame_head *
 dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
 			  struct frame_head * head, int mode)
 {
-	if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
-		return 0;
-
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= head->ebp)
-		return NULL;
-
-	return head->ebp;
+    if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= head->ebp)
+        return NULL;
+    
+    return head->ebp;
 }
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
 		     struct frame_head * head, int mode)
 {
-	struct frame_head bufhead[2];
-	XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
+    struct frame_head bufhead[2];
+    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
 	
-	/* Also check accessibility of one struct frame_head beyond */
-	if (!guest_handle_okay(guest_head, sizeof(bufhead)))
-		return 0;
-	if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-	    sizeof(bufhead)))
-		return 0;
-
-	if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
-	    return 0;
-
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= bufhead[0].ebp)
-		return NULL;
-
-	return bufhead[0].ebp;
+    /* Also check accessibility of one struct frame_head beyond */
+    if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+        return 0;
+    if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
+                                 sizeof(bufhead)))
+        return 0;
+    
+    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= bufhead[0].ebp)
+        return NULL;
+    
+    return bufhead[0].ebp;
 }
 
 /*
@@ -94,22 +94,22 @@
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	unsigned long headaddr = (unsigned long)head;
+    unsigned long headaddr = (unsigned long)head;
 #ifdef CONFIG_X86_64
-	unsigned long stack = (unsigned long)regs->rsp;
+    unsigned long stack = (unsigned long)regs->rsp;
 #else
-	unsigned long stack = (unsigned long)regs;
+    unsigned long stack = (unsigned long)regs;
 #endif
-	unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
+    unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
 
-	return headaddr > stack && headaddr < stack_base;
+    return headaddr > stack && headaddr < stack_base;
 }
 #else
 /* without fp, it's just junk */
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	return 0;
+    return 0;
 }
 #endif
 
@@ -117,16 +117,16 @@
 			struct cpu_user_regs * const regs,
 			unsigned long depth, int mode)
 {
-	struct frame_head *head;
+    struct frame_head *head;
 
-	head = (struct frame_head *)regs->ebp;
+    head = (struct frame_head *)regs->ebp;
 
-	if (mode > 1) {
-		while (depth-- && valid_hypervisor_stack(head, regs))
-		    head = dump_hypervisor_backtrace(d, vcpu, head, mode);
-		return;
-	}
+    if (mode > 1) {
+        while (depth-- && valid_hypervisor_stack(head, regs))
+            head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+        return;
+    }
 
-	while (depth-- && head)
-	    head = dump_guest_backtrace(d, vcpu, head, mode);
+    while (depth-- && head)
+        head = dump_guest_backtrace(d, vcpu, head, mode);
 }

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPC-0005z5-Iw; Mon, 23 Jan 2012 20:22:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPB-0005xy-NN
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1327350130!12228833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13099 invoked from network); 23 Jan 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:11 -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 1RpQP4-0001OJ-6R
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP4-0000kK-1j
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Message-Id: <E1RpQP4-0000kK-1j@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Handle 32-bit guest stacks
	properly in a 64-bit hypervisor
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327311389 0
# Node ID 3c0a533d3af06839ef3d90d67b01171498d9e572
# Parent  212cf37d50e13e4f13bb6e239d1c3e1808bcfdfd
xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor

The dump_guest_backtrace() function attempted to walk the stack
based on the assumption that the guest and hypervisor pointer sizes
were the same; thus any 32-bit guest running under 64-bit hypervisor
would have unreliable results.

In 64-bit mode, read the 32-bit stack frame properly.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 212cf37d50e1 -r 3c0a533d3af0 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:36:01 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:36:29 2012 +0000
@@ -20,6 +20,13 @@
     unsigned long ret;
 } __attribute__((packed));
 
+#ifdef CONFIG_X86_64
+struct frame_head_32bit {
+    uint32_t ebp;
+    unsigned long ret;
+} __attribute__((packed));
+#endif
+
 static struct frame_head *
 dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
 			  struct frame_head * head, int mode)
@@ -35,19 +42,46 @@
     return head->ebp;
 }
 
+#ifdef CONFIG_X86_64
+static inline int is_32bit_vcpu(struct vcpu *vcpu)
+{
+    if (is_hvm_vcpu(vcpu))
+        return !hvm_long_mode_enabled(vcpu);
+    else
+        return is_pv_32bit_vcpu(vcpu);
+}
+#endif
+
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
 		     struct frame_head * head, int mode)
 {
     struct frame_head bufhead[2];
     XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
-	
-    /* Also check accessibility of one struct frame_head beyond */
-    if (!guest_handle_okay(guest_head, sizeof(bufhead)))
-        return 0;
-    if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-                                 sizeof(bufhead)))
-        return 0;
+
+#ifdef CONFIG_X86_64
+    if ( is_32bit_vcpu(vcpu) )
+    {
+        struct frame_head_32bit bufhead32[2];
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
+                                     sizeof(bufhead32)))
+            return 0;
+        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
+        bufhead[0].ret=bufhead32[0].ret;
+    }
+    else
+#endif
+    {
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
+                                     sizeof(bufhead)))
+            return 0;
+    }
     
     if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
         return 0;

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPC-0005yu-GO; Mon, 23 Jan 2012 20:22:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPB-0005xx-84
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1327350129!13595284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23960 invoked from network); 23 Jan 2012 20:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:10 -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 1RpQP3-0001OD-8C
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP3-0000jS-0D
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Message-Id: <E1RpQP3-0000jS-0D@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vMSI: miscellaneous fixes
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327311317 0
# Node ID fb81b807c1540eb5797b3daa4bddff99363b20ef
# Parent  eca719b621a1201528bfec25fb1786ec21c0c9d3
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r eca719b621a1 -r fb81b807c154 xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/arch/x86/hvm/vmsi.c	Mon Jan 23 09:35:17 2012 +0000
@@ -165,7 +165,7 @@
     struct pci_dev *pdev;
     unsigned long gtable;       /* gpa of msix table */
     unsigned long table_len;
-    unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1];
+    unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)];
 #define MAX_MSIX_ACC_ENTRIES 3
     struct { 
         uint32_t msi_ad[3];	/* Shadow of address low, high and data */
@@ -192,17 +192,14 @@
 static void __iomem *msixtbl_addr_to_virt(
     struct msixtbl_entry *entry, unsigned long addr)
 {
-    int idx, nr_page;
+    unsigned int idx, nr_page;
 
-    if ( !entry )
+    if ( !entry || !entry->pdev )
         return NULL;
 
     nr_page = (addr >> PAGE_SHIFT) -
               (entry->gtable >> PAGE_SHIFT);
 
-    if ( !entry->pdev )
-        return NULL;
-
     idx = entry->pdev->msix_table_idx[nr_page];
     if ( !idx )
         return NULL;
@@ -215,37 +212,34 @@
     struct vcpu *v, unsigned long address,
     unsigned long len, unsigned long *pval)
 {
-    unsigned long offset, val;
+    unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
+    entry = msixtbl_find_entry(v, address);
+    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
 
-    entry = msixtbl_find_entry(v, address);
-    virt = msixtbl_addr_to_virt(entry, address);
-    if ( !virt )
-        goto out;
-
-    nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
-    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
-    if ( nr_entry >= MAX_MSIX_ACC_ENTRIES && 
-         offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
-        goto out;
-
-    val = readl(virt);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
     {
+        nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
+        if ( nr_entry >= MAX_MSIX_ACC_ENTRIES )
+            goto out;
         index = offset / sizeof(uint32_t);
         *pval = entry->gentries[nr_entry].msi_ad[index];
     }
     else 
     {
-        *pval = val;
+        virt = msixtbl_addr_to_virt(entry, address);
+        if ( !virt )
+            goto out;
+        *pval = readl(virt);
     }
     
     r = X86EMUL_OKAY;
@@ -260,14 +254,14 @@
     unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
-
     entry = msixtbl_find_entry(v, address);
     nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
@@ -291,9 +285,22 @@
     if ( !virt )
         goto out;
 
+    /* Do not allow the mask bit to be changed. */
+#if 0 /* XXX
+       * As the mask bit is the only defined bit in the word, and as the
+       * host MSI-X code doesn't preserve the other bits anyway, doing
+       * this is pointless. So for now just discard the write (also
+       * saving us from having to determine the matching irq_desc).
+       */
+    spin_lock_irqsave(&desc->lock, flags);
+    orig = readl(virt);
+    val &= ~PCI_MSIX_VECTOR_BITMASK;
+    val |= orig & PCI_MSIX_VECTOR_BITMASK;
     writel(val, virt);
+    spin_unlock_irqrestore(&desc->lock, flags);
+#endif
+
     r = X86EMUL_OKAY;
-
 out:
     rcu_read_unlock(&msixtbl_rcu_lock);
     return r;
diff -r eca719b621a1 -r fb81b807c154 xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/include/asm-x86/msi.h	Mon Jan 23 09:35:17 2012 +0000
@@ -122,12 +122,6 @@
  */
 #define NR_HP_RESERVED_VECTORS 	20
 
-#define PCI_MSIX_ENTRY_SIZE			16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
-#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
-
 #define msi_control_reg(base)		(base + PCI_MSI_FLAGS)
 #define msi_lower_address_reg(base)	(base + PCI_MSI_ADDRESS_LO)
 #define msi_upper_address_reg(base)	(base + PCI_MSI_ADDRESS_HI)
diff -r eca719b621a1 -r fb81b807c154 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/include/xen/pci.h	Mon Jan 23 09:35:17 2012 +0000
@@ -11,6 +11,8 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/irq.h>
+#include <xen/pci_regs.h>
+#include <xen/pfn.h>
 #include <asm/pci.h>
 
 /*
@@ -30,8 +32,10 @@
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
 
-#define MAX_MSIX_TABLE_ENTRIES  2048
-#define MAX_MSIX_TABLE_PAGES    8
+#define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+                                       PCI_MSIX_ENTRY_SIZE + \
+                                       (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1)))
 struct pci_dev_info {
     bool_t is_extfn;
     bool_t is_virtfn;
diff -r eca719b621a1 -r fb81b807c154 xen/include/xen/pci_regs.h
--- a/xen/include/xen/pci_regs.h	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/include/xen/pci_regs.h	Mon Jan 23 09:35:17 2012 +0000
@@ -305,6 +305,12 @@
 #define PCI_MSIX_PBA		8
 #define  PCI_MSIX_BIRMASK	(7 << 0)
 
+#define PCI_MSIX_ENTRY_SIZE			16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
+#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
+
 #define PCI_MSIX_VECTOR_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPC-0005yu-GO; Mon, 23 Jan 2012 20:22:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPB-0005xx-84
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1327350129!13595284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23960 invoked from network); 23 Jan 2012 20:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:10 -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 1RpQP3-0001OD-8C
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP3-0000jS-0D
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:09 +0000
Message-Id: <E1RpQP3-0000jS-0D@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vMSI: miscellaneous fixes
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327311317 0
# Node ID fb81b807c1540eb5797b3daa4bddff99363b20ef
# Parent  eca719b621a1201528bfec25fb1786ec21c0c9d3
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r eca719b621a1 -r fb81b807c154 xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/arch/x86/hvm/vmsi.c	Mon Jan 23 09:35:17 2012 +0000
@@ -165,7 +165,7 @@
     struct pci_dev *pdev;
     unsigned long gtable;       /* gpa of msix table */
     unsigned long table_len;
-    unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1];
+    unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)];
 #define MAX_MSIX_ACC_ENTRIES 3
     struct { 
         uint32_t msi_ad[3];	/* Shadow of address low, high and data */
@@ -192,17 +192,14 @@
 static void __iomem *msixtbl_addr_to_virt(
     struct msixtbl_entry *entry, unsigned long addr)
 {
-    int idx, nr_page;
+    unsigned int idx, nr_page;
 
-    if ( !entry )
+    if ( !entry || !entry->pdev )
         return NULL;
 
     nr_page = (addr >> PAGE_SHIFT) -
               (entry->gtable >> PAGE_SHIFT);
 
-    if ( !entry->pdev )
-        return NULL;
-
     idx = entry->pdev->msix_table_idx[nr_page];
     if ( !idx )
         return NULL;
@@ -215,37 +212,34 @@
     struct vcpu *v, unsigned long address,
     unsigned long len, unsigned long *pval)
 {
-    unsigned long offset, val;
+    unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
+    entry = msixtbl_find_entry(v, address);
+    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
 
-    entry = msixtbl_find_entry(v, address);
-    virt = msixtbl_addr_to_virt(entry, address);
-    if ( !virt )
-        goto out;
-
-    nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
-    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
-    if ( nr_entry >= MAX_MSIX_ACC_ENTRIES && 
-         offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
-        goto out;
-
-    val = readl(virt);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
     {
+        nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
+        if ( nr_entry >= MAX_MSIX_ACC_ENTRIES )
+            goto out;
         index = offset / sizeof(uint32_t);
         *pval = entry->gentries[nr_entry].msi_ad[index];
     }
     else 
     {
-        *pval = val;
+        virt = msixtbl_addr_to_virt(entry, address);
+        if ( !virt )
+            goto out;
+        *pval = readl(virt);
     }
     
     r = X86EMUL_OKAY;
@@ -260,14 +254,14 @@
     unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
-
     entry = msixtbl_find_entry(v, address);
     nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
@@ -291,9 +285,22 @@
     if ( !virt )
         goto out;
 
+    /* Do not allow the mask bit to be changed. */
+#if 0 /* XXX
+       * As the mask bit is the only defined bit in the word, and as the
+       * host MSI-X code doesn't preserve the other bits anyway, doing
+       * this is pointless. So for now just discard the write (also
+       * saving us from having to determine the matching irq_desc).
+       */
+    spin_lock_irqsave(&desc->lock, flags);
+    orig = readl(virt);
+    val &= ~PCI_MSIX_VECTOR_BITMASK;
+    val |= orig & PCI_MSIX_VECTOR_BITMASK;
     writel(val, virt);
+    spin_unlock_irqrestore(&desc->lock, flags);
+#endif
+
     r = X86EMUL_OKAY;
-
 out:
     rcu_read_unlock(&msixtbl_rcu_lock);
     return r;
diff -r eca719b621a1 -r fb81b807c154 xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/include/asm-x86/msi.h	Mon Jan 23 09:35:17 2012 +0000
@@ -122,12 +122,6 @@
  */
 #define NR_HP_RESERVED_VECTORS 	20
 
-#define PCI_MSIX_ENTRY_SIZE			16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
-#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
-
 #define msi_control_reg(base)		(base + PCI_MSI_FLAGS)
 #define msi_lower_address_reg(base)	(base + PCI_MSI_ADDRESS_LO)
 #define msi_upper_address_reg(base)	(base + PCI_MSI_ADDRESS_HI)
diff -r eca719b621a1 -r fb81b807c154 xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/include/xen/pci.h	Mon Jan 23 09:35:17 2012 +0000
@@ -11,6 +11,8 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/irq.h>
+#include <xen/pci_regs.h>
+#include <xen/pfn.h>
 #include <asm/pci.h>
 
 /*
@@ -30,8 +32,10 @@
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
 
-#define MAX_MSIX_TABLE_ENTRIES  2048
-#define MAX_MSIX_TABLE_PAGES    8
+#define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+                                       PCI_MSIX_ENTRY_SIZE + \
+                                       (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1)))
 struct pci_dev_info {
     bool_t is_extfn;
     bool_t is_virtfn;
diff -r eca719b621a1 -r fb81b807c154 xen/include/xen/pci_regs.h
--- a/xen/include/xen/pci_regs.h	Sun Jan 22 10:20:03 2012 +0000
+++ b/xen/include/xen/pci_regs.h	Mon Jan 23 09:35:17 2012 +0000
@@ -305,6 +305,12 @@
 #define PCI_MSIX_PBA		8
 #define  PCI_MSIX_BIRMASK	(7 << 0)
 
+#define PCI_MSIX_ENTRY_SIZE			16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
+#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
+
 #define PCI_MSIX_VECTOR_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPC-0005z5-Iw; Mon, 23 Jan 2012 20:22:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPB-0005xy-NN
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1327350130!12228833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13099 invoked from network); 23 Jan 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:11 -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 1RpQP4-0001OJ-6R
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP4-0000kK-1j
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:10 +0000
Message-Id: <E1RpQP4-0000kK-1j@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Handle 32-bit guest stacks
	properly in a 64-bit hypervisor
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327311389 0
# Node ID 3c0a533d3af06839ef3d90d67b01171498d9e572
# Parent  212cf37d50e13e4f13bb6e239d1c3e1808bcfdfd
xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor

The dump_guest_backtrace() function attempted to walk the stack
based on the assumption that the guest and hypervisor pointer sizes
were the same; thus any 32-bit guest running under 64-bit hypervisor
would have unreliable results.

In 64-bit mode, read the 32-bit stack frame properly.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 212cf37d50e1 -r 3c0a533d3af0 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:36:01 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Mon Jan 23 09:36:29 2012 +0000
@@ -20,6 +20,13 @@
     unsigned long ret;
 } __attribute__((packed));
 
+#ifdef CONFIG_X86_64
+struct frame_head_32bit {
+    uint32_t ebp;
+    unsigned long ret;
+} __attribute__((packed));
+#endif
+
 static struct frame_head *
 dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
 			  struct frame_head * head, int mode)
@@ -35,19 +42,46 @@
     return head->ebp;
 }
 
+#ifdef CONFIG_X86_64
+static inline int is_32bit_vcpu(struct vcpu *vcpu)
+{
+    if (is_hvm_vcpu(vcpu))
+        return !hvm_long_mode_enabled(vcpu);
+    else
+        return is_pv_32bit_vcpu(vcpu);
+}
+#endif
+
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
 		     struct frame_head * head, int mode)
 {
     struct frame_head bufhead[2];
     XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
-	
-    /* Also check accessibility of one struct frame_head beyond */
-    if (!guest_handle_okay(guest_head, sizeof(bufhead)))
-        return 0;
-    if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-                                 sizeof(bufhead)))
-        return 0;
+
+#ifdef CONFIG_X86_64
+    if ( is_32bit_vcpu(vcpu) )
+    {
+        struct frame_head_32bit bufhead32[2];
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
+                                     sizeof(bufhead32)))
+            return 0;
+        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
+        bufhead[0].ret=bufhead32[0].ret;
+    }
+    else
+#endif
+    {
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
+                                     sizeof(bufhead)))
+            return 0;
+    }
     
     if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
         return 0;

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPH-00061d-5C; Mon, 23 Jan 2012 20:22:23 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPF-0005yV-Rx
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327350134!3018592!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8071 invoked from network); 23 Jan 2012 20:22:15 -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;
	23 Jan 2012 20:22:15 -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 1RpQP8-0001Ol-Af
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP8-0000nv-9T
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Message-Id: <E1RpQP8-0000nv-9T@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unlzo: fix input buffer free
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Sascha Hauer <s.hauer@pengutronix.de>
# Date 1327326662 -3600
# Node ID 9920641d11169a86ec9d0cb47e78414720545861
# Parent  137c16a83e4084b717a8a5685371800aeb313233
unlzo: fix input buffer free

unlzo modifies the pointer to in_buf, so we have to free the original
buffer, not the modified pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 137c16a83e40 -r 9920641d1116 xen/common/unlzo.c
--- a/xen/common/unlzo.c	Mon Jan 23 09:42:12 2012 +0000
+++ b/xen/common/unlzo.c	Mon Jan 23 14:51:02 2012 +0100
@@ -254,7 +254,7 @@
 	ret = 0;
 exit_2:
 	if (!input)
-		free(in_buf);
+		free(in_buf_save);
 exit_1:
 	if (!output)
 		free(out_buf);

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPH-00061d-5C; Mon, 23 Jan 2012 20:22:23 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPF-0005yV-Rx
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327350134!3018592!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8071 invoked from network); 23 Jan 2012 20:22:15 -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;
	23 Jan 2012 20:22:15 -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 1RpQP8-0001Ol-Af
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP8-0000nv-9T
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Message-Id: <E1RpQP8-0000nv-9T@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unlzo: fix input buffer free
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Sascha Hauer <s.hauer@pengutronix.de>
# Date 1327326662 -3600
# Node ID 9920641d11169a86ec9d0cb47e78414720545861
# Parent  137c16a83e4084b717a8a5685371800aeb313233
unlzo: fix input buffer free

unlzo modifies the pointer to in_buf, so we have to free the original
buffer, not the modified pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 137c16a83e40 -r 9920641d1116 xen/common/unlzo.c
--- a/xen/common/unlzo.c	Mon Jan 23 09:42:12 2012 +0000
+++ b/xen/common/unlzo.c	Mon Jan 23 14:51:02 2012 +0100
@@ -254,7 +254,7 @@
 	ret = 0;
 exit_2:
 	if (!input)
-		free(in_buf);
+		free(in_buf_save);
 exit_1:
 	if (!output)
 		free(out_buf);

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-000638-IS; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPH-0005yi-B0
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327350135!10337239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16868 invoked from network); 23 Jan 2012 20:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:17 -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 1RpQP9-0001Or-Bc
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP9-0000ol-AN
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:15 +0000
Message-Id: <E1RpQP9-0000ol-AN@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24538:5bb22a6871f6 "xenoprof:
	Make the escape code consistent across 32 and 64-bit xen"
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327331443 0
# Node ID 370924e204dc29e12cd807dd730974d6b2bc53d3
# Parent  cc9105fa55e0821023b43f179fb00fd4ee0da771
Revert 24538:5bb22a6871f6 "xenoprof: Make the escape code consistent across 32 and 64-bit xen"

Breaks 32-bit build.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r cc9105fa55e0 -r 370924e204dc xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Mon Jan 23 14:51:25 2012 +0100
+++ b/xen/include/public/xenoprof.h	Mon Jan 23 15:10:43 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE (~0ULL)
+#define XENOPROF_ESCAPE_CODE ~0UL
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-000638-IS; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPH-0005yi-B0
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1327350135!10337239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16868 invoked from network); 23 Jan 2012 20:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:17 -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 1RpQP9-0001Or-Bc
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP9-0000ol-AN
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:15 +0000
Message-Id: <E1RpQP9-0000ol-AN@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24538:5bb22a6871f6 "xenoprof:
	Make the escape code consistent across 32 and 64-bit xen"
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327331443 0
# Node ID 370924e204dc29e12cd807dd730974d6b2bc53d3
# Parent  cc9105fa55e0821023b43f179fb00fd4ee0da771
Revert 24538:5bb22a6871f6 "xenoprof: Make the escape code consistent across 32 and 64-bit xen"

Breaks 32-bit build.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r cc9105fa55e0 -r 370924e204dc xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Mon Jan 23 14:51:25 2012 +0100
+++ b/xen/include/public/xenoprof.h	Mon Jan 23 15:10:43 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE (~0ULL)
+#define XENOPROF_ESCAPE_CODE ~0UL
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-00062e-8I; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPF-0005yU-Pe
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327350133!12135230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 899 invoked from network); 23 Jan 2012 20:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP7-0001Oe-CD
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP7-0000n2-8w
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Message-Id: <E1RpQP7-0000n2-8w@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Introduce clear_user and clear_guest
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311687 0
# Node ID d6cdbc4fe0787adccc6194d9352fa950dd42e810
# Parent  37eefb79503cc36a5e3ca324744b06dffb4fb912
Introduce clear_user and clear_guest

Introduce clear_user for x86 and ia64, shamelessly taken from Linux.
The x86 version is the 32 bit clear_user implementation.  Introduce
clear_guest for x86 and ia64. The x86 implementation is based on
clear_user and a new clear_user_hvm function.  The ia64 implementation
is actually in xencomm and it is based on xencomm_copy_to_guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/ia64/linux/Makefile
--- a/xen/arch/ia64/linux/Makefile	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/ia64/linux/Makefile	Mon Jan 23 09:41:27 2012 +0000
@@ -4,6 +4,7 @@
 
 obj-y += bitop.o
 obj-y += clear_page.o
+obj-y += clear_user.o
 obj-y += copy_page_mck.o
 obj-y += efi_stub.o
 obj-y += extable.o
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/ia64/linux/README.origin
--- a/xen/arch/ia64/linux/README.origin	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/ia64/linux/README.origin	Mon Jan 23 09:41:27 2012 +0000
@@ -15,6 +15,7 @@
 
 bitop.c			-> linux/arch/ia64/lib/bitop.c
 clear_page.S		-> linux/arch/ia64/lib/clear_page.S
+clear_user.S		-> linux/arch/ia64/lib/clear_user.S
 copy_page_mck.S		-> linux/arch/ia64/lib/copy_page_mck.S
 flush.S			-> linux/arch/ia64/lib/flush.S
 idiv32.S		-> linux/arch/ia64/lib/idiv32.S
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/ia64/linux/clear_user.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/ia64/linux/clear_user.S	Mon Jan 23 09:41:27 2012 +0000
@@ -0,0 +1,209 @@
+/*
+ * This routine clears to zero a linear memory buffer in user space.
+ *
+ * Inputs:
+ *	in0:	address of buffer
+ *	in1:	length of buffer in bytes
+ * Outputs:
+ *	r8:	number of bytes that didn't get cleared due to a fault
+ *
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ *	Stephane Eranian <eranian@hpl.hp.com>
+ */
+
+#include <asm/asmmacro.h>
+
+//
+// arguments
+//
+#define buf		r32
+#define len		r33
+
+//
+// local registers
+//
+#define cnt		r16
+#define buf2		r17
+#define saved_lc	r18
+#define saved_pfs	r19
+#define tmp		r20
+#define len2		r21
+#define len3		r22
+
+//
+// Theory of operations:
+//	- we check whether or not the buffer is small, i.e., less than 17
+//	  in which case we do the byte by byte loop.
+//
+//	- Otherwise we go progressively from 1 byte store to 8byte store in
+//	  the head part, the body is a 16byte store loop and we finish we the
+//	  tail for the last 15 bytes.
+//	  The good point about this breakdown is that the long buffer handling
+//	  contains only 2 branches.
+//
+//	The reason for not using shifting & masking for both the head and the
+//	tail is to stay semantically correct. This routine is not supposed
+//	to write bytes outside of the buffer. While most of the time this would
+//	be ok, we can't tolerate a mistake. A classical example is the case
+//	of multithreaded code were to the extra bytes touched is actually owned
+//	by another thread which runs concurrently to ours. Another, less likely,
+//	example is with device drivers where reading an I/O mapped location may
+//	have side effects (same thing for writing).
+//
+
+GLOBAL_ENTRY(__do_clear_user)
+	.prologue
+	.save ar.pfs, saved_pfs
+	alloc	saved_pfs=ar.pfs,2,0,0,0
+	cmp.eq p6,p0=r0,len		// check for zero length
+	.save ar.lc, saved_lc
+	mov saved_lc=ar.lc		// preserve ar.lc (slow)
+	.body
+	;;				// avoid WAW on CFM
+	adds tmp=-1,len			// br.ctop is repeat/until
+	mov ret0=len			// return value is length at this point
+(p6)	br.ret.spnt.many rp
+	;;
+	cmp.lt p6,p0=16,len		// if len > 16 then long memset
+	mov ar.lc=tmp			// initialize lc for small count
+(p6)	br.cond.dptk .long_do_clear
+	;;				// WAR on ar.lc
+	//
+	// worst case 16 iterations, avg 8 iterations
+	//
+	// We could have played with the predicates to use the extra
+	// M slot for 2 stores/iteration but the cost the initialization
+	// the various counters compared to how long the loop is supposed
+	// to last on average does not make this solution viable.
+	//
+1:
+	EX( .Lexit1, st1 [buf]=r0,1 )
+	adds len=-1,len			// countdown length using len
+	br.cloop.dptk 1b
+	;;				// avoid RAW on ar.lc
+	//
+	// .Lexit4: comes from byte by byte loop
+	//	    len contains bytes left
+.Lexit1:
+	mov ret0=len			// faster than using ar.lc
+	mov ar.lc=saved_lc
+	br.ret.sptk.many rp		// end of short clear_user
+
+
+	//
+	// At this point we know we have more than 16 bytes to copy
+	// so we focus on alignment (no branches required)
+	//
+	// The use of len/len2 for countdown of the number of bytes left
+	// instead of ret0 is due to the fact that the exception code
+	// changes the values of r8.
+	//
+.long_do_clear:
+	tbit.nz p6,p0=buf,0		// odd alignment (for long_do_clear)
+	;;
+	EX( .Lexit3, (p6) st1 [buf]=r0,1 )	// 1-byte aligned
+(p6)	adds len=-1,len;;		// sync because buf is modified
+	tbit.nz p6,p0=buf,1
+	;;
+	EX( .Lexit3, (p6) st2 [buf]=r0,2 )	// 2-byte aligned
+(p6)	adds len=-2,len;;
+	tbit.nz p6,p0=buf,2
+	;;
+	EX( .Lexit3, (p6) st4 [buf]=r0,4 )	// 4-byte aligned
+(p6)	adds len=-4,len;;
+	tbit.nz p6,p0=buf,3
+	;;
+	EX( .Lexit3, (p6) st8 [buf]=r0,8 )	// 8-byte aligned
+(p6)	adds len=-8,len;;
+	shr.u cnt=len,4		// number of 128-bit (2x64bit) words
+	;;
+	cmp.eq p6,p0=r0,cnt
+	adds tmp=-1,cnt
+(p6)	br.cond.dpnt .dotail		// we have less than 16 bytes left
+	;;
+	adds buf2=8,buf			// setup second base pointer
+	mov ar.lc=tmp
+	;;
+
+	//
+	// 16bytes/iteration core loop
+	//
+	// The second store can never generate a fault because
+	// we come into the loop only when we are 16-byte aligned.
+	// This means that if we cross a page then it will always be
+	// in the first store and never in the second.
+	//
+	//
+	// We need to keep track of the remaining length. A possible (optimistic)
+	// way would be to use ar.lc and derive how many byte were left by
+	// doing : left= 16*ar.lc + 16.  this would avoid the addition at
+	// every iteration.
+	// However we need to keep the synchronization point. A template
+	// M;;MB does not exist and thus we can keep the addition at no
+	// extra cycle cost (use a nop slot anyway). It also simplifies the
+	// (unlikely)  error recovery code
+	//
+
+2:	EX(.Lexit3, st8 [buf]=r0,16 )
+	;;				// needed to get len correct when error
+	st8 [buf2]=r0,16
+	adds len=-16,len
+	br.cloop.dptk 2b
+	;;
+	mov ar.lc=saved_lc
+	//
+	// tail correction based on len only
+	//
+	// We alternate the use of len3,len2 to allow parallelism and correct
+	// error handling. We also reuse p6/p7 to return correct value.
+	// The addition of len2/len3 does not cost anything more compared to
+	// the regular memset as we had empty slots.
+	//
+.dotail:
+	mov len2=len			// for parallelization of error handling
+	mov len3=len
+	tbit.nz p6,p0=len,3
+	;;
+	EX( .Lexit2, (p6) st8 [buf]=r0,8 )	// at least 8 bytes
+(p6)	adds len3=-8,len2
+	tbit.nz p7,p6=len,2
+	;;
+	EX( .Lexit2, (p7) st4 [buf]=r0,4 )	// at least 4 bytes
+(p7)	adds len2=-4,len3
+	tbit.nz p6,p7=len,1
+	;;
+	EX( .Lexit2, (p6) st2 [buf]=r0,2 )	// at least 2 bytes
+(p6)	adds len3=-2,len2
+	tbit.nz p7,p6=len,0
+	;;
+	EX( .Lexit2, (p7) st1 [buf]=r0 )	// only 1 byte left
+	mov ret0=r0				// success
+	br.ret.sptk.many rp			// end of most likely path
+
+	//
+	// Outlined error handling code
+	//
+
+	//
+	// .Lexit3: comes from core loop, need restore pr/lc
+	//	    len contains bytes left
+	//
+	//
+	// .Lexit2:
+	//	if p6 -> coming from st8 or st2 : len2 contains what's left
+	//	if p7 -> coming from st4 or st1 : len3 contains what's left
+	// We must restore lc/pr even though might not have been used.
+.Lexit2:
+	.pred.rel "mutex", p6, p7
+(p6)	mov len=len2
+(p7)	mov len=len3
+	;;
+	//
+	// .Lexit4: comes from head, need not restore pr/lc
+	//	    len contains bytes left
+	//
+.Lexit3:
+	mov ret0=len
+	mov ar.lc=saved_lc
+	br.ret.sptk.many rp
+END(__do_clear_user)
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Mon Jan 23 09:41:27 2012 +0000
@@ -2381,6 +2381,96 @@
     return HVMCOPY_okay;
 }
 
+static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
+{
+    struct vcpu *curr = current;
+    unsigned long gfn, mfn;
+    p2m_type_t p2mt;
+    char *p;
+    int count, todo = size;
+    uint32_t pfec = PFEC_page_present | PFEC_write_access;
+
+    /*
+     * XXX Disable for 4.1.0: PV-on-HVM drivers will do grant-table ops
+     * such as query_size. Grant-table code currently does copy_to/from_guest
+     * accesses under the big per-domain lock, which this test would disallow.
+     * The test is not needed until we implement sleeping-on-waitqueue when
+     * we access a paged-out frame, and that's post 4.1.0 now.
+     */
+#if 0
+    /*
+     * If the required guest memory is paged out, this function may sleep.
+     * Hence we bail immediately if called from atomic context.
+     */
+    if ( in_atomic() )
+        return HVMCOPY_unhandleable;
+#endif
+
+    while ( todo > 0 )
+    {
+        count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
+
+        gfn = paging_gva_to_gfn(curr, addr, &pfec);
+        if ( gfn == INVALID_GFN )
+        {
+            if ( pfec == PFEC_page_paged )
+                return HVMCOPY_gfn_paged_out;
+            if ( pfec == PFEC_page_shared )
+                return HVMCOPY_gfn_shared;
+            return HVMCOPY_bad_gva_to_gfn;
+        }
+
+        mfn = mfn_x(get_gfn_unshare(curr->domain, gfn, &p2mt));
+
+        if ( p2m_is_paging(p2mt) )
+        {
+            p2m_mem_paging_populate(curr->domain, gfn);
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_gfn_paged_out;
+        }
+        if ( p2m_is_shared(p2mt) )
+        {
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_gfn_shared;
+        }
+        if ( p2m_is_grant(p2mt) )
+        {
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_unhandleable;
+        }
+        if ( !p2m_is_ram(p2mt) )
+        {
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_bad_gfn_to_mfn;
+        }
+        ASSERT(mfn_valid(mfn));
+
+        p = (char *)map_domain_page(mfn) + (addr & ~PAGE_MASK);
+
+        if ( p2mt == p2m_ram_ro )
+        {
+            static unsigned long lastpage;
+            if ( xchg(&lastpage, gfn) != gfn )
+                gdprintk(XENLOG_DEBUG, "guest attempted write to read-only"
+                        " memory page. gfn=%#lx, mfn=%#lx\n",
+                        gfn, mfn);
+        }
+        else
+        {
+            memset(p, 0x00, count);
+            paging_mark_dirty(curr->domain, mfn);
+        }
+
+        unmap_domain_page(p);
+
+        addr += count;
+        todo -= count;
+        put_gfn(curr->domain, gfn);
+    }
+
+    return HVMCOPY_okay;
+}
+
 enum hvm_copy_result hvm_copy_to_guest_phys(
     paddr_t paddr, void *buf, int size)
 {
@@ -2467,6 +2557,23 @@
     return rc ? len : 0; /* fake a copy_to_user() return code */
 }
 
+unsigned long clear_user_hvm(void *to, unsigned int len)
+{
+    int rc;
+
+#ifdef __x86_64__
+    if ( !current->arch.hvm_vcpu.hcall_64bit &&
+         is_compat_arg_xlat_range(to, len) )
+    {
+        memset(to, 0x00, len);
+        return 0;
+    }
+#endif
+
+    rc = __hvm_clear((unsigned long)to, len);
+    return rc ? len : 0; /* fake a copy_to_user() return code */
+}
+
 unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len)
 {
     int rc;
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/x86/usercopy.c
--- a/xen/arch/x86/usercopy.c	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/x86/usercopy.c	Mon Jan 23 09:41:27 2012 +0000
@@ -110,6 +110,42 @@
     return n;
 }
 
+#define __do_clear_user(addr,size)					\
+do {									\
+	long __d0;							\
+	__asm__ __volatile__(						\
+		"0:	rep; stosl\n"					\
+		"	movl %2,%0\n"					\
+		"1:	rep; stosb\n"					\
+		"2:\n"							\
+		".section .fixup,\"ax\"\n"				\
+		"3:	lea 0(%2,%0,4),%0\n"				\
+		"	jmp 2b\n"					\
+		".previous\n"						\
+		_ASM_EXTABLE(0b,3b)					\
+		_ASM_EXTABLE(1b,2b)					\
+		: "=&c"(size), "=&D" (__d0)				\
+		: "r"(size & 3), "0"(size / 4), "1"((long)addr), "a"(0));	\
+} while (0)
+
+/**
+ * clear_user: - Zero a block of memory in user space.
+ * @to:   Destination address, in user space.
+ * @n:    Number of bytes to zero.
+ *
+ * Zero a block of memory in user space.
+ *
+ * Returns number of bytes that could not be cleared.
+ * On success, this will be zero.
+ */
+unsigned long
+clear_user(void __user *to, unsigned n)
+{
+	if ( access_ok(to, n) )
+		__do_clear_user(to, n);
+	return n;
+}
+
 /**
  * copy_from_user: - Copy a block of data from user space.
  * @to:   Destination address, in kernel space.
diff -r 37eefb79503c -r d6cdbc4fe078 xen/common/xencomm.c
--- a/xen/common/xencomm.c	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/common/xencomm.c	Mon Jan 23 09:41:27 2012 +0000
@@ -414,6 +414,117 @@
     return n - from_pos;
 }
 
+static int
+xencomm_clear_chunk(
+    unsigned long paddr, unsigned int  len)
+{
+    struct page_info *page;
+    int res;
+
+    do {
+        res = xencomm_get_page(paddr, &page);
+    } while ( res == -EAGAIN );
+
+    if ( res )
+        return res;
+
+    memset(xencomm_vaddr(paddr, page), 0x00, len);
+    xencomm_mark_dirty((unsigned long)xencomm_vaddr(paddr, page), len);
+    put_page(page);
+
+    return 0;
+}
+
+static unsigned long
+xencomm_inline_clear_guest(
+    void *to, unsigned int n, unsigned int skip)
+{
+    unsigned long dest_paddr = xencomm_inline_addr(to) + skip;
+
+    while ( n > 0 )
+    {
+        unsigned int chunksz, bytes;
+
+        chunksz = PAGE_SIZE - (dest_paddr % PAGE_SIZE);
+        bytes   = min(chunksz, n);
+
+        if ( xencomm_clear_chunk(dest_paddr, bytes) )
+            return n;
+        dest_paddr += bytes;
+        n -= bytes;
+    }
+
+    /* Always successful. */
+    return 0;
+}
+
+/**
+ * xencomm_clear_guest: Clear a block of data in domain space.
+ * @to:     Physical address to xencomm buffer descriptor.
+ * @n:      Number of bytes to copy.
+ * @skip: Number of bytes from the start to skip.
+ *
+ * Clear domain data
+ *
+ * Returns number of bytes that could not be cleared
+ * On success, this will be zero.
+ */
+unsigned long
+xencomm_clear_guest(
+    void *to, unsigned int n, unsigned int skip)
+{
+    struct xencomm_ctxt ctxt;
+    unsigned int from_pos = 0;
+    unsigned int to_pos = 0;
+    unsigned int i = 0;
+
+    if ( xencomm_is_inline(to) )
+        return xencomm_inline_clear_guest(to, n, skip);
+
+    if ( xencomm_ctxt_init(to, &ctxt) )
+        return n;
+
+    /* Iterate through the descriptor, copying up to a page at a time */
+    while ( (from_pos < n) && (i < xencomm_ctxt_nr_addrs(&ctxt)) )
+    {
+        unsigned long dest_paddr;
+        unsigned int pgoffset, chunksz, chunk_skip;
+
+        if ( xencomm_ctxt_next(&ctxt, i) )
+            goto out;
+        dest_paddr = *xencomm_ctxt_address(&ctxt);
+        if ( dest_paddr == XENCOMM_INVALID )
+        {
+            i++;
+            continue;
+        }
+
+        pgoffset = dest_paddr % PAGE_SIZE;
+        chunksz = PAGE_SIZE - pgoffset;
+
+        chunk_skip = min(chunksz, skip);
+        to_pos += chunk_skip;
+        chunksz -= chunk_skip;
+        skip -= chunk_skip;
+
+        if ( skip == 0 && chunksz > 0 )
+        {
+            unsigned int bytes = min(chunksz, n - from_pos);
+
+            if ( xencomm_clear_chunk(dest_paddr + chunk_skip, bytes) )
+                goto out;
+            from_pos += bytes;
+            to_pos += bytes;
+        }
+
+        i++;
+    }
+
+out:
+    xencomm_ctxt_done(&ctxt);
+    return n - from_pos;
+}
+
 static int xencomm_inline_add_offset(void **handle, unsigned int bytes)
 {
     *handle += bytes;
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-ia64/uaccess.h
--- a/xen/include/asm-ia64/uaccess.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-ia64/uaccess.h	Mon Jan 23 09:41:27 2012 +0000
@@ -236,6 +236,18 @@
 	__cu_len;									\
 })
 
+extern unsigned long __do_clear_user (void __user * to, unsigned long count);
+
+#define clear_user(to, n)					\
+({								\
+	void __user *__cu_to = (to);							\
+	long __cu_len = (n);								\
+											\
+	if (__access_ok(__cu_to))							\
+		__cu_len = __do_clear_user(__cu_to, __cu_len);	\
+	__cu_len;						\
+})
+
 #define copy_from_user(to, from, n)							\
 ({											\
 	void *__cu_to = (to);								\
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-x86/guest_access.h	Mon Jan 23 09:41:27 2012 +0000
@@ -21,6 +21,10 @@
     (is_hvm_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      copy_from_user((dst), (src), (len)))
+#define raw_clear_guest(dst,  len)              \
+    (is_hvm_vcpu(current) ?                     \
+     clear_user_hvm((dst), (len)) :             \
+     clear_user((dst), (len)))
 #define __raw_copy_to_guest(dst, src, len)      \
     (is_hvm_vcpu(current) ?                     \
      copy_to_user_hvm((dst), (src), (len)) :    \
@@ -29,6 +33,10 @@
     (is_hvm_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      __copy_from_user((dst), (src), (len)))
+#define __raw_clear_guest(dst,  len)            \
+    (is_hvm_vcpu(current) ?                     \
+     clear_user_hvm((dst), (len)) :             \
+     clear_user((dst), (len)))
 
 /* Is the guest handle a NULL reference? */
 #define guest_handle_is_null(hnd)        ((hnd).p == NULL)
@@ -69,6 +77,11 @@
     raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\
 })
 
+#define clear_guest_offset(hnd, off, nr) ({    \
+    void *_d = (hnd).p;                        \
+    raw_clear_guest(_d+(off), nr);             \
+})
+
 /* Copy sub-field of a structure to guest context via a guest handle. */
 #define copy_field_to_guest(hnd, ptr, field) ({         \
     const typeof(&(ptr)->field) _s = &(ptr)->field;     \
@@ -110,6 +123,11 @@
     __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\
 })
 
+#define __clear_guest_offset(hnd, off, nr) ({    \
+    void *_d = (hnd).p;                          \
+    __raw_clear_guest(_d+(off), nr);             \
+})
+
 #define __copy_field_to_guest(hnd, ptr, field) ({       \
     const typeof(&(ptr)->field) _s = &(ptr)->field;     \
     void *_d = &(hnd).p->field;                         \
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-x86/hvm/guest_access.h
--- a/xen/include/asm-x86/hvm/guest_access.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-x86/hvm/guest_access.h	Mon Jan 23 09:41:27 2012 +0000
@@ -2,6 +2,7 @@
 #define __ASM_X86_HVM_GUEST_ACCESS_H__
 
 unsigned long copy_to_user_hvm(void *to, const void *from, unsigned len);
+unsigned long clear_user_hvm(void *to, unsigned int len);
 unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len);
 
 #endif /* __ASM_X86_HVM_GUEST_ACCESS_H__ */
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-x86/uaccess.h
--- a/xen/include/asm-x86/uaccess.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-x86/uaccess.h	Mon Jan 23 09:41:27 2012 +0000
@@ -16,6 +16,7 @@
 #endif
 
 unsigned long copy_to_user(void *to, const void *from, unsigned len);
+unsigned long clear_user(void *to, unsigned len);
 unsigned long copy_from_user(void *to, const void *from, unsigned len);
 /* Handles exceptions in both to and from, but doesn't do access_ok */
 unsigned long __copy_to_user_ll(void *to, const void *from, unsigned n);
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/xen/guest_access.h
--- a/xen/include/xen/guest_access.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/xen/guest_access.h	Mon Jan 23 09:41:27 2012 +0000
@@ -15,10 +15,16 @@
 #define copy_from_guest(ptr, hnd, nr)                   \
     copy_from_guest_offset(ptr, hnd, 0, nr)
 
+#define clear_guest(hnd, nr)                            \
+    clear_guest_offset(hnd, 0, nr)
+
 #define __copy_to_guest(hnd, ptr, nr)                   \
     __copy_to_guest_offset(hnd, 0, ptr, nr)
 
 #define __copy_from_guest(ptr, hnd, nr)                 \
     __copy_from_guest_offset(ptr, hnd, 0, nr)
 
+#define __clear_guest(hnd, nr)                          \
+    __clear_guest_offset(hnd, 0, nr)
+
 #endif /* __XEN_GUEST_ACCESS_H__ */
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/xen/xencomm.h
--- a/xen/include/xen/xencomm.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/xen/xencomm.h	Mon Jan 23 09:41:27 2012 +0000
@@ -27,6 +27,8 @@
     void *to, const void *from, unsigned int len, unsigned int skip); 
 unsigned long xencomm_copy_from_guest(
     void *to, const void *from, unsigned int len, unsigned int skip); 
+unsigned long xencomm_clear_guest(
+    void *to, unsigned int n, unsigned int skip);
 int xencomm_add_offset(void **handle, unsigned int bytes);
 int xencomm_handle_is_null(void *ptr);
 
@@ -41,6 +43,16 @@
     return (unsigned long)handle & ~XENCOMM_INLINE_FLAG;
 }
 
+#define raw_copy_to_guest(dst, src, len)       \
+    xencomm_copy_to_guest(dst, src, len, 0)
+#define raw_copy_from_guest(dst, src, len)     \
+    xencomm_copy_from_guest(dst, src, nr, 0)
+#define raw_clear_guest(dst, len)              \
+    xencomm_clear_guest(dst, len, 0)
+#define __raw_copy_to_guest raw_copy_to_guest
+#define __raw_copy_from_guest raw_copy_from_guest
+#define __raw_clear_guest raw_clear_guest
+
 /* Is the guest handle a NULL reference? */
 #define guest_handle_is_null(hnd) \
     ((hnd).p == NULL || xencomm_handle_is_null((hnd).p))
@@ -82,6 +94,13 @@
 #define copy_from_guest_offset(ptr, hnd, idx, nr) \
     __copy_from_guest_offset(ptr, hnd, idx, nr)
 
+/*
+ * Clear an array of objects in guest context via a guest handle.
+ * Optionally specify an offset into the guest array.
+ */
+#define clear_guest_offset(hnd, idx, nr) \
+    __clear_guest_offset(hnd, idx, nr)
+
 /* Copy sub-field of a structure from guest context via a guest handle. */
 #define copy_field_from_guest(ptr, hnd, field) \
     __copy_field_from_guest(ptr, hnd, field)
@@ -115,6 +134,11 @@
     xencomm_copy_from_guest(_d, _s, sizeof(*_d), _off);             \
 })
 
+#define __clear_guest_offset(hnd, idx, nr) ({                \
+    void *_d = (hnd).p;                                             \
+    xencomm_clear_guest(_d, nr, idx); \
+})
+
 #ifdef CONFIG_XENCOMM_MARK_DIRTY
 extern void xencomm_mark_dirty(unsigned long addr, unsigned int len);
 #else

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-00062e-8I; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPF-0005yU-Pe
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1327350133!12135230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 899 invoked from network); 23 Jan 2012 20:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP7-0001Oe-CD
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP7-0000n2-8w
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Message-Id: <E1RpQP7-0000n2-8w@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Introduce clear_user and clear_guest
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311687 0
# Node ID d6cdbc4fe0787adccc6194d9352fa950dd42e810
# Parent  37eefb79503cc36a5e3ca324744b06dffb4fb912
Introduce clear_user and clear_guest

Introduce clear_user for x86 and ia64, shamelessly taken from Linux.
The x86 version is the 32 bit clear_user implementation.  Introduce
clear_guest for x86 and ia64. The x86 implementation is based on
clear_user and a new clear_user_hvm function.  The ia64 implementation
is actually in xencomm and it is based on xencomm_copy_to_guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/ia64/linux/Makefile
--- a/xen/arch/ia64/linux/Makefile	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/ia64/linux/Makefile	Mon Jan 23 09:41:27 2012 +0000
@@ -4,6 +4,7 @@
 
 obj-y += bitop.o
 obj-y += clear_page.o
+obj-y += clear_user.o
 obj-y += copy_page_mck.o
 obj-y += efi_stub.o
 obj-y += extable.o
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/ia64/linux/README.origin
--- a/xen/arch/ia64/linux/README.origin	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/ia64/linux/README.origin	Mon Jan 23 09:41:27 2012 +0000
@@ -15,6 +15,7 @@
 
 bitop.c			-> linux/arch/ia64/lib/bitop.c
 clear_page.S		-> linux/arch/ia64/lib/clear_page.S
+clear_user.S		-> linux/arch/ia64/lib/clear_user.S
 copy_page_mck.S		-> linux/arch/ia64/lib/copy_page_mck.S
 flush.S			-> linux/arch/ia64/lib/flush.S
 idiv32.S		-> linux/arch/ia64/lib/idiv32.S
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/ia64/linux/clear_user.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/ia64/linux/clear_user.S	Mon Jan 23 09:41:27 2012 +0000
@@ -0,0 +1,209 @@
+/*
+ * This routine clears to zero a linear memory buffer in user space.
+ *
+ * Inputs:
+ *	in0:	address of buffer
+ *	in1:	length of buffer in bytes
+ * Outputs:
+ *	r8:	number of bytes that didn't get cleared due to a fault
+ *
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ *	Stephane Eranian <eranian@hpl.hp.com>
+ */
+
+#include <asm/asmmacro.h>
+
+//
+// arguments
+//
+#define buf		r32
+#define len		r33
+
+//
+// local registers
+//
+#define cnt		r16
+#define buf2		r17
+#define saved_lc	r18
+#define saved_pfs	r19
+#define tmp		r20
+#define len2		r21
+#define len3		r22
+
+//
+// Theory of operations:
+//	- we check whether or not the buffer is small, i.e., less than 17
+//	  in which case we do the byte by byte loop.
+//
+//	- Otherwise we go progressively from 1 byte store to 8byte store in
+//	  the head part, the body is a 16byte store loop and we finish we the
+//	  tail for the last 15 bytes.
+//	  The good point about this breakdown is that the long buffer handling
+//	  contains only 2 branches.
+//
+//	The reason for not using shifting & masking for both the head and the
+//	tail is to stay semantically correct. This routine is not supposed
+//	to write bytes outside of the buffer. While most of the time this would
+//	be ok, we can't tolerate a mistake. A classical example is the case
+//	of multithreaded code were to the extra bytes touched is actually owned
+//	by another thread which runs concurrently to ours. Another, less likely,
+//	example is with device drivers where reading an I/O mapped location may
+//	have side effects (same thing for writing).
+//
+
+GLOBAL_ENTRY(__do_clear_user)
+	.prologue
+	.save ar.pfs, saved_pfs
+	alloc	saved_pfs=ar.pfs,2,0,0,0
+	cmp.eq p6,p0=r0,len		// check for zero length
+	.save ar.lc, saved_lc
+	mov saved_lc=ar.lc		// preserve ar.lc (slow)
+	.body
+	;;				// avoid WAW on CFM
+	adds tmp=-1,len			// br.ctop is repeat/until
+	mov ret0=len			// return value is length at this point
+(p6)	br.ret.spnt.many rp
+	;;
+	cmp.lt p6,p0=16,len		// if len > 16 then long memset
+	mov ar.lc=tmp			// initialize lc for small count
+(p6)	br.cond.dptk .long_do_clear
+	;;				// WAR on ar.lc
+	//
+	// worst case 16 iterations, avg 8 iterations
+	//
+	// We could have played with the predicates to use the extra
+	// M slot for 2 stores/iteration but the cost the initialization
+	// the various counters compared to how long the loop is supposed
+	// to last on average does not make this solution viable.
+	//
+1:
+	EX( .Lexit1, st1 [buf]=r0,1 )
+	adds len=-1,len			// countdown length using len
+	br.cloop.dptk 1b
+	;;				// avoid RAW on ar.lc
+	//
+	// .Lexit4: comes from byte by byte loop
+	//	    len contains bytes left
+.Lexit1:
+	mov ret0=len			// faster than using ar.lc
+	mov ar.lc=saved_lc
+	br.ret.sptk.many rp		// end of short clear_user
+
+
+	//
+	// At this point we know we have more than 16 bytes to copy
+	// so we focus on alignment (no branches required)
+	//
+	// The use of len/len2 for countdown of the number of bytes left
+	// instead of ret0 is due to the fact that the exception code
+	// changes the values of r8.
+	//
+.long_do_clear:
+	tbit.nz p6,p0=buf,0		// odd alignment (for long_do_clear)
+	;;
+	EX( .Lexit3, (p6) st1 [buf]=r0,1 )	// 1-byte aligned
+(p6)	adds len=-1,len;;		// sync because buf is modified
+	tbit.nz p6,p0=buf,1
+	;;
+	EX( .Lexit3, (p6) st2 [buf]=r0,2 )	// 2-byte aligned
+(p6)	adds len=-2,len;;
+	tbit.nz p6,p0=buf,2
+	;;
+	EX( .Lexit3, (p6) st4 [buf]=r0,4 )	// 4-byte aligned
+(p6)	adds len=-4,len;;
+	tbit.nz p6,p0=buf,3
+	;;
+	EX( .Lexit3, (p6) st8 [buf]=r0,8 )	// 8-byte aligned
+(p6)	adds len=-8,len;;
+	shr.u cnt=len,4		// number of 128-bit (2x64bit) words
+	;;
+	cmp.eq p6,p0=r0,cnt
+	adds tmp=-1,cnt
+(p6)	br.cond.dpnt .dotail		// we have less than 16 bytes left
+	;;
+	adds buf2=8,buf			// setup second base pointer
+	mov ar.lc=tmp
+	;;
+
+	//
+	// 16bytes/iteration core loop
+	//
+	// The second store can never generate a fault because
+	// we come into the loop only when we are 16-byte aligned.
+	// This means that if we cross a page then it will always be
+	// in the first store and never in the second.
+	//
+	//
+	// We need to keep track of the remaining length. A possible (optimistic)
+	// way would be to use ar.lc and derive how many byte were left by
+	// doing : left= 16*ar.lc + 16.  this would avoid the addition at
+	// every iteration.
+	// However we need to keep the synchronization point. A template
+	// M;;MB does not exist and thus we can keep the addition at no
+	// extra cycle cost (use a nop slot anyway). It also simplifies the
+	// (unlikely)  error recovery code
+	//
+
+2:	EX(.Lexit3, st8 [buf]=r0,16 )
+	;;				// needed to get len correct when error
+	st8 [buf2]=r0,16
+	adds len=-16,len
+	br.cloop.dptk 2b
+	;;
+	mov ar.lc=saved_lc
+	//
+	// tail correction based on len only
+	//
+	// We alternate the use of len3,len2 to allow parallelism and correct
+	// error handling. We also reuse p6/p7 to return correct value.
+	// The addition of len2/len3 does not cost anything more compared to
+	// the regular memset as we had empty slots.
+	//
+.dotail:
+	mov len2=len			// for parallelization of error handling
+	mov len3=len
+	tbit.nz p6,p0=len,3
+	;;
+	EX( .Lexit2, (p6) st8 [buf]=r0,8 )	// at least 8 bytes
+(p6)	adds len3=-8,len2
+	tbit.nz p7,p6=len,2
+	;;
+	EX( .Lexit2, (p7) st4 [buf]=r0,4 )	// at least 4 bytes
+(p7)	adds len2=-4,len3
+	tbit.nz p6,p7=len,1
+	;;
+	EX( .Lexit2, (p6) st2 [buf]=r0,2 )	// at least 2 bytes
+(p6)	adds len3=-2,len2
+	tbit.nz p7,p6=len,0
+	;;
+	EX( .Lexit2, (p7) st1 [buf]=r0 )	// only 1 byte left
+	mov ret0=r0				// success
+	br.ret.sptk.many rp			// end of most likely path
+
+	//
+	// Outlined error handling code
+	//
+
+	//
+	// .Lexit3: comes from core loop, need restore pr/lc
+	//	    len contains bytes left
+	//
+	//
+	// .Lexit2:
+	//	if p6 -> coming from st8 or st2 : len2 contains what's left
+	//	if p7 -> coming from st4 or st1 : len3 contains what's left
+	// We must restore lc/pr even though might not have been used.
+.Lexit2:
+	.pred.rel "mutex", p6, p7
+(p6)	mov len=len2
+(p7)	mov len=len3
+	;;
+	//
+	// .Lexit4: comes from head, need not restore pr/lc
+	//	    len contains bytes left
+	//
+.Lexit3:
+	mov ret0=len
+	mov ar.lc=saved_lc
+	br.ret.sptk.many rp
+END(__do_clear_user)
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Mon Jan 23 09:41:27 2012 +0000
@@ -2381,6 +2381,96 @@
     return HVMCOPY_okay;
 }
 
+static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
+{
+    struct vcpu *curr = current;
+    unsigned long gfn, mfn;
+    p2m_type_t p2mt;
+    char *p;
+    int count, todo = size;
+    uint32_t pfec = PFEC_page_present | PFEC_write_access;
+
+    /*
+     * XXX Disable for 4.1.0: PV-on-HVM drivers will do grant-table ops
+     * such as query_size. Grant-table code currently does copy_to/from_guest
+     * accesses under the big per-domain lock, which this test would disallow.
+     * The test is not needed until we implement sleeping-on-waitqueue when
+     * we access a paged-out frame, and that's post 4.1.0 now.
+     */
+#if 0
+    /*
+     * If the required guest memory is paged out, this function may sleep.
+     * Hence we bail immediately if called from atomic context.
+     */
+    if ( in_atomic() )
+        return HVMCOPY_unhandleable;
+#endif
+
+    while ( todo > 0 )
+    {
+        count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
+
+        gfn = paging_gva_to_gfn(curr, addr, &pfec);
+        if ( gfn == INVALID_GFN )
+        {
+            if ( pfec == PFEC_page_paged )
+                return HVMCOPY_gfn_paged_out;
+            if ( pfec == PFEC_page_shared )
+                return HVMCOPY_gfn_shared;
+            return HVMCOPY_bad_gva_to_gfn;
+        }
+
+        mfn = mfn_x(get_gfn_unshare(curr->domain, gfn, &p2mt));
+
+        if ( p2m_is_paging(p2mt) )
+        {
+            p2m_mem_paging_populate(curr->domain, gfn);
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_gfn_paged_out;
+        }
+        if ( p2m_is_shared(p2mt) )
+        {
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_gfn_shared;
+        }
+        if ( p2m_is_grant(p2mt) )
+        {
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_unhandleable;
+        }
+        if ( !p2m_is_ram(p2mt) )
+        {
+            put_gfn(curr->domain, gfn);
+            return HVMCOPY_bad_gfn_to_mfn;
+        }
+        ASSERT(mfn_valid(mfn));
+
+        p = (char *)map_domain_page(mfn) + (addr & ~PAGE_MASK);
+
+        if ( p2mt == p2m_ram_ro )
+        {
+            static unsigned long lastpage;
+            if ( xchg(&lastpage, gfn) != gfn )
+                gdprintk(XENLOG_DEBUG, "guest attempted write to read-only"
+                        " memory page. gfn=%#lx, mfn=%#lx\n",
+                        gfn, mfn);
+        }
+        else
+        {
+            memset(p, 0x00, count);
+            paging_mark_dirty(curr->domain, mfn);
+        }
+
+        unmap_domain_page(p);
+
+        addr += count;
+        todo -= count;
+        put_gfn(curr->domain, gfn);
+    }
+
+    return HVMCOPY_okay;
+}
+
 enum hvm_copy_result hvm_copy_to_guest_phys(
     paddr_t paddr, void *buf, int size)
 {
@@ -2467,6 +2557,23 @@
     return rc ? len : 0; /* fake a copy_to_user() return code */
 }
 
+unsigned long clear_user_hvm(void *to, unsigned int len)
+{
+    int rc;
+
+#ifdef __x86_64__
+    if ( !current->arch.hvm_vcpu.hcall_64bit &&
+         is_compat_arg_xlat_range(to, len) )
+    {
+        memset(to, 0x00, len);
+        return 0;
+    }
+#endif
+
+    rc = __hvm_clear((unsigned long)to, len);
+    return rc ? len : 0; /* fake a copy_to_user() return code */
+}
+
 unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len)
 {
     int rc;
diff -r 37eefb79503c -r d6cdbc4fe078 xen/arch/x86/usercopy.c
--- a/xen/arch/x86/usercopy.c	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/arch/x86/usercopy.c	Mon Jan 23 09:41:27 2012 +0000
@@ -110,6 +110,42 @@
     return n;
 }
 
+#define __do_clear_user(addr,size)					\
+do {									\
+	long __d0;							\
+	__asm__ __volatile__(						\
+		"0:	rep; stosl\n"					\
+		"	movl %2,%0\n"					\
+		"1:	rep; stosb\n"					\
+		"2:\n"							\
+		".section .fixup,\"ax\"\n"				\
+		"3:	lea 0(%2,%0,4),%0\n"				\
+		"	jmp 2b\n"					\
+		".previous\n"						\
+		_ASM_EXTABLE(0b,3b)					\
+		_ASM_EXTABLE(1b,2b)					\
+		: "=&c"(size), "=&D" (__d0)				\
+		: "r"(size & 3), "0"(size / 4), "1"((long)addr), "a"(0));	\
+} while (0)
+
+/**
+ * clear_user: - Zero a block of memory in user space.
+ * @to:   Destination address, in user space.
+ * @n:    Number of bytes to zero.
+ *
+ * Zero a block of memory in user space.
+ *
+ * Returns number of bytes that could not be cleared.
+ * On success, this will be zero.
+ */
+unsigned long
+clear_user(void __user *to, unsigned n)
+{
+	if ( access_ok(to, n) )
+		__do_clear_user(to, n);
+	return n;
+}
+
 /**
  * copy_from_user: - Copy a block of data from user space.
  * @to:   Destination address, in kernel space.
diff -r 37eefb79503c -r d6cdbc4fe078 xen/common/xencomm.c
--- a/xen/common/xencomm.c	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/common/xencomm.c	Mon Jan 23 09:41:27 2012 +0000
@@ -414,6 +414,117 @@
     return n - from_pos;
 }
 
+static int
+xencomm_clear_chunk(
+    unsigned long paddr, unsigned int  len)
+{
+    struct page_info *page;
+    int res;
+
+    do {
+        res = xencomm_get_page(paddr, &page);
+    } while ( res == -EAGAIN );
+
+    if ( res )
+        return res;
+
+    memset(xencomm_vaddr(paddr, page), 0x00, len);
+    xencomm_mark_dirty((unsigned long)xencomm_vaddr(paddr, page), len);
+    put_page(page);
+
+    return 0;
+}
+
+static unsigned long
+xencomm_inline_clear_guest(
+    void *to, unsigned int n, unsigned int skip)
+{
+    unsigned long dest_paddr = xencomm_inline_addr(to) + skip;
+
+    while ( n > 0 )
+    {
+        unsigned int chunksz, bytes;
+
+        chunksz = PAGE_SIZE - (dest_paddr % PAGE_SIZE);
+        bytes   = min(chunksz, n);
+
+        if ( xencomm_clear_chunk(dest_paddr, bytes) )
+            return n;
+        dest_paddr += bytes;
+        n -= bytes;
+    }
+
+    /* Always successful. */
+    return 0;
+}
+
+/**
+ * xencomm_clear_guest: Clear a block of data in domain space.
+ * @to:     Physical address to xencomm buffer descriptor.
+ * @n:      Number of bytes to copy.
+ * @skip: Number of bytes from the start to skip.
+ *
+ * Clear domain data
+ *
+ * Returns number of bytes that could not be cleared
+ * On success, this will be zero.
+ */
+unsigned long
+xencomm_clear_guest(
+    void *to, unsigned int n, unsigned int skip)
+{
+    struct xencomm_ctxt ctxt;
+    unsigned int from_pos = 0;
+    unsigned int to_pos = 0;
+    unsigned int i = 0;
+
+    if ( xencomm_is_inline(to) )
+        return xencomm_inline_clear_guest(to, n, skip);
+
+    if ( xencomm_ctxt_init(to, &ctxt) )
+        return n;
+
+    /* Iterate through the descriptor, copying up to a page at a time */
+    while ( (from_pos < n) && (i < xencomm_ctxt_nr_addrs(&ctxt)) )
+    {
+        unsigned long dest_paddr;
+        unsigned int pgoffset, chunksz, chunk_skip;
+
+        if ( xencomm_ctxt_next(&ctxt, i) )
+            goto out;
+        dest_paddr = *xencomm_ctxt_address(&ctxt);
+        if ( dest_paddr == XENCOMM_INVALID )
+        {
+            i++;
+            continue;
+        }
+
+        pgoffset = dest_paddr % PAGE_SIZE;
+        chunksz = PAGE_SIZE - pgoffset;
+
+        chunk_skip = min(chunksz, skip);
+        to_pos += chunk_skip;
+        chunksz -= chunk_skip;
+        skip -= chunk_skip;
+
+        if ( skip == 0 && chunksz > 0 )
+        {
+            unsigned int bytes = min(chunksz, n - from_pos);
+
+            if ( xencomm_clear_chunk(dest_paddr + chunk_skip, bytes) )
+                goto out;
+            from_pos += bytes;
+            to_pos += bytes;
+        }
+
+        i++;
+    }
+
+out:
+    xencomm_ctxt_done(&ctxt);
+    return n - from_pos;
+}
+
 static int xencomm_inline_add_offset(void **handle, unsigned int bytes)
 {
     *handle += bytes;
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-ia64/uaccess.h
--- a/xen/include/asm-ia64/uaccess.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-ia64/uaccess.h	Mon Jan 23 09:41:27 2012 +0000
@@ -236,6 +236,18 @@
 	__cu_len;									\
 })
 
+extern unsigned long __do_clear_user (void __user * to, unsigned long count);
+
+#define clear_user(to, n)					\
+({								\
+	void __user *__cu_to = (to);							\
+	long __cu_len = (n);								\
+											\
+	if (__access_ok(__cu_to))							\
+		__cu_len = __do_clear_user(__cu_to, __cu_len);	\
+	__cu_len;						\
+})
+
 #define copy_from_user(to, from, n)							\
 ({											\
 	void *__cu_to = (to);								\
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-x86/guest_access.h	Mon Jan 23 09:41:27 2012 +0000
@@ -21,6 +21,10 @@
     (is_hvm_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      copy_from_user((dst), (src), (len)))
+#define raw_clear_guest(dst,  len)              \
+    (is_hvm_vcpu(current) ?                     \
+     clear_user_hvm((dst), (len)) :             \
+     clear_user((dst), (len)))
 #define __raw_copy_to_guest(dst, src, len)      \
     (is_hvm_vcpu(current) ?                     \
      copy_to_user_hvm((dst), (src), (len)) :    \
@@ -29,6 +33,10 @@
     (is_hvm_vcpu(current) ?                     \
      copy_from_user_hvm((dst), (src), (len)) :  \
      __copy_from_user((dst), (src), (len)))
+#define __raw_clear_guest(dst,  len)            \
+    (is_hvm_vcpu(current) ?                     \
+     clear_user_hvm((dst), (len)) :             \
+     clear_user((dst), (len)))
 
 /* Is the guest handle a NULL reference? */
 #define guest_handle_is_null(hnd)        ((hnd).p == NULL)
@@ -69,6 +77,11 @@
     raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\
 })
 
+#define clear_guest_offset(hnd, off, nr) ({    \
+    void *_d = (hnd).p;                        \
+    raw_clear_guest(_d+(off), nr);             \
+})
+
 /* Copy sub-field of a structure to guest context via a guest handle. */
 #define copy_field_to_guest(hnd, ptr, field) ({         \
     const typeof(&(ptr)->field) _s = &(ptr)->field;     \
@@ -110,6 +123,11 @@
     __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\
 })
 
+#define __clear_guest_offset(hnd, off, nr) ({    \
+    void *_d = (hnd).p;                          \
+    __raw_clear_guest(_d+(off), nr);             \
+})
+
 #define __copy_field_to_guest(hnd, ptr, field) ({       \
     const typeof(&(ptr)->field) _s = &(ptr)->field;     \
     void *_d = &(hnd).p->field;                         \
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-x86/hvm/guest_access.h
--- a/xen/include/asm-x86/hvm/guest_access.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-x86/hvm/guest_access.h	Mon Jan 23 09:41:27 2012 +0000
@@ -2,6 +2,7 @@
 #define __ASM_X86_HVM_GUEST_ACCESS_H__
 
 unsigned long copy_to_user_hvm(void *to, const void *from, unsigned len);
+unsigned long clear_user_hvm(void *to, unsigned int len);
 unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len);
 
 #endif /* __ASM_X86_HVM_GUEST_ACCESS_H__ */
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/asm-x86/uaccess.h
--- a/xen/include/asm-x86/uaccess.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/asm-x86/uaccess.h	Mon Jan 23 09:41:27 2012 +0000
@@ -16,6 +16,7 @@
 #endif
 
 unsigned long copy_to_user(void *to, const void *from, unsigned len);
+unsigned long clear_user(void *to, unsigned len);
 unsigned long copy_from_user(void *to, const void *from, unsigned len);
 /* Handles exceptions in both to and from, but doesn't do access_ok */
 unsigned long __copy_to_user_ll(void *to, const void *from, unsigned n);
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/xen/guest_access.h
--- a/xen/include/xen/guest_access.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/xen/guest_access.h	Mon Jan 23 09:41:27 2012 +0000
@@ -15,10 +15,16 @@
 #define copy_from_guest(ptr, hnd, nr)                   \
     copy_from_guest_offset(ptr, hnd, 0, nr)
 
+#define clear_guest(hnd, nr)                            \
+    clear_guest_offset(hnd, 0, nr)
+
 #define __copy_to_guest(hnd, ptr, nr)                   \
     __copy_to_guest_offset(hnd, 0, ptr, nr)
 
 #define __copy_from_guest(ptr, hnd, nr)                 \
     __copy_from_guest_offset(ptr, hnd, 0, nr)
 
+#define __clear_guest(hnd, nr)                          \
+    __clear_guest_offset(hnd, 0, nr)
+
 #endif /* __XEN_GUEST_ACCESS_H__ */
diff -r 37eefb79503c -r d6cdbc4fe078 xen/include/xen/xencomm.h
--- a/xen/include/xen/xencomm.h	Mon Jan 23 09:40:35 2012 +0000
+++ b/xen/include/xen/xencomm.h	Mon Jan 23 09:41:27 2012 +0000
@@ -27,6 +27,8 @@
     void *to, const void *from, unsigned int len, unsigned int skip); 
 unsigned long xencomm_copy_from_guest(
     void *to, const void *from, unsigned int len, unsigned int skip); 
+unsigned long xencomm_clear_guest(
+    void *to, unsigned int n, unsigned int skip);
 int xencomm_add_offset(void **handle, unsigned int bytes);
 int xencomm_handle_is_null(void *ptr);
 
@@ -41,6 +43,16 @@
     return (unsigned long)handle & ~XENCOMM_INLINE_FLAG;
 }
 
+#define raw_copy_to_guest(dst, src, len)       \
+    xencomm_copy_to_guest(dst, src, len, 0)
+#define raw_copy_from_guest(dst, src, len)     \
+    xencomm_copy_from_guest(dst, src, nr, 0)
+#define raw_clear_guest(dst, len)              \
+    xencomm_clear_guest(dst, len, 0)
+#define __raw_copy_to_guest raw_copy_to_guest
+#define __raw_copy_from_guest raw_copy_from_guest
+#define __raw_clear_guest raw_clear_guest
+
 /* Is the guest handle a NULL reference? */
 #define guest_handle_is_null(hnd) \
     ((hnd).p == NULL || xencomm_handle_is_null((hnd).p))
@@ -82,6 +94,13 @@
 #define copy_from_guest_offset(ptr, hnd, idx, nr) \
     __copy_from_guest_offset(ptr, hnd, idx, nr)
 
+/*
+ * Clear an array of objects in guest context via a guest handle.
+ * Optionally specify an offset into the guest array.
+ */
+#define clear_guest_offset(hnd, idx, nr) \
+    __clear_guest_offset(hnd, idx, nr)
+
 /* Copy sub-field of a structure from guest context via a guest handle. */
 #define copy_field_from_guest(ptr, hnd, field) \
     __copy_field_from_guest(ptr, hnd, field)
@@ -115,6 +134,11 @@
     xencomm_copy_from_guest(_d, _s, sizeof(*_d), _off);             \
 })
 
+#define __clear_guest_offset(hnd, idx, nr) ({                \
+    void *_d = (hnd).p;                                             \
+    xencomm_clear_guest(_d, nr, idx); \
+})
+
 #ifdef CONFIG_XENCOMM_MARK_DIRTY
 extern void xencomm_mark_dirty(unsigned long addr, unsigned int len);
 #else

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-00062u-Dy; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPG-0005yZ-D0
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1327350134!12083222!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7069 invoked from network); 23 Jan 2012 20:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:15 -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 1RpQP7-0001Oi-Tn
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP7-0000nV-Pf
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Message-Id: <E1RpQP7-0000nV-Pf@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libelf-loader: introduce
	elf_load_image
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311732 0
# Node ID 137c16a83e4084b717a8a5685371800aeb313233
# Parent  d6cdbc4fe0787adccc6194d9352fa950dd42e810
libelf-loader: introduce elf_load_image

Implement a new function, called elf_load_image, to perform the
actually copy of the elf image and clearing the padding.  The function
is implemented as memcpy and memset when the library is built as part
of the tools, but it is implemented as raw_copy_to_guest and
raw_clear_guest when built as part of Xen, so that it can be safely
called with an HVM style dom0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d6cdbc4fe078 -r 137c16a83e40 tools/libxc/xc_dom_elfloader.c
--- a/tools/libxc/xc_dom_elfloader.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/tools/libxc/xc_dom_elfloader.c	Mon Jan 23 09:42:12 2012 +0000
@@ -310,9 +310,15 @@
 static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
 {
     struct elf_binary *elf = dom->private_loader;
+    int rc;
 
     elf->dest = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
-    elf_load_binary(elf);
+    rc = elf_load_binary(elf);
+    if ( rc < 0 )
+    {
+        DOMPRINTF("%s: failed to load elf binary", __FUNCTION__);
+        return rc;
+    }
     if ( dom->parms.bsd_symtab )
         xc_dom_load_elf_symtab(dom, elf, 1);
     return 0;
diff -r d6cdbc4fe078 -r 137c16a83e40 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Mon Jan 23 09:42:12 2012 +0000
@@ -109,8 +109,9 @@
     elf->dest += elf->pstart & (PAGE_SIZE - 1);
 
     /* Load the initial elf image. */
-    elf_load_binary(elf);
-    rc = 0;
+    rc = elf_load_binary(elf);
+    if ( rc < 0 )
+        PERROR("Failed to load elf binary\n");
 
     munmap(elf->dest, pages << PAGE_SHIFT);
     elf->dest = NULL;
diff -r d6cdbc4fe078 -r 137c16a83e40 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/xen/arch/x86/domain_build.c	Mon Jan 23 09:42:12 2012 +0000
@@ -903,7 +903,12 @@
 
     /* Copy the OS image and free temporary buffer. */
     elf.dest = (void*)vkern_start;
-    elf_load_binary(&elf);
+    rc = elf_load_binary(&elf);
+    if ( rc < 0 )
+    {
+        printk("Failed to load the kernel binary\n");
+        return rc;
+    }
     bootstrap_map(NULL);
 
     if ( UNSET_ADDR != parms.virt_hypercall )
diff -r d6cdbc4fe078 -r 137c16a83e40 xen/common/libelf/libelf-loader.c
--- a/xen/common/libelf/libelf-loader.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/xen/common/libelf/libelf-loader.c	Mon Jan 23 09:42:12 2012 +0000
@@ -107,11 +107,34 @@
     elf->log_caller_data = log_caller_data;
     elf->verbose = verbose;
 }
+
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+{
+    memcpy(dst, src, filesz);
+    memset(dst + filesz, 0, memsz - filesz);
+    return 0;
+}
 #else
+#include <asm/guest_access.h>
+
 void elf_set_verbose(struct elf_binary *elf)
 {
     elf->verbose = 1;
 }
+
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+{
+    int rc;
+    if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
+        return -1;
+    rc = raw_copy_to_guest(dst, src, filesz);
+    if ( rc != 0 )
+        return -1;
+    rc = raw_clear_guest(dst + filesz, memsz - filesz);
+    if ( rc != 0 )
+        return -1;
+    return 0;
+}
 #endif
 
 /* Calculate the required additional kernel space for the elf image */
@@ -237,7 +260,7 @@
             __FUNCTION__, elf->pstart, elf->pend);
 }
 
-void elf_load_binary(struct elf_binary *elf)
+int elf_load_binary(struct elf_binary *elf)
 {
     const elf_phdr *phdr;
     uint64_t i, count, paddr, offset, filesz, memsz;
@@ -256,11 +279,12 @@
         dest = elf_get_ptr(elf, paddr);
         elf_msg(elf, "%s: phdr %" PRIu64 " at 0x%p -> 0x%p\n",
                 __func__, i, dest, dest + filesz);
-        memcpy(dest, elf->image + offset, filesz);
-        memset(dest + filesz, 0, memsz - filesz);
+        if ( elf_load_image(dest, elf->image + offset, filesz, memsz) != 0 )
+            return -1;
     }
 
     elf_load_bsdsyms(elf);
+    return 0;
 }
 
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr)
diff -r d6cdbc4fe078 -r 137c16a83e40 xen/include/xen/libelf.h
--- a/xen/include/xen/libelf.h	Mon Jan 23 09:41:27 2012 +0000
+++ b/xen/include/xen/libelf.h	Mon Jan 23 09:42:12 2012 +0000
@@ -198,7 +198,7 @@
 #endif
 
 void elf_parse_binary(struct elf_binary *elf);
-void elf_load_binary(struct elf_binary *elf);
+int elf_load_binary(struct elf_binary *elf);
 
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
 uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-00062u-Dy; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPG-0005yZ-D0
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1327350134!12083222!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7069 invoked from network); 23 Jan 2012 20:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:22:15 -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 1RpQP7-0001Oi-Tn
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP7-0000nV-Pf
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:13 +0000
Message-Id: <E1RpQP7-0000nV-Pf@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libelf-loader: introduce
	elf_load_image
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311732 0
# Node ID 137c16a83e4084b717a8a5685371800aeb313233
# Parent  d6cdbc4fe0787adccc6194d9352fa950dd42e810
libelf-loader: introduce elf_load_image

Implement a new function, called elf_load_image, to perform the
actually copy of the elf image and clearing the padding.  The function
is implemented as memcpy and memset when the library is built as part
of the tools, but it is implemented as raw_copy_to_guest and
raw_clear_guest when built as part of Xen, so that it can be safely
called with an HVM style dom0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d6cdbc4fe078 -r 137c16a83e40 tools/libxc/xc_dom_elfloader.c
--- a/tools/libxc/xc_dom_elfloader.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/tools/libxc/xc_dom_elfloader.c	Mon Jan 23 09:42:12 2012 +0000
@@ -310,9 +310,15 @@
 static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
 {
     struct elf_binary *elf = dom->private_loader;
+    int rc;
 
     elf->dest = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
-    elf_load_binary(elf);
+    rc = elf_load_binary(elf);
+    if ( rc < 0 )
+    {
+        DOMPRINTF("%s: failed to load elf binary", __FUNCTION__);
+        return rc;
+    }
     if ( dom->parms.bsd_symtab )
         xc_dom_load_elf_symtab(dom, elf, 1);
     return 0;
diff -r d6cdbc4fe078 -r 137c16a83e40 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Mon Jan 23 09:42:12 2012 +0000
@@ -109,8 +109,9 @@
     elf->dest += elf->pstart & (PAGE_SIZE - 1);
 
     /* Load the initial elf image. */
-    elf_load_binary(elf);
-    rc = 0;
+    rc = elf_load_binary(elf);
+    if ( rc < 0 )
+        PERROR("Failed to load elf binary\n");
 
     munmap(elf->dest, pages << PAGE_SHIFT);
     elf->dest = NULL;
diff -r d6cdbc4fe078 -r 137c16a83e40 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/xen/arch/x86/domain_build.c	Mon Jan 23 09:42:12 2012 +0000
@@ -903,7 +903,12 @@
 
     /* Copy the OS image and free temporary buffer. */
     elf.dest = (void*)vkern_start;
-    elf_load_binary(&elf);
+    rc = elf_load_binary(&elf);
+    if ( rc < 0 )
+    {
+        printk("Failed to load the kernel binary\n");
+        return rc;
+    }
     bootstrap_map(NULL);
 
     if ( UNSET_ADDR != parms.virt_hypercall )
diff -r d6cdbc4fe078 -r 137c16a83e40 xen/common/libelf/libelf-loader.c
--- a/xen/common/libelf/libelf-loader.c	Mon Jan 23 09:41:27 2012 +0000
+++ b/xen/common/libelf/libelf-loader.c	Mon Jan 23 09:42:12 2012 +0000
@@ -107,11 +107,34 @@
     elf->log_caller_data = log_caller_data;
     elf->verbose = verbose;
 }
+
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+{
+    memcpy(dst, src, filesz);
+    memset(dst + filesz, 0, memsz - filesz);
+    return 0;
+}
 #else
+#include <asm/guest_access.h>
+
 void elf_set_verbose(struct elf_binary *elf)
 {
     elf->verbose = 1;
 }
+
+static int elf_load_image(void *dst, const void *src, uint64_t filesz, uint64_t memsz)
+{
+    int rc;
+    if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
+        return -1;
+    rc = raw_copy_to_guest(dst, src, filesz);
+    if ( rc != 0 )
+        return -1;
+    rc = raw_clear_guest(dst + filesz, memsz - filesz);
+    if ( rc != 0 )
+        return -1;
+    return 0;
+}
 #endif
 
 /* Calculate the required additional kernel space for the elf image */
@@ -237,7 +260,7 @@
             __FUNCTION__, elf->pstart, elf->pend);
 }
 
-void elf_load_binary(struct elf_binary *elf)
+int elf_load_binary(struct elf_binary *elf)
 {
     const elf_phdr *phdr;
     uint64_t i, count, paddr, offset, filesz, memsz;
@@ -256,11 +279,12 @@
         dest = elf_get_ptr(elf, paddr);
         elf_msg(elf, "%s: phdr %" PRIu64 " at 0x%p -> 0x%p\n",
                 __func__, i, dest, dest + filesz);
-        memcpy(dest, elf->image + offset, filesz);
-        memset(dest + filesz, 0, memsz - filesz);
+        if ( elf_load_image(dest, elf->image + offset, filesz, memsz) != 0 )
+            return -1;
     }
 
     elf_load_bsdsyms(elf);
+    return 0;
 }
 
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr)
diff -r d6cdbc4fe078 -r 137c16a83e40 xen/include/xen/libelf.h
--- a/xen/include/xen/libelf.h	Mon Jan 23 09:41:27 2012 +0000
+++ b/xen/include/xen/libelf.h	Mon Jan 23 09:42:12 2012 +0000
@@ -198,7 +198,7 @@
 #endif
 
 void elf_parse_binary(struct elf_binary *elf);
-void elf_load_binary(struct elf_binary *elf);
+int elf_load_binary(struct elf_binary *elf);
 
 void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
 uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPE-00060E-WB; Mon, 23 Jan 2012 20:22:20 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPD-0005y9-Jn
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1327350015!60906474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1330 invoked from network); 23 Jan 2012 20:20:16 -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;
	23 Jan 2012 20:20:16 -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 1RpQP6-0001OV-9l
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP6-0000m5-5C
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Message-Id: <E1RpQP6-0000m5-5C@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] A collection of fixes to Xen common
	files
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311598 0
# Node ID 96e071fbefd7fb1331a04b0bc11c1518605d3c02
# Parent  ab0eab766edb933431d29e35cc18075be2a9bf41
A collection of fixes to Xen common files

- call free_xenoprof_pages only ifdef CONFIG_XENOPROF;
- define PRI_stime as PRId64 in an header file;
- respect boundaries in is_kernel_*;
- implement is_kernel_rodata;
- guest_physmap_add_page should be ((void)0).
- fix guest_physmap_add_page;
- introduce CONFIG_XENOPROF;
- define _srodata and _erodata as const char*.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ab0eab766edb -r 96e071fbefd7 xen/common/domain.c
--- a/xen/common/domain.c	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/common/domain.c	Mon Jan 23 09:39:58 2012 +0000
@@ -635,7 +635,9 @@
     sched_destroy_domain(d);
 
     /* Free page used by xen oprofile buffer. */
+#ifdef CONFIG_XENOPROF
     free_xenoprof_pages(d);
+#endif
 
     xfree(d->mem_event);
 
diff -r ab0eab766edb -r 96e071fbefd7 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/common/sched_credit2.c	Mon Jan 23 09:39:58 2012 +0000
@@ -26,12 +26,6 @@
 #include <xen/trace.h>
 #include <xen/cpu.h>
 
-#if __i386__
-#define PRI_stime "lld"
-#else
-#define PRI_stime "ld"
-#endif
-
 #define d2printk(x...)
 //#define d2printk printk
 
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/asm-ia64/config.h	Mon Jan 23 09:39:58 2012 +0000
@@ -20,6 +20,7 @@
 #define CONFIG_EFI
 #define CONFIG_EFI_PCDP
 #define CONFIG_SERIAL_SGI_L1_CONSOLE
+#define CONFIG_XENOPROF 1
 
 #define CONFIG_XEN_SMP
 
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/asm-x86/config.h	Mon Jan 23 09:39:58 2012 +0000
@@ -48,6 +48,8 @@
 #define CONFIG_HOTPLUG 1
 #define CONFIG_HOTPLUG_CPU 1
 
+#define CONFIG_XENOPROF 1
+
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/xen/kernel.h	Mon Jan 23 09:39:58 2012 +0000
@@ -66,19 +66,25 @@
 extern char _start[], _end[];
 #define is_kernel(p) ({                         \
     char *__p = (char *)(unsigned long)(p);     \
-    (__p >= _start) && (__p <= _end);           \
+    (__p >= _start) && (__p < _end);            \
 })
 
 extern char _stext[], _etext[];
 #define is_kernel_text(p) ({                    \
     char *__p = (char *)(unsigned long)(p);     \
-    (__p >= _stext) && (__p <= _etext);         \
+    (__p >= _stext) && (__p < _etext);          \
+})
+
+extern const char _srodata[], _erodata[];
+#define is_kernel_rodata(p) ({                  \
+    const char *__p = (const char *)(unsigned long)(p);     \
+    (__p >= _srodata) && (__p < _erodata);      \
 })
 
 extern char _sinittext[], _einittext[];
 #define is_kernel_inittext(p) ({                \
     char *__p = (char *)(unsigned long)(p);     \
-    (__p >= _sinittext) && (__p <= _einittext); \
+    (__p >= _sinittext) && (__p < _einittext);  \
 })
 
 #endif /* _LINUX_KERNEL_H */
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/xen/paging.h
--- a/xen/include/xen/paging.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/xen/paging.h	Mon Jan 23 09:39:58 2012 +0000
@@ -18,7 +18,7 @@
 
 #define paging_mode_translate(d)              (0)
 #define paging_mode_external(d)               (0)
-#define guest_physmap_add_page(d, p, m, o)    (0)
+#define guest_physmap_add_page(d, p, m, o)    ((void)0)
 #define guest_physmap_remove_page(d, p, m, o) ((void)0)
 
 #endif
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/xen/time.h
--- a/xen/include/xen/time.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/xen/time.h	Mon Jan 23 09:39:58 2012 +0000
@@ -30,6 +30,7 @@
  */
 
 typedef s64 s_time_t;
+#define PRI_stime PRId64
 
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPE-000608-TG; Mon, 23 Jan 2012 20:22:20 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPD-0005y6-8F
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1327350131!1841145!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21836 invoked from network); 23 Jan 2012 20:22:12 -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;
	23 Jan 2012 20:22:12 -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 1RpQP5-0001OP-D9
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP5-0000lB-2K
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Message-Id: <E1RpQP5-0000lB-2K@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Move cpufreq option parsing to
	cpufreq.c
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311514 0
# Node ID 95e07258d189579592fabd1fb6633dfc4a6be9bb
# Parent  5bb22a6871f6c2a0dcd8573135abdf8c91af6f17
Move cpufreq option parsing to cpufreq.c

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5bb22a6871f6 -r 95e07258d189 xen/common/domain.c
--- a/xen/common/domain.c	Mon Jan 23 09:36:54 2012 +0000
+++ b/xen/common/domain.c	Mon Jan 23 09:38:34 2012 +0000
@@ -31,8 +31,8 @@
 #include <xen/grant_table.h>
 #include <xen/xenoprof.h>
 #include <xen/irq.h>
-#include <acpi/cpufreq/cpufreq.h>
 #include <asm/debugger.h>
+#include <asm/processor.h>
 #include <public/sched.h>
 #include <public/sysctl.h>
 #include <public/vcpu.h>
@@ -45,40 +45,9 @@
 unsigned int xen_processor_pmbits = XEN_PROCESSOR_PM_PX;
 
 /* opt_dom0_vcpus_pin: If true, dom0 VCPUs are pinned. */
-static bool_t opt_dom0_vcpus_pin;
+bool_t opt_dom0_vcpus_pin;
 boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
 
-/* set xen as default cpufreq */
-enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
-
-static void __init setup_cpufreq_option(char *str)
-{
-    char *arg;
-
-    if ( !strcmp(str, "dom0-kernel") )
-    {
-        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_dom0_kernel;
-        opt_dom0_vcpus_pin = 1;
-        return;
-    }
-
-    if ( !strcmp(str, "none") )
-    {
-        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_none;
-        return;
-    }
-
-    if ( (arg = strpbrk(str, ",:")) != NULL )
-        *arg++ = '\0';
-
-    if ( !strcmp(str, "xen") )
-        if ( arg && *arg )
-            cpufreq_cmdline_parse(arg);
-}
-custom_param("cpufreq", setup_cpufreq_option);
-
 /* Protect updates/reads (resp.) of domain_list and domain_hash. */
 DEFINE_SPINLOCK(domlist_update_lock);
 DEFINE_RCU_READ_LOCK(domlist_read_lock);
diff -r 5bb22a6871f6 -r 95e07258d189 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Mon Jan 23 09:36:54 2012 +0000
+++ b/xen/drivers/cpufreq/cpufreq.c	Mon Jan 23 09:38:34 2012 +0000
@@ -60,6 +60,37 @@
 struct cpufreq_governor *__read_mostly cpufreq_opt_governor;
 LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 
+/* set xen as default cpufreq */
+enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
+
+static void __init setup_cpufreq_option(char *str)
+{
+    char *arg;
+
+    if ( !strcmp(str, "dom0-kernel") )
+    {
+        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
+        cpufreq_controller = FREQCTL_dom0_kernel;
+        opt_dom0_vcpus_pin = 1;
+        return;
+    }
+
+    if ( !strcmp(str, "none") )
+    {
+        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
+        cpufreq_controller = FREQCTL_none;
+        return;
+    }
+
+    if ( (arg = strpbrk(str, ",:")) != NULL )
+        *arg++ = '\0';
+
+    if ( !strcmp(str, "xen") )
+        if ( arg && *arg )
+            cpufreq_cmdline_parse(arg);
+}
+custom_param("cpufreq", setup_cpufreq_option);
+
 bool_t __read_mostly cpufreq_verbose;
 
 struct cpufreq_governor *__find_governor(const char *governor)
diff -r 5bb22a6871f6 -r 95e07258d189 xen/include/xen/domain.h
--- a/xen/include/xen/domain.h	Mon Jan 23 09:36:54 2012 +0000
+++ b/xen/include/xen/domain.h	Mon Jan 23 09:38:34 2012 +0000
@@ -83,4 +83,6 @@
 
 extern unsigned int xen_processor_pmbits;
 
+extern bool_t opt_dom0_vcpus_pin;
+
 #endif /* __XEN_DOMAIN_H__ */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPE-00060E-WB; Mon, 23 Jan 2012 20:22:20 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPD-0005y9-Jn
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1327350015!60906474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1330 invoked from network); 23 Jan 2012 20:20:16 -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;
	23 Jan 2012 20:20:16 -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 1RpQP6-0001OV-9l
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP6-0000m5-5C
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Message-Id: <E1RpQP6-0000m5-5C@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] A collection of fixes to Xen common
	files
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311598 0
# Node ID 96e071fbefd7fb1331a04b0bc11c1518605d3c02
# Parent  ab0eab766edb933431d29e35cc18075be2a9bf41
A collection of fixes to Xen common files

- call free_xenoprof_pages only ifdef CONFIG_XENOPROF;
- define PRI_stime as PRId64 in an header file;
- respect boundaries in is_kernel_*;
- implement is_kernel_rodata;
- guest_physmap_add_page should be ((void)0).
- fix guest_physmap_add_page;
- introduce CONFIG_XENOPROF;
- define _srodata and _erodata as const char*.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ab0eab766edb -r 96e071fbefd7 xen/common/domain.c
--- a/xen/common/domain.c	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/common/domain.c	Mon Jan 23 09:39:58 2012 +0000
@@ -635,7 +635,9 @@
     sched_destroy_domain(d);
 
     /* Free page used by xen oprofile buffer. */
+#ifdef CONFIG_XENOPROF
     free_xenoprof_pages(d);
+#endif
 
     xfree(d->mem_event);
 
diff -r ab0eab766edb -r 96e071fbefd7 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/common/sched_credit2.c	Mon Jan 23 09:39:58 2012 +0000
@@ -26,12 +26,6 @@
 #include <xen/trace.h>
 #include <xen/cpu.h>
 
-#if __i386__
-#define PRI_stime "lld"
-#else
-#define PRI_stime "ld"
-#endif
-
 #define d2printk(x...)
 //#define d2printk printk
 
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/asm-ia64/config.h	Mon Jan 23 09:39:58 2012 +0000
@@ -20,6 +20,7 @@
 #define CONFIG_EFI
 #define CONFIG_EFI_PCDP
 #define CONFIG_SERIAL_SGI_L1_CONSOLE
+#define CONFIG_XENOPROF 1
 
 #define CONFIG_XEN_SMP
 
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/asm-x86/config.h	Mon Jan 23 09:39:58 2012 +0000
@@ -48,6 +48,8 @@
 #define CONFIG_HOTPLUG 1
 #define CONFIG_HOTPLUG_CPU 1
 
+#define CONFIG_XENOPROF 1
+
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/xen/kernel.h	Mon Jan 23 09:39:58 2012 +0000
@@ -66,19 +66,25 @@
 extern char _start[], _end[];
 #define is_kernel(p) ({                         \
     char *__p = (char *)(unsigned long)(p);     \
-    (__p >= _start) && (__p <= _end);           \
+    (__p >= _start) && (__p < _end);            \
 })
 
 extern char _stext[], _etext[];
 #define is_kernel_text(p) ({                    \
     char *__p = (char *)(unsigned long)(p);     \
-    (__p >= _stext) && (__p <= _etext);         \
+    (__p >= _stext) && (__p < _etext);          \
+})
+
+extern const char _srodata[], _erodata[];
+#define is_kernel_rodata(p) ({                  \
+    const char *__p = (const char *)(unsigned long)(p);     \
+    (__p >= _srodata) && (__p < _erodata);      \
 })
 
 extern char _sinittext[], _einittext[];
 #define is_kernel_inittext(p) ({                \
     char *__p = (char *)(unsigned long)(p);     \
-    (__p >= _sinittext) && (__p <= _einittext); \
+    (__p >= _sinittext) && (__p < _einittext);  \
 })
 
 #endif /* _LINUX_KERNEL_H */
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/xen/paging.h
--- a/xen/include/xen/paging.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/xen/paging.h	Mon Jan 23 09:39:58 2012 +0000
@@ -18,7 +18,7 @@
 
 #define paging_mode_translate(d)              (0)
 #define paging_mode_external(d)               (0)
-#define guest_physmap_add_page(d, p, m, o)    (0)
+#define guest_physmap_add_page(d, p, m, o)    ((void)0)
 #define guest_physmap_remove_page(d, p, m, o) ((void)0)
 
 #endif
diff -r ab0eab766edb -r 96e071fbefd7 xen/include/xen/time.h
--- a/xen/include/xen/time.h	Mon Jan 23 09:39:11 2012 +0000
+++ b/xen/include/xen/time.h	Mon Jan 23 09:39:58 2012 +0000
@@ -30,6 +30,7 @@
  */
 
 typedef s64 s_time_t;
+#define PRI_stime PRId64
 
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPE-000608-TG; Mon, 23 Jan 2012 20:22:20 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPD-0005y6-8F
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1327350131!1841145!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21836 invoked from network); 23 Jan 2012 20:22:12 -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;
	23 Jan 2012 20:22:12 -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 1RpQP5-0001OP-D9
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP5-0000lB-2K
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Message-Id: <E1RpQP5-0000lB-2K@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Move cpufreq option parsing to
	cpufreq.c
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311514 0
# Node ID 95e07258d189579592fabd1fb6633dfc4a6be9bb
# Parent  5bb22a6871f6c2a0dcd8573135abdf8c91af6f17
Move cpufreq option parsing to cpufreq.c

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5bb22a6871f6 -r 95e07258d189 xen/common/domain.c
--- a/xen/common/domain.c	Mon Jan 23 09:36:54 2012 +0000
+++ b/xen/common/domain.c	Mon Jan 23 09:38:34 2012 +0000
@@ -31,8 +31,8 @@
 #include <xen/grant_table.h>
 #include <xen/xenoprof.h>
 #include <xen/irq.h>
-#include <acpi/cpufreq/cpufreq.h>
 #include <asm/debugger.h>
+#include <asm/processor.h>
 #include <public/sched.h>
 #include <public/sysctl.h>
 #include <public/vcpu.h>
@@ -45,40 +45,9 @@
 unsigned int xen_processor_pmbits = XEN_PROCESSOR_PM_PX;
 
 /* opt_dom0_vcpus_pin: If true, dom0 VCPUs are pinned. */
-static bool_t opt_dom0_vcpus_pin;
+bool_t opt_dom0_vcpus_pin;
 boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
 
-/* set xen as default cpufreq */
-enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
-
-static void __init setup_cpufreq_option(char *str)
-{
-    char *arg;
-
-    if ( !strcmp(str, "dom0-kernel") )
-    {
-        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_dom0_kernel;
-        opt_dom0_vcpus_pin = 1;
-        return;
-    }
-
-    if ( !strcmp(str, "none") )
-    {
-        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_none;
-        return;
-    }
-
-    if ( (arg = strpbrk(str, ",:")) != NULL )
-        *arg++ = '\0';
-
-    if ( !strcmp(str, "xen") )
-        if ( arg && *arg )
-            cpufreq_cmdline_parse(arg);
-}
-custom_param("cpufreq", setup_cpufreq_option);
-
 /* Protect updates/reads (resp.) of domain_list and domain_hash. */
 DEFINE_SPINLOCK(domlist_update_lock);
 DEFINE_RCU_READ_LOCK(domlist_read_lock);
diff -r 5bb22a6871f6 -r 95e07258d189 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c	Mon Jan 23 09:36:54 2012 +0000
+++ b/xen/drivers/cpufreq/cpufreq.c	Mon Jan 23 09:38:34 2012 +0000
@@ -60,6 +60,37 @@
 struct cpufreq_governor *__read_mostly cpufreq_opt_governor;
 LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 
+/* set xen as default cpufreq */
+enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
+
+static void __init setup_cpufreq_option(char *str)
+{
+    char *arg;
+
+    if ( !strcmp(str, "dom0-kernel") )
+    {
+        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
+        cpufreq_controller = FREQCTL_dom0_kernel;
+        opt_dom0_vcpus_pin = 1;
+        return;
+    }
+
+    if ( !strcmp(str, "none") )
+    {
+        xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
+        cpufreq_controller = FREQCTL_none;
+        return;
+    }
+
+    if ( (arg = strpbrk(str, ",:")) != NULL )
+        *arg++ = '\0';
+
+    if ( !strcmp(str, "xen") )
+        if ( arg && *arg )
+            cpufreq_cmdline_parse(arg);
+}
+custom_param("cpufreq", setup_cpufreq_option);
+
 bool_t __read_mostly cpufreq_verbose;
 
 struct cpufreq_governor *__find_governor(const char *governor)
diff -r 5bb22a6871f6 -r 95e07258d189 xen/include/xen/domain.h
--- a/xen/include/xen/domain.h	Mon Jan 23 09:36:54 2012 +0000
+++ b/xen/include/xen/domain.h	Mon Jan 23 09:38:34 2012 +0000
@@ -83,4 +83,6 @@
 
 extern unsigned int xen_processor_pmbits;
 
+extern bool_t opt_dom0_vcpus_pin;
+
 #endif /* __XEN_DOMAIN_H__ */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPG-00060Z-2g; Mon, 23 Jan 2012 20:22:22 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPE-0005yG-Jc
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1327350133!1841151!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21902 invoked from network); 23 Jan 2012 20:22:14 -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;
	23 Jan 2012 20:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP6-0001Oa-UR
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP6-0000mW-MC
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Message-Id: <E1RpQP6-0000mW-MC@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: implement an signed 64 bit
	division helper function
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311635 0
# Node ID 37eefb79503cc36a5e3ca324744b06dffb4fb912
# Parent  96e071fbefd7fb1331a04b0bc11c1518605d3c02
xen: implement an signed 64 bit division helper function

Implement a C function to perform 64 bit signed division and return
both quotient and remainder.
Useful as an helper function to implement __aeabi_ldivmod.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 96e071fbefd7 -r 37eefb79503c xen/common/lib.c
--- a/xen/common/lib.c	Mon Jan 23 09:39:58 2012 +0000
+++ b/xen/common/lib.c	Mon Jan 23 09:40:35 2012 +0000
@@ -399,6 +399,25 @@
     return (neg ? -urem : urem);
 }
 
+/*
+ * Quotient and remainder of unsigned long long division
+ */
+s64 __ldivmod_helper(s64 a, s64 b, s64 *r)
+{
+    u64 ua, ub, rem, quot;
+
+    ua = ABS(a);
+    ub = ABS(b);
+    quot = __qdivrem(ua, ub, &rem);
+    if ( a < 0 )
+        *r = -rem;
+    else
+        *r = rem;
+    if ( (a < 0) ^ (b < 0) )
+        return -quot;
+    else
+        return quot;
+}
 #endif /* BITS_PER_LONG == 32 */
 
 /* Compute with 96 bit intermediate result: (a*b)/c */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPG-00060Z-2g; Mon, 23 Jan 2012 20:22:22 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPE-0005yG-Jc
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1327350133!1841151!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21902 invoked from network); 23 Jan 2012 20:22:14 -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;
	23 Jan 2012 20:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP6-0001Oa-UR
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP6-0000mW-MC
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:12 +0000
Message-Id: <E1RpQP6-0000mW-MC@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: implement an signed 64 bit
	division helper function
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311635 0
# Node ID 37eefb79503cc36a5e3ca324744b06dffb4fb912
# Parent  96e071fbefd7fb1331a04b0bc11c1518605d3c02
xen: implement an signed 64 bit division helper function

Implement a C function to perform 64 bit signed division and return
both quotient and remainder.
Useful as an helper function to implement __aeabi_ldivmod.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 96e071fbefd7 -r 37eefb79503c xen/common/lib.c
--- a/xen/common/lib.c	Mon Jan 23 09:39:58 2012 +0000
+++ b/xen/common/lib.c	Mon Jan 23 09:40:35 2012 +0000
@@ -399,6 +399,25 @@
     return (neg ? -urem : urem);
 }
 
+/*
+ * Quotient and remainder of unsigned long long division
+ */
+s64 __ldivmod_helper(s64 a, s64 b, s64 *r)
+{
+    u64 ua, ub, rem, quot;
+
+    ua = ABS(a);
+    ub = ABS(b);
+    quot = __qdivrem(ua, ub, &rem);
+    if ( a < 0 )
+        *r = -rem;
+    else
+        *r = rem;
+    if ( (a < 0) ^ (b < 0) )
+        return -quot;
+    else
+        return quot;
+}
 #endif /* BITS_PER_LONG == 32 */
 
 /* Compute with 96 bit intermediate result: (a*b)/c */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-00062k-B8; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPG-0005yX-2G
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1327350099!49480168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 906 invoked from network); 23 Jan 2012 20:21:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:21:40 -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 1RpQP8-0001Oo-RU
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP8-0000oL-QJ
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Message-Id: <E1RpQP8-0000oL-QJ@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] decompressors: fix string typo
	'bufer'
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Bolle <pebolle@tiscali.nl>
# Date 1327326685 -3600
# Node ID cc9105fa55e0821023b43f179fb00fd4ee0da771
# Parent  9920641d11169a86ec9d0cb47e78414720545861
decompressors: fix string typo 'bufer'

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 9920641d1116 -r cc9105fa55e0 xen/common/bunzip2.c
--- a/xen/common/bunzip2.c	Mon Jan 23 14:51:02 2012 +0100
+++ b/xen/common/bunzip2.c	Mon Jan 23 14:51:25 2012 +0100
@@ -680,7 +680,7 @@
 		outbuf = malloc(BZIP2_IOBUF_SIZE);
 
 	if (!outbuf) {
-		error("Could not allocate output bufer");
+		error("Could not allocate output buffer");
 		return RETVAL_OUT_OF_MEMORY;
 	}
 	if (buf)
@@ -688,7 +688,7 @@
 	else
 		inbuf = malloc(BZIP2_IOBUF_SIZE);
 	if (!inbuf) {
-		error("Could not allocate input bufer");
+		error("Could not allocate input buffer");
 		i = RETVAL_OUT_OF_MEMORY;
 		goto exit_0;
 	}
diff -r 9920641d1116 -r cc9105fa55e0 xen/common/unlzma.c
--- a/xen/common/unlzma.c	Mon Jan 23 14:51:02 2012 +0100
+++ b/xen/common/unlzma.c	Mon Jan 23 14:51:25 2012 +0100
@@ -556,7 +556,7 @@
 	else
 		inbuf = malloc(LZMA_IOBUF_SIZE);
 	if (!inbuf) {
-		error("Could not allocate input bufer");
+		error("Could not allocate input buffer");
 		goto exit_0;
 	}
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20:22: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.xensource.com>)
	id 1RpQPI-00062k-B8; Mon, 23 Jan 2012 20:22:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPG-0005yX-2G
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1327350099!49480168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 906 invoked from network); 23 Jan 2012 20:21:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Jan 2012 20:21:40 -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 1RpQP8-0001Oo-RU
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP8-0000oL-QJ
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:14 +0000
Message-Id: <E1RpQP8-0000oL-QJ@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] decompressors: fix string typo
	'bufer'
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Paul Bolle <pebolle@tiscali.nl>
# Date 1327326685 -3600
# Node ID cc9105fa55e0821023b43f179fb00fd4ee0da771
# Parent  9920641d11169a86ec9d0cb47e78414720545861
decompressors: fix string typo 'bufer'

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 9920641d1116 -r cc9105fa55e0 xen/common/bunzip2.c
--- a/xen/common/bunzip2.c	Mon Jan 23 14:51:02 2012 +0100
+++ b/xen/common/bunzip2.c	Mon Jan 23 14:51:25 2012 +0100
@@ -680,7 +680,7 @@
 		outbuf = malloc(BZIP2_IOBUF_SIZE);
 
 	if (!outbuf) {
-		error("Could not allocate output bufer");
+		error("Could not allocate output buffer");
 		return RETVAL_OUT_OF_MEMORY;
 	}
 	if (buf)
@@ -688,7 +688,7 @@
 	else
 		inbuf = malloc(BZIP2_IOBUF_SIZE);
 	if (!inbuf) {
-		error("Could not allocate input bufer");
+		error("Could not allocate input buffer");
 		i = RETVAL_OUT_OF_MEMORY;
 		goto exit_0;
 	}
diff -r 9920641d1116 -r cc9105fa55e0 xen/common/unlzma.c
--- a/xen/common/unlzma.c	Mon Jan 23 14:51:02 2012 +0100
+++ b/xen/common/unlzma.c	Mon Jan 23 14:51:25 2012 +0100
@@ -556,7 +556,7 @@
 	else
 		inbuf = malloc(LZMA_IOBUF_SIZE);
 	if (!inbuf) {
-		error("Could not allocate input bufer");
+		error("Could not allocate input buffer");
 		goto exit_0;
 	}
 

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20: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.xensource.com>)
	id 1RpQPK-00065k-Li; Mon, 23 Jan 2012 20:22:26 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPJ-0005zh-IY
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327350131!8292453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23917 invoked from network); 23 Jan 2012 20:22:19 -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;
	23 Jan 2012 20:22:19 -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 1RpQP5-0001OS-LJ
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP5-0000le-KG
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Message-Id: <E1RpQP5-0000le-KG@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Include some header files that are
	not automatically included on all archs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311551 0
# Node ID ab0eab766edb933431d29e35cc18075be2a9bf41
# Parent  95e07258d189579592fabd1fb6633dfc4a6be9bb
Include some header files that are not automatically included on all archs

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 95e07258d189 -r ab0eab766edb xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/domctl.c	Mon Jan 23 09:39:11 2012 +0000
@@ -24,6 +24,7 @@
 #include <xen/paging.h>
 #include <xen/hypercall.h>
 #include <asm/current.h>
+#include <asm/page.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
 
diff -r 95e07258d189 -r ab0eab766edb xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/grant_table.c	Mon Jan 23 09:39:11 2012 +0000
@@ -38,6 +38,7 @@
 #include <xen/paging.h>
 #include <xen/keyhandler.h>
 #include <xsm/xsm.h>
+#include <asm/flushtlb.h>
 
 #ifndef max_nr_grant_frames
 unsigned int max_nr_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
diff -r 95e07258d189 -r ab0eab766edb xen/common/irq.c
--- a/xen/common/irq.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/irq.c	Mon Jan 23 09:39:11 2012 +0000
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <xen/irq.h>
+#include <xen/errno.h>
 
 int init_one_irq_desc(struct irq_desc *desc)
 {
diff -r 95e07258d189 -r ab0eab766edb xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/keyhandler.c	Mon Jan 23 09:39:11 2012 +0000
@@ -15,6 +15,7 @@
 #include <xen/compat.h>
 #include <xen/ctype.h>
 #include <xen/perfc.h>
+#include <xen/init.h>
 #include <asm/debugger.h>
 #include <asm/div64.h>
 
diff -r 95e07258d189 -r ab0eab766edb xen/common/memory.c
--- a/xen/common/memory.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/memory.c	Mon Jan 23 09:39:11 2012 +0000
@@ -23,8 +23,8 @@
 #include <xen/tmem_xen.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
-#ifdef CONFIG_X86
-# include <asm/p2m.h>
+#ifndef __ia64__
+#include <asm/p2m.h>
 #endif
 #include <xen/numa.h>
 #include <public/memory.h>
diff -r 95e07258d189 -r ab0eab766edb xen/common/spinlock.c
--- a/xen/common/spinlock.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/spinlock.c	Mon Jan 23 09:39:11 2012 +0000
@@ -8,6 +8,7 @@
 #include <xen/preempt.h>
 #include <public/sysctl.h>
 #include <asm/processor.h>
+#include <asm/atomic.h>
 
 #ifndef NDEBUG
 
diff -r 95e07258d189 -r ab0eab766edb xen/common/wait.c
--- a/xen/common/wait.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/wait.c	Mon Jan 23 09:39:11 2012 +0000
@@ -23,6 +23,7 @@
 #include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/wait.h>
+#include <xen/errno.h>
 
 struct waitqueue_vcpu {
     struct list_head list;
diff -r 95e07258d189 -r ab0eab766edb xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/drivers/char/console.c	Mon Jan 23 09:39:11 2012 +0000
@@ -12,6 +12,7 @@
 
 #include <xen/version.h>
 #include <xen/lib.h>
+#include <xen/init.h>
 #include <xen/event.h>
 #include <xen/console.h>
 #include <xen/serial.h>
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/grant_table.h	Mon Jan 23 09:39:11 2012 +0000
@@ -25,6 +25,7 @@
 #define __XEN_GRANT_TABLE_H__
 
 #include <public/grant_table.h>
+#include <asm/page.h>
 #include <asm/grant_table.h>
 
 /* Active grant entry - used for shadowing GTF_permit_access grants. */
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/list.h
--- a/xen/include/xen/list.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/list.h	Mon Jan 23 09:39:11 2012 +0000
@@ -8,6 +8,7 @@
 #define __XEN_LIST_H__
 
 #include <xen/lib.h>
+#include <xen/prefetch.h>
 #include <asm/system.h>
 
 /* These are non-NULL pointers that will result in page faults
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/sched.h	Mon Jan 23 09:39:11 2012 +0000
@@ -13,6 +13,10 @@
 #include <xen/nodemask.h>
 #include <xen/radix-tree.h>
 #include <xen/multicall.h>
+#include <xen/tasklet.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+#include <asm/atomic.h>
 #include <xen/wait.h>
 #include <public/xen.h>
 #include <public/domctl.h>
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/timer.h
--- a/xen/include/xen/timer.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/timer.h	Mon Jan 23 09:39:11 2012 +0000
@@ -12,6 +12,7 @@
 #include <xen/time.h>
 #include <xen/string.h>
 #include <xen/list.h>
+#include <xen/percpu.h>
 
 struct timer {
     /* System time expiry value (nanoseconds since boot). */
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/tmem_xen.h	Mon Jan 23 09:39:11 2012 +0000
@@ -10,6 +10,7 @@
 #define __XEN_TMEM_XEN_H__
 
 #include <xen/mm.h> /* heap alloc/free */
+#include <xen/pfn.h>
 #include <xen/xmalloc.h> /* xmalloc/xfree */
 #include <xen/sched.h>  /* struct domain */
 #include <xen/guest_access.h> /* copy_from_guest */

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

From xen-changelog-bounces@lists.xensource.com Mon Jan 23 20:22:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Jan 2012 20: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.xensource.com>)
	id 1RpQPK-00065k-Li; Mon, 23 Jan 2012 20:22:26 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQPJ-0005zh-IY
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327350131!8292453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23917 invoked from network); 23 Jan 2012 20:22:19 -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;
	23 Jan 2012 20:22:19 -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 1RpQP5-0001OS-LJ
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpQP5-0000le-KG
	for xen-changelog@lists.xensource.com; Mon, 23 Jan 2012 20:22:11 +0000
Message-Id: <E1RpQP5-0000le-KG@xenbits.xen.org>
Date: Mon, 23 Jan 2012 20:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Include some header files that are
	not automatically included on all archs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327311551 0
# Node ID ab0eab766edb933431d29e35cc18075be2a9bf41
# Parent  95e07258d189579592fabd1fb6633dfc4a6be9bb
Include some header files that are not automatically included on all archs

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 95e07258d189 -r ab0eab766edb xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/domctl.c	Mon Jan 23 09:39:11 2012 +0000
@@ -24,6 +24,7 @@
 #include <xen/paging.h>
 #include <xen/hypercall.h>
 #include <asm/current.h>
+#include <asm/page.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
 
diff -r 95e07258d189 -r ab0eab766edb xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/grant_table.c	Mon Jan 23 09:39:11 2012 +0000
@@ -38,6 +38,7 @@
 #include <xen/paging.h>
 #include <xen/keyhandler.h>
 #include <xsm/xsm.h>
+#include <asm/flushtlb.h>
 
 #ifndef max_nr_grant_frames
 unsigned int max_nr_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
diff -r 95e07258d189 -r ab0eab766edb xen/common/irq.c
--- a/xen/common/irq.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/irq.c	Mon Jan 23 09:39:11 2012 +0000
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <xen/irq.h>
+#include <xen/errno.h>
 
 int init_one_irq_desc(struct irq_desc *desc)
 {
diff -r 95e07258d189 -r ab0eab766edb xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/keyhandler.c	Mon Jan 23 09:39:11 2012 +0000
@@ -15,6 +15,7 @@
 #include <xen/compat.h>
 #include <xen/ctype.h>
 #include <xen/perfc.h>
+#include <xen/init.h>
 #include <asm/debugger.h>
 #include <asm/div64.h>
 
diff -r 95e07258d189 -r ab0eab766edb xen/common/memory.c
--- a/xen/common/memory.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/memory.c	Mon Jan 23 09:39:11 2012 +0000
@@ -23,8 +23,8 @@
 #include <xen/tmem_xen.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
-#ifdef CONFIG_X86
-# include <asm/p2m.h>
+#ifndef __ia64__
+#include <asm/p2m.h>
 #endif
 #include <xen/numa.h>
 #include <public/memory.h>
diff -r 95e07258d189 -r ab0eab766edb xen/common/spinlock.c
--- a/xen/common/spinlock.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/spinlock.c	Mon Jan 23 09:39:11 2012 +0000
@@ -8,6 +8,7 @@
 #include <xen/preempt.h>
 #include <public/sysctl.h>
 #include <asm/processor.h>
+#include <asm/atomic.h>
 
 #ifndef NDEBUG
 
diff -r 95e07258d189 -r ab0eab766edb xen/common/wait.c
--- a/xen/common/wait.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/common/wait.c	Mon Jan 23 09:39:11 2012 +0000
@@ -23,6 +23,7 @@
 #include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/wait.h>
+#include <xen/errno.h>
 
 struct waitqueue_vcpu {
     struct list_head list;
diff -r 95e07258d189 -r ab0eab766edb xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/drivers/char/console.c	Mon Jan 23 09:39:11 2012 +0000
@@ -12,6 +12,7 @@
 
 #include <xen/version.h>
 #include <xen/lib.h>
+#include <xen/init.h>
 #include <xen/event.h>
 #include <xen/console.h>
 #include <xen/serial.h>
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/grant_table.h	Mon Jan 23 09:39:11 2012 +0000
@@ -25,6 +25,7 @@
 #define __XEN_GRANT_TABLE_H__
 
 #include <public/grant_table.h>
+#include <asm/page.h>
 #include <asm/grant_table.h>
 
 /* Active grant entry - used for shadowing GTF_permit_access grants. */
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/list.h
--- a/xen/include/xen/list.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/list.h	Mon Jan 23 09:39:11 2012 +0000
@@ -8,6 +8,7 @@
 #define __XEN_LIST_H__
 
 #include <xen/lib.h>
+#include <xen/prefetch.h>
 #include <asm/system.h>
 
 /* These are non-NULL pointers that will result in page faults
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/sched.h	Mon Jan 23 09:39:11 2012 +0000
@@ -13,6 +13,10 @@
 #include <xen/nodemask.h>
 #include <xen/radix-tree.h>
 #include <xen/multicall.h>
+#include <xen/tasklet.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+#include <asm/atomic.h>
 #include <xen/wait.h>
 #include <public/xen.h>
 #include <public/domctl.h>
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/timer.h
--- a/xen/include/xen/timer.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/timer.h	Mon Jan 23 09:39:11 2012 +0000
@@ -12,6 +12,7 @@
 #include <xen/time.h>
 #include <xen/string.h>
 #include <xen/list.h>
+#include <xen/percpu.h>
 
 struct timer {
     /* System time expiry value (nanoseconds since boot). */
diff -r 95e07258d189 -r ab0eab766edb xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Mon Jan 23 09:38:34 2012 +0000
+++ b/xen/include/xen/tmem_xen.h	Mon Jan 23 09:39:11 2012 +0000
@@ -10,6 +10,7 @@
 #define __XEN_TMEM_XEN_H__
 
 #include <xen/mm.h> /* heap alloc/free */
+#include <xen/pfn.h>
 #include <xen/xmalloc.h> /* xmalloc/xfree */
 #include <xen/sched.h>  /* struct domain */
 #include <xen/guest_access.h> /* copy_from_guest */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1Rptx8-00087c-UG; Wed, 25 Jan 2012 03:55:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx7-00087O-NJ
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1327463693!50121543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8247 invoked from network); 25 Jan 2012 03:54:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:54:54 -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 1Rptx4-0008Kb-W3
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx4-0001xY-OE
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Message-Id: <E1Rptx4-0001xY-OE@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Introduce git-checkout.sh
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417769 0
# Node ID 0bc51b1f2d74750888b70984fec7b7289d74bea0
# Parent  0f8f633dbe2d182d448214fefb4e2e3afaa75e7e
Introduce git-checkout.sh

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Introduce a script to perform git checkout on an external git tree; use
git-checkout.sh in ioemu-dir-find.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 0f8f633dbe2d -r 0bc51b1f2d74 .hgignore
--- a/.hgignore	Tue Jan 24 14:21:12 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:29 2012 +0000
@@ -296,7 +296,7 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
-^tools/ioemu-remote
+^tools/ioemu-dir-remote
 ^tools/ioemu-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
diff -r 0f8f633dbe2d -r 0bc51b1f2d74 scripts/git-checkout.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/git-checkout.sh	Tue Jan 24 15:09:29 2012 +0000
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if test $# -lt 3; then
+	echo "Usage: $0 <tree> <tag> <dir>"
+	exit 1
+fi
+
+TREE=$1
+TAG=$2
+DIR=$3
+
+set -e
+
+if test \! -d $DIR-remote; then
+	rm -rf $DIR-remote $DIR-remote.tmp
+	mkdir $DIR-remote.tmp; rmdir $DIR-remote.tmp
+	$GIT clone $TREE $DIR-remote.tmp
+	if test "$TAG" ; then
+		cd $DIR-remote.tmp
+		$GIT branch -D dummy >/dev/null 2>&1 ||:
+		$GIT checkout -b dummy $TAG
+		cd ..
+	fi
+	mv $DIR-remote.tmp $DIR-remote
+fi
+rm -f $DIR
+ln -sf $DIR-remote $DIR
diff -r 0f8f633dbe2d -r 0bc51b1f2d74 tools/Makefile
--- a/tools/Makefile	Tue Jan 24 14:21:12 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -75,7 +75,7 @@
 
 .PHONY: distclean
 distclean: subdirs-distclean
-	rm -rf ioemu-dir ioemu-remote
+	rm -rf ioemu-dir ioemu-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -93,20 +93,8 @@
 	if test -d $(CONFIG_QEMU); then \
 		mkdir -p ioemu-dir; \
 	else \
-		if [ ! -d ioemu-remote ]; then \
-			rm -rf ioemu-remote ioemu-remote.tmp; \
-			mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
-			$(GIT) clone $(CONFIG_QEMU) ioemu-remote.tmp; \
-			if [ "$(QEMU_TAG)" ]; then			\
-				cd ioemu-remote.tmp;			\
-				$(GIT) branch -D dummy >/dev/null 2>&1 ||:; \
-				$(GIT) checkout -b dummy $(QEMU_TAG);	\
-				cd ..;					\
-			fi;						\
-			mv ioemu-remote.tmp ioemu-remote; \
-		fi; \
-		rm -f ioemu-dir; \
-		ln -sf ioemu-remote ioemu-dir; \
+		export GIT=$(GIT); \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) ioemu-dir; \
 	fi
 	set -e; \
 		$(buildmakevars2shellvars); \
@@ -117,7 +105,7 @@
 ioemu-dir-force-update:
 	set -ex; \
 	if [ "$(QEMU_TAG)" ]; then \
-		cd ioemu-remote; \
+		cd ioemu-dir-remote; \
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(QEMU_TAG); \
 	fi

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1Rptx8-00087c-UG; Wed, 25 Jan 2012 03:55:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx7-00087O-NJ
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1327463693!50121543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8247 invoked from network); 25 Jan 2012 03:54:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:54:54 -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 1Rptx4-0008Kb-W3
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx4-0001xY-OE
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Message-Id: <E1Rptx4-0001xY-OE@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Introduce git-checkout.sh
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417769 0
# Node ID 0bc51b1f2d74750888b70984fec7b7289d74bea0
# Parent  0f8f633dbe2d182d448214fefb4e2e3afaa75e7e
Introduce git-checkout.sh

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Introduce a script to perform git checkout on an external git tree; use
git-checkout.sh in ioemu-dir-find.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 0f8f633dbe2d -r 0bc51b1f2d74 .hgignore
--- a/.hgignore	Tue Jan 24 14:21:12 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:29 2012 +0000
@@ -296,7 +296,7 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
-^tools/ioemu-remote
+^tools/ioemu-dir-remote
 ^tools/ioemu-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
diff -r 0f8f633dbe2d -r 0bc51b1f2d74 scripts/git-checkout.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/git-checkout.sh	Tue Jan 24 15:09:29 2012 +0000
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if test $# -lt 3; then
+	echo "Usage: $0 <tree> <tag> <dir>"
+	exit 1
+fi
+
+TREE=$1
+TAG=$2
+DIR=$3
+
+set -e
+
+if test \! -d $DIR-remote; then
+	rm -rf $DIR-remote $DIR-remote.tmp
+	mkdir $DIR-remote.tmp; rmdir $DIR-remote.tmp
+	$GIT clone $TREE $DIR-remote.tmp
+	if test "$TAG" ; then
+		cd $DIR-remote.tmp
+		$GIT branch -D dummy >/dev/null 2>&1 ||:
+		$GIT checkout -b dummy $TAG
+		cd ..
+	fi
+	mv $DIR-remote.tmp $DIR-remote
+fi
+rm -f $DIR
+ln -sf $DIR-remote $DIR
diff -r 0f8f633dbe2d -r 0bc51b1f2d74 tools/Makefile
--- a/tools/Makefile	Tue Jan 24 14:21:12 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -75,7 +75,7 @@
 
 .PHONY: distclean
 distclean: subdirs-distclean
-	rm -rf ioemu-dir ioemu-remote
+	rm -rf ioemu-dir ioemu-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -93,20 +93,8 @@
 	if test -d $(CONFIG_QEMU); then \
 		mkdir -p ioemu-dir; \
 	else \
-		if [ ! -d ioemu-remote ]; then \
-			rm -rf ioemu-remote ioemu-remote.tmp; \
-			mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
-			$(GIT) clone $(CONFIG_QEMU) ioemu-remote.tmp; \
-			if [ "$(QEMU_TAG)" ]; then			\
-				cd ioemu-remote.tmp;			\
-				$(GIT) branch -D dummy >/dev/null 2>&1 ||:; \
-				$(GIT) checkout -b dummy $(QEMU_TAG);	\
-				cd ..;					\
-			fi;						\
-			mv ioemu-remote.tmp ioemu-remote; \
-		fi; \
-		rm -f ioemu-dir; \
-		ln -sf ioemu-remote ioemu-dir; \
+		export GIT=$(GIT); \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) ioemu-dir; \
 	fi
 	set -e; \
 		$(buildmakevars2shellvars); \
@@ -117,7 +105,7 @@
 ioemu-dir-force-update:
 	set -ex; \
 	if [ "$(QEMU_TAG)" ]; then \
-		cd ioemu-remote; \
+		cd ioemu-dir-remote; \
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(QEMU_TAG); \
 	fi

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1Rptx7-00087Q-Rd; Wed, 25 Jan 2012 03:55:17 +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 1Rptx6-00087I-7m
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Received: from [85.158.138.51:21068] by server-1.bemta-3.messagelabs.com id
	6A/A6-09565-32D7F1F4; Wed, 25 Jan 2012 03:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1327463713!10551100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25225 invoked from network); 25 Jan 2012 03:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx2-0008KP-EC
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx1-0001vc-Ud
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:11 +0000
Message-Id: <E1Rptx1-0001vc-Ud@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add a GNTTABOP to swap the content
	of two grant references under lock
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1327414564 0
# Node ID d115844ebfbb02bd785a4bd1b50fa31072f36bff
# Parent  370924e204dc29e12cd807dd730974d6b2bc53d3
Add a GNTTABOP to swap the content of two grant references under lock
provided that they are not currently active.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 370924e204dc -r d115844ebfbb xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Jan 24 14:16:04 2012 +0000
@@ -2959,6 +2959,7 @@
     case GNTTABOP_copy:
     case GNTTABOP_map_grant_ref:
     case GNTTABOP_unmap_grant_ref:
+    case GNTTABOP_swap_grant_ref:
         return 1;
     default:
         /* all other commands need auditing */
diff -r 370924e204dc -r d115844ebfbb xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/common/compat/grant_table.c	Tue Jan 24 14:16:04 2012 +0000
@@ -47,6 +47,10 @@
 CHECK_gnttab_get_version;
 #undef xen_gnttab_get_version
 
+#define xen_gnttab_swap_grant_ref gnttab_swap_grant_ref
+CHECK_gnttab_swap_grant_ref;
+#undef xen_gnttab_swap_grant_ref
+
 int compat_grant_table_op(unsigned int cmd,
                           XEN_GUEST_HANDLE(void) cmp_uop,
                           unsigned int count)
@@ -98,6 +102,10 @@
     CASE(get_status_frames);
 #endif
 
+#ifndef CHECK_gnttab_swap_grant_ref
+    CASE(swap_grant_ref);
+#endif
+
 #undef CASE
     default:
         return do_grant_table_op(cmd, cmp_uop, count);
diff -r 370924e204dc -r d115844ebfbb xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/common/grant_table.c	Tue Jan 24 14:16:04 2012 +0000
@@ -2283,6 +2283,81 @@
     return 0;
 }
 
+static s16
+__gnttab_swap_grant_ref(grant_ref_t ref_a, grant_ref_t ref_b)
+{
+    struct domain *d;
+    struct active_grant_entry *act;
+    s16 rc = GNTST_okay;
+
+    d = rcu_lock_current_domain();
+
+    spin_lock(&d->grant_table->lock);
+
+    act = &active_entry(d->grant_table, ref_a);
+    if ( act->pin )
+        PIN_FAIL(out, GNTST_eagain, "ref a %ld busy\n", (long)ref_a);
+
+    act = &active_entry(d->grant_table, ref_b);
+    if ( act->pin )
+        PIN_FAIL(out, GNTST_eagain, "ref b %ld busy\n", (long)ref_b);
+
+    if ( d->grant_table->gt_version == 1 )
+    {
+        grant_entry_v1_t shared;
+
+        shared = shared_entry_v1(d->grant_table, ref_a);
+
+        shared_entry_v1(d->grant_table, ref_a) =
+            shared_entry_v1(d->grant_table, ref_b);
+
+        shared_entry_v1(d->grant_table, ref_b) = shared;
+    }
+    else
+    {
+        grant_entry_v2_t shared;
+        grant_status_t status;
+
+        shared = shared_entry_v2(d->grant_table, ref_a);
+        status = status_entry(d->grant_table, ref_a);
+
+        shared_entry_v2(d->grant_table, ref_a) =
+            shared_entry_v2(d->grant_table, ref_b);
+        status_entry(d->grant_table, ref_a) =
+            status_entry(d->grant_table, ref_b);
+
+        shared_entry_v2(d->grant_table, ref_b) = shared;
+        status_entry(d->grant_table, ref_b) = status;
+    }
+
+out:
+    spin_unlock(&d->grant_table->lock);
+
+    rcu_unlock_domain(d);
+
+    return rc;
+}
+
+static long
+gnttab_swap_grant_ref(XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t uop),
+                      unsigned int count)
+{
+    int i;
+    gnttab_swap_grant_ref_t op;
+
+    for ( i = 0; i < count; i++ )
+    {
+        if ( i && hypercall_preempt_check() )
+            return i;
+        if ( unlikely(__copy_from_guest_offset(&op, uop, i, 1)) )
+            return -EFAULT;
+        op.status = __gnttab_swap_grant_ref(op.ref_a, op.ref_b);
+        if ( unlikely(__copy_to_guest_offset(uop, i, &op, 1)) )
+            return -EFAULT;
+    }
+    return 0;
+}
+
 long
 do_grant_table_op(
     unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
@@ -2401,6 +2476,20 @@
         rc = gnttab_get_version(guest_handle_cast(uop, gnttab_get_version_t));
         break;
     }
+    case GNTTABOP_swap_grant_ref:
+    {
+        XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t) swap =
+            guest_handle_cast(uop, gnttab_swap_grant_ref_t);
+        if ( unlikely(!guest_handle_okay(swap, count)) )
+            goto out;
+        rc = gnttab_swap_grant_ref(swap, count);
+        if ( rc > 0 )
+        {
+            guest_handle_add_offset(swap, rc);
+            uop = guest_handle_cast(swap, void);
+        }
+        break;
+    }
     default:
         rc = -ENOSYS;
         break;
diff -r 370924e204dc -r d115844ebfbb xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/include/public/grant_table.h	Tue Jan 24 14:16:04 2012 +0000
@@ -511,6 +511,20 @@
 typedef struct gnttab_get_version gnttab_get_version_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_get_version_t);
 
+/* 
+ * GNTTABOP_swap_grant_ref: Swap the contents of two grant entries.
+ */
+#define GNTTABOP_swap_grant_ref	      11
+struct gnttab_swap_grant_ref {
+    /* IN parameters */
+    grant_ref_t ref_a;
+    grant_ref_t ref_b;
+    /* OUT parameters */
+    int16_t status;             /* GNTST_* */
+};
+typedef struct gnttab_swap_grant_ref gnttab_swap_grant_ref_t;
+DEFINE_XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t);
+
 #endif /* __XEN_INTERFACE_VERSION__ */
 
 /*
@@ -566,7 +580,7 @@
 #define GNTST_bad_page         (-9) /* Specified page was invalid for op.    */
 #define GNTST_bad_copy_arg    (-10) /* copy arguments cross page boundary.   */
 #define GNTST_address_too_big (-11) /* transfer page address too large.      */
-#define GNTST_eagain          (-12) /* Could not map at the moment. Retry.   */
+#define GNTST_eagain          (-12) /* Operation not done; try again.        */
 
 #define GNTTABOP_error_msgs {                   \
     "okay",                                     \
@@ -581,7 +595,7 @@
     "bad page",                                 \
     "copy arguments cross page boundary",       \
     "page address size too large",              \
-    "could not map at the moment, retry"        \
+    "operation not done; try again"             \
 }
 
 #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
diff -r 370924e204dc -r d115844ebfbb xen/include/xlat.lst
--- a/xen/include/xlat.lst	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/include/xlat.lst	Tue Jan 24 14:16:04 2012 +0000
@@ -50,6 +50,7 @@
 ?	grant_entry_v1			grant_table.h
 ?       grant_entry_header              grant_table.h
 ?	grant_entry_v2			grant_table.h
+?	gnttab_swap_grant_ref		grant_table.h
 ?	kexec_exec			kexec.h
 !	kexec_image			kexec.h
 !	kexec_range			kexec.h

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1Rptx7-00087Q-Rd; Wed, 25 Jan 2012 03:55:17 +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 1Rptx6-00087I-7m
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Received: from [85.158.138.51:21068] by server-1.bemta-3.messagelabs.com id
	6A/A6-09565-32D7F1F4; Wed, 25 Jan 2012 03:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1327463713!10551100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25225 invoked from network); 25 Jan 2012 03:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx2-0008KP-EC
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx1-0001vc-Ud
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:11 +0000
Message-Id: <E1Rptx1-0001vc-Ud@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add a GNTTABOP to swap the content
	of two grant references under lock
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1327414564 0
# Node ID d115844ebfbb02bd785a4bd1b50fa31072f36bff
# Parent  370924e204dc29e12cd807dd730974d6b2bc53d3
Add a GNTTABOP to swap the content of two grant references under lock
provided that they are not currently active.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 370924e204dc -r d115844ebfbb xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Jan 24 14:16:04 2012 +0000
@@ -2959,6 +2959,7 @@
     case GNTTABOP_copy:
     case GNTTABOP_map_grant_ref:
     case GNTTABOP_unmap_grant_ref:
+    case GNTTABOP_swap_grant_ref:
         return 1;
     default:
         /* all other commands need auditing */
diff -r 370924e204dc -r d115844ebfbb xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/common/compat/grant_table.c	Tue Jan 24 14:16:04 2012 +0000
@@ -47,6 +47,10 @@
 CHECK_gnttab_get_version;
 #undef xen_gnttab_get_version
 
+#define xen_gnttab_swap_grant_ref gnttab_swap_grant_ref
+CHECK_gnttab_swap_grant_ref;
+#undef xen_gnttab_swap_grant_ref
+
 int compat_grant_table_op(unsigned int cmd,
                           XEN_GUEST_HANDLE(void) cmp_uop,
                           unsigned int count)
@@ -98,6 +102,10 @@
     CASE(get_status_frames);
 #endif
 
+#ifndef CHECK_gnttab_swap_grant_ref
+    CASE(swap_grant_ref);
+#endif
+
 #undef CASE
     default:
         return do_grant_table_op(cmd, cmp_uop, count);
diff -r 370924e204dc -r d115844ebfbb xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/common/grant_table.c	Tue Jan 24 14:16:04 2012 +0000
@@ -2283,6 +2283,81 @@
     return 0;
 }
 
+static s16
+__gnttab_swap_grant_ref(grant_ref_t ref_a, grant_ref_t ref_b)
+{
+    struct domain *d;
+    struct active_grant_entry *act;
+    s16 rc = GNTST_okay;
+
+    d = rcu_lock_current_domain();
+
+    spin_lock(&d->grant_table->lock);
+
+    act = &active_entry(d->grant_table, ref_a);
+    if ( act->pin )
+        PIN_FAIL(out, GNTST_eagain, "ref a %ld busy\n", (long)ref_a);
+
+    act = &active_entry(d->grant_table, ref_b);
+    if ( act->pin )
+        PIN_FAIL(out, GNTST_eagain, "ref b %ld busy\n", (long)ref_b);
+
+    if ( d->grant_table->gt_version == 1 )
+    {
+        grant_entry_v1_t shared;
+
+        shared = shared_entry_v1(d->grant_table, ref_a);
+
+        shared_entry_v1(d->grant_table, ref_a) =
+            shared_entry_v1(d->grant_table, ref_b);
+
+        shared_entry_v1(d->grant_table, ref_b) = shared;
+    }
+    else
+    {
+        grant_entry_v2_t shared;
+        grant_status_t status;
+
+        shared = shared_entry_v2(d->grant_table, ref_a);
+        status = status_entry(d->grant_table, ref_a);
+
+        shared_entry_v2(d->grant_table, ref_a) =
+            shared_entry_v2(d->grant_table, ref_b);
+        status_entry(d->grant_table, ref_a) =
+            status_entry(d->grant_table, ref_b);
+
+        shared_entry_v2(d->grant_table, ref_b) = shared;
+        status_entry(d->grant_table, ref_b) = status;
+    }
+
+out:
+    spin_unlock(&d->grant_table->lock);
+
+    rcu_unlock_domain(d);
+
+    return rc;
+}
+
+static long
+gnttab_swap_grant_ref(XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t uop),
+                      unsigned int count)
+{
+    int i;
+    gnttab_swap_grant_ref_t op;
+
+    for ( i = 0; i < count; i++ )
+    {
+        if ( i && hypercall_preempt_check() )
+            return i;
+        if ( unlikely(__copy_from_guest_offset(&op, uop, i, 1)) )
+            return -EFAULT;
+        op.status = __gnttab_swap_grant_ref(op.ref_a, op.ref_b);
+        if ( unlikely(__copy_to_guest_offset(uop, i, &op, 1)) )
+            return -EFAULT;
+    }
+    return 0;
+}
+
 long
 do_grant_table_op(
     unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
@@ -2401,6 +2476,20 @@
         rc = gnttab_get_version(guest_handle_cast(uop, gnttab_get_version_t));
         break;
     }
+    case GNTTABOP_swap_grant_ref:
+    {
+        XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t) swap =
+            guest_handle_cast(uop, gnttab_swap_grant_ref_t);
+        if ( unlikely(!guest_handle_okay(swap, count)) )
+            goto out;
+        rc = gnttab_swap_grant_ref(swap, count);
+        if ( rc > 0 )
+        {
+            guest_handle_add_offset(swap, rc);
+            uop = guest_handle_cast(swap, void);
+        }
+        break;
+    }
     default:
         rc = -ENOSYS;
         break;
diff -r 370924e204dc -r d115844ebfbb xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/include/public/grant_table.h	Tue Jan 24 14:16:04 2012 +0000
@@ -511,6 +511,20 @@
 typedef struct gnttab_get_version gnttab_get_version_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_get_version_t);
 
+/* 
+ * GNTTABOP_swap_grant_ref: Swap the contents of two grant entries.
+ */
+#define GNTTABOP_swap_grant_ref	      11
+struct gnttab_swap_grant_ref {
+    /* IN parameters */
+    grant_ref_t ref_a;
+    grant_ref_t ref_b;
+    /* OUT parameters */
+    int16_t status;             /* GNTST_* */
+};
+typedef struct gnttab_swap_grant_ref gnttab_swap_grant_ref_t;
+DEFINE_XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t);
+
 #endif /* __XEN_INTERFACE_VERSION__ */
 
 /*
@@ -566,7 +580,7 @@
 #define GNTST_bad_page         (-9) /* Specified page was invalid for op.    */
 #define GNTST_bad_copy_arg    (-10) /* copy arguments cross page boundary.   */
 #define GNTST_address_too_big (-11) /* transfer page address too large.      */
-#define GNTST_eagain          (-12) /* Could not map at the moment. Retry.   */
+#define GNTST_eagain          (-12) /* Operation not done; try again.        */
 
 #define GNTTABOP_error_msgs {                   \
     "okay",                                     \
@@ -581,7 +595,7 @@
     "bad page",                                 \
     "copy arguments cross page boundary",       \
     "page address size too large",              \
-    "could not map at the moment, retry"        \
+    "operation not done; try again"             \
 }
 
 #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
diff -r 370924e204dc -r d115844ebfbb xen/include/xlat.lst
--- a/xen/include/xlat.lst	Mon Jan 23 15:10:43 2012 +0000
+++ b/xen/include/xlat.lst	Tue Jan 24 14:16:04 2012 +0000
@@ -50,6 +50,7 @@
 ?	grant_entry_v1			grant_table.h
 ?       grant_entry_header              grant_table.h
 ?	grant_entry_v2			grant_table.h
+?	gnttab_swap_grant_ref		grant_table.h
 ?	kexec_exec			kexec.h
 !	kexec_image			kexec.h
 !	kexec_range			kexec.h

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxC-00087v-0Z; Wed, 25 Jan 2012 03:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxB-00087J-An
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1327463713!12441012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12323 invoked from network); 25 Jan 2012 03:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx3-0008KS-7G
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx2-0001w8-QB
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:12 +0000
Message-Id: <E1Rptx2-0001w8-QB@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] introduce and use common macros for
	selecting cpupool based cpumasks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327414798 0
# Node ID 3df3a0a95551a65ae0c29a481f0f756b63a3f37c
# Parent  d115844ebfbb02bd785a4bd1b50fa31072f36bff
introduce and use common macros for selecting cpupool based cpumasks

There are several instances of the same construct finding the cpumask
for a cpupool. Use macros instead.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d115844ebfbb -r 3df3a0a95551 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/domctl.c	Tue Jan 24 14:19:58 2012 +0000
@@ -518,7 +518,7 @@
             goto maxvcpu_out;
 
         ret = -ENOMEM;
-        online = (d->cpupool == NULL) ? &cpu_online_map : d->cpupool->cpu_valid;
+        online = cpupool_online_cpumask(d->cpupool);
         if ( max > d->max_vcpus )
         {
             struct vcpu **vcpus;
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Jan 24 14:19:58 2012 +0000
@@ -72,8 +72,6 @@
 #define CSCHED_VCPU(_vcpu)  ((struct csched_vcpu *) (_vcpu)->sched_priv)
 #define CSCHED_DOM(_dom)    ((struct csched_dom *) (_dom)->sched_priv)
 #define RUNQ(_cpu)          (&(CSCHED_PCPU(_cpu)->runq))
-#define CSCHED_CPUONLINE(_pool)    \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 
 
 /*
@@ -471,7 +469,7 @@
      * Pick from online CPUs in VCPU's affinity mask, giving a
      * preference to its current processor if it's in there.
      */
-    online = CSCHED_CPUONLINE(vc->domain->cpupool);
+    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
     cpumask_and(&cpus, online, vc->cpu_affinity);
     cpu = cpumask_test_cpu(vc->processor, &cpus)
             ? vc->processor
@@ -1230,7 +1228,7 @@
     int peer_cpu;
 
     BUG_ON( cpu != snext->vcpu->processor );
-    online = CSCHED_CPUONLINE(per_cpu(cpupool, cpu));
+    online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
 
     /* If this CPU is going offline we shouldn't steal work. */
     if ( unlikely(!cpumask_test_cpu(cpu, online)) )
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/sched_credit2.c	Tue Jan 24 14:19:58 2012 +0000
@@ -169,8 +169,6 @@
     ((struct csched_private *)((_ops)->sched_data))
 #define CSCHED_VCPU(_vcpu)  ((struct csched_vcpu *) (_vcpu)->sched_priv)
 #define CSCHED_DOM(_dom)    ((struct csched_dom *) (_dom)->sched_priv)
-#define CSCHED_CPUONLINE(_pool)    \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 /* CPU to runq_id macro */
 #define c2r(_ops, _cpu)     (CSCHED_PRIV(_ops)->runq_map[(_cpu)])
 /* CPU to runqueue struct macro */
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/sched_sedf.c	Tue Jan 24 14:19:58 2012 +0000
@@ -13,9 +13,6 @@
 #include <xen/time.h>
 #include <xen/errno.h>
 
-#define SEDF_CPUONLINE(_pool)                                             \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
-
 #ifndef NDEBUG
 #define SEDF_STATS
 #define CHECK(_p)                                           \
@@ -397,7 +394,7 @@
     cpumask_t online_affinity;
     cpumask_t *online;
 
-    online = SEDF_CPUONLINE(v->domain->cpupool);
+    online = cpupool_scheduler_cpumask(v->domain->cpupool);
     cpumask_and(&online_affinity, v->cpu_affinity, online);
     return cpumask_first(&online_affinity);
 }
@@ -801,7 +798,8 @@
      */
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
-         unlikely(!cpumask_test_cpu(cpu, SEDF_CPUONLINE(per_cpu(cpupool, cpu)))) )
+         unlikely(!cpumask_test_cpu(cpu,
+                   cpupool_scheduler_cpumask(per_cpu(cpupool, cpu)))) )
     {
         ret.task = IDLETASK(cpu);
         ret.time = SECONDS(1);
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/schedule.c	Tue Jan 24 14:19:58 2012 +0000
@@ -77,9 +77,7 @@
 
 #define DOM2OP(_d)    (((_d)->cpupool == NULL) ? &ops : ((_d)->cpupool->sched))
 #define VCPU2OP(_v)   (DOM2OP((_v)->domain))
-#define VCPU2ONLINE(_v)                                                    \
-         (((_v)->domain->cpupool == NULL) ? &cpu_online_map                \
-         : (_v)->domain->cpupool->cpu_valid)
+#define VCPU2ONLINE(_v) cpupool_online_cpumask((_v)->domain->cpupool)
 
 static inline void trace_runstate_change(struct vcpu *v, int new_state)
 {
@@ -1418,7 +1416,7 @@
     cpumask_t        *cpus;
 
     sched = (c == NULL) ? &ops : c->sched;
-    cpus = (c == NULL) ? &cpupool_free_cpus : c->cpu_valid;
+    cpus = cpupool_scheduler_cpumask(c);
     printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name);
     SCHED_OP(sched, dump_settings);
 
diff -r d115844ebfbb -r 3df3a0a95551 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/include/xen/sched-if.h	Tue Jan 24 14:19:58 2012 +0000
@@ -204,4 +204,9 @@
     atomic_t         refcnt;
 };
 
+#define cpupool_scheduler_cpumask(_pool) \
+    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
+#define cpupool_online_cpumask(_pool) \
+    (((_pool) == NULL) ? &cpu_online_map : (_pool)->cpu_valid)
+
 #endif /* __XEN_SCHED_IF_H__ */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxC-00087v-0Z; Wed, 25 Jan 2012 03:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxB-00087J-An
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1327463713!12441012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12323 invoked from network); 25 Jan 2012 03:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx3-0008KS-7G
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx2-0001w8-QB
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:12 +0000
Message-Id: <E1Rptx2-0001w8-QB@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] introduce and use common macros for
	selecting cpupool based cpumasks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327414798 0
# Node ID 3df3a0a95551a65ae0c29a481f0f756b63a3f37c
# Parent  d115844ebfbb02bd785a4bd1b50fa31072f36bff
introduce and use common macros for selecting cpupool based cpumasks

There are several instances of the same construct finding the cpumask
for a cpupool. Use macros instead.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d115844ebfbb -r 3df3a0a95551 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/domctl.c	Tue Jan 24 14:19:58 2012 +0000
@@ -518,7 +518,7 @@
             goto maxvcpu_out;
 
         ret = -ENOMEM;
-        online = (d->cpupool == NULL) ? &cpu_online_map : d->cpupool->cpu_valid;
+        online = cpupool_online_cpumask(d->cpupool);
         if ( max > d->max_vcpus )
         {
             struct vcpu **vcpus;
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Jan 24 14:19:58 2012 +0000
@@ -72,8 +72,6 @@
 #define CSCHED_VCPU(_vcpu)  ((struct csched_vcpu *) (_vcpu)->sched_priv)
 #define CSCHED_DOM(_dom)    ((struct csched_dom *) (_dom)->sched_priv)
 #define RUNQ(_cpu)          (&(CSCHED_PCPU(_cpu)->runq))
-#define CSCHED_CPUONLINE(_pool)    \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 
 
 /*
@@ -471,7 +469,7 @@
      * Pick from online CPUs in VCPU's affinity mask, giving a
      * preference to its current processor if it's in there.
      */
-    online = CSCHED_CPUONLINE(vc->domain->cpupool);
+    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
     cpumask_and(&cpus, online, vc->cpu_affinity);
     cpu = cpumask_test_cpu(vc->processor, &cpus)
             ? vc->processor
@@ -1230,7 +1228,7 @@
     int peer_cpu;
 
     BUG_ON( cpu != snext->vcpu->processor );
-    online = CSCHED_CPUONLINE(per_cpu(cpupool, cpu));
+    online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
 
     /* If this CPU is going offline we shouldn't steal work. */
     if ( unlikely(!cpumask_test_cpu(cpu, online)) )
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/sched_credit2.c	Tue Jan 24 14:19:58 2012 +0000
@@ -169,8 +169,6 @@
     ((struct csched_private *)((_ops)->sched_data))
 #define CSCHED_VCPU(_vcpu)  ((struct csched_vcpu *) (_vcpu)->sched_priv)
 #define CSCHED_DOM(_dom)    ((struct csched_dom *) (_dom)->sched_priv)
-#define CSCHED_CPUONLINE(_pool)    \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 /* CPU to runq_id macro */
 #define c2r(_ops, _cpu)     (CSCHED_PRIV(_ops)->runq_map[(_cpu)])
 /* CPU to runqueue struct macro */
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/sched_sedf.c	Tue Jan 24 14:19:58 2012 +0000
@@ -13,9 +13,6 @@
 #include <xen/time.h>
 #include <xen/errno.h>
 
-#define SEDF_CPUONLINE(_pool)                                             \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
-
 #ifndef NDEBUG
 #define SEDF_STATS
 #define CHECK(_p)                                           \
@@ -397,7 +394,7 @@
     cpumask_t online_affinity;
     cpumask_t *online;
 
-    online = SEDF_CPUONLINE(v->domain->cpupool);
+    online = cpupool_scheduler_cpumask(v->domain->cpupool);
     cpumask_and(&online_affinity, v->cpu_affinity, online);
     return cpumask_first(&online_affinity);
 }
@@ -801,7 +798,8 @@
      */
     if ( tasklet_work_scheduled ||
          (list_empty(runq) && list_empty(waitq)) ||
-         unlikely(!cpumask_test_cpu(cpu, SEDF_CPUONLINE(per_cpu(cpupool, cpu)))) )
+         unlikely(!cpumask_test_cpu(cpu,
+                   cpupool_scheduler_cpumask(per_cpu(cpupool, cpu)))) )
     {
         ret.task = IDLETASK(cpu);
         ret.time = SECONDS(1);
diff -r d115844ebfbb -r 3df3a0a95551 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/common/schedule.c	Tue Jan 24 14:19:58 2012 +0000
@@ -77,9 +77,7 @@
 
 #define DOM2OP(_d)    (((_d)->cpupool == NULL) ? &ops : ((_d)->cpupool->sched))
 #define VCPU2OP(_v)   (DOM2OP((_v)->domain))
-#define VCPU2ONLINE(_v)                                                    \
-         (((_v)->domain->cpupool == NULL) ? &cpu_online_map                \
-         : (_v)->domain->cpupool->cpu_valid)
+#define VCPU2ONLINE(_v) cpupool_online_cpumask((_v)->domain->cpupool)
 
 static inline void trace_runstate_change(struct vcpu *v, int new_state)
 {
@@ -1418,7 +1416,7 @@
     cpumask_t        *cpus;
 
     sched = (c == NULL) ? &ops : c->sched;
-    cpus = (c == NULL) ? &cpupool_free_cpus : c->cpu_valid;
+    cpus = cpupool_scheduler_cpumask(c);
     printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name);
     SCHED_OP(sched, dump_settings);
 
diff -r d115844ebfbb -r 3df3a0a95551 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue Jan 24 14:16:04 2012 +0000
+++ b/xen/include/xen/sched-if.h	Tue Jan 24 14:19:58 2012 +0000
@@ -204,4 +204,9 @@
     atomic_t         refcnt;
 };
 
+#define cpupool_scheduler_cpumask(_pool) \
+    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
+#define cpupool_online_cpumask(_pool) \
+    (((_pool) == NULL) ? &cpu_online_map : (_pool)->cpu_valid)
+
 #endif /* __XEN_SCHED_IF_H__ */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxD-00088D-3K; Wed, 25 Jan 2012 03:55:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxC-00087a-A5
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327463696!63799088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6561 invoked from network); 25 Jan 2012 03:54:57 -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;
	25 Jan 2012 03:54:57 -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 1Rptx6-0008Kk-O5
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx6-0001yw-MV
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Message-Id: <E1Rptx6-0001yw-MV@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Clone and build upstream Qemu by
	default
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417770 0
# Node ID 277a1cde337f2d3777db18e2c76ec663c50f5dc6
# Parent  905ecf8d6482cc13e31e1c6a38c691e089ec335e
Clone and build upstream Qemu by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 905ecf8d6482 -r 277a1cde337f .hgignore
--- a/.hgignore	Tue Jan 24 15:09:30 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:30 2012 +0000
@@ -298,6 +298,8 @@
 ^tools/xm-test/tests/.*\.test$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
+^tools/qemu-xen-dir-remote
+^tools/qemu-xen-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
diff -r 905ecf8d6482 -r 277a1cde337f Config.mk
--- a/Config.mk	Tue Jan 24 15:09:30 2012 +0000
+++ b/Config.mk	Tue Jan 24 15:09:30 2012 +0000
@@ -207,6 +207,13 @@
 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
+ifeq ($(GIT_HTTP),y)
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+else
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+endif
+QEMU_UPSTREAM_REVISION ?= master
+
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
diff -r 905ecf8d6482 -r 277a1cde337f Makefile
--- a/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/Makefile	Tue Jan 24 15:09:30 2012 +0000
@@ -70,7 +70,7 @@
 	$(MAKE) -C tools install
 
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: tools/qemu-xen-traditional-dir
+install-tools: tools/qemu-xen-traditional-dir tools/qemu-xen-dir
 endif
 
 .PHONY: install-kernels
@@ -91,6 +91,13 @@
 tools/qemu-xen-traditional-dir-force-update:
 	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
 
+tools/qemu-xen-dir:
+	$(MAKE) -C tools qemu-xen-dir-find
+
+.PHONY: tools/qemu-xen-dir-force-update
+tools/qemu-xen-dir-force-update:
+	$(MAKE) -C tools qemu-xen-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
diff -r 905ecf8d6482 -r 277a1cde337f tools/Makefile
--- a/tools/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:30 2012 +0000
@@ -36,6 +36,7 @@
 # do not recurse in to a dir we are about to delete
 ifneq "$(MAKECMDGOALS)" "distclean"
 SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-traditional-dir
+SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-dir
 endif
 
 SUBDIRS-y += xenpmd
@@ -76,6 +77,7 @@
 .PHONY: distclean
 distclean: subdirs-distclean
 	rm -rf qemu-xen-traditional-dir qemu-xen-traditional-dir-remote
+	rm -rf qemu-xen-dir qemu-xen-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -97,6 +99,14 @@
 		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
 
+qemu-xen-dir-find:
+	if test -d $(QEMU_UPSTREAM_URL) ; then \
+		mkdir -p qemu-xen-dir; \
+	else \
+		export GIT=$(GIT); \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(QEMU_UPSTREAM_URL) $(QEMU_UPSTREAM_REVISION) qemu-xen-dir ; \
+	fi
+
 .PHONY: qemu-xen-traditional-dir-force-update
 qemu-xen-traditional-dir-force-update:
 	set -ex; \
@@ -119,6 +129,40 @@
 		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
+.PHONY: qemu-xen-dir-force-update
+qemu-xen-dir-force-update:
+	set -ex; \
+	if [ "$(QEMU_UPSTREAM_REVISION)" ]; then \
+		cd qemu-xen-dir-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(QEMU_UPSTREAM_REVISION); \
+	fi
+
+subdir-all-qemu-xen-dir subdir-install-qemu-xen-dir: qemu-xen-dir-find
+	if test -d $(QEMU_UPSTREAM_URL) ; then \
+		source=$(QEMU_UPSTREAM_URL); \
+	else \
+		source=.; \
+	fi; \
+	cd qemu-xen-dir; \
+	$$source/configure --enable-xen --target-list=i386-softmmu \
+		--source-path=$$source \
+		--extra-cflags="-I$(XEN_ROOT)/tools/include \
+		-I$(XEN_ROOT)/tools/libxc \
+		-I$(XEN_ROOT)/tools/xenstore" \
+		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
+		-L$(XEN_ROOT)/tools/xenstore" \
+		--bindir=$(LIBEXEC) \
+		--disable-kvm \
+		$(IOEMU_CONFIGURE_CROSS); \
+	$(MAKE) install
+
+subdir-clean-qemu-xen-dir:
+	set -e; if test -d qemu-xen-dir/.; then \
+		$(buildmakevars2shellvars); \
+		$(MAKE) -C qemu-xen-dir clean; \
+	fi
+
 subdir-clean-debugger/gdbsx subdir-distclean-debugger/gdbsx: .phony
 	$(MAKE) -C debugger/gdbsx clean
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxD-00088D-3K; Wed, 25 Jan 2012 03:55:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxC-00087a-A5
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327463696!63799088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6561 invoked from network); 25 Jan 2012 03:54:57 -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;
	25 Jan 2012 03:54:57 -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 1Rptx6-0008Kk-O5
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx6-0001yw-MV
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Message-Id: <E1Rptx6-0001yw-MV@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Clone and build upstream Qemu by
	default
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417770 0
# Node ID 277a1cde337f2d3777db18e2c76ec663c50f5dc6
# Parent  905ecf8d6482cc13e31e1c6a38c691e089ec335e
Clone and build upstream Qemu by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 905ecf8d6482 -r 277a1cde337f .hgignore
--- a/.hgignore	Tue Jan 24 15:09:30 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:30 2012 +0000
@@ -298,6 +298,8 @@
 ^tools/xm-test/tests/.*\.test$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
+^tools/qemu-xen-dir-remote
+^tools/qemu-xen-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
diff -r 905ecf8d6482 -r 277a1cde337f Config.mk
--- a/Config.mk	Tue Jan 24 15:09:30 2012 +0000
+++ b/Config.mk	Tue Jan 24 15:09:30 2012 +0000
@@ -207,6 +207,13 @@
 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
+ifeq ($(GIT_HTTP),y)
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+else
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+endif
+QEMU_UPSTREAM_REVISION ?= master
+
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
diff -r 905ecf8d6482 -r 277a1cde337f Makefile
--- a/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/Makefile	Tue Jan 24 15:09:30 2012 +0000
@@ -70,7 +70,7 @@
 	$(MAKE) -C tools install
 
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: tools/qemu-xen-traditional-dir
+install-tools: tools/qemu-xen-traditional-dir tools/qemu-xen-dir
 endif
 
 .PHONY: install-kernels
@@ -91,6 +91,13 @@
 tools/qemu-xen-traditional-dir-force-update:
 	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
 
+tools/qemu-xen-dir:
+	$(MAKE) -C tools qemu-xen-dir-find
+
+.PHONY: tools/qemu-xen-dir-force-update
+tools/qemu-xen-dir-force-update:
+	$(MAKE) -C tools qemu-xen-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
diff -r 905ecf8d6482 -r 277a1cde337f tools/Makefile
--- a/tools/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:30 2012 +0000
@@ -36,6 +36,7 @@
 # do not recurse in to a dir we are about to delete
 ifneq "$(MAKECMDGOALS)" "distclean"
 SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-traditional-dir
+SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-dir
 endif
 
 SUBDIRS-y += xenpmd
@@ -76,6 +77,7 @@
 .PHONY: distclean
 distclean: subdirs-distclean
 	rm -rf qemu-xen-traditional-dir qemu-xen-traditional-dir-remote
+	rm -rf qemu-xen-dir qemu-xen-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -97,6 +99,14 @@
 		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
 
+qemu-xen-dir-find:
+	if test -d $(QEMU_UPSTREAM_URL) ; then \
+		mkdir -p qemu-xen-dir; \
+	else \
+		export GIT=$(GIT); \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(QEMU_UPSTREAM_URL) $(QEMU_UPSTREAM_REVISION) qemu-xen-dir ; \
+	fi
+
 .PHONY: qemu-xen-traditional-dir-force-update
 qemu-xen-traditional-dir-force-update:
 	set -ex; \
@@ -119,6 +129,40 @@
 		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
+.PHONY: qemu-xen-dir-force-update
+qemu-xen-dir-force-update:
+	set -ex; \
+	if [ "$(QEMU_UPSTREAM_REVISION)" ]; then \
+		cd qemu-xen-dir-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(QEMU_UPSTREAM_REVISION); \
+	fi
+
+subdir-all-qemu-xen-dir subdir-install-qemu-xen-dir: qemu-xen-dir-find
+	if test -d $(QEMU_UPSTREAM_URL) ; then \
+		source=$(QEMU_UPSTREAM_URL); \
+	else \
+		source=.; \
+	fi; \
+	cd qemu-xen-dir; \
+	$$source/configure --enable-xen --target-list=i386-softmmu \
+		--source-path=$$source \
+		--extra-cflags="-I$(XEN_ROOT)/tools/include \
+		-I$(XEN_ROOT)/tools/libxc \
+		-I$(XEN_ROOT)/tools/xenstore" \
+		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
+		-L$(XEN_ROOT)/tools/xenstore" \
+		--bindir=$(LIBEXEC) \
+		--disable-kvm \
+		$(IOEMU_CONFIGURE_CROSS); \
+	$(MAKE) install
+
+subdir-clean-qemu-xen-dir:
+	set -e; if test -d qemu-xen-dir/.; then \
+		$(buildmakevars2shellvars); \
+		$(MAKE) -C qemu-xen-dir clean; \
+	fi
+
 subdir-clean-debugger/gdbsx subdir-distclean-debugger/gdbsx: .phony
 	$(MAKE) -C debugger/gdbsx clean
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxE-00088f-6v; Wed, 25 Jan 2012 03:55:24 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxC-00087P-Ot
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1327463714!2031686!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17615 invoked from network); 25 Jan 2012 03:55:15 -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;
	25 Jan 2012 03:55:15 -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 1Rptx4-0008KY-CT
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx4-0001x6-4t
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Message-Id: <E1Rptx4-0001x6-4t@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] reflect cpupool in numa node affinity
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327414872 0
# Node ID 0f8f633dbe2d182d448214fefb4e2e3afaa75e7e
# Parent  455a50622fb2a135e6bbfce8705fddc8705fe2d7
reflect cpupool in numa node affinity

In order to prefer node local memory for a domain the numa node
locality info must be built according to the cpus belonging to the
cpupool of the domain.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 455a50622fb2 -r 0f8f633dbe2d xen/common/cpupool.c
--- a/xen/common/cpupool.c	Tue Jan 24 14:20:40 2012 +0000
+++ b/xen/common/cpupool.c	Tue Jan 24 14:21:12 2012 +0000
@@ -220,6 +220,7 @@
 {
     int ret;
     struct cpupool *old;
+    struct domain *d;
 
     if ( (cpupool_moving_cpu == cpu) && (c != cpupool_cpu_moving) )
         return -EBUSY;
@@ -240,6 +241,14 @@
         cpupool_cpu_moving = NULL;
     }
     cpumask_set_cpu(cpu, c->cpu_valid);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain_in_cpupool(d, c)
+    {
+        domain_update_node_affinity(d);
+    }
+    rcu_read_unlock(&domlist_read_lock);
+
     return 0;
 }
 
diff -r 455a50622fb2 -r 0f8f633dbe2d xen/common/domain.c
--- a/xen/common/domain.c	Tue Jan 24 14:20:40 2012 +0000
+++ b/xen/common/domain.c	Tue Jan 24 14:21:12 2012 +0000
@@ -11,6 +11,7 @@
 #include <xen/ctype.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
+#include <xen/sched-if.h>
 #include <xen/domain.h>
 #include <xen/mm.h>
 #include <xen/event.h>
@@ -335,17 +336,29 @@
 void domain_update_node_affinity(struct domain *d)
 {
     cpumask_var_t cpumask;
+    cpumask_var_t online_affinity;
+    const cpumask_t *online;
     nodemask_t nodemask = NODE_MASK_NONE;
     struct vcpu *v;
     unsigned int node;
 
     if ( !zalloc_cpumask_var(&cpumask) )
         return;
+    if ( !alloc_cpumask_var(&online_affinity) )
+    {
+        free_cpumask_var(cpumask);
+        return;
+    }
+
+    online = cpupool_online_cpumask(d->cpupool);
 
     spin_lock(&d->node_affinity_lock);
 
     for_each_vcpu ( d, v )
-        cpumask_or(cpumask, cpumask, v->cpu_affinity);
+    {
+        cpumask_and(online_affinity, v->cpu_affinity, online);
+        cpumask_or(cpumask, cpumask, online_affinity);
+    }
 
     for_each_online_node ( node )
         if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
@@ -354,6 +367,7 @@
     d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
 
+    free_cpumask_var(online_affinity);
     free_cpumask_var(cpumask);
 }
 
diff -r 455a50622fb2 -r 0f8f633dbe2d xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Jan 24 14:20:40 2012 +0000
+++ b/xen/common/schedule.c	Tue Jan 24 14:21:12 2012 +0000
@@ -280,12 +280,13 @@
 
         SCHED_OP(VCPU2OP(v), insert_vcpu, v);
     }
-    domain_update_node_affinity(d);
 
     d->cpupool = c;
     SCHED_OP(DOM2OP(d), free_domdata, d->sched_priv);
     d->sched_priv = domdata;
 
+    domain_update_node_affinity(d);
+
     domain_unpause(d);
 
     xfree(vcpu_priv);
@@ -535,7 +536,6 @@
     struct cpupool *c;
     cpumask_t online_affinity;
     int    ret = 0;
-    bool_t affinity_broken;
 
     c = per_cpu(cpupool, cpu);
     if ( c == NULL )
@@ -543,8 +543,6 @@
 
     for_each_domain_in_cpupool ( d, c )
     {
-        affinity_broken = 0;
-
         for_each_vcpu ( d, v )
         {
             vcpu_schedule_lock_irq(v);
@@ -556,7 +554,6 @@
                 printk("Breaking vcpu affinity for domain %d vcpu %d\n",
                         v->domain->domain_id, v->vcpu_id);
                 cpumask_setall(v->cpu_affinity);
-                affinity_broken = 1;
             }
 
             if ( v->processor == cpu )
@@ -580,8 +577,7 @@
                 ret = -EAGAIN;
         }
 
-        if ( affinity_broken )
-            domain_update_node_affinity(d);
+        domain_update_node_affinity(d);
     }
 
     return ret;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxE-00088f-6v; Wed, 25 Jan 2012 03:55:24 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxC-00087P-Ot
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1327463714!2031686!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17615 invoked from network); 25 Jan 2012 03:55:15 -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;
	25 Jan 2012 03:55:15 -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 1Rptx4-0008KY-CT
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx4-0001x6-4t
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:14 +0000
Message-Id: <E1Rptx4-0001x6-4t@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] reflect cpupool in numa node affinity
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327414872 0
# Node ID 0f8f633dbe2d182d448214fefb4e2e3afaa75e7e
# Parent  455a50622fb2a135e6bbfce8705fddc8705fe2d7
reflect cpupool in numa node affinity

In order to prefer node local memory for a domain the numa node
locality info must be built according to the cpus belonging to the
cpupool of the domain.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 455a50622fb2 -r 0f8f633dbe2d xen/common/cpupool.c
--- a/xen/common/cpupool.c	Tue Jan 24 14:20:40 2012 +0000
+++ b/xen/common/cpupool.c	Tue Jan 24 14:21:12 2012 +0000
@@ -220,6 +220,7 @@
 {
     int ret;
     struct cpupool *old;
+    struct domain *d;
 
     if ( (cpupool_moving_cpu == cpu) && (c != cpupool_cpu_moving) )
         return -EBUSY;
@@ -240,6 +241,14 @@
         cpupool_cpu_moving = NULL;
     }
     cpumask_set_cpu(cpu, c->cpu_valid);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain_in_cpupool(d, c)
+    {
+        domain_update_node_affinity(d);
+    }
+    rcu_read_unlock(&domlist_read_lock);
+
     return 0;
 }
 
diff -r 455a50622fb2 -r 0f8f633dbe2d xen/common/domain.c
--- a/xen/common/domain.c	Tue Jan 24 14:20:40 2012 +0000
+++ b/xen/common/domain.c	Tue Jan 24 14:21:12 2012 +0000
@@ -11,6 +11,7 @@
 #include <xen/ctype.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
+#include <xen/sched-if.h>
 #include <xen/domain.h>
 #include <xen/mm.h>
 #include <xen/event.h>
@@ -335,17 +336,29 @@
 void domain_update_node_affinity(struct domain *d)
 {
     cpumask_var_t cpumask;
+    cpumask_var_t online_affinity;
+    const cpumask_t *online;
     nodemask_t nodemask = NODE_MASK_NONE;
     struct vcpu *v;
     unsigned int node;
 
     if ( !zalloc_cpumask_var(&cpumask) )
         return;
+    if ( !alloc_cpumask_var(&online_affinity) )
+    {
+        free_cpumask_var(cpumask);
+        return;
+    }
+
+    online = cpupool_online_cpumask(d->cpupool);
 
     spin_lock(&d->node_affinity_lock);
 
     for_each_vcpu ( d, v )
-        cpumask_or(cpumask, cpumask, v->cpu_affinity);
+    {
+        cpumask_and(online_affinity, v->cpu_affinity, online);
+        cpumask_or(cpumask, cpumask, online_affinity);
+    }
 
     for_each_online_node ( node )
         if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
@@ -354,6 +367,7 @@
     d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
 
+    free_cpumask_var(online_affinity);
     free_cpumask_var(cpumask);
 }
 
diff -r 455a50622fb2 -r 0f8f633dbe2d xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Jan 24 14:20:40 2012 +0000
+++ b/xen/common/schedule.c	Tue Jan 24 14:21:12 2012 +0000
@@ -280,12 +280,13 @@
 
         SCHED_OP(VCPU2OP(v), insert_vcpu, v);
     }
-    domain_update_node_affinity(d);
 
     d->cpupool = c;
     SCHED_OP(DOM2OP(d), free_domdata, d->sched_priv);
     d->sched_priv = domdata;
 
+    domain_update_node_affinity(d);
+
     domain_unpause(d);
 
     xfree(vcpu_priv);
@@ -535,7 +536,6 @@
     struct cpupool *c;
     cpumask_t online_affinity;
     int    ret = 0;
-    bool_t affinity_broken;
 
     c = per_cpu(cpupool, cpu);
     if ( c == NULL )
@@ -543,8 +543,6 @@
 
     for_each_domain_in_cpupool ( d, c )
     {
-        affinity_broken = 0;
-
         for_each_vcpu ( d, v )
         {
             vcpu_schedule_lock_irq(v);
@@ -556,7 +554,6 @@
                 printk("Breaking vcpu affinity for domain %d vcpu %d\n",
                         v->domain->domain_id, v->vcpu_id);
                 cpumask_setall(v->cpu_affinity);
-                affinity_broken = 1;
             }
 
             if ( v->processor == cpu )
@@ -580,8 +577,7 @@
                 ret = -EAGAIN;
         }
 
-        if ( affinity_broken )
-            domain_update_node_affinity(d);
+        domain_update_node_affinity(d);
     }
 
     return ret;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxF-000895-Bb; Wed, 25 Jan 2012 03:55:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxE-00087Z-5g
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1327463716!12205129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3062 invoked from network); 25 Jan 2012 03:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:17 -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 1Rptx5-0008Ke-MY
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx5-0001y3-HU
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:15 +0000
Message-Id: <E1Rptx5-0001y3-HU@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Rename ioemu-dir as
	qemu-xen-traditional-dir
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417769 0
# Node ID f9e164f72615ffa3f47adc686496282e0463838e
# Parent  0bc51b1f2d74750888b70984fec7b7289d74bea0
Rename ioemu-dir as qemu-xen-traditional-dir

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 0bc51b1f2d74 -r f9e164f72615 .hgignore
--- a/.hgignore	Tue Jan 24 15:09:29 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:29 2012 +0000
@@ -296,8 +296,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
-^tools/ioemu-dir-remote
-^tools/ioemu-dir$
+^tools/qemu-xen-traditional-dir-remote
+^tools/qemu-xen-traditional-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
diff -r 0bc51b1f2d74 -r f9e164f72615 Makefile
--- a/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -70,7 +70,7 @@
 	$(MAKE) -C tools install
 
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: tools/ioemu-dir
+install-tools: tools/qemu-xen-traditional-dir
 endif
 
 .PHONY: install-kernels
@@ -78,18 +78,18 @@
 	for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
 
 .PHONY: install-stubdom
-install-stubdom: tools/ioemu-dir install-tools
+install-stubdom: tools/qemu-xen-traditional-dir install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
 endif
 
-tools/ioemu-dir:
-	$(MAKE) -C tools ioemu-dir-find
+tools/qemu-xen-traditional-dir:
+	$(MAKE) -C tools qemu-xen-traditional-dir-find
 
-.PHONY: tools/ioemu-dir-force-update
-tools/ioemu-dir-force-update:
-	$(MAKE) -C tools ioemu-dir-force-update
+.PHONY: tools/qemu-xen-traditional-dir-force-update
+tools/qemu-xen-traditional-dir-force-update:
+	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
 
 .PHONY: install-docs
 install-docs:
diff -r 0bc51b1f2d74 -r f9e164f72615 stubdom/Makefile
--- a/stubdom/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/stubdom/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -218,15 +218,15 @@
 QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
 
 ifeq ($(QEMU_ROOT),.)
-$(XEN_ROOT)/tools/ioemu-dir:
-	$(CROSS_MAKE) -C $(XEN_ROOT)/tools ioemu-dir-find
+$(XEN_ROOT)/tools/qemu-xen-traditional-dir:
+	$(CROSS_MAKE) -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
 
-ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir
+ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
 	mkdir -p ioemu
 	set -e;									\
 	$(buildmakevars2shellvars);						\
 	cd ioemu;								\
-	src="$$XEN_ROOT/tools/ioemu-dir"; export src;				\
+	src="$$XEN_ROOT/tools/qemu-xen-traditional-dir"; export src;		\
 	(cd $$src && find * -type d -print) | xargs mkdir -p;			\
 	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
 			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
diff -r 0bc51b1f2d74 -r f9e164f72615 tools/Makefile
--- a/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -35,7 +35,7 @@
 
 # do not recurse in to a dir we are about to delete
 ifneq "$(MAKECMDGOALS)" "distclean"
-SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
+SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-traditional-dir
 endif
 
 SUBDIRS-y += xenpmd
@@ -75,7 +75,7 @@
 
 .PHONY: distclean
 distclean: subdirs-distclean
-	rm -rf ioemu-dir ioemu-dir-remote
+	rm -rf qemu-xen-traditional-dir qemu-xen-traditional-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -88,34 +88,34 @@
 export QEMU_ROOT
 endif
 
-ioemu-dir-find:
+qemu-xen-traditional-dir-find:
 	set -ex; \
 	if test -d $(CONFIG_QEMU); then \
-		mkdir -p ioemu-dir; \
+		mkdir -p qemu-xen-traditional-dir; \
 	else \
 		export GIT=$(GIT); \
-		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) ioemu-dir; \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
 	set -e; \
 		$(buildmakevars2shellvars); \
-		cd ioemu-dir; \
+		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
 
-.PHONY: ioemu-dir-force-update
-ioemu-dir-force-update:
+.PHONY: qemu-xen-traditional-dir-force-update
+qemu-xen-traditional-dir-force-update:
 	set -ex; \
 	if [ "$(QEMU_TAG)" ]; then \
-		cd ioemu-dir-remote; \
+		cd qemu-xen-traditional-dir-remote; \
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(QEMU_TAG); \
 	fi
 
-subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
+subdir-all-qemu-xen-traditional-dir subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 
-subdir-clean-ioemu-dir:
-	set -e; if test -d ioemu-dir/.; then \
+subdir-clean-qemu-xen-traditional-dir:
+	set -e; if test -d qemu-xen-traditional-dir/.; then \
 		$(buildmakevars2shellvars); \
-		$(MAKE) -C ioemu-dir clean; \
+		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
 subdir-clean-debugger/gdbsx subdir-distclean-debugger/gdbsx: .phony

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxF-000895-Bb; Wed, 25 Jan 2012 03:55:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxE-00087Z-5g
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1327463716!12205129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3062 invoked from network); 25 Jan 2012 03:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:17 -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 1Rptx5-0008Ke-MY
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx5-0001y3-HU
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:15 +0000
Message-Id: <E1Rptx5-0001y3-HU@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Rename ioemu-dir as
	qemu-xen-traditional-dir
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417769 0
# Node ID f9e164f72615ffa3f47adc686496282e0463838e
# Parent  0bc51b1f2d74750888b70984fec7b7289d74bea0
Rename ioemu-dir as qemu-xen-traditional-dir

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 0bc51b1f2d74 -r f9e164f72615 .hgignore
--- a/.hgignore	Tue Jan 24 15:09:29 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:29 2012 +0000
@@ -296,8 +296,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
-^tools/ioemu-dir-remote
-^tools/ioemu-dir$
+^tools/qemu-xen-traditional-dir-remote
+^tools/qemu-xen-traditional-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
diff -r 0bc51b1f2d74 -r f9e164f72615 Makefile
--- a/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -70,7 +70,7 @@
 	$(MAKE) -C tools install
 
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: tools/ioemu-dir
+install-tools: tools/qemu-xen-traditional-dir
 endif
 
 .PHONY: install-kernels
@@ -78,18 +78,18 @@
 	for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
 
 .PHONY: install-stubdom
-install-stubdom: tools/ioemu-dir install-tools
+install-stubdom: tools/qemu-xen-traditional-dir install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
 endif
 
-tools/ioemu-dir:
-	$(MAKE) -C tools ioemu-dir-find
+tools/qemu-xen-traditional-dir:
+	$(MAKE) -C tools qemu-xen-traditional-dir-find
 
-.PHONY: tools/ioemu-dir-force-update
-tools/ioemu-dir-force-update:
-	$(MAKE) -C tools ioemu-dir-force-update
+.PHONY: tools/qemu-xen-traditional-dir-force-update
+tools/qemu-xen-traditional-dir-force-update:
+	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
 
 .PHONY: install-docs
 install-docs:
diff -r 0bc51b1f2d74 -r f9e164f72615 stubdom/Makefile
--- a/stubdom/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/stubdom/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -218,15 +218,15 @@
 QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
 
 ifeq ($(QEMU_ROOT),.)
-$(XEN_ROOT)/tools/ioemu-dir:
-	$(CROSS_MAKE) -C $(XEN_ROOT)/tools ioemu-dir-find
+$(XEN_ROOT)/tools/qemu-xen-traditional-dir:
+	$(CROSS_MAKE) -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
 
-ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir
+ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
 	mkdir -p ioemu
 	set -e;									\
 	$(buildmakevars2shellvars);						\
 	cd ioemu;								\
-	src="$$XEN_ROOT/tools/ioemu-dir"; export src;				\
+	src="$$XEN_ROOT/tools/qemu-xen-traditional-dir"; export src;		\
 	(cd $$src && find * -type d -print) | xargs mkdir -p;			\
 	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
 			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
diff -r 0bc51b1f2d74 -r f9e164f72615 tools/Makefile
--- a/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
@@ -35,7 +35,7 @@
 
 # do not recurse in to a dir we are about to delete
 ifneq "$(MAKECMDGOALS)" "distclean"
-SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
+SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-traditional-dir
 endif
 
 SUBDIRS-y += xenpmd
@@ -75,7 +75,7 @@
 
 .PHONY: distclean
 distclean: subdirs-distclean
-	rm -rf ioemu-dir ioemu-dir-remote
+	rm -rf qemu-xen-traditional-dir qemu-xen-traditional-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -88,34 +88,34 @@
 export QEMU_ROOT
 endif
 
-ioemu-dir-find:
+qemu-xen-traditional-dir-find:
 	set -ex; \
 	if test -d $(CONFIG_QEMU); then \
-		mkdir -p ioemu-dir; \
+		mkdir -p qemu-xen-traditional-dir; \
 	else \
 		export GIT=$(GIT); \
-		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) ioemu-dir; \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
 	set -e; \
 		$(buildmakevars2shellvars); \
-		cd ioemu-dir; \
+		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
 
-.PHONY: ioemu-dir-force-update
-ioemu-dir-force-update:
+.PHONY: qemu-xen-traditional-dir-force-update
+qemu-xen-traditional-dir-force-update:
 	set -ex; \
 	if [ "$(QEMU_TAG)" ]; then \
-		cd ioemu-dir-remote; \
+		cd qemu-xen-traditional-dir-remote; \
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(QEMU_TAG); \
 	fi
 
-subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
+subdir-all-qemu-xen-traditional-dir subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 
-subdir-clean-ioemu-dir:
-	set -e; if test -d ioemu-dir/.; then \
+subdir-clean-qemu-xen-traditional-dir:
+	set -e; if test -d qemu-xen-traditional-dir/.; then \
 		$(buildmakevars2shellvars); \
-		$(MAKE) -C ioemu-dir clean; \
+		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
 subdir-clean-debugger/gdbsx subdir-distclean-debugger/gdbsx: .phony

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxI-0008AD-Hp; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxG-00087p-R1
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1327463719!11874166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30236 invoked from network); 25 Jan 2012 03:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:20 -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 1Rptx9-0008Kx-9P
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx9-00020k-4y
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Message-Id: <E1Rptx9-00020k-4y@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: remove _libxl_json_internal.h
	from libxl_json.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1327419046 0
# Node ID cae83bffe6767f95295120c11c5c33f44a6a7ee9
# Parent  2c9b3b9da3b1b57b3cbda0ee238ca460312e2c78
libxl: remove _libxl_json_internal.h from libxl_json.h

libxl_json.h is intended as a user-includable header for applications which
would like to use libyajl directly with libxl types. It should not expose libxl
internals.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 2c9b3b9da3b1 -r cae83bffe676 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Jan 24 15:09:32 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Tue Jan 24 15:30:46 2012 +0000
@@ -61,8 +61,10 @@
 #include "flexarray.h"
 #include "libxl_utils.h"
 
+#include "libxl_json.h"
+
 #include "_libxl_types_internal.h"
-#include "libxl_json.h"
+#include "_libxl_types_internal_json.h"
 
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
diff -r 2c9b3b9da3b1 -r cae83bffe676 tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Tue Jan 24 15:09:32 2012 +0000
+++ b/tools/libxl/libxl_json.h	Tue Jan 24 15:30:46 2012 +0000
@@ -18,6 +18,5 @@
 #include <yajl/yajl_gen.h>
 
 #include <_libxl_types_json.h>
-#include <_libxl_types_internal_json.h>
 
 #endif /* LIBXL_JSON_H */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxI-0008AD-Hp; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxG-00087p-R1
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1327463719!11874166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30236 invoked from network); 25 Jan 2012 03:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:20 -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 1Rptx9-0008Kx-9P
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx9-00020k-4y
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Message-Id: <E1Rptx9-00020k-4y@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: remove _libxl_json_internal.h
	from libxl_json.h
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1327419046 0
# Node ID cae83bffe6767f95295120c11c5c33f44a6a7ee9
# Parent  2c9b3b9da3b1b57b3cbda0ee238ca460312e2c78
libxl: remove _libxl_json_internal.h from libxl_json.h

libxl_json.h is intended as a user-includable header for applications which
would like to use libyajl directly with libxl types. It should not expose libxl
internals.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 2c9b3b9da3b1 -r cae83bffe676 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Jan 24 15:09:32 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Tue Jan 24 15:30:46 2012 +0000
@@ -61,8 +61,10 @@
 #include "flexarray.h"
 #include "libxl_utils.h"
 
+#include "libxl_json.h"
+
 #include "_libxl_types_internal.h"
-#include "libxl_json.h"
+#include "_libxl_types_internal_json.h"
 
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
diff -r 2c9b3b9da3b1 -r cae83bffe676 tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Tue Jan 24 15:09:32 2012 +0000
+++ b/tools/libxl/libxl_json.h	Tue Jan 24 15:30:46 2012 +0000
@@ -18,6 +18,5 @@
 #include <yajl/yajl_gen.h>
 
 #include <_libxl_types_json.h>
-#include <_libxl_types_internal_json.h>
 
 #endif /* LIBXL_JSON_H */

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxF-00089A-Ei; Wed, 25 Jan 2012 03:55:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxE-00087b-Dm
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327463716!12269853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 917 invoked from network); 25 Jan 2012 03:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:17 -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 1Rptx6-0008Kh-8I
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx6-0001yV-3m
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Message-Id: <E1Rptx6-0001yV-3m@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] move the call to xen-setup after
	libxc and xenstore are built
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417770 0
# Node ID 905ecf8d6482cc13e31e1c6a38c691e089ec335e
# Parent  f9e164f72615ffa3f47adc686496282e0463838e
move the call to xen-setup after libxc and xenstore are built

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Move the call to xen-setup, the wrapper script to configure
qemu-xen-traditional, right before building qemu-xen-traditional and
after libxc and xenstore are already built.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f9e164f72615 -r 905ecf8d6482 tools/Makefile
--- a/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:30 2012 +0000
@@ -96,10 +96,6 @@
 		export GIT=$(GIT); \
 		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
-	set -e; \
-		$(buildmakevars2shellvars); \
-		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
 
 .PHONY: qemu-xen-traditional-dir-force-update
 qemu-xen-traditional-dir-force-update:
@@ -111,6 +107,11 @@
 	fi
 
 subdir-all-qemu-xen-traditional-dir subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
+	set -e; \
+		$(buildmakevars2shellvars); \
+		cd qemu-xen-traditional-dir; \
+		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(MAKE) install
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxF-00089A-Ei; Wed, 25 Jan 2012 03:55:25 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxE-00087b-Dm
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327463716!12269853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 917 invoked from network); 25 Jan 2012 03:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:17 -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 1Rptx6-0008Kh-8I
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx6-0001yV-3m
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:16 +0000
Message-Id: <E1Rptx6-0001yV-3m@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] move the call to xen-setup after
	libxc and xenstore are built
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417770 0
# Node ID 905ecf8d6482cc13e31e1c6a38c691e089ec335e
# Parent  f9e164f72615ffa3f47adc686496282e0463838e
move the call to xen-setup after libxc and xenstore are built

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Move the call to xen-setup, the wrapper script to configure
qemu-xen-traditional, right before building qemu-xen-traditional and
after libxc and xenstore are already built.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f9e164f72615 -r 905ecf8d6482 tools/Makefile
--- a/tools/Makefile	Tue Jan 24 15:09:29 2012 +0000
+++ b/tools/Makefile	Tue Jan 24 15:09:30 2012 +0000
@@ -96,10 +96,6 @@
 		export GIT=$(GIT); \
 		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
-	set -e; \
-		$(buildmakevars2shellvars); \
-		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
 
 .PHONY: qemu-xen-traditional-dir-force-update
 qemu-xen-traditional-dir-force-update:
@@ -111,6 +107,11 @@
 	fi
 
 subdir-all-qemu-xen-traditional-dir subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
+	set -e; \
+		$(buildmakevars2shellvars); \
+		cd qemu-xen-traditional-dir; \
+		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(MAKE) install
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxI-0008Ab-Mk; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxG-00087q-VA
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1327463720!11832955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30472 invoked from network); 25 Jan 2012 03:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:21 -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 1Rptx9-0008L0-Ml
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx9-00021A-LZ
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Message-Id: <E1Rptx9-00021A-LZ@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Add missing trigger for the xl
	trigger cmd.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1327419216 0
# Node ID b7936bee33bf3e41dd79a8bb5a4e3f72809945a0
# Parent  cae83bffe6767f95295120c11c5c33f44a6a7ee9
xl: Add missing trigger for the xl trigger cmd.

Add s3resume trigger in the usage of the xl trigger cmd.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r cae83bffe676 -r b7936bee33bf tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Tue Jan 24 15:30:46 2012 +0000
+++ b/tools/libxl/xl_cmdtable.c	Tue Jan 24 15:33:36 2012 +0000
@@ -240,7 +240,7 @@
     { "trigger",
       &main_trigger, 0,
       "Send a trigger to a domain",
-      "<Domain> <nmi|reset|init|power|sleep> [<VCPU>]",
+      "<Domain> <nmi|reset|init|power|sleep|s3resume> [<VCPU>]",
     },
     { "sysrq",
       &main_sysrq, 0,

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03:55: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.xensource.com>)
	id 1RptxI-0008Ab-Mk; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxG-00087q-VA
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1327463720!11832955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30472 invoked from network); 25 Jan 2012 03:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:21 -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 1Rptx9-0008L0-Ml
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx9-00021A-LZ
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:19 +0000
Message-Id: <E1Rptx9-00021A-LZ@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Add missing trigger for the xl
	trigger cmd.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jean Guyader <jean.guyader@eu.citrix.com>
# Date 1327419216 0
# Node ID b7936bee33bf3e41dd79a8bb5a4e3f72809945a0
# Parent  cae83bffe6767f95295120c11c5c33f44a6a7ee9
xl: Add missing trigger for the xl trigger cmd.

Add s3resume trigger in the usage of the xl trigger cmd.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r cae83bffe676 -r b7936bee33bf tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Tue Jan 24 15:30:46 2012 +0000
+++ b/tools/libxl/xl_cmdtable.c	Tue Jan 24 15:33:36 2012 +0000
@@ -240,7 +240,7 @@
     { "trigger",
       &main_trigger, 0,
       "Send a trigger to a domain",
-      "<Domain> <nmi|reset|init|power|sleep> [<VCPU>]",
+      "<Domain> <nmi|reset|init|power|sleep|s3resume> [<VCPU>]",
     },
     { "sysrq",
       &main_sysrq, 0,

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03: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.xensource.com>)
	id 1RptxI-0008Ai-PZ; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxH-000880-Nj
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327463720!4933322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8969 invoked from network); 25 Jan 2012 03:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:21 -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 1RptxA-0008L3-AA
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxA-00021a-5p
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Message-Id: <E1RptxA-00021a-5p@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: rename is_assigned to
	is_pcidev_in_array
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Doug Magee <djmagee@mageenet.net>
# Date 1327419379 0
# Node ID 4cd3560aec0bf8975905b1633392cdd97db195bb
# Parent  b7936bee33bf3e41dd79a8bb5a4e3f72809945a0
libxl: rename is_assigned to is_pcidev_in_array

All this function does is check to see if a device is in an array of
pcidevs passed by the caller.  The function name can be misleading if
ever used to check against a list of devices other than those assigned
to a domain.

Signed-off-by: Doug Magee <djmagee@mageenet.net>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r b7936bee33bf -r 4cd3560aec0b tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Tue Jan 24 15:33:36 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Tue Jan 24 15:36:19 2012 +0000
@@ -447,7 +447,7 @@
     return 0;
 }
 
-static int is_assigned(libxl_device_pci *assigned, int num_assigned,
+static int is_pcidev_in_array(libxl_device_pci *assigned, int num_assigned,
                        int dom, int bus, int dev, int func)
 {
     int i;
@@ -496,7 +496,7 @@
         if ( sscanf(de->d_name, PCI_BDF, &dom, &bus, &dev, &func) != 4 )
             continue;
 
-        if ( is_assigned(assigned, num_assigned, dom, bus, dev, func) )
+        if ( is_pcidev_in_array(assigned, num_assigned, dom, bus, dev, func) )
             continue;
 
         new = realloc(pcidevs, ((*num) + 1) * sizeof(*new));
@@ -788,7 +788,7 @@
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
         goto out;
     }
-    if ( is_assigned(assigned, num_assigned, pcidev->domain,
+    if ( is_pcidev_in_array(assigned, num_assigned, pcidev->domain,
                      pcidev->bus, pcidev->dev, pcidev->func) ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device already attached to a domain");
         rc = ERROR_FAIL;
@@ -892,7 +892,7 @@
         return ERROR_FAIL;
 
     rc = ERROR_INVAL;
-    if ( !is_assigned(assigned, num, pcidev->domain,
+    if ( !is_pcidev_in_array(assigned, num, pcidev->domain,
                       pcidev->bus, pcidev->dev, pcidev->func) ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device not attached to this domain");
         goto out_fail;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03: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.xensource.com>)
	id 1RptxI-0008Ai-PZ; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxH-000880-Nj
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327463720!4933322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8969 invoked from network); 25 Jan 2012 03:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:21 -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 1RptxA-0008L3-AA
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxA-00021a-5p
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Message-Id: <E1RptxA-00021a-5p@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: rename is_assigned to
	is_pcidev_in_array
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Doug Magee <djmagee@mageenet.net>
# Date 1327419379 0
# Node ID 4cd3560aec0bf8975905b1633392cdd97db195bb
# Parent  b7936bee33bf3e41dd79a8bb5a4e3f72809945a0
libxl: rename is_assigned to is_pcidev_in_array

All this function does is check to see if a device is in an array of
pcidevs passed by the caller.  The function name can be misleading if
ever used to check against a list of devices other than those assigned
to a domain.

Signed-off-by: Doug Magee <djmagee@mageenet.net>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r b7936bee33bf -r 4cd3560aec0b tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Tue Jan 24 15:33:36 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Tue Jan 24 15:36:19 2012 +0000
@@ -447,7 +447,7 @@
     return 0;
 }
 
-static int is_assigned(libxl_device_pci *assigned, int num_assigned,
+static int is_pcidev_in_array(libxl_device_pci *assigned, int num_assigned,
                        int dom, int bus, int dev, int func)
 {
     int i;
@@ -496,7 +496,7 @@
         if ( sscanf(de->d_name, PCI_BDF, &dom, &bus, &dev, &func) != 4 )
             continue;
 
-        if ( is_assigned(assigned, num_assigned, dom, bus, dev, func) )
+        if ( is_pcidev_in_array(assigned, num_assigned, dom, bus, dev, func) )
             continue;
 
         new = realloc(pcidevs, ((*num) + 1) * sizeof(*new));
@@ -788,7 +788,7 @@
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
         goto out;
     }
-    if ( is_assigned(assigned, num_assigned, pcidev->domain,
+    if ( is_pcidev_in_array(assigned, num_assigned, pcidev->domain,
                      pcidev->bus, pcidev->dev, pcidev->func) ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device already attached to a domain");
         rc = ERROR_FAIL;
@@ -892,7 +892,7 @@
         return ERROR_FAIL;
 
     rc = ERROR_INVAL;
-    if ( !is_assigned(assigned, num, pcidev->domain,
+    if ( !is_pcidev_in_array(assigned, num, pcidev->domain,
                       pcidev->bus, pcidev->dev, pcidev->func) ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device not attached to this domain");
         goto out_fail;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03: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.xensource.com>)
	id 1RptxI-0008AJ-KI; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxG-00087o-SE
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1327463719!13780634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18933 invoked from network); 25 Jan 2012 03:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:20 -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 1Rptx8-0008Kt-L4
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx8-00020F-Jj
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:18 +0000
Message-Id: <E1Rptx8-00020F-Jj@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] update MAINTAINERS file
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417772 0
# Node ID 2c9b3b9da3b1b57b3cbda0ee238ca460312e2c78
# Parent  d919b814d0f331748816b842a38b062e52ea9a7c
update MAINTAINERS file

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Add Ian as Seabios maintainer and myself as upstream Qemu maintainer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d919b814d0f3 -r 2c9b3b9da3b1 MAINTAINERS
--- a/MAINTAINERS	Tue Jan 24 15:09:31 2012 +0000
+++ b/MAINTAINERS	Tue Jan 24 15:09:32 2012 +0000
@@ -176,6 +176,11 @@
 S:	Supported
 T:	git git://xenbits.xen.org/qemu-xen-*.git
 
+QEMU UPSTREAM
+M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+S:	Supported
+T:	git git://xenbits.xen.org/qemu-upstream-*.git
+
 REMUS
 M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
 S:	Maintained
@@ -190,6 +195,11 @@
 S:	Supported
 F:	xen/common/sched*
 
+SEABIOS UPSTREAM
+M:	Ian Campbell <ian.campbell@citrix.com>
+S:	Supported
+T:	git git://xenbits.xen.org/seabios.git
+
 STUB DOMAINS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 S:	Supported

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03: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.xensource.com>)
	id 1RptxI-0008AJ-KI; Wed, 25 Jan 2012 03:55:28 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxG-00087o-SE
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1327463719!13780634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.4.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18933 invoked from network); 25 Jan 2012 03:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:20 -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 1Rptx8-0008Kt-L4
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx8-00020F-Jj
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:18 +0000
Message-Id: <E1Rptx8-00020F-Jj@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] update MAINTAINERS file
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417772 0
# Node ID 2c9b3b9da3b1b57b3cbda0ee238ca460312e2c78
# Parent  d919b814d0f331748816b842a38b062e52ea9a7c
update MAINTAINERS file

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Add Ian as Seabios maintainer and myself as upstream Qemu maintainer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d919b814d0f3 -r 2c9b3b9da3b1 MAINTAINERS
--- a/MAINTAINERS	Tue Jan 24 15:09:31 2012 +0000
+++ b/MAINTAINERS	Tue Jan 24 15:09:32 2012 +0000
@@ -176,6 +176,11 @@
 S:	Supported
 T:	git git://xenbits.xen.org/qemu-xen-*.git
 
+QEMU UPSTREAM
+M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+S:	Supported
+T:	git git://xenbits.xen.org/qemu-upstream-*.git
+
 REMUS
 M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
 S:	Maintained
@@ -190,6 +195,11 @@
 S:	Supported
 F:	xen/common/sched*
 
+SEABIOS UPSTREAM
+M:	Ian Campbell <ian.campbell@citrix.com>
+S:	Supported
+T:	git git://xenbits.xen.org/seabios.git
+
 STUB DOMAINS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 S:	Supported

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:53 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03: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.xensource.com>)
	id 1Rptxf-0008KA-TB; Wed, 25 Jan 2012 03:55:51 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptxe-0008I9-Ej
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327463721!12190284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5971 invoked from network); 25 Jan 2012 03:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:22 -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 1RptxA-0008L6-SG
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxA-000222-O7
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Message-Id: <E1RptxA-000222-O7@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] SVM: Plumb NPT error-code bits into
	nested-fault access_X arguments.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327423577 0
# Node ID a2a8089b1ffbf5757ca3191cb8f74a5f1ed7fed1
# Parent  4cd3560aec0bf8975905b1633392cdd97db195bb
SVM: Plumb NPT error-code bits into nested-fault access_X arguments.

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r 4cd3560aec0b -r a2a8089b1ffb xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Jan 24 16:46:17 2012 +0000
@@ -1185,7 +1185,6 @@
 int hvm_hap_nested_page_fault(unsigned long gpa,
                               bool_t gla_valid,
                               unsigned long gla,
-                              bool_t access_valid,
                               bool_t access_r,
                               bool_t access_w,
                               bool_t access_x)
@@ -1234,7 +1233,7 @@
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_guest, NULL);
 
     /* Check access permissions first, then handle faults */
-    if ( access_valid && (mfn_x(mfn) != INVALID_MFN) )
+    if ( mfn_x(mfn) != INVALID_MFN )
     {
         int violation = 0;
         /* If the access is against the permissions, then send to mem_event */
diff -r 4cd3560aec0b -r a2a8089b1ffb xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Tue Jan 24 16:46:17 2012 +0000
@@ -1143,7 +1143,7 @@
 }
 
 static void svm_do_nested_pgfault(struct vcpu *v,
-    struct cpu_user_regs *regs, paddr_t gpa)
+    struct cpu_user_regs *regs, uint32_t npfec, paddr_t gpa)
 {
     int ret;
     unsigned long gfn = gpa >> PAGE_SHIFT;
@@ -1152,7 +1152,10 @@
     p2m_access_t p2ma;
     struct p2m_domain *p2m = NULL;
 
-    ret = hvm_hap_nested_page_fault(gpa, 0, ~0ul, 0, 0, 0, 0);
+    ret = hvm_hap_nested_page_fault(gpa, 0, ~0ul, 
+                                    1, /* All NPFs count as reads */
+                                    npfec & PFEC_write_access, 
+                                    npfec & PFEC_insn_fetch);
 
     if ( tb_init_done )
     {
@@ -1181,7 +1184,7 @@
     case -1:
         ASSERT(nestedhvm_enabled(v->domain) && nestedhvm_vcpu_in_guestmode(v));
         /* inject #VMEXIT(NPF) into guest. */
-        nestedsvm_vmexit_defer(v, VMEXIT_NPF, regs->error_code, gpa);
+        nestedsvm_vmexit_defer(v, VMEXIT_NPF, npfec, gpa);
         return;
     }
 
@@ -2198,10 +2201,9 @@
 
     case VMEXIT_NPF:
         perfc_incra(svmexits, VMEXIT_NPF_PERFC);
-        regs->error_code = vmcb->exitinfo1;
         if ( cpu_has_svm_decode )
             v->arch.hvm_svm.cached_insn_len = vmcb->guest_ins_len & 0xf;
-        svm_do_nested_pgfault(v, regs, vmcb->exitinfo2);
+        svm_do_nested_pgfault(v, regs, vmcb->exitinfo1, vmcb->exitinfo2);
         v->arch.hvm_svm.cached_insn_len = 0;
         break;
 
diff -r 4cd3560aec0b -r a2a8089b1ffb xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Jan 24 16:46:17 2012 +0000
@@ -2106,7 +2106,6 @@
                                    qualification & EPT_GLA_VALID       ? 1 : 0,
                                    qualification & EPT_GLA_VALID
                                      ? __vmread(GUEST_LINEAR_ADDRESS) : ~0ull,
-                                   1, /* access types are as follows */
                                    qualification & EPT_READ_VIOLATION  ? 1 : 0,
                                    qualification & EPT_WRITE_VIOLATION ? 1 : 0,
                                    qualification & EPT_EXEC_VIOLATION  ? 1 : 0) )
diff -r 4cd3560aec0b -r a2a8089b1ffb xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/include/asm-x86/hvm/hvm.h	Tue Jan 24 16:46:17 2012 +0000
@@ -409,7 +409,6 @@
 
 int hvm_hap_nested_page_fault(unsigned long gpa,
                               bool_t gla_valid, unsigned long gla,
-                              bool_t access_valid, 
                               bool_t access_r,
                               bool_t access_w,
                               bool_t access_x);

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 03:55:53 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 03: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.xensource.com>)
	id 1Rptxf-0008KA-TB; Wed, 25 Jan 2012 03:55:51 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptxe-0008I9-Ej
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1327463721!12190284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5971 invoked from network); 25 Jan 2012 03:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:22 -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 1RptxA-0008L6-SG
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RptxA-000222-O7
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:20 +0000
Message-Id: <E1RptxA-000222-O7@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] SVM: Plumb NPT error-code bits into
	nested-fault access_X arguments.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327423577 0
# Node ID a2a8089b1ffbf5757ca3191cb8f74a5f1ed7fed1
# Parent  4cd3560aec0bf8975905b1633392cdd97db195bb
SVM: Plumb NPT error-code bits into nested-fault access_X arguments.

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r 4cd3560aec0b -r a2a8089b1ffb xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Jan 24 16:46:17 2012 +0000
@@ -1185,7 +1185,6 @@
 int hvm_hap_nested_page_fault(unsigned long gpa,
                               bool_t gla_valid,
                               unsigned long gla,
-                              bool_t access_valid,
                               bool_t access_r,
                               bool_t access_w,
                               bool_t access_x)
@@ -1234,7 +1233,7 @@
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_guest, NULL);
 
     /* Check access permissions first, then handle faults */
-    if ( access_valid && (mfn_x(mfn) != INVALID_MFN) )
+    if ( mfn_x(mfn) != INVALID_MFN )
     {
         int violation = 0;
         /* If the access is against the permissions, then send to mem_event */
diff -r 4cd3560aec0b -r a2a8089b1ffb xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Tue Jan 24 16:46:17 2012 +0000
@@ -1143,7 +1143,7 @@
 }
 
 static void svm_do_nested_pgfault(struct vcpu *v,
-    struct cpu_user_regs *regs, paddr_t gpa)
+    struct cpu_user_regs *regs, uint32_t npfec, paddr_t gpa)
 {
     int ret;
     unsigned long gfn = gpa >> PAGE_SHIFT;
@@ -1152,7 +1152,10 @@
     p2m_access_t p2ma;
     struct p2m_domain *p2m = NULL;
 
-    ret = hvm_hap_nested_page_fault(gpa, 0, ~0ul, 0, 0, 0, 0);
+    ret = hvm_hap_nested_page_fault(gpa, 0, ~0ul, 
+                                    1, /* All NPFs count as reads */
+                                    npfec & PFEC_write_access, 
+                                    npfec & PFEC_insn_fetch);
 
     if ( tb_init_done )
     {
@@ -1181,7 +1184,7 @@
     case -1:
         ASSERT(nestedhvm_enabled(v->domain) && nestedhvm_vcpu_in_guestmode(v));
         /* inject #VMEXIT(NPF) into guest. */
-        nestedsvm_vmexit_defer(v, VMEXIT_NPF, regs->error_code, gpa);
+        nestedsvm_vmexit_defer(v, VMEXIT_NPF, npfec, gpa);
         return;
     }
 
@@ -2198,10 +2201,9 @@
 
     case VMEXIT_NPF:
         perfc_incra(svmexits, VMEXIT_NPF_PERFC);
-        regs->error_code = vmcb->exitinfo1;
         if ( cpu_has_svm_decode )
             v->arch.hvm_svm.cached_insn_len = vmcb->guest_ins_len & 0xf;
-        svm_do_nested_pgfault(v, regs, vmcb->exitinfo2);
+        svm_do_nested_pgfault(v, regs, vmcb->exitinfo1, vmcb->exitinfo2);
         v->arch.hvm_svm.cached_insn_len = 0;
         break;
 
diff -r 4cd3560aec0b -r a2a8089b1ffb xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Jan 24 16:46:17 2012 +0000
@@ -2106,7 +2106,6 @@
                                    qualification & EPT_GLA_VALID       ? 1 : 0,
                                    qualification & EPT_GLA_VALID
                                      ? __vmread(GUEST_LINEAR_ADDRESS) : ~0ull,
-                                   1, /* access types are as follows */
                                    qualification & EPT_READ_VIOLATION  ? 1 : 0,
                                    qualification & EPT_WRITE_VIOLATION ? 1 : 0,
                                    qualification & EPT_EXEC_VIOLATION  ? 1 : 0) )
diff -r 4cd3560aec0b -r a2a8089b1ffb xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Tue Jan 24 15:36:19 2012 +0000
+++ b/xen/include/asm-x86/hvm/hvm.h	Tue Jan 24 16:46:17 2012 +0000
@@ -409,7 +409,6 @@
 
 int hvm_hap_nested_page_fault(unsigned long gpa,
                               bool_t gla_valid, unsigned long gla,
-                              bool_t access_valid, 
                               bool_t access_r,
                               bool_t access_w,
                               bool_t access_x);

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 05:11:56 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 05:11: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.xensource.com>)
	id 1Rpv9D-0001cO-W7; Wed, 25 Jan 2012 05:11:51 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rpv9B-0001cF-UL
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 05:11:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327463717!8482680!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18894 invoked from network); 25 Jan 2012 03:55:19 -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;
	25 Jan 2012 03:55:19 -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 1Rptx7-0008Kn-GA
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx7-0001zN-88
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Message-Id: <E1Rptx7-0001zN-88@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Clone and build Seabios by default
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417771 0
# Node ID d24509a987c3eaac9bcd882294300e18039e1512
# Parent  277a1cde337f2d3777db18e2c76ec663c50f5dc6
Clone and build Seabios by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 277a1cde337f -r d24509a987c3 .hgignore
--- a/.hgignore	Tue Jan 24 15:09:30 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:31 2012 +0000
@@ -300,6 +300,8 @@
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
 ^tools/qemu-xen-dir$
+^tools/firmware/seabios-dir-remote
+^tools/firmware/seabios-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
diff -r 277a1cde337f -r d24509a987c3 Config.mk
--- a/Config.mk	Tue Jan 24 15:09:30 2012 +0000
+++ b/Config.mk	Tue Jan 24 15:09:31 2012 +0000
@@ -209,10 +209,13 @@
 
 ifeq ($(GIT_HTTP),y)
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
+SEABIOS_UPSTREAM_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
 
 # 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.
@@ -226,15 +229,6 @@
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
 
-# SeaBIOS integration is a work in progress. Before enabling this
-# option you must clone git://git.qemu.org/seabios.git/, possibly add
-# some development patches and then build it yourself before pointing
-# this variable to it (using an absolute path).
-#
-# Note that using SeaBIOS requires the use the upstream qemu as the
-# device model.
-SEABIOS_DIR ?= 
-
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
diff -r 277a1cde337f -r d24509a987c3 Makefile
--- a/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/Makefile	Tue Jan 24 15:09:31 2012 +0000
@@ -98,6 +98,10 @@
 tools/qemu-xen-dir-force-update:
 	$(MAKE) -C tools qemu-xen-dir-force-update
 
+.PHONY: tools/firmware/seabios-dir-force-update
+tools/firmware/seabios-dir-force-update:
+	$(MAKE) -C tools/firmware seabios-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
diff -r 277a1cde337f -r d24509a987c3 tools/firmware/Makefile
--- a/tools/firmware/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/tools/firmware/Makefile	Tue Jan 24 15:09:31 2012 +0000
@@ -6,13 +6,18 @@
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS :=
+SUBDIRS += seabios-dir
 SUBDIRS += rombios
 SUBDIRS += vgabios
 SUBDIRS += etherboot
 SUBDIRS += hvmloader
 
+seabios-dir:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
+	cp seabios-config seabios-dir/.config;
+
 .PHONY: all
-all:
+all: seabios-dir
 	@set -e; if [ $$((`( bcc -v 2>&1 | grep version || echo 0.0.0 ) | cut -d' ' -f 3 | awk -F. '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -lt $$((0x00100e)) ] ; then \
 	echo "==========================================================================="; \
 	echo "Require dev86 rpm or bin86 & bcc debs version >= 0.16.14 to build firmware!"; \
@@ -35,4 +40,16 @@
 distclean: subdirs-distclean
 
 subdir-distclean-etherboot: .phony
-	$(MAKE) -C etherboot distclean
\ No newline at end of file
+	$(MAKE) -C etherboot distclean
+
+subdir-distclean-seabios-dir: .phony
+	rm -rf seabios-dir seabios-dir-remote
+
+.PHONY: seabios-dir-force-update
+seabios-dir-force-update:
+	set -ex; \
+	if [ "$(SEABIOS_UPSTREAM_TAG)" ]; then \
+		cd seabios-dir-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
+	fi
diff -r 277a1cde337f -r d24509a987c3 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/tools/firmware/hvmloader/Makefile	Tue Jan 24 15:09:31 2012 +0000
@@ -44,6 +44,7 @@
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
 endif
 
+SEABIOS_DIR := ../seabios-dir
 ifneq ($(SEABIOS_DIR),)
 OBJS += seabios.o
 CFLAGS += -DENABLE_SEABIOS
diff -r 277a1cde337f -r d24509a987c3 tools/firmware/seabios-config
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/seabios-config	Tue Jan 24 15:09:31 2012 +0000
@@ -0,0 +1,73 @@
+#
+# Automatically generated make config: don't edit
+# SeaBIOS Configuration
+# Wed Sep  7 13:03:21 2011
+#
+
+#
+# General Features
+#
+# CONFIG_COREBOOT is not set
+CONFIG_XEN=y
+CONFIG_THREADS=y
+# CONFIG_THREAD_OPTIONROMS is not set
+CONFIG_RELOCATE_INIT=y
+CONFIG_BOOTMENU=y
+# CONFIG_BOOTSPLASH is not set
+CONFIG_BOOTORDER=y
+
+#
+# Hardware support
+#
+CONFIG_ATA=y
+CONFIG_ATA_DMA=y
+CONFIG_ATA_PIO32=y
+CONFIG_AHCI=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_FLOPPY=y
+CONFIG_PS2PORT=y
+CONFIG_USB=y
+CONFIG_USB_UHCI=y
+CONFIG_USB_OHCI=y
+CONFIG_USB_EHCI=y
+CONFIG_USB_MSC=y
+CONFIG_USB_HUB=y
+CONFIG_USB_KEYBOARD=y
+CONFIG_USB_MOUSE=y
+CONFIG_SERIAL=y
+CONFIG_LPT=y
+# CONFIG_USE_SMM is not set
+CONFIG_MTRR_INIT=y
+
+#
+# BIOS interfaces
+#
+CONFIG_DRIVES=y
+CONFIG_CDROM_BOOT=y
+CONFIG_CDROM_EMU=y
+CONFIG_PCIBIOS=y
+CONFIG_APMBIOS=y
+CONFIG_PNPBIOS=y
+CONFIG_OPTIONROMS=y
+# CONFIG_OPTIONROMS_DEPLOYED is not set
+CONFIG_PMM=y
+CONFIG_BOOT=y
+CONFIG_KEYBOARD=y
+CONFIG_KBD_CALL_INT15_4F=y
+CONFIG_MOUSE=y
+CONFIG_S3_RESUME=y
+# CONFIG_DISABLE_A20 is not set
+
+#
+# BIOS Tables
+#
+CONFIG_PIRTABLE=y
+CONFIG_MPTABLE=y
+CONFIG_SMBIOS=y
+CONFIG_ACPI=y
+
+#
+# Debugging
+#
+CONFIG_DEBUG_LEVEL=1
+# CONFIG_DEBUG_SERIAL is not set

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 05:11:56 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 05:11: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.xensource.com>)
	id 1Rpv9D-0001cO-W7; Wed, 25 Jan 2012 05:11:51 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rpv9B-0001cF-UL
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 05:11:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327463717!8482680!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18894 invoked from network); 25 Jan 2012 03:55:19 -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;
	25 Jan 2012 03:55:19 -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 1Rptx7-0008Kn-GA
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx7-0001zN-88
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Message-Id: <E1Rptx7-0001zN-88@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Clone and build Seabios by default
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417771 0
# Node ID d24509a987c3eaac9bcd882294300e18039e1512
# Parent  277a1cde337f2d3777db18e2c76ec663c50f5dc6
Clone and build Seabios by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 277a1cde337f -r d24509a987c3 .hgignore
--- a/.hgignore	Tue Jan 24 15:09:30 2012 +0000
+++ b/.hgignore	Tue Jan 24 15:09:31 2012 +0000
@@ -300,6 +300,8 @@
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
 ^tools/qemu-xen-dir$
+^tools/firmware/seabios-dir-remote
+^tools/firmware/seabios-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
diff -r 277a1cde337f -r d24509a987c3 Config.mk
--- a/Config.mk	Tue Jan 24 15:09:30 2012 +0000
+++ b/Config.mk	Tue Jan 24 15:09:31 2012 +0000
@@ -209,10 +209,13 @@
 
 ifeq ($(GIT_HTTP),y)
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
+SEABIOS_UPSTREAM_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
 
 # 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.
@@ -226,15 +229,6 @@
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
 
-# SeaBIOS integration is a work in progress. Before enabling this
-# option you must clone git://git.qemu.org/seabios.git/, possibly add
-# some development patches and then build it yourself before pointing
-# this variable to it (using an absolute path).
-#
-# Note that using SeaBIOS requires the use the upstream qemu as the
-# device model.
-SEABIOS_DIR ?= 
-
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
diff -r 277a1cde337f -r d24509a987c3 Makefile
--- a/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/Makefile	Tue Jan 24 15:09:31 2012 +0000
@@ -98,6 +98,10 @@
 tools/qemu-xen-dir-force-update:
 	$(MAKE) -C tools qemu-xen-dir-force-update
 
+.PHONY: tools/firmware/seabios-dir-force-update
+tools/firmware/seabios-dir-force-update:
+	$(MAKE) -C tools/firmware seabios-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
diff -r 277a1cde337f -r d24509a987c3 tools/firmware/Makefile
--- a/tools/firmware/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/tools/firmware/Makefile	Tue Jan 24 15:09:31 2012 +0000
@@ -6,13 +6,18 @@
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS :=
+SUBDIRS += seabios-dir
 SUBDIRS += rombios
 SUBDIRS += vgabios
 SUBDIRS += etherboot
 SUBDIRS += hvmloader
 
+seabios-dir:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
+	cp seabios-config seabios-dir/.config;
+
 .PHONY: all
-all:
+all: seabios-dir
 	@set -e; if [ $$((`( bcc -v 2>&1 | grep version || echo 0.0.0 ) | cut -d' ' -f 3 | awk -F. '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -lt $$((0x00100e)) ] ; then \
 	echo "==========================================================================="; \
 	echo "Require dev86 rpm or bin86 & bcc debs version >= 0.16.14 to build firmware!"; \
@@ -35,4 +40,16 @@
 distclean: subdirs-distclean
 
 subdir-distclean-etherboot: .phony
-	$(MAKE) -C etherboot distclean
\ No newline at end of file
+	$(MAKE) -C etherboot distclean
+
+subdir-distclean-seabios-dir: .phony
+	rm -rf seabios-dir seabios-dir-remote
+
+.PHONY: seabios-dir-force-update
+seabios-dir-force-update:
+	set -ex; \
+	if [ "$(SEABIOS_UPSTREAM_TAG)" ]; then \
+		cd seabios-dir-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
+	fi
diff -r 277a1cde337f -r d24509a987c3 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile	Tue Jan 24 15:09:30 2012 +0000
+++ b/tools/firmware/hvmloader/Makefile	Tue Jan 24 15:09:31 2012 +0000
@@ -44,6 +44,7 @@
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
 endif
 
+SEABIOS_DIR := ../seabios-dir
 ifneq ($(SEABIOS_DIR),)
 OBJS += seabios.o
 CFLAGS += -DENABLE_SEABIOS
diff -r 277a1cde337f -r d24509a987c3 tools/firmware/seabios-config
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/seabios-config	Tue Jan 24 15:09:31 2012 +0000
@@ -0,0 +1,73 @@
+#
+# Automatically generated make config: don't edit
+# SeaBIOS Configuration
+# Wed Sep  7 13:03:21 2011
+#
+
+#
+# General Features
+#
+# CONFIG_COREBOOT is not set
+CONFIG_XEN=y
+CONFIG_THREADS=y
+# CONFIG_THREAD_OPTIONROMS is not set
+CONFIG_RELOCATE_INIT=y
+CONFIG_BOOTMENU=y
+# CONFIG_BOOTSPLASH is not set
+CONFIG_BOOTORDER=y
+
+#
+# Hardware support
+#
+CONFIG_ATA=y
+CONFIG_ATA_DMA=y
+CONFIG_ATA_PIO32=y
+CONFIG_AHCI=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_FLOPPY=y
+CONFIG_PS2PORT=y
+CONFIG_USB=y
+CONFIG_USB_UHCI=y
+CONFIG_USB_OHCI=y
+CONFIG_USB_EHCI=y
+CONFIG_USB_MSC=y
+CONFIG_USB_HUB=y
+CONFIG_USB_KEYBOARD=y
+CONFIG_USB_MOUSE=y
+CONFIG_SERIAL=y
+CONFIG_LPT=y
+# CONFIG_USE_SMM is not set
+CONFIG_MTRR_INIT=y
+
+#
+# BIOS interfaces
+#
+CONFIG_DRIVES=y
+CONFIG_CDROM_BOOT=y
+CONFIG_CDROM_EMU=y
+CONFIG_PCIBIOS=y
+CONFIG_APMBIOS=y
+CONFIG_PNPBIOS=y
+CONFIG_OPTIONROMS=y
+# CONFIG_OPTIONROMS_DEPLOYED is not set
+CONFIG_PMM=y
+CONFIG_BOOT=y
+CONFIG_KEYBOARD=y
+CONFIG_KBD_CALL_INT15_4F=y
+CONFIG_MOUSE=y
+CONFIG_S3_RESUME=y
+# CONFIG_DISABLE_A20 is not set
+
+#
+# BIOS Tables
+#
+CONFIG_PIRTABLE=y
+CONFIG_MPTABLE=y
+CONFIG_SMBIOS=y
+CONFIG_ACPI=y
+
+#
+# Debugging
+#
+CONFIG_DEBUG_LEVEL=1
+# CONFIG_DEBUG_SERIAL is not set

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 05:12:00 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 05:12: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.xensource.com>)
	id 1Rpv9J-0001co-2M; Wed, 25 Jan 2012 05:11:57 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rpv9G-0001cJ-Qn
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 05:11:55 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327463714!8482673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18836 invoked from network); 25 Jan 2012 03:55:15 -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;
	25 Jan 2012 03:55:15 -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 1Rptx3-0008KV-Rh
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx3-0001we-Gp
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:13 +0000
Message-Id: <E1Rptx3-0001we-Gp@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] switch to dynamically allocated
	cpumask in domain_update_node_affinity()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327414840 0
# Node ID 455a50622fb2a135e6bbfce8705fddc8705fe2d7
# Parent  3df3a0a95551a65ae0c29a481f0f756b63a3f37c
switch to dynamically allocated cpumask in domain_update_node_affinity()

cpumasks should rather be allocated dynamically.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3df3a0a95551 -r 455a50622fb2 xen/common/domain.c
--- a/xen/common/domain.c	Tue Jan 24 14:19:58 2012 +0000
+++ b/xen/common/domain.c	Tue Jan 24 14:20:40 2012 +0000
@@ -220,6 +220,7 @@
     INIT_PAGE_LIST_HEAD(&d->xenpage_list);
 
     spin_lock_init(&d->node_affinity_lock);
+    d->node_affinity = NODE_MASK_ALL;
 
     spin_lock_init(&d->shutdown_lock);
     d->shutdown_code = -1;
@@ -333,23 +334,27 @@
 
 void domain_update_node_affinity(struct domain *d)
 {
-    cpumask_t cpumask;
+    cpumask_var_t cpumask;
     nodemask_t nodemask = NODE_MASK_NONE;
     struct vcpu *v;
     unsigned int node;
 
-    cpumask_clear(&cpumask);
+    if ( !zalloc_cpumask_var(&cpumask) )
+        return;
+
     spin_lock(&d->node_affinity_lock);
 
     for_each_vcpu ( d, v )
-        cpumask_or(&cpumask, &cpumask, v->cpu_affinity);
+        cpumask_or(cpumask, cpumask, v->cpu_affinity);
 
     for_each_online_node ( node )
-        if ( cpumask_intersects(&node_to_cpumask(node), &cpumask) )
+        if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
             node_set(node, nodemask);
 
     d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
+
+    free_cpumask_var(cpumask);
 }
 
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 05:12:00 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 05:12: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.xensource.com>)
	id 1Rpv9J-0001co-2M; Wed, 25 Jan 2012 05:11:57 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rpv9G-0001cJ-Qn
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 05:11:55 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1327463714!8482673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18836 invoked from network); 25 Jan 2012 03:55:15 -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;
	25 Jan 2012 03:55:15 -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 1Rptx3-0008KV-Rh
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx3-0001we-Gp
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:13 +0000
Message-Id: <E1Rptx3-0001we-Gp@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] switch to dynamically allocated
	cpumask in domain_update_node_affinity()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1327414840 0
# Node ID 455a50622fb2a135e6bbfce8705fddc8705fe2d7
# Parent  3df3a0a95551a65ae0c29a481f0f756b63a3f37c
switch to dynamically allocated cpumask in domain_update_node_affinity()

cpumasks should rather be allocated dynamically.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3df3a0a95551 -r 455a50622fb2 xen/common/domain.c
--- a/xen/common/domain.c	Tue Jan 24 14:19:58 2012 +0000
+++ b/xen/common/domain.c	Tue Jan 24 14:20:40 2012 +0000
@@ -220,6 +220,7 @@
     INIT_PAGE_LIST_HEAD(&d->xenpage_list);
 
     spin_lock_init(&d->node_affinity_lock);
+    d->node_affinity = NODE_MASK_ALL;
 
     spin_lock_init(&d->shutdown_lock);
     d->shutdown_code = -1;
@@ -333,23 +334,27 @@
 
 void domain_update_node_affinity(struct domain *d)
 {
-    cpumask_t cpumask;
+    cpumask_var_t cpumask;
     nodemask_t nodemask = NODE_MASK_NONE;
     struct vcpu *v;
     unsigned int node;
 
-    cpumask_clear(&cpumask);
+    if ( !zalloc_cpumask_var(&cpumask) )
+        return;
+
     spin_lock(&d->node_affinity_lock);
 
     for_each_vcpu ( d, v )
-        cpumask_or(&cpumask, &cpumask, v->cpu_affinity);
+        cpumask_or(cpumask, cpumask, v->cpu_affinity);
 
     for_each_online_node ( node )
-        if ( cpumask_intersects(&node_to_cpumask(node), &cpumask) )
+        if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
             node_set(node, nodemask);
 
     d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
+
+    free_cpumask_var(cpumask);
 }
 
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 05:43:09 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 05:43: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.xensource.com>)
	id 1RpvdQ-0002Er-1w; Wed, 25 Jan 2012 05:43:04 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpvdO-0002Em-M4
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 05:43:02 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1327463718!12257476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23510 invoked from network); 25 Jan 2012 03:55:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:19 -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 1Rptx7-0008Kq-V7
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx7-0001zp-Ti
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Message-Id: <E1Rptx7-0001zp-Ti@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use new qemu at the location
	where xen-unstable installs it
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417771 0
# Node ID d919b814d0f331748816b842a38b062e52ea9a7c
# Parent  d24509a987c3eaac9bcd882294300e18039e1512
libxl: use new qemu at the location where xen-unstable installs it

From: Ian Campbell <ian.campbell@citrix.com>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d24509a987c3 -r d919b814d0f3 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Jan 24 15:09:31 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Tue Jan 24 15:09:31 2012 +0000
@@ -50,7 +50,7 @@
             dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path());
             break;
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = libxl__strdup(gc, "/usr/bin/qemu");
+            dm = libxl__abs_path(gc, "qemu", libxl_libexec_path());
             break;
         default:
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR,

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 05:43:09 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 05:43: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.xensource.com>)
	id 1RpvdQ-0002Er-1w; Wed, 25 Jan 2012 05:43:04 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RpvdO-0002Em-M4
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 05:43:02 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1327463718!12257476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23510 invoked from network); 25 Jan 2012 03:55:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 03:55:19 -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 1Rptx7-0008Kq-V7
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rptx7-0001zp-Ti
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 03:55:17 +0000
Message-Id: <E1Rptx7-0001zp-Ti@xenbits.xen.org>
Date: Wed, 25 Jan 2012 03:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use new qemu at the location
	where xen-unstable installs it
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User <stefano.stabellini@eu.citrix.com>
# Date 1327417771 0
# Node ID d919b814d0f331748816b842a38b062e52ea9a7c
# Parent  d24509a987c3eaac9bcd882294300e18039e1512
libxl: use new qemu at the location where xen-unstable installs it

From: Ian Campbell <ian.campbell@citrix.com>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d24509a987c3 -r d919b814d0f3 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Jan 24 15:09:31 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Tue Jan 24 15:09:31 2012 +0000
@@ -50,7 +50,7 @@
             dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path());
             break;
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = libxl__strdup(gc, "/usr/bin/qemu");
+            dm = libxl__abs_path(gc, "qemu", libxl_libexec_path());
             break;
         default:
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR,

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 11:44:11 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 11:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rq1Gp-0002z0-Dn; Wed, 25 Jan 2012 11:44:07 +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 1Rq1Go-0002yl-Sh
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:07 +0000
Received: from [85.158.138.51:22804] by server-12.bemta-3.messagelabs.com id
	CC/69-24557-50BEF1F4; Wed, 25 Jan 2012 11:44:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327491844!10429678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16865 invoked from network); 25 Jan 2012 11:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 11:44:05 -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 1Rq1Gl-0005fc-TV
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gl-0007cA-Jp
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Message-Id: <E1Rq1Gl-0007cA-Jp@xenbits.xen.org>
Date: Wed, 25 Jan 2012 11:44: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] drivers/xen/: use strlcpy()
	instead of strncpy()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327491109 -3600
# Node ID 06cf8b206bb42584fad133237182ee3519d31649
# Parent  684281d7a1a3f2001047b59700408048b66da178
drivers/xen/: use strlcpy() instead of strncpy()

... for being the safer alternative.

In blktap2, snprintf() also gets replaced by strlcpy(), and the bounds
check in blktap_sysfs_set_name() also gets adjusted.

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


diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/blktap/xenbus.c	Wed Jan 25 12:31:49 2012 +0100
@@ -72,24 +72,22 @@
                                 return i;
                         len--;
                 }
-        return (len == 0) ? i : -ERANGE;
+        return -ERANGE;
 }
 
 static long get_id(const char *str)
 {
-        int len,end;
+	int len;
         const char *ptr;
-        char *tptr, num[10];
+	char num[10];
 	
         len = strsep_len(str, '/', 2);
-        end = strlen(str);
-        if ( (len < 0) || (end < 0) ) return -1;
+	if (len < 0)
+		return -1;
 	
         ptr = str + len + 1;
-        strncpy(num,ptr,end - len);
-        tptr = num + (end - (len + 1));
-        *tptr = '\0';
-	DPRINTK("Get_id called for %s (%s)\n",str,num);
+	strlcpy(num, ptr, ARRAY_SIZE(num));
+	DPRINTK("get_id(%s) -> %s\n", str, num);
 	
         return simple_strtol(num, NULL, 10);
 }				
diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/blktap2/sysfs.c
--- a/drivers/xen/blktap2/sysfs.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/blktap2/sysfs.c	Wed Jan 25 12:31:49 2012 +0100
@@ -65,12 +65,12 @@
 		goto out;
 	}
 
-	if (strnlen(buf, BLKTAP2_MAX_MESSAGE_LEN) >= BLKTAP2_MAX_MESSAGE_LEN) {
+	if (strnlen(buf, size) >= size) {
 		err = -EINVAL;
 		goto out;
 	}
 
-	snprintf(tap->params.name, sizeof(tap->params.name) - 1, "%s", buf);
+	strlcpy(tap->params.name, buf, size);
 	err = size;
 
 out:
diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/usbback/usbstub.c
--- a/drivers/xen/usbback/usbstub.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/usbback/usbstub.c	Wed Jan 25 12:31:49 2012 +0100
@@ -110,7 +110,7 @@
 	portid->handle = handle;
 	portid->portnum = portnum;
 
-	strncpy(portid->phys_bus, busid, BUS_ID_SIZE);
+	strlcpy(portid->phys_bus, busid, BUS_ID_SIZE);
 
 	spin_lock_irqsave(&port_list_lock, flags);
 	list_add(&portid->id_list, &port_list);
diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/xenoprof/xenoprofile.c
--- a/drivers/xen/xenoprof/xenoprofile.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/xenoprof/xenoprofile.c	Wed Jan 25 12:31:49 2012 +0100
@@ -553,9 +553,8 @@
 		xenoprof_arch_init_counter(&init);
 		xenoprof_is_primary = init.is_primary;
 
-		/*  cpu_type is detected by Xen */
-		cpu_type[XENOPROF_CPU_TYPE_SIZE-1] = 0;
-		strncpy(cpu_type, init.cpu_type, XENOPROF_CPU_TYPE_SIZE - 1);
+		/* cpu_type is detected by Xen */
+		strlcpy(cpu_type, init.cpu_type, XENOPROF_CPU_TYPE_SIZE);
 		xenoprof_ops.cpu_type = cpu_type;
 
 		init_driverfs();

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 11:44:11 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 11:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rq1Gp-0002z0-Dn; Wed, 25 Jan 2012 11:44:07 +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 1Rq1Go-0002yl-Sh
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:07 +0000
Received: from [85.158.138.51:22804] by server-12.bemta-3.messagelabs.com id
	CC/69-24557-50BEF1F4; Wed, 25 Jan 2012 11:44:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327491844!10429678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16865 invoked from network); 25 Jan 2012 11:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 11:44:05 -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 1Rq1Gl-0005fc-TV
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gl-0007cA-Jp
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Message-Id: <E1Rq1Gl-0007cA-Jp@xenbits.xen.org>
Date: Wed, 25 Jan 2012 11:44: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] drivers/xen/: use strlcpy()
	instead of strncpy()
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327491109 -3600
# Node ID 06cf8b206bb42584fad133237182ee3519d31649
# Parent  684281d7a1a3f2001047b59700408048b66da178
drivers/xen/: use strlcpy() instead of strncpy()

... for being the safer alternative.

In blktap2, snprintf() also gets replaced by strlcpy(), and the bounds
check in blktap_sysfs_set_name() also gets adjusted.

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


diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/blktap/xenbus.c	Wed Jan 25 12:31:49 2012 +0100
@@ -72,24 +72,22 @@
                                 return i;
                         len--;
                 }
-        return (len == 0) ? i : -ERANGE;
+        return -ERANGE;
 }
 
 static long get_id(const char *str)
 {
-        int len,end;
+	int len;
         const char *ptr;
-        char *tptr, num[10];
+	char num[10];
 	
         len = strsep_len(str, '/', 2);
-        end = strlen(str);
-        if ( (len < 0) || (end < 0) ) return -1;
+	if (len < 0)
+		return -1;
 	
         ptr = str + len + 1;
-        strncpy(num,ptr,end - len);
-        tptr = num + (end - (len + 1));
-        *tptr = '\0';
-	DPRINTK("Get_id called for %s (%s)\n",str,num);
+	strlcpy(num, ptr, ARRAY_SIZE(num));
+	DPRINTK("get_id(%s) -> %s\n", str, num);
 	
         return simple_strtol(num, NULL, 10);
 }				
diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/blktap2/sysfs.c
--- a/drivers/xen/blktap2/sysfs.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/blktap2/sysfs.c	Wed Jan 25 12:31:49 2012 +0100
@@ -65,12 +65,12 @@
 		goto out;
 	}
 
-	if (strnlen(buf, BLKTAP2_MAX_MESSAGE_LEN) >= BLKTAP2_MAX_MESSAGE_LEN) {
+	if (strnlen(buf, size) >= size) {
 		err = -EINVAL;
 		goto out;
 	}
 
-	snprintf(tap->params.name, sizeof(tap->params.name) - 1, "%s", buf);
+	strlcpy(tap->params.name, buf, size);
 	err = size;
 
 out:
diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/usbback/usbstub.c
--- a/drivers/xen/usbback/usbstub.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/usbback/usbstub.c	Wed Jan 25 12:31:49 2012 +0100
@@ -110,7 +110,7 @@
 	portid->handle = handle;
 	portid->portnum = portnum;
 
-	strncpy(portid->phys_bus, busid, BUS_ID_SIZE);
+	strlcpy(portid->phys_bus, busid, BUS_ID_SIZE);
 
 	spin_lock_irqsave(&port_list_lock, flags);
 	list_add(&portid->id_list, &port_list);
diff -r 684281d7a1a3 -r 06cf8b206bb4 drivers/xen/xenoprof/xenoprofile.c
--- a/drivers/xen/xenoprof/xenoprofile.c	Wed Jan 25 12:30:46 2012 +0100
+++ b/drivers/xen/xenoprof/xenoprofile.c	Wed Jan 25 12:31:49 2012 +0100
@@ -553,9 +553,8 @@
 		xenoprof_arch_init_counter(&init);
 		xenoprof_is_primary = init.is_primary;
 
-		/*  cpu_type is detected by Xen */
-		cpu_type[XENOPROF_CPU_TYPE_SIZE-1] = 0;
-		strncpy(cpu_type, init.cpu_type, XENOPROF_CPU_TYPE_SIZE - 1);
+		/* cpu_type is detected by Xen */
+		strlcpy(cpu_type, init.cpu_type, XENOPROF_CPU_TYPE_SIZE);
 		xenoprof_ops.cpu_type = cpu_type;
 
 		init_driverfs();

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 11:44:13 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 11:44: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.xensource.com>)
	id 1Rq1Gp-0002yv-Bf; Wed, 25 Jan 2012 11:44:07 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Go-0002yk-1h
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1327491791!53979627!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7962 invoked from network); 25 Jan 2012 11:43:12 -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;
	25 Jan 2012 11:43:12 -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 1Rq1Gl-0005fa-Ng
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gl-0007bm-69
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Message-Id: <E1Rq1Gl-0007bm-69@xenbits.xen.org>
Date: Wed, 25 Jan 2012 11:44: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] xenbus_dev: add missing error
	checks to watch handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327491046 -3600
# Node ID 684281d7a1a3f2001047b59700408048b66da178
# Parent  712106b6b4d7cee855dcee46c34e9822da908a5f
xenbus_dev: add missing error checks to watch handling

So far only the watch path was checked to be zero terminated, while
the watch token was merely assumed to be.

Additionally, none of the three associated memory allocations got
checked for being successful.

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


diff -r 712106b6b4d7 -r 684281d7a1a3 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c	Fri Jan 20 14:13:12 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c	Wed Jan 25 12:30:46 2012 +0100
@@ -269,18 +269,24 @@
 			goto out;
 		}
 		token++;
+		if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) {
+			rc = -EILSEQ;
+			goto out;
+		}
 
 		if (msg_type == XS_WATCH) {
 			watch = kzalloc(sizeof(*watch), GFP_KERNEL);
-			watch->watch.node = kmalloc(strlen(path)+1,
-                                                    GFP_KERNEL);
-			strcpy((char *)watch->watch.node, path);
+			if (watch == NULL) {
+				rc = -ENOMEM;
+				goto out;
+			}
+			watch->watch.node = kstrdup(path, GFP_KERNEL);
 			watch->watch.callback = watch_fired;
-			watch->token = kmalloc(strlen(token)+1, GFP_KERNEL);
-			strcpy(watch->token, token);
+			watch->token = kstrdup(token, GFP_KERNEL);
 			watch->dev_data = u;
 
-			err = register_xenbus_watch(&watch->watch);
+			err = watch->watch.node && watch->token
+			      ? register_xenbus_watch(&watch->watch) : -ENOMEM;
 			if (err) {
 				free_watch_adapter(watch);
 				rc = err;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 11:44:13 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 11:44: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.xensource.com>)
	id 1Rq1Gp-0002yv-Bf; Wed, 25 Jan 2012 11:44:07 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Go-0002yk-1h
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1327491791!53979627!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7962 invoked from network); 25 Jan 2012 11:43:12 -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;
	25 Jan 2012 11:43:12 -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 1Rq1Gl-0005fa-Ng
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gl-0007bm-69
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:03 +0000
Message-Id: <E1Rq1Gl-0007bm-69@xenbits.xen.org>
Date: Wed, 25 Jan 2012 11:44: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] xenbus_dev: add missing error
	checks to watch handling
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327491046 -3600
# Node ID 684281d7a1a3f2001047b59700408048b66da178
# Parent  712106b6b4d7cee855dcee46c34e9822da908a5f
xenbus_dev: add missing error checks to watch handling

So far only the watch path was checked to be zero terminated, while
the watch token was merely assumed to be.

Additionally, none of the three associated memory allocations got
checked for being successful.

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


diff -r 712106b6b4d7 -r 684281d7a1a3 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c	Fri Jan 20 14:13:12 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c	Wed Jan 25 12:30:46 2012 +0100
@@ -269,18 +269,24 @@
 			goto out;
 		}
 		token++;
+		if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) {
+			rc = -EILSEQ;
+			goto out;
+		}
 
 		if (msg_type == XS_WATCH) {
 			watch = kzalloc(sizeof(*watch), GFP_KERNEL);
-			watch->watch.node = kmalloc(strlen(path)+1,
-                                                    GFP_KERNEL);
-			strcpy((char *)watch->watch.node, path);
+			if (watch == NULL) {
+				rc = -ENOMEM;
+				goto out;
+			}
+			watch->watch.node = kstrdup(path, GFP_KERNEL);
 			watch->watch.callback = watch_fired;
-			watch->token = kmalloc(strlen(token)+1, GFP_KERNEL);
-			strcpy(watch->token, token);
+			watch->token = kstrdup(token, GFP_KERNEL);
 			watch->dev_data = u;
 
-			err = register_xenbus_watch(&watch->watch);
+			err = watch->watch.node && watch->token
+			      ? register_xenbus_watch(&watch->watch) : -ENOMEM;
 			if (err) {
 				free_watch_adapter(watch);
 				rc = err;

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 11:44:16 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 11:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rq1Gv-0002zs-Ge; Wed, 25 Jan 2012 11:44:13 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gt-0002yq-VQ
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1327491844!11774016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6968 invoked from network); 25 Jan 2012 11:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 11:44:05 -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 1Rq1Gm-0005fg-1A
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gm-0007cX-00
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:04 +0000
Message-Id: <E1Rq1Gm-0007cX-00@xenbits.xen.org>
Date: Wed, 25 Jan 2012 11:44: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] xenoprof: consolidate read/write
	of active/passive domain IDs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327491191 -3600
# Node ID 5aa9c1c436f6e4a478edca4d28677f4f8db03b71
# Parent  06cf8b206bb42584fad133237182ee3519d31649
xenoprof: consolidate read/write of active/passive domain IDs

This doesn't just fold redundant code, but also fixes the potential for
a buffer overrun: While active_domains[] was properly sized (matching
the main loop in adomain_write()), passive_domains[] was declared one
entry too short.

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


diff -r 06cf8b206bb4 -r 5aa9c1c436f6 drivers/oprofile/oprofile_files.c
--- a/drivers/oprofile/oprofile_files.c	Wed Jan 25 12:31:49 2012 +0100
+++ b/drivers/oprofile/oprofile_files.c	Wed Jan 25 12:33:11 2012 +0100
@@ -126,13 +126,22 @@
 
 #define TMPBUFSIZE 512
 
-static unsigned int adomains = 0;
-static int active_domains[MAX_OPROF_DOMAINS + 1];
-static DEFINE_MUTEX(adom_mutex);
+struct domain_data {
+    unsigned int nr;
+    int ids[MAX_OPROF_DOMAINS + 1];
+    struct mutex mutex;
+    int (*set)(int[], unsigned int);
+};
+#define DEFINE_DOMAIN_DATA(what) \
+	struct domain_data what##_domains = { \
+		.mutex = __MUTEX_INITIALIZER(what##_domains.mutex), \
+		.set = oprofile_set_##what \
+	}
 
-static ssize_t adomain_write(struct file * file, char const __user * buf, 
-			     size_t count, loff_t * offset)
+static ssize_t domain_write(struct file *filp, char const __user *buf,
+			    size_t count, loff_t *offset)
 {
+	struct domain_data *dom = filp->private_data;
 	char *tmpbuf;
 	char *startp, *endp;
 	int i;
@@ -153,7 +162,7 @@
 	}
 	tmpbuf[count] = 0;
 
-	mutex_lock(&adom_mutex);
+	mutex_lock(&dom->mutex);
 
 	startp = tmpbuf;
 	/* Parse one more than MAX_OPROF_DOMAINS, for easy error checking */
@@ -163,31 +172,32 @@
 			break;
 		while (ispunct(*endp) || isspace(*endp))
 			endp++;
-		active_domains[i] = val;
-		if (active_domains[i] != val)
+		dom->ids[i] = val;
+		if (dom->ids[i] != val)
 			/* Overflow, force error below */
 			i = MAX_OPROF_DOMAINS + 1;
 		startp = endp;
 	}
 	/* Force error on trailing junk */
-	adomains = *startp ? MAX_OPROF_DOMAINS + 1 : i;
+	dom->nr = *startp ? MAX_OPROF_DOMAINS + 1 : i;
 
 	kfree(tmpbuf);
 
-	if (adomains > MAX_OPROF_DOMAINS
-	    || oprofile_set_active(active_domains, adomains)) {
-		adomains = 0;
+	if (dom->nr > MAX_OPROF_DOMAINS
+	    || dom->set(dom->ids, dom->nr)) {
+		dom->nr = 0;
 		retval = -EINVAL;
 	}
 
-	mutex_unlock(&adom_mutex);
+	mutex_unlock(&dom->mutex);
 	return retval;
 }
 
-static ssize_t adomain_read(struct file * file, char __user * buf, 
-			    size_t count, loff_t * offset)
+static ssize_t domain_read(struct file *filp, char __user *buf,
+			    size_t count, loff_t *offset)
 {
-	char * tmpbuf;
+	struct domain_data *dom = filp->private_data;
+	char *tmpbuf;
 	size_t len;
 	int i;
 	ssize_t retval;
@@ -195,18 +205,18 @@
 	if (!(tmpbuf = kmalloc(TMPBUFSIZE, GFP_KERNEL)))
 		return -ENOMEM;
 
-	mutex_lock(&adom_mutex);
+	mutex_lock(&dom->mutex);
 
 	len = 0;
-	for (i = 0; i < adomains; i++)
+	for (i = 0; i < dom->nr; i++)
 		len += snprintf(tmpbuf + len,
 				len < TMPBUFSIZE ? TMPBUFSIZE - len : 0,
-				"%u ", active_domains[i]);
+				"%u ", dom->ids[i]);
 	WARN_ON(len > TMPBUFSIZE);
 	if (len != 0 && len <= TMPBUFSIZE)
 		tmpbuf[len-1] = '\n';
 
-	mutex_unlock(&adom_mutex);
+	mutex_unlock(&dom->mutex);
 
 	retval = simple_read_from_buffer(buf, count, offset, tmpbuf, len);
 
@@ -214,103 +224,32 @@
 	return retval;
 }
 
+static DEFINE_DOMAIN_DATA(active);
+
+static int adomain_open(struct inode *inode, struct file *filp)
+{
+    filp->private_data = &active_domains;
+    return 0;
+}
 
 static const struct file_operations active_domain_ops = {
-	.read		= adomain_read,
-	.write		= adomain_write,
+	.open		= adomain_open,
+	.read		= domain_read,
+	.write		= domain_write,
 };
 
-static unsigned int pdomains = 0;
-static int passive_domains[MAX_OPROF_DOMAINS];
-static DEFINE_MUTEX(pdom_mutex);
+static DEFINE_DOMAIN_DATA(passive);
 
-static ssize_t pdomain_write(struct file * file, char const __user * buf, 
-			     size_t count, loff_t * offset)
+static int pdomain_open(struct inode *inode, struct file *filp)
 {
-	char *tmpbuf;
-	char *startp, *endp;
-	int i;
-	unsigned long val;
-	ssize_t retval = count;
-	
-	if (*offset)
-		return -EINVAL;	
-	if (count > TMPBUFSIZE - 1)
-		return -EINVAL;
-
-	if (!(tmpbuf = kmalloc(TMPBUFSIZE, GFP_KERNEL)))
-		return -ENOMEM;
-
-	if (copy_from_user(tmpbuf, buf, count)) {
-		kfree(tmpbuf);
-		return -EFAULT;
-	}
-	tmpbuf[count] = 0;
-
-	mutex_lock(&pdom_mutex);
-
-	startp = tmpbuf;
-	/* Parse one more than MAX_OPROF_DOMAINS, for easy error checking */
-	for (i = 0; i <= MAX_OPROF_DOMAINS; i++) {
-		val = simple_strtoul(startp, &endp, 0);
-		if (endp == startp)
-			break;
-		while (ispunct(*endp) || isspace(*endp))
-			endp++;
-		passive_domains[i] = val;
-		if (passive_domains[i] != val)
-			/* Overflow, force error below */
-			i = MAX_OPROF_DOMAINS + 1;
-		startp = endp;
-	}
-	/* Force error on trailing junk */
-	pdomains = *startp ? MAX_OPROF_DOMAINS + 1 : i;
-
-	kfree(tmpbuf);
-
-	if (pdomains > MAX_OPROF_DOMAINS
-	    || oprofile_set_passive(passive_domains, pdomains)) {
-		pdomains = 0;
-		retval = -EINVAL;
-	}
-
-	mutex_unlock(&pdom_mutex);
-	return retval;
-}
-
-static ssize_t pdomain_read(struct file * file, char __user * buf, 
-			    size_t count, loff_t * offset)
-{
-	char * tmpbuf;
-	size_t len;
-	int i;
-	ssize_t retval;
-
-	if (!(tmpbuf = kmalloc(TMPBUFSIZE, GFP_KERNEL)))
-		return -ENOMEM;
-
-	mutex_lock(&pdom_mutex);
-
-	len = 0;
-	for (i = 0; i < pdomains; i++)
-		len += snprintf(tmpbuf + len,
-				len < TMPBUFSIZE ? TMPBUFSIZE - len : 0,
-				"%u ", passive_domains[i]);
-	WARN_ON(len > TMPBUFSIZE);
-	if (len != 0 && len <= TMPBUFSIZE)
-		tmpbuf[len-1] = '\n';
-
-	mutex_unlock(&pdom_mutex);
-
-	retval = simple_read_from_buffer(buf, count, offset, tmpbuf, len);
-
-	kfree(tmpbuf);
-	return retval;
+    filp->private_data = &passive_domains;
+    return 0;
 }
 
 static const struct file_operations passive_domain_ops = {
-	.read		= pdomain_read,
-	.write		= pdomain_write,
+	.open		= pdomain_open,
+	.read		= domain_read,
+	.write		= domain_write,
 };
 
 void oprofile_create_files(struct super_block * sb, struct dentry * root)

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 11:44:16 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 11:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rq1Gv-0002zs-Ge; Wed, 25 Jan 2012 11:44:13 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gt-0002yq-VQ
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1327491844!11774016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6968 invoked from network); 25 Jan 2012 11:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 11:44:05 -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 1Rq1Gm-0005fg-1A
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq1Gm-0007cX-00
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 11:44:04 +0000
Message-Id: <E1Rq1Gm-0007cX-00@xenbits.xen.org>
Date: Wed, 25 Jan 2012 11:44: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] xenoprof: consolidate read/write
	of active/passive domain IDs
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1327491191 -3600
# Node ID 5aa9c1c436f6e4a478edca4d28677f4f8db03b71
# Parent  06cf8b206bb42584fad133237182ee3519d31649
xenoprof: consolidate read/write of active/passive domain IDs

This doesn't just fold redundant code, but also fixes the potential for
a buffer overrun: While active_domains[] was properly sized (matching
the main loop in adomain_write()), passive_domains[] was declared one
entry too short.

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


diff -r 06cf8b206bb4 -r 5aa9c1c436f6 drivers/oprofile/oprofile_files.c
--- a/drivers/oprofile/oprofile_files.c	Wed Jan 25 12:31:49 2012 +0100
+++ b/drivers/oprofile/oprofile_files.c	Wed Jan 25 12:33:11 2012 +0100
@@ -126,13 +126,22 @@
 
 #define TMPBUFSIZE 512
 
-static unsigned int adomains = 0;
-static int active_domains[MAX_OPROF_DOMAINS + 1];
-static DEFINE_MUTEX(adom_mutex);
+struct domain_data {
+    unsigned int nr;
+    int ids[MAX_OPROF_DOMAINS + 1];
+    struct mutex mutex;
+    int (*set)(int[], unsigned int);
+};
+#define DEFINE_DOMAIN_DATA(what) \
+	struct domain_data what##_domains = { \
+		.mutex = __MUTEX_INITIALIZER(what##_domains.mutex), \
+		.set = oprofile_set_##what \
+	}
 
-static ssize_t adomain_write(struct file * file, char const __user * buf, 
-			     size_t count, loff_t * offset)
+static ssize_t domain_write(struct file *filp, char const __user *buf,
+			    size_t count, loff_t *offset)
 {
+	struct domain_data *dom = filp->private_data;
 	char *tmpbuf;
 	char *startp, *endp;
 	int i;
@@ -153,7 +162,7 @@
 	}
 	tmpbuf[count] = 0;
 
-	mutex_lock(&adom_mutex);
+	mutex_lock(&dom->mutex);
 
 	startp = tmpbuf;
 	/* Parse one more than MAX_OPROF_DOMAINS, for easy error checking */
@@ -163,31 +172,32 @@
 			break;
 		while (ispunct(*endp) || isspace(*endp))
 			endp++;
-		active_domains[i] = val;
-		if (active_domains[i] != val)
+		dom->ids[i] = val;
+		if (dom->ids[i] != val)
 			/* Overflow, force error below */
 			i = MAX_OPROF_DOMAINS + 1;
 		startp = endp;
 	}
 	/* Force error on trailing junk */
-	adomains = *startp ? MAX_OPROF_DOMAINS + 1 : i;
+	dom->nr = *startp ? MAX_OPROF_DOMAINS + 1 : i;
 
 	kfree(tmpbuf);
 
-	if (adomains > MAX_OPROF_DOMAINS
-	    || oprofile_set_active(active_domains, adomains)) {
-		adomains = 0;
+	if (dom->nr > MAX_OPROF_DOMAINS
+	    || dom->set(dom->ids, dom->nr)) {
+		dom->nr = 0;
 		retval = -EINVAL;
 	}
 
-	mutex_unlock(&adom_mutex);
+	mutex_unlock(&dom->mutex);
 	return retval;
 }
 
-static ssize_t adomain_read(struct file * file, char __user * buf, 
-			    size_t count, loff_t * offset)
+static ssize_t domain_read(struct file *filp, char __user *buf,
+			    size_t count, loff_t *offset)
 {
-	char * tmpbuf;
+	struct domain_data *dom = filp->private_data;
+	char *tmpbuf;
 	size_t len;
 	int i;
 	ssize_t retval;
@@ -195,18 +205,18 @@
 	if (!(tmpbuf = kmalloc(TMPBUFSIZE, GFP_KERNEL)))
 		return -ENOMEM;
 
-	mutex_lock(&adom_mutex);
+	mutex_lock(&dom->mutex);
 
 	len = 0;
-	for (i = 0; i < adomains; i++)
+	for (i = 0; i < dom->nr; i++)
 		len += snprintf(tmpbuf + len,
 				len < TMPBUFSIZE ? TMPBUFSIZE - len : 0,
-				"%u ", active_domains[i]);
+				"%u ", dom->ids[i]);
 	WARN_ON(len > TMPBUFSIZE);
 	if (len != 0 && len <= TMPBUFSIZE)
 		tmpbuf[len-1] = '\n';
 
-	mutex_unlock(&adom_mutex);
+	mutex_unlock(&dom->mutex);
 
 	retval = simple_read_from_buffer(buf, count, offset, tmpbuf, len);
 
@@ -214,103 +224,32 @@
 	return retval;
 }
 
+static DEFINE_DOMAIN_DATA(active);
+
+static int adomain_open(struct inode *inode, struct file *filp)
+{
+    filp->private_data = &active_domains;
+    return 0;
+}
 
 static const struct file_operations active_domain_ops = {
-	.read		= adomain_read,
-	.write		= adomain_write,
+	.open		= adomain_open,
+	.read		= domain_read,
+	.write		= domain_write,
 };
 
-static unsigned int pdomains = 0;
-static int passive_domains[MAX_OPROF_DOMAINS];
-static DEFINE_MUTEX(pdom_mutex);
+static DEFINE_DOMAIN_DATA(passive);
 
-static ssize_t pdomain_write(struct file * file, char const __user * buf, 
-			     size_t count, loff_t * offset)
+static int pdomain_open(struct inode *inode, struct file *filp)
 {
-	char *tmpbuf;
-	char *startp, *endp;
-	int i;
-	unsigned long val;
-	ssize_t retval = count;
-	
-	if (*offset)
-		return -EINVAL;	
-	if (count > TMPBUFSIZE - 1)
-		return -EINVAL;
-
-	if (!(tmpbuf = kmalloc(TMPBUFSIZE, GFP_KERNEL)))
-		return -ENOMEM;
-
-	if (copy_from_user(tmpbuf, buf, count)) {
-		kfree(tmpbuf);
-		return -EFAULT;
-	}
-	tmpbuf[count] = 0;
-
-	mutex_lock(&pdom_mutex);
-
-	startp = tmpbuf;
-	/* Parse one more than MAX_OPROF_DOMAINS, for easy error checking */
-	for (i = 0; i <= MAX_OPROF_DOMAINS; i++) {
-		val = simple_strtoul(startp, &endp, 0);
-		if (endp == startp)
-			break;
-		while (ispunct(*endp) || isspace(*endp))
-			endp++;
-		passive_domains[i] = val;
-		if (passive_domains[i] != val)
-			/* Overflow, force error below */
-			i = MAX_OPROF_DOMAINS + 1;
-		startp = endp;
-	}
-	/* Force error on trailing junk */
-	pdomains = *startp ? MAX_OPROF_DOMAINS + 1 : i;
-
-	kfree(tmpbuf);
-
-	if (pdomains > MAX_OPROF_DOMAINS
-	    || oprofile_set_passive(passive_domains, pdomains)) {
-		pdomains = 0;
-		retval = -EINVAL;
-	}
-
-	mutex_unlock(&pdom_mutex);
-	return retval;
-}
-
-static ssize_t pdomain_read(struct file * file, char __user * buf, 
-			    size_t count, loff_t * offset)
-{
-	char * tmpbuf;
-	size_t len;
-	int i;
-	ssize_t retval;
-
-	if (!(tmpbuf = kmalloc(TMPBUFSIZE, GFP_KERNEL)))
-		return -ENOMEM;
-
-	mutex_lock(&pdom_mutex);
-
-	len = 0;
-	for (i = 0; i < pdomains; i++)
-		len += snprintf(tmpbuf + len,
-				len < TMPBUFSIZE ? TMPBUFSIZE - len : 0,
-				"%u ", passive_domains[i]);
-	WARN_ON(len > TMPBUFSIZE);
-	if (len != 0 && len <= TMPBUFSIZE)
-		tmpbuf[len-1] = '\n';
-
-	mutex_unlock(&pdom_mutex);
-
-	retval = simple_read_from_buffer(buf, count, offset, tmpbuf, len);
-
-	kfree(tmpbuf);
-	return retval;
+    filp->private_data = &passive_domains;
+    return 0;
 }
 
 static const struct file_operations passive_domain_ops = {
-	.read		= pdomain_read,
-	.write		= pdomain_write,
+	.open		= pdomain_open,
+	.read		= domain_read,
+	.write		= domain_write,
 };
 
 void oprofile_create_files(struct super_block * sb, struct dentry * root)

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 20:55:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 20:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rq9s9-0006gn-4u; Wed, 25 Jan 2012 20:55:13 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s7-0006gY-V0
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327524889!63923599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13197 invoked from network); 25 Jan 2012 20:54:50 -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;
	25 Jan 2012 20:54:50 -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 1Rq9s5-00047e-LK
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s5-0001L2-5e
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Message-Id: <E1Rq9s5-0001L2-5e@xenbits.xen.org>
Date: Wed, 25 Jan 2012 20:55:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added tag RELEASE-3.4.4 for
	changeset 4f003add869b
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1327524356 18000
# Node ID 9e59e91c1eff01128e5e090b80fb8df66d75c614
# Parent  4f003add869b4287759e64796f0da1f679c55851
Added tag RELEASE-3.4.4 for changeset 4f003add869b
---


diff -r 4f003add869b -r 9e59e91c1eff .hgtags
--- a/.hgtags	Wed Jan 25 15:44:25 2012 -0500
+++ b/.hgtags	Wed Jan 25 15:45:56 2012 -0500
@@ -65,3 +65,4 @@
 6b411577871da411a0822fd732900acb5ca244d0 3.4.4-rc2
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 3.4.4-rc3
 dda061bf71b6f11e91a38b8f96ba47a55729ed97 3.4.4-rc4
+4f003add869b4287759e64796f0da1f679c55851 RELEASE-3.4.4

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 20:55:18 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 20:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xensource.com>)
	id 1Rq9s9-0006gn-4u; Wed, 25 Jan 2012 20:55:13 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s7-0006gY-V0
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327524889!63923599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13197 invoked from network); 25 Jan 2012 20:54:50 -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;
	25 Jan 2012 20:54:50 -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 1Rq9s5-00047e-LK
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s5-0001L2-5e
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Message-Id: <E1Rq9s5-0001L2-5e@xenbits.xen.org>
Date: Wed, 25 Jan 2012 20:55:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added tag RELEASE-3.4.4 for
	changeset 4f003add869b
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1327524356 18000
# Node ID 9e59e91c1eff01128e5e090b80fb8df66d75c614
# Parent  4f003add869b4287759e64796f0da1f679c55851
Added tag RELEASE-3.4.4 for changeset 4f003add869b
---


diff -r 4f003add869b -r 9e59e91c1eff .hgtags
--- a/.hgtags	Wed Jan 25 15:44:25 2012 -0500
+++ b/.hgtags	Wed Jan 25 15:45:56 2012 -0500
@@ -65,3 +65,4 @@
 6b411577871da411a0822fd732900acb5ca244d0 3.4.4-rc2
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 3.4.4-rc3
 dda061bf71b6f11e91a38b8f96ba47a55729ed97 3.4.4-rc4
+4f003add869b4287759e64796f0da1f679c55851 RELEASE-3.4.4

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 20:55:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 20: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.xensource.com>)
	id 1Rq9sA-0006h1-7X; Wed, 25 Jan 2012 20:55:14 +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 1Rq9s9-0006gi-0E
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:13 +0000
Received: from [85.158.138.51:26879] by server-5.bemta-3.messagelabs.com id
	D1/2D-02363-03C602F4; Wed, 25 Jan 2012 20:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327524910!10502431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 689 invoked from network); 25 Jan 2012 20:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 20:55:11 -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 1Rq9s5-00047h-Me
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s5-0001LQ-JC
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Message-Id: <E1Rq9s5-0001LQ-JC@xenbits.xen.org>
Date: Wed, 25 Jan 2012 20:55:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added signature for changeset
	4f003add869b
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1327524575 18000
# Node ID ac68ad6fe4b779ca0b894ca3845b66662dd2dd9c
# Parent  9e59e91c1eff01128e5e090b80fb8df66d75c614
Added signature for changeset 4f003add869b
---


diff -r 9e59e91c1eff -r ac68ad6fe4b7 .hgsigs
--- a/.hgsigs	Wed Jan 25 15:45:56 2012 -0500
+++ b/.hgsigs	Wed Jan 25 15:49:35 2012 -0500
@@ -7,3 +7,4 @@
 6b411577871da411a0822fd732900acb5ca244d0 0 iQIcBAABAgAGBQJO8TtmAAoJEHs3akJKJvCcBKQP+wSF9pD7ebGcxBcRptBdiw+a1DId2UkTzJOT3HhlcaXu85uVhdf1lHSdMAPZAOT8vVrPQwYwdy3/wzD8YpKavy/n1cqgYXDwECPTodpjgh66JiWpkVE2wV0YgjvxtAQ9qPiNyQOeF1zhszA+xFbI2DVhzgR8LP/+J9gGEmk1FHXy1g/J3lpUmGEy+DIkzFG6t17PTM1j/5Q+6QwmE5Knkambl61hk9D5BCfP42V5AxLbYaBW4nL+Ro8mQa8wXbIUPPwq3VyoI2Via1yunpR0nY96qQzJ+h8Kz0US0S/qkuYhewuScv8sX+EMHppSCFRx6ZAIV5c2D5MrWg5IQJGeNTshBLOC2aGIuJU5vQpw0MYNHqZablQwvjyVx9wLRCW2SYBpi/HgJ7RDk3l5N1K9u+nszSJTh1AGtBCbOUze4UZOFs6Wk2tLhSReDKewimFZlnw12U3jdvwyoRDeO5iY5o2jlpEI0U13XWk7cfKXLdzqzp2wystXDHKA904/8ZeSB0mYNwoAGOXGX3L8R79gajb3NgZaD40IGQa2tLcXfmA9y5rcFOeAsxv9ZwFALtKW5/OqROQZ3RYd5Yo0fFotFwGwmNmLh4+xNsVjnidcUO7Nz2zSdx+QMWSqhYIfufz2rjM2lYVv++5zx6/D82//31Kqb/aXC3Vq4PolHmSVq3qE
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 0 iQIcBAABAgAGBQJPA/CWAAoJEHs3akJKJvCcaeAQANQgQBI8BtruBdj5v3+5y4tPfSYl8R2HWFqRBC+AUFzqQYvzv1uJVoiGJPvlZNjd8eEKtLxJ612NFBgL6hSfwNMKx6Ab13gnQU/voiF9PR4yfdMmSwzC8NLYlwjtco3/0SKgg5AX5TCZwqp4BPpducWC/x6/TW2y91bOcaOHfMuWtfmN3GLHshSliAMEyqWbRebWCiZXNucRg+wDa5OksbF/cITATPxL7zz0rvygAiMrkS/yp+WgEqTQL/epGkgzZH/OVNkSLp+sw/r3iUVQjkryK7XvMGuJUJBxs8SSJDESjvgMOxZ/HuDEuroavbLNzCfH9KwqUQDgaI5QPecUPzpfFK/pOlReVAu4WB096AL4HO+eeD2kMGcxOyEB4Ld+p1Et80ZUFHUkLdbfsUUN1P2KKfEM9sKN0i0QSoWK7ZPyPRlGOqriT+CsWqOvYJPYQX2z/XHAkegUzaYFYES+P6gDC/3NGva9jb8apx9W3l5ujsYis8/EKtY9U2Mm2DP19nxeAAGGLYqWv44kA6zGjtATP8x9iH2ci+eOjcTJFFwQzBQA5Fwdmlv+CV5aGpvDajVzJU6Il0wcuFKMPRiZRaBAMJ/jZCcyJ8NNwonLPoWMSFhaY9F3Zn3AXawvMV2/PYYgpOEwqkJyf2UdYk7D45irM6lbekAQXp8p6RTDcUJv
 dda061bf71b6f11e91a38b8f96ba47a55729ed97 0 iQIcBAABAgAGBQJPBAJ6AAoJEHs3akJKJvCcZZ8QAMxGgfAptV88ZQ065MqJwrHwYtgUaqYpGLal4cGIYg1XmAlVM0uTSk6kIJqjwMlWS0ByyPBCGo6PSP6lWA4VAFM8X0207DVN+OeO7eRWKj06Qv9QV77Kck/3525rrd13CuMBo3DpPHg+VpOYLnnVYFl3qebJCet6ITPp0P1OLg+khp2YCxbXAB2ZZfg3FfiUuvuGDomCTJgR16l5SHUIFxPAfuLKKuO3vX1a24eIAxI2HjUtTiGC0t8G9Oahy5pGdGsi7mzflv68Y5SWBy0GfFXzsop96yXyU62FpqQwPoKFPANpVYi2oSut574pzO/6YyeYdwAggkD45xyHAZcj/VH/wE8cfdB40x7Pyez09lSVjkAOb+Rr8CGtExt0aJfqz3ozXNwM+5WbQ/28jv475dCJfQweBkBik6PQnyrRcdBD3Mzoqr833Ux9rFp9afLxEo8aKBQ2P72hoJjQVWW/1rvHP3MfBg970C65zWOSkixZjw2vk9c0zwBa4pZ0Ss3ku+aLfaWGVzeg2Y/eLeIZMBu04alkMOdxzh4yDkSuxEF98rfty8qvtoVhpuQvMmuOtvJ2bWgYhqL7Aylh6fFnA65t/9ED+2kLP53iid6rBqokZ7pH/nOuzD2M+g0vtLgBl8wcrU61Ovtcqcqwkt1GJpPmF3aRteaM7fDgePj76Gz1
+4f003add869b4287759e64796f0da1f679c55851 0 iQIcBAABAgAGBQJPIGrKAAoJEHs3akJKJvCcQuIP/2t01zHeDjDT4Bo1oa59EHt3ZFxoe1enNla9L9k9mbtsvVhFLWLmksvEhUUkdLJKtWeAEL+DfFs3CT38sMWQCXm2mTHdr71jVHP6mGiVk70p8NCnEgdB9imiUJlW9gtz4lXaJ1l4Q1KJGuHxlRXEttgqFSOBkCxOc6mcK2P1VgsmRpL9MEOnBbDXt1oJQA+iGb+XSewe2xfB6dlzfuH4JQsVkvqALoCctttaYRZKTZkQCU9TYUyXY4rLAYF7AHBsXC7uriGBjW93NSDy0ryaqlPhUGfkODT+nfnldjidkNIBiP+eoC07LLg4YKPy7SmiVngOo6m+Wk0Mnu2wMOzc5QS++vKv4pQpqpMcyGGK6uaTuRc+dktSKZFGaShMNMIpwAizxFfEdTHYqUZWQzjenlSj8s41SoR6K3Pklmu+idUM21mHx0hKPJN27N3IN0uob3eNx6tNT/MAWj6VER7Cyt5Nrrh8WCL+FENKxH4xQn4UKNVerzP7GNrL+/YQHf2kI7jGwhsHQxg0HWSMS7EbvuyCcyGH714/AXEUw18QyA+QAluXoRqf87VB8SP13aknDRR8UfhLp+CwxGmO+VdwR8FSIULJpJDWg+bJz93DnZkPLISGrPU/9vcu/VkN21IW+WIFRV2vbTXvY/NSjw6TUa6qnSH0btYQ5eq5NDW1DC7K

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 20:55:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 20: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.xensource.com>)
	id 1Rq9sA-0006h1-7X; Wed, 25 Jan 2012 20:55:14 +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 1Rq9s9-0006gi-0E
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:13 +0000
Received: from [85.158.138.51:26879] by server-5.bemta-3.messagelabs.com id
	D1/2D-02363-03C602F4; Wed, 25 Jan 2012 20:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1327524910!10502431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 689 invoked from network); 25 Jan 2012 20:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2012 20:55:11 -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 1Rq9s5-00047h-Me
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s5-0001LQ-JC
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Message-Id: <E1Rq9s5-0001LQ-JC@xenbits.xen.org>
Date: Wed, 25 Jan 2012 20:55:09 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Added signature for changeset
	4f003add869b
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1327524575 18000
# Node ID ac68ad6fe4b779ca0b894ca3845b66662dd2dd9c
# Parent  9e59e91c1eff01128e5e090b80fb8df66d75c614
Added signature for changeset 4f003add869b
---


diff -r 9e59e91c1eff -r ac68ad6fe4b7 .hgsigs
--- a/.hgsigs	Wed Jan 25 15:45:56 2012 -0500
+++ b/.hgsigs	Wed Jan 25 15:49:35 2012 -0500
@@ -7,3 +7,4 @@
 6b411577871da411a0822fd732900acb5ca244d0 0 iQIcBAABAgAGBQJO8TtmAAoJEHs3akJKJvCcBKQP+wSF9pD7ebGcxBcRptBdiw+a1DId2UkTzJOT3HhlcaXu85uVhdf1lHSdMAPZAOT8vVrPQwYwdy3/wzD8YpKavy/n1cqgYXDwECPTodpjgh66JiWpkVE2wV0YgjvxtAQ9qPiNyQOeF1zhszA+xFbI2DVhzgR8LP/+J9gGEmk1FHXy1g/J3lpUmGEy+DIkzFG6t17PTM1j/5Q+6QwmE5Knkambl61hk9D5BCfP42V5AxLbYaBW4nL+Ro8mQa8wXbIUPPwq3VyoI2Via1yunpR0nY96qQzJ+h8Kz0US0S/qkuYhewuScv8sX+EMHppSCFRx6ZAIV5c2D5MrWg5IQJGeNTshBLOC2aGIuJU5vQpw0MYNHqZablQwvjyVx9wLRCW2SYBpi/HgJ7RDk3l5N1K9u+nszSJTh1AGtBCbOUze4UZOFs6Wk2tLhSReDKewimFZlnw12U3jdvwyoRDeO5iY5o2jlpEI0U13XWk7cfKXLdzqzp2wystXDHKA904/8ZeSB0mYNwoAGOXGX3L8R79gajb3NgZaD40IGQa2tLcXfmA9y5rcFOeAsxv9ZwFALtKW5/OqROQZ3RYd5Yo0fFotFwGwmNmLh4+xNsVjnidcUO7Nz2zSdx+QMWSqhYIfufz2rjM2lYVv++5zx6/D82//31Kqb/aXC3Vq4PolHmSVq3qE
 fa0b63cdbedc4a985d4710476640b42f0f9de1cc 0 iQIcBAABAgAGBQJPA/CWAAoJEHs3akJKJvCcaeAQANQgQBI8BtruBdj5v3+5y4tPfSYl8R2HWFqRBC+AUFzqQYvzv1uJVoiGJPvlZNjd8eEKtLxJ612NFBgL6hSfwNMKx6Ab13gnQU/voiF9PR4yfdMmSwzC8NLYlwjtco3/0SKgg5AX5TCZwqp4BPpducWC/x6/TW2y91bOcaOHfMuWtfmN3GLHshSliAMEyqWbRebWCiZXNucRg+wDa5OksbF/cITATPxL7zz0rvygAiMrkS/yp+WgEqTQL/epGkgzZH/OVNkSLp+sw/r3iUVQjkryK7XvMGuJUJBxs8SSJDESjvgMOxZ/HuDEuroavbLNzCfH9KwqUQDgaI5QPecUPzpfFK/pOlReVAu4WB096AL4HO+eeD2kMGcxOyEB4Ld+p1Et80ZUFHUkLdbfsUUN1P2KKfEM9sKN0i0QSoWK7ZPyPRlGOqriT+CsWqOvYJPYQX2z/XHAkegUzaYFYES+P6gDC/3NGva9jb8apx9W3l5ujsYis8/EKtY9U2Mm2DP19nxeAAGGLYqWv44kA6zGjtATP8x9iH2ci+eOjcTJFFwQzBQA5Fwdmlv+CV5aGpvDajVzJU6Il0wcuFKMPRiZRaBAMJ/jZCcyJ8NNwonLPoWMSFhaY9F3Zn3AXawvMV2/PYYgpOEwqkJyf2UdYk7D45irM6lbekAQXp8p6RTDcUJv
 dda061bf71b6f11e91a38b8f96ba47a55729ed97 0 iQIcBAABAgAGBQJPBAJ6AAoJEHs3akJKJvCcZZ8QAMxGgfAptV88ZQ065MqJwrHwYtgUaqYpGLal4cGIYg1XmAlVM0uTSk6kIJqjwMlWS0ByyPBCGo6PSP6lWA4VAFM8X0207DVN+OeO7eRWKj06Qv9QV77Kck/3525rrd13CuMBo3DpPHg+VpOYLnnVYFl3qebJCet6ITPp0P1OLg+khp2YCxbXAB2ZZfg3FfiUuvuGDomCTJgR16l5SHUIFxPAfuLKKuO3vX1a24eIAxI2HjUtTiGC0t8G9Oahy5pGdGsi7mzflv68Y5SWBy0GfFXzsop96yXyU62FpqQwPoKFPANpVYi2oSut574pzO/6YyeYdwAggkD45xyHAZcj/VH/wE8cfdB40x7Pyez09lSVjkAOb+Rr8CGtExt0aJfqz3ozXNwM+5WbQ/28jv475dCJfQweBkBik6PQnyrRcdBD3Mzoqr833Ux9rFp9afLxEo8aKBQ2P72hoJjQVWW/1rvHP3MfBg970C65zWOSkixZjw2vk9c0zwBa4pZ0Ss3ku+aLfaWGVzeg2Y/eLeIZMBu04alkMOdxzh4yDkSuxEF98rfty8qvtoVhpuQvMmuOtvJ2bWgYhqL7Aylh6fFnA65t/9ED+2kLP53iid6rBqokZ7pH/nOuzD2M+g0vtLgBl8wcrU61Ovtcqcqwkt1GJpPmF3aRteaM7fDgePj76Gz1
+4f003add869b4287759e64796f0da1f679c55851 0 iQIcBAABAgAGBQJPIGrKAAoJEHs3akJKJvCcQuIP/2t01zHeDjDT4Bo1oa59EHt3ZFxoe1enNla9L9k9mbtsvVhFLWLmksvEhUUkdLJKtWeAEL+DfFs3CT38sMWQCXm2mTHdr71jVHP6mGiVk70p8NCnEgdB9imiUJlW9gtz4lXaJ1l4Q1KJGuHxlRXEttgqFSOBkCxOc6mcK2P1VgsmRpL9MEOnBbDXt1oJQA+iGb+XSewe2xfB6dlzfuH4JQsVkvqALoCctttaYRZKTZkQCU9TYUyXY4rLAYF7AHBsXC7uriGBjW93NSDy0ryaqlPhUGfkODT+nfnldjidkNIBiP+eoC07LLg4YKPy7SmiVngOo6m+Wk0Mnu2wMOzc5QS++vKv4pQpqpMcyGGK6uaTuRc+dktSKZFGaShMNMIpwAizxFfEdTHYqUZWQzjenlSj8s41SoR6K3Pklmu+idUM21mHx0hKPJN27N3IN0uob3eNx6tNT/MAWj6VER7Cyt5Nrrh8WCL+FENKxH4xQn4UKNVerzP7GNrL+/YQHf2kI7jGwhsHQxg0HWSMS7EbvuyCcyGH714/AXEUw18QyA+QAluXoRqf87VB8SP13aknDRR8UfhLp+CwxGmO+VdwR8FSIULJpJDWg+bJz93DnZkPLISGrPU/9vcu/VkN21IW+WIFRV2vbTXvY/NSjw6TUa6qnSH0btYQ5eq5NDW1DC7K

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 20:55:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 20:55: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.xensource.com>)
	id 1Rq9sC-0006hQ-A5; Wed, 25 Jan 2012 20:55:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9sB-0006gZ-0Z
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1327524841!62488066!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14543 invoked from network); 25 Jan 2012 20:54:02 -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;
	25 Jan 2012 20:54:02 -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 1Rq9s5-00047b-15
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s4-0001Kb-Ls
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:08 +0000
Message-Id: <E1Rq9s4-0001Kb-Ls@xenbits.xen.org>
Date: Wed, 25 Jan 2012 20:55:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to 3.4.4
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1327524265 18000
# Node ID 4f003add869b4287759e64796f0da1f679c55851
# Parent  d0b8738f6e9f4ac8a1a749637df4424bfd30e9f5
Update Xen version to 3.4.4
---


diff -r d0b8738f6e9f -r 4f003add869b xen/Makefile
--- a/xen/Makefile	Wed Jan 04 02:41:21 2012 -0500
+++ b/xen/Makefile	Wed Jan 25 15:44:25 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Wed Jan 25 20:55:20 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jan 2012 20:55: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.xensource.com>)
	id 1Rq9sC-0006hQ-A5; Wed, 25 Jan 2012 20:55:16 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9sB-0006gZ-0Z
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1327524841!62488066!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14543 invoked from network); 25 Jan 2012 20:54:02 -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;
	25 Jan 2012 20:54:02 -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 1Rq9s5-00047b-15
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rq9s4-0001Kb-Ls
	for xen-changelog@lists.xensource.com; Wed, 25 Jan 2012 20:55:08 +0000
Message-Id: <E1Rq9s4-0001Kb-Ls@xenbits.xen.org>
Date: Wed, 25 Jan 2012 20:55:08 +0000
From: Xen patchbot-3.4-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-3.4-testing] Update Xen version to 3.4.4
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keith Coleman <keith.coleman@n2servers.com>
# Date 1327524265 18000
# Node ID 4f003add869b4287759e64796f0da1f679c55851
# Parent  d0b8738f6e9f4ac8a1a749637df4424bfd30e9f5
Update Xen version to 3.4.4
---


diff -r d0b8738f6e9f -r 4f003add869b xen/Makefile
--- a/xen/Makefile	Wed Jan 04 02:41:21 2012 -0500
+++ b/xen/Makefile	Wed Jan 25 15:44:25 2012 -0500
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 3
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .4-rc4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 26 00:44:35 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jan 2012 00:44: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.xensource.com>)
	id 1RqDS1-0003MG-1C; Thu, 26 Jan 2012 00:44:29 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RqDRy-0003M4-Qa
	for xen-changelog@lists.xensource.com; Thu, 26 Jan 2012 00:44:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327538650!3099405!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23036 invoked from network); 26 Jan 2012 00:44:11 -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;
	26 Jan 2012 00:44:11 -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 1RqDRh-0006zb-B0
	for xen-changelog@lists.xensource.com; Thu, 26 Jan 2012 00:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RqDRg-0001EK-MG
	for xen-changelog@lists.xensource.com; Thu, 26 Jan 2012 00:44:08 +0000
Message-Id: <E1RqDRg-0001EK-MG@xenbits.xen.org>
Date: Thu, 26 Jan 2012 00:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: Remove outdated LaTex
	documentation.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327506767 0
# Node ID 4271634e4c86568b6bf2241ebf9be4a82ab430bf
# Parent  a2a8089b1ffbf5757ca3191cb8f74a5f1ed7fed1
docs: Remove outdated LaTex documentation.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r a2a8089b1ffb -r 4271634e4c86 Makefile
--- a/Makefile	Tue Jan 24 16:46:17 2012 +0000
+++ b/Makefile	Wed Jan 25 15:52:47 2012 +0000
@@ -104,7 +104,7 @@
 
 .PHONY: install-docs
 install-docs:
-	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
+	$(MAKE) -C docs install || true
 
 .PHONY: dev-docs
 dev-docs:
diff -r a2a8089b1ffb -r 4271634e4c86 docs/INDEX
--- a/docs/INDEX	Tue Jan 24 16:46:17 2012 +0000
+++ b/docs/INDEX	Wed Jan 25 15:52:47 2012 +0000
@@ -5,7 +5,3 @@
 misc				Miscellaneous Documentation
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 misc/console			Xen PV Console notes
-
-# These are not all that useful anymore, hide them from the index
-reference/interface/index	NO-INDEX
-reference/user/index		NO-INDEX
diff -r a2a8089b1ffb -r 4271634e4c86 docs/Makefile
--- a/docs/Makefile	Tue Jan 24 16:46:17 2012 +0000
+++ b/docs/Makefile	Wed Jan 25 15:52:47 2012 +0000
@@ -10,12 +10,8 @@
 DOC_MAN1SRC	:= $(wildcard man/*.pod.1)
 DOC_MAN1	:= $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
 DOC_MAN5	:= $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
-DOC_TEX		:= src/user.tex src/interface.tex
 DOC_MARKDOWN	:= $(wildcard misc/*.markdown)
-DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
-DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
-DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
-		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+DOC_HTML	:= $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
 		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt)) \
@@ -25,13 +21,11 @@
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC))
 
-GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
-
 .PHONY: all
 all: build
 
 .PHONY: build
-build: ps pdf html txt man-pages
+build: html txt man-pages
 	@if which $(DOT) 1>/dev/null 2>/dev/null ; then              \
 	$(MAKE) -C xen-api build ; else                              \
         echo "Graphviz (dot) not installed; skipping xen-api." ; fi
@@ -40,12 +34,6 @@
 .PHONY: dev-docs
 dev-docs: python-dev-docs
 
-.PHONY: ps
-ps: $(DOC_PS)
-
-.PHONY: pdf
-pdf: $(DOC_PDF)
-
 .PHONY: html
 html: $(DOC_HTML) html/index.html
 
@@ -82,7 +70,7 @@
 	$(MAKE) -C xen-api clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
-	rm -rf $(GFX) ps pdf html txt
+	rm -rf html txt
 	rm -rf api
 	rm -rf man5
 	rm -rf man1
@@ -97,39 +85,11 @@
 
 	$(MAKE) -C xen-api install
 
-	cp -dR ps $(DESTDIR)$(DOCDIR)
-	cp -dR pdf $(DESTDIR)$(DOCDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
 	cp -dR man1 $(DESTDIR)$(MANDIR)
 	cp -dR man5 $(DESTDIR)$(MANDIR)
 	[ ! -d html ] || cp -dR html $(DESTDIR)$(DOCDIR)
 
-pdf/%.pdf: ps/%.ps
-	$(INSTALL_DIR) $(@D)
-	$(PS2PDF) $< $@.new
-	mv $@.new $@
-
-ps/%.ps: %.dvi
-	$(INSTALL_DIR) $(@D)
-	$(DVIPS) -Ppdf -G0 -o $@.new $<
-	mv $@.new $@
-
-%.dvi: src/%.tex $(GFX)
-	$(LATEX) $< >/dev/null
-	if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
-
-%.eps: %.fig
-	$(FIG2DEV) -L eps $< $@
-
-html/reference/%/index.html: src/%.tex
-	@$(INSTALL_DIR) $(@D)
-	@set -e ; if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
-        echo "Running latex2html to generate reference/$*/index.html ... "; \
-	$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
-	-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
-	$< 1>/dev/null 2>/dev/null ; else \
-	echo "latex2html not installed; skipping reference/$*."; fi
-
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
 
diff -r a2a8089b1ffb -r 4271634e4c86 docs/check_pkgs
--- a/docs/check_pkgs	Tue Jan 24 16:46:17 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-
-silent_which ()
-{
-        which $1 1>/dev/null 2>/dev/null || {
-                echo "================================================="
-                echo "================================================="
-                echo "= WARNING: Package '$1' is required"
-                echo "=          to build Xen documentation"
-                echo "================================================="
-                echo "================================================="
-        }
-        which $1 1>/dev/null 2>/dev/null
-}
-
-silent_which latex      || exit 1
-silent_which dvips      || exit 1
-silent_which ps2pdf     || exit 1
-silent_which fig2dev    || exit 1
-
-exit 0
diff -r a2a8089b1ffb -r 4271634e4c86 docs/src/interface.tex
--- a/docs/src/interface.tex	Tue Jan 24 16:46:17 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2216 +0,0 @@
-\documentclass[11pt,twoside,final,openright,a4paper]{report}
-\usepackage{graphicx,html,setspace,times}
-\usepackage{parskip}
-\setstretch{1.15}
-
-% LIBRARY FUNCTIONS
-
-\newcommand{\hypercall}[1]{\vspace{2mm}{\sf #1}}
-
-\begin{document}
-
-% TITLE PAGE
-\pagestyle{empty}
-\begin{center}
-\vspace*{\fill}
-\includegraphics{figs/xenlogo.eps}
-\vfill
-\vfill
-\vfill
-\begin{tabular}{l}
-{\Huge \bf Interface manual} \\[4mm]
-{\huge Xen v3.0 for x86} \\[80mm]
-
-{\Large Xen is Copyright (c) 2002-2005, The Xen Team} \\[3mm]
-{\Large University of Cambridge, UK} \\[20mm]
-\end{tabular}
-\end{center}
-
-{\bf DISCLAIMER: This documentation is always under active development
-and as such there may be mistakes and omissions --- watch out for
-these and please report any you find to the developer's mailing list.
-The latest version is always available on-line.  Contributions of
-material, suggestions and corrections are welcome.  }
-
-\vfill
-\cleardoublepage
-
-% TABLE OF CONTENTS
-\pagestyle{plain}
-\pagenumbering{roman}
-{ \parskip 0pt plus 1pt
-  \tableofcontents }
-\cleardoublepage
-
-% PREPARE FOR MAIN TEXT
-\pagenumbering{arabic}
-\raggedbottom
-\widowpenalty=10000
-\clubpenalty=10000
-\parindent=0pt
-\parskip=5pt
-\renewcommand{\topfraction}{.8}
-\renewcommand{\bottomfraction}{.8}
-\renewcommand{\textfraction}{.2}
-\renewcommand{\floatpagefraction}{.8}
-\setstretch{1.1}
-
-\chapter{Introduction}
-
-Xen allows the hardware resources of a machine to be virtualized and
-dynamically partitioned, allowing multiple different {\em guest}
-operating system images to be run simultaneously.  Virtualizing the
-machine in this manner provides considerable flexibility, for example
-allowing different users to choose their preferred operating system
-(e.g., Linux, NetBSD, or a custom operating system).  Furthermore, Xen
-provides secure partitioning between virtual machines (known as
-{\em domains} in Xen terminology), and enables better resource
-accounting and QoS isolation than can be achieved with a conventional
-operating system. 
-
-Xen essentially takes a `whole machine' virtualization approach as
-pioneered by IBM VM/370.  However, unlike VM/370 or more recent
-efforts such as VMware and Virtual PC, Xen does not attempt to
-completely virtualize the underlying hardware.  Instead parts of the
-hosted guest operating systems are modified to work with the VMM; the
-operating system is effectively ported to a new target architecture,
-typically requiring changes in just the machine-dependent code.  The
-user-level API is unchanged, and so existing binaries and operating
-system distributions work without modification.
-
-In addition to exporting virtualized instances of CPU, memory, network
-and block devices, Xen exposes a control interface to manage how these
-resources are shared between the running domains. Access to the
-control interface is restricted: it may only be used by one
-specially-privileged VM, known as {\em domain 0}.  This domain is a
-required part of any Xen-based server and runs the application software
-that manages the control-plane aspects of the platform.  Running the
-control software in {\it domain 0}, distinct from the hypervisor
-itself, allows the Xen framework to separate the notions of 
-mechanism and policy within the system.
-
-
-\chapter{Virtual Architecture}
-
-In a Xen/x86 system, only the hypervisor runs with full processor
-privileges ({\it ring 0} in the x86 four-ring model). It has full
-access to the physical memory available in the system and is
-responsible for allocating portions of it to running domains.  
-
-On a 32-bit x86 system, guest operating systems may use {\it rings 1},
-{\it 2} and {\it 3} as they see fit.  Segmentation is used to prevent
-the guest OS from accessing the portion of the address space that is
-reserved for Xen.  We expect most guest operating systems will use
-ring 1 for their own operation and place applications in ring 3.
-
-On 64-bit systems it is not possible to protect the hypervisor from
-untrusted guest code running in rings 1 and 2. Guests are therefore
-restricted to run in ring 3 only. The guest kernel is protected from its
-applications by context switching between the kernel and currently
-running application.
-
-In this chapter we consider the basic virtual architecture provided by
-Xen: CPU state, exception and interrupt handling, and time.
-Other aspects such as memory and device access are discussed in later
-chapters.
-
-
-\section{CPU state}
-
-All privileged state must be handled by Xen.  The guest OS has no
-direct access to CR3 and is not permitted to update privileged bits in
-EFLAGS. Guest OSes use \emph{hypercalls} to invoke operations in Xen;
-these are analogous to system calls but occur from ring 1 to ring 0.
-
-A list of all hypercalls is given in Appendix~\ref{a:hypercalls}.
-
-
-\section{Exceptions}
-
-A virtual IDT is provided --- a domain can submit a table of trap
-handlers to Xen via the {\bf set\_trap\_table} hypercall.  The
-exception stack frame presented to a virtual trap handler is identical
-to its native equivalent.
-
-
-\section{Interrupts and events}
-
-Interrupts are virtualized by mapping them to \emph{event channels},
-which are delivered asynchronously to the target domain using a callback
-supplied via the {\bf set\_callbacks} hypercall.  A guest OS can map
-these events onto its standard interrupt dispatch mechanisms.  Xen is
-responsible for determining the target domain that will handle each
-physical interrupt source. For more details on the binding of event
-sources to event channels, see Chapter~\ref{c:devices}.
-
-
-\section{Time}
-
-Guest operating systems need to be aware of the passage of both real
-(or wallclock) time and their own `virtual time' (the time for which
-they have been executing). Furthermore, Xen has a notion of time which
-is used for scheduling. The following notions of time are provided:
-
-\begin{description}
-\item[Cycle counter time.]
-
-  This provides a fine-grained time reference.  The cycle counter time
-  is used to accurately extrapolate the other time references.  On SMP
-  machines it is currently assumed that the cycle counter time is
-  synchronized between CPUs.  The current x86-based implementation
-  achieves this within inter-CPU communication latencies.
-
-\item[System time.]
-
-  This is a 64-bit counter which holds the number of nanoseconds that
-  have elapsed since system boot.
-
-\item[Wall clock time.]
-
-  This is the time of day in a Unix-style {\bf struct timeval}
-  (seconds and microseconds since 1 January 1970, adjusted by leap
-  seconds).  An NTP client hosted by {\it domain 0} can keep this
-  value accurate.
-
-\item[Domain virtual time.]
-
-  This progresses at the same pace as system time, but only while a
-  domain is executing --- it stops while a domain is de-scheduled.
-  Therefore the share of the CPU that a domain receives is indicated
-  by the rate at which its virtual time increases.
-
-\end{description}
-
-
-Xen exports timestamps for system time and wall-clock time to guest
-operating systems through a shared page of memory.  Xen also provides
-the cycle counter time at the instant the timestamps were calculated,
-and the CPU frequency in Hertz.  This allows the guest to extrapolate
-system and wall-clock times accurately based on the current cycle
-counter time.
-
-Since all time stamps need to be updated and read \emph{atomically}
-a version number is also stored in the shared info page, which is
-incremented before and after updating the timestamps. Thus a guest can
-be sure that it read a consistent state by checking the two version
-numbers are equal and even.
-
-Xen includes a periodic ticker which sends a timer event to the
-currently executing domain every 10ms.  The Xen scheduler also sends a
-timer event whenever a domain is scheduled; this allows the guest OS
-to adjust for the time that has passed while it has been inactive.  In
-addition, Xen allows each domain to request that they receive a timer
-event sent at a specified system time by using the {\bf
-  set\_timer\_op} hypercall.  Guest OSes may use this timer to
-implement timeout values when they block.
-
-
-\section{Xen CPU Scheduling}
-
-Xen offers a uniform API for CPU schedulers.  It is possible to choose
-from a number of schedulers at boot and it should be easy to add more.
-The SEDF and Credit schedulers are part of the normal Xen
-distribution.  SEDF will be going away and its use should be
-avoided once the credit scheduler has stabilized and become the default.
-The Credit scheduler provides proportional fair shares of the
-host's CPUs to the running domains. It does this while transparently
-load balancing runnable VCPUs across the whole system.
-
-\paragraph*{Note: SMP host support}
-Xen has always supported SMP host systems. When using the credit scheduler,
-a domain's VCPUs will be dynamically moved across physical CPUs to maximise
-domain and system throughput. VCPUs can also be manually restricted to be
-mapped only on a subset of the host's physical CPUs, using the pinning
-mechanism.
-
-
-%% More information on the characteristics and use of these schedulers
-%% is available in {\bf Sched-HOWTO.txt}.
-
-
-\section{Privileged operations}
-
-Xen exports an extended interface to privileged domains (viz.\ {\it
-  Domain 0}). This allows such domains to build and boot other domains
-on the server, and provides control interfaces for managing
-scheduling, memory, networking, and block devices.
-
-\chapter{Memory}
-\label{c:memory} 
-
-Xen is responsible for managing the allocation of physical memory to
-domains, and for ensuring safe use of the paging and segmentation
-hardware.
-
-
-\section{Memory Allocation}
-
-As well as allocating a portion of physical memory for its own private
-use, Xen also reserves s small fixed portion of every virtual address
-space. This is located in the top 64MB on 32-bit systems, the top
-168MB on PAE systems, and a larger portion in the middle of the
-address space on 64-bit systems. Unreserved physical memory is
-available for allocation to domains at a page granularity.  Xen tracks
-the ownership and use of each page, which allows it to enforce secure
-partitioning between domains.
-
-Each domain has a maximum and current physical memory allocation.  A
-guest OS may run a `balloon driver' to dynamically adjust its current
-memory allocation up to its limit.
-
-
-\section{Pseudo-Physical Memory}
-
-Since physical memory is allocated and freed on a page granularity,
-there is no guarantee that a domain will receive a contiguous stretch
-of physical memory. However most operating systems do not have good
-support for operating in a fragmented physical address space. To aid
-porting such operating systems to run on top of Xen, we make a
-distinction between \emph{machine memory} and \emph{pseudo-physical
-  memory}.
-
-Put simply, machine memory refers to the entire amount of memory
-installed in the machine, including that reserved by Xen, in use by
-various domains, or currently unallocated. We consider machine memory
-to comprise a set of 4kB \emph{machine page frames} numbered
-consecutively starting from 0. Machine frame numbers mean the same
-within Xen or any domain.
-
-Pseudo-physical memory, on the other hand, is a per-domain
-abstraction. It allows a guest operating system to consider its memory
-allocation to consist of a contiguous range of physical page frames
-starting at physical frame 0, despite the fact that the underlying
-machine page frames may be sparsely allocated and in any order.
-
-To achieve this, Xen maintains a globally readable {\it
-  machine-to-physical} table which records the mapping from machine
-page frames to pseudo-physical ones. In addition, each domain is
-supplied with a {\it physical-to-machine} table which performs the
-inverse mapping. Clearly the machine-to-physical table has size
-proportional to the amount of RAM installed in the machine, while each
-physical-to-machine table has size proportional to the memory
-allocation of the given domain.
-
-Architecture dependent code in guest operating systems can then use
-the two tables to provide the abstraction of pseudo-physical memory.
-In general, only certain specialized parts of the operating system
-(such as page table management) needs to understand the difference
-between machine and pseudo-physical addresses.
-
-
-\section{Page Table Updates}
-
-In the default mode of operation, Xen enforces read-only access to
-page tables and requires guest operating systems to explicitly request
-any modifications.  Xen validates all such requests and only applies
-updates that it deems safe.  This is necessary to prevent domains from
-adding arbitrary mappings to their page tables.
-
-To aid validation, Xen associates a type and reference count with each
-memory page. A page has one of the following mutually-exclusive types
-at any point in time: page directory ({\sf PD}), page table ({\sf
-  PT}), local descriptor table ({\sf LDT}), global descriptor table
-({\sf GDT}), or writable ({\sf RW}). Note that a guest OS may always
-create readable mappings of its own memory regardless of its current
-type.
-
-%%% XXX: possibly explain more about ref count 'lifecyle' here?
-This mechanism is used to maintain the invariants required for safety;
-for example, a domain cannot have a writable mapping to any part of a
-page table as this would require the page concerned to simultaneously
-be of types {\sf PT} and {\sf RW}.
-
-\hypercall{mmu\_update(mmu\_update\_t *req, int count, int *success\_count, domid\_t domid)}
-
-This hypercall is used to make updates to either the domain's
-pagetables or to the machine to physical mapping table.  It supports
-submitting a queue of updates, allowing batching for maximal
-performance.  Explicitly queuing updates using this interface will
-cause any outstanding writable pagetable state to be flushed from the
-system.
-
-\section{Writable Page Tables}
-
-Xen also provides an alternative mode of operation in which guests
-have the illusion that their page tables are directly writable.  Of
-course this is not really the case, since Xen must still validate
-modifications to ensure secure partitioning. To this end, Xen traps
-any write attempt to a memory page of type {\sf PT} (i.e., that is
-currently part of a page table).  If such an access occurs, Xen
-temporarily allows write access to that page while at the same time
-\emph{disconnecting} it from the page table that is currently in use.
-This allows the guest to safely make updates to the page because the
-newly-updated entries cannot be used by the MMU until Xen revalidates
-and reconnects the page.  Reconnection occurs automatically in a
-number of situations: for example, when the guest modifies a different
-page-table page, when the domain is preempted, or whenever the guest
-uses Xen's explicit page-table update interfaces.
-
-Writable pagetable functionality is enabled when the guest requests
-it, using a {\bf vm\_assist} hypercall.  Writable pagetables do {\em
-not} provide full virtualisation of the MMU, so the memory management
-code of the guest still needs to be aware that it is running on Xen.
-Since the guest's page tables are used directly, it must translate
-pseudo-physical addresses to real machine addresses when building page
-table entries.  The guest may not attempt to map its own pagetables
-writably, since this would violate the memory type invariants; page
-tables will automatically be made writable by the hypervisor, as
-necessary.
-
-\section{Shadow Page Tables}
-
-Finally, Xen also supports a form of \emph{shadow page tables} in
-which the guest OS uses a independent copy of page tables which are
-unknown to the hardware (i.e.\ which are never pointed to by {\tt
-  cr3}). Instead Xen propagates changes made to the guest's tables to
-the real ones, and vice versa. This is useful for logging page writes
-(e.g.\ for live migration or checkpoint). A full version of the shadow
-page tables also allows guest OS porting with less effort.
-
-
-\section{Segment Descriptor Tables}
-
-At start of day a guest is supplied with a default GDT, which does not reside
-within its own memory allocation.  If the guest wishes to use other
-than the default `flat' ring-1 and ring-3 segments that this GDT
-provides, it must register a custom GDT and/or LDT with Xen, allocated
-from its own memory.
-
-The following hypercall is used to specify a new GDT:
-
-\begin{quote}
-  int {\bf set\_gdt}(unsigned long *{\em frame\_list}, int {\em
-    entries})
-
-  \emph{frame\_list}: An array of up to 14 machine page frames within
-  which the GDT resides.  Any frame registered as a GDT frame may only
-  be mapped read-only within the guest's address space (e.g., no
-  writable mappings, no use as a page-table page, and so on). Only 14
-  pages may be specified because pages 15 and 16 are reserved for
-  the hypervisor's GDT entries.
-
-  \emph{entries}: The number of descriptor-entry slots in the GDT.
-\end{quote}
-
-The LDT is updated via the generic MMU update mechanism (i.e., via the
-{\bf mmu\_update} hypercall.
-
-\section{Start of Day}
-
-The start-of-day environment for guest operating systems is rather
-different to that provided by the underlying hardware. In particular,
-the processor is already executing in protected mode with paging
-enabled.
-
-{\it Domain 0} is created and booted by Xen itself. For all subsequent
-domains, the analogue of the boot-loader is the {\it domain builder},
-user-space software running in {\it domain 0}. The domain builder is
-responsible for building the initial page tables for a domain and
-loading its kernel image at the appropriate virtual address.
-
-\section{VM assists}
-
-Xen provides a number of ``assists'' for guest memory management.
-These are available on an ``opt-in'' basis to provide commonly-used
-extra functionality to a guest.
-
-\hypercall{vm\_assist(unsigned int cmd, unsigned int type)}
-
-The {\bf cmd} parameter describes the action to be taken, whilst the
-{\bf type} parameter describes the kind of assist that is being
-referred to.  Available commands are as follows:
-
-\begin{description}
-\item[VMASST\_CMD\_enable] Enable a particular assist type
-\item[VMASST\_CMD\_disable] Disable a particular assist type
-\end{description}
-
-And the available types are:
-
-\begin{description}
-\item[VMASST\_TYPE\_4gb\_segments] Provide emulated support for
-  instructions that rely on 4GB segments (such as the techniques used
-  by some TLS solutions).
-\item[VMASST\_TYPE\_4gb\_segments\_notify] Provide a callback (via trap number
-  15) to the guest if the above segment fixups are used: allows the guest to
-  display a warning message during boot.
-\item[VMASST\_TYPE\_writable\_pagetables] Enable writable pagetable
-  mode - described above.
-\end{description}
-
-
-\chapter{Xen Info Pages}
-
-The {\bf Shared info page} is used to share various CPU-related state
-between the guest OS and the hypervisor.  This information includes VCPU
-status, time information and event channel (virtual interrupt) state.
-The {\bf Start info page} is used to pass build-time information to
-the guest when it boots and when it is resumed from a suspended state.
-This chapter documents the fields included in the {\bf
-shared\_info\_t} and {\bf start\_info\_t} structures for use by the
-guest OS.
-
-\section{Shared info page}
-
-The {\bf shared\_info\_t} is accessed at run time by both Xen and the
-guest OS.  It is used to pass information relating to the
-virtual CPU and virtual machine state between the OS and the
-hypervisor.
-
-The structure is declared in {\bf xen/include/public/xen.h}:
-
-\scriptsize
-\begin{verbatim}
-typedef struct shared_info {
-    vcpu_info_t vcpu_info[XEN_LEGACY_MAX_VCPUS];
-
-    /*
-     * A domain can create "event channels" on which it can send and receive
-     * asynchronous event notifications. There are three classes of event that
-     * are delivered by this mechanism:
-     *  1. Bi-directional inter- and intra-domain connections. Domains must
-     *     arrange out-of-band to set up a connection (usually by allocating
-     *     an unbound 'listener' port and advertising that via a storage service
-     *     such as xenstore).
-     *  2. Physical interrupts. A domain with suitable hardware-access
-     *     privileges can bind an event-channel port to a physical interrupt
-     *     source.
-     *  3. Virtual interrupts ('events'). A domain can bind an event-channel
-     *     port to a virtual interrupt source, such as the virtual-timer
-     *     device or the emergency console.
-     * 
-     * Event channels are addressed by a "port index". Each channel is
-     * associated with two bits of information:
-     *  1. PENDING -- notifies the domain that there is a pending notification
-     *     to be processed. This bit is cleared by the guest.
-     *  2. MASK -- if this bit is clear then a 0->1 transition of PENDING
-     *     will cause an asynchronous upcall to be scheduled. This bit is only
-     *     updated by the guest. It is read-only within Xen. If a channel
-     *     becomes pending while the channel is masked then the 'edge' is lost
-     *     (i.e., when the channel is unmasked, the guest must manually handle
-     *     pending notifications as no upcall will be scheduled by Xen).
-     * 
-     * To expedite scanning of pending notifications, any 0->1 pending
-     * transition on an unmasked channel causes a corresponding bit in a
-     * per-vcpu selector word to be set. Each bit in the selector covers a
-     * 'C long' in the PENDING bitfield array.
-     */
-    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
-    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
-
-    /*
-     * Wallclock time: updated only by control software. Guests should base
-     * their gettimeofday() syscall on this wallclock-base value.
-     */
-    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.  */
-
-    arch_shared_info_t arch;
-
-} shared_info_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[vcpu\_info] An array of {\bf vcpu\_info\_t} structures, each of
-  which holds either runtime information about a virtual CPU, or is
-  ``empty'' if the corresponding VCPU does not exist.
-\item[evtchn\_pending] Guest-global array, with one bit per event
-  channel.  Bits are set if an event is currently pending on that
-  channel.
-\item[evtchn\_mask] Guest-global array for masking notifications on
-  event channels.
-\item[wc\_version] Version counter for current wallclock time.
-\item[wc\_sec] Whole seconds component of current wallclock time.
-\item[wc\_nsec] Nanoseconds component of current wallclock time.
-\item[arch] Host architecture-dependent portion of the shared info
-  structure.
-\end{description}
-
-\subsection{vcpu\_info\_t}
-
-\scriptsize
-\begin{verbatim}
-typedef struct vcpu_info {
-    /*
-     * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
-     * a pending notification for a particular VCPU. It is then cleared 
-     * by the guest OS /before/ checking for pending work, thus avoiding
-     * a set-and-check race. Note that the mask is only accessed by Xen
-     * on the CPU that is currently hosting the VCPU. This means that the
-     * pending and mask flags can be updated by the guest without special
-     * synchronisation (i.e., no need for the x86 LOCK prefix).
-     * This may seem suboptimal because if the pending flag is set by
-     * a different CPU then an IPI may be scheduled even when the mask
-     * is set. However, note:
-     *  1. The task of 'interrupt holdoff' is covered by the per-event-
-     *     channel mask bits. A 'noisy' event that is continually being
-     *     triggered can be masked at source at this very precise
-     *     granularity.
-     *  2. The main purpose of the per-VCPU mask is therefore to restrict
-     *     reentrant execution: whether for concurrency control, or to
-     *     prevent unbounded stack usage. Whatever the purpose, we expect
-     *     that the mask will be asserted only for short periods at a time,
-     *     and so the likelihood of a 'spurious' IPI is suitably small.
-     * The mask is read before making an event upcall to the guest: a
-     * non-zero mask therefore guarantees that the VCPU will not receive
-     * an upcall activation. The mask is cleared when the VCPU requests
-     * to block: this avoids wakeup-waiting races.
-     */
-    uint8_t evtchn_upcall_pending;
-    uint8_t evtchn_upcall_mask;
-    unsigned long evtchn_pending_sel;
-    arch_vcpu_info_t arch;
-    vcpu_time_info_t time;
-} vcpu_info_t; /* 64 bytes (x86) */
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[evtchn\_upcall\_pending] This is set non-zero by Xen to indicate
-  that there are pending events to be received.
-\item[evtchn\_upcall\_mask] This is set non-zero to disable all
-  interrupts for this CPU for short periods of time.  If individual
-  event channels need to be masked, the {\bf evtchn\_mask} in the {\bf
-  shared\_info\_t} is used instead.
-\item[evtchn\_pending\_sel] When an event is delivered to this VCPU, a
-  bit is set in this selector to indicate which word of the {\bf
-  evtchn\_pending} array in the {\bf shared\_info\_t} contains the
-  event in question.
-\item[arch] Architecture-specific VCPU info. On x86 this contains the
-  virtualized CR2 register (page fault linear address) for this VCPU.
-\item[time] Time values for this VCPU.
-\end{description}
-
-\subsection{vcpu\_time\_info}
-
-\scriptsize
-\begin{verbatim}
-typedef struct vcpu_time_info {
-    /*
-     * Updates to the following values are preceded and followed by an
-     * increment of 'version'. The guest can therefore detect updates by
-     * looking for changes to 'version'. If the least-significant bit of
-     * the version number is set then an update is in progress and the guest
-     * must wait to read a consistent set of values.
-     * The correct way to interact with the version number is similar to
-     * Linux's seqlock: see the implementations of read_seqbegin/read_seqretry.
-     */
-    uint32_t version;
-    uint32_t pad0;
-    uint64_t tsc_timestamp;   /* TSC at last update of time vals.  */
-    uint64_t system_time;     /* Time, in nanosecs, since boot.    */
-    /*
-     * Current system time:
-     *   system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
-     * CPU frequency (Hz):
-     *   ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
-     */
-    uint32_t tsc_to_system_mul;
-    int8_t   tsc_shift;
-    int8_t   pad1[3];
-} vcpu_time_info_t; /* 32 bytes */
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[version] Used to ensure the guest gets consistent time updates.
-\item[tsc\_timestamp] Cycle counter timestamp of last time value;
-  could be used to expolate in between updates, for instance.
-\item[system\_time] Time since boot (nanoseconds).
-\item[tsc\_to\_system\_mul] Cycle counter to nanoseconds multiplier
-(used in extrapolating current time).
-\item[tsc\_shift] Cycle counter to nanoseconds shift (used in
-extrapolating current time).
-\end{description}
-
-\subsection{arch\_shared\_info\_t}
-
-On x86, the {\bf arch\_shared\_info\_t} is defined as follows (from
-xen/public/arch-x86\_32.h):
-
-\scriptsize
-\begin{verbatim}
-typedef struct arch_shared_info {
-    unsigned long max_pfn;                  /* max pfn that appears in table */
-    /* Frame containing list of mfns containing list of mfns containing p2m. */
-    unsigned long pfn_to_mfn_frame_list_list; 
-} arch_shared_info_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[max\_pfn] The maximum PFN listed in the physical-to-machine
-  mapping table (P2M table).
-\item[pfn\_to\_mfn\_frame\_list\_list] Machine address of the frame
-  that contains the machine addresses of the P2M table frames.
-\end{description}
-
-\section{Start info page}
-
-The start info structure is declared as the following (in {\bf
-xen/include/public/xen.h}):
-
-\scriptsize
-\begin{verbatim}
-#define MAX_GUEST_CMDLINE 1024
-typedef struct start_info {
-    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
-    char magic[32];             /* "Xen-<version>.<subversion>". */
-    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
-    unsigned long shared_info;  /* MACHINE address of shared info struct. */
-    uint32_t flags;             /* SIF_xxx flags.                         */
-    unsigned long store_mfn;    /* MACHINE page number of shared page.    */
-    uint32_t store_evtchn;      /* Event channel for store communication. */
-    unsigned long console_mfn;  /* MACHINE address of console page.       */
-    uint32_t console_evtchn;    /* Event channel for console messages.    */
-    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
-    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
-    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
-    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
-    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module.  */
-    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
-    int8_t cmd_line[MAX_GUEST_CMDLINE];
-} start_info_t;
-\end{verbatim}
-\normalsize
-
-The fields are in two groups: the first group are always filled in
-when a domain is booted or resumed, the second set are only used at
-boot time.
-
-The always-available group is as follows:
-
-\begin{description}
-\item[magic] A text string identifying the Xen version to the guest.
-\item[nr\_pages] The number of real machine pages available to the
-  guest.
-\item[shared\_info] Machine address of the shared info structure,
-  allowing the guest to map it during initialisation.
-\item[flags] Flags for describing optional extra settings to the
-  guest.
-\item[store\_mfn] Machine address of the Xenstore communications page.
-\item[store\_evtchn] Event channel to communicate with the store.
-\item[console\_mfn] Machine address of the console data page.
-\item[console\_evtchn] Event channel to notify the console backend.
-\end{description}
-
-The boot-only group may only be safely referred to during system boot:
-
-\begin{description}
-\item[pt\_base] Virtual address of the page directory created for us
-  by the domain builder.
-\item[nr\_pt\_frames] Number of frames used by the builders' bootstrap
-  pagetables.
-\item[mfn\_list] Virtual address of the list of machine frames this
-  domain owns.
-\item[mod\_start] Virtual address of any pre-loaded modules
-  (e.g. ramdisk)
-\item[mod\_len] Size of pre-loaded module (if any).
-\item[cmd\_line] Kernel command line passed by the domain builder.
-\end{description}
-
-
-% by Mark Williamson <mark.williamson@cl.cam.ac.uk>
-
-\chapter{Event Channels}
-\label{c:eventchannels}
-
-Event channels are the basic primitive provided by Xen for event
-notifications.  An event is the Xen equivalent of a hardware
-interrupt.  They essentially store one bit of information, the event
-of interest is signalled by transitioning this bit from 0 to 1.
-
-Notifications are received by a guest via an upcall from Xen,
-indicating when an event arrives (setting the bit).  Further
-notifications are masked until the bit is cleared again (therefore,
-guests must check the value of the bit after re-enabling event
-delivery to ensure no missed notifications).
-
-Event notifications can be masked by setting a flag; this is
-equivalent to disabling interrupts and can be used to ensure atomicity
-of certain operations in the guest kernel.
-
-\section{Hypercall interface}
-
-\hypercall{event\_channel\_op(evtchn\_op\_t *op)}
-
-The event channel operation hypercall is used for all operations on
-event channels / ports.  Operations are distinguished by the value of
-the {\bf cmd} field of the {\bf op} structure.  The possible commands
-are described below:
-
-\begin{description}
-
-\item[EVTCHNOP\_alloc\_unbound]
-  Allocate a new event channel port, ready to be connected to by a
-  remote domain.
-  \begin{itemize}
-  \item Specified domain must exist.
-  \item A free port must exist in that domain.
-  \end{itemize}
-  Unprivileged domains may only allocate their own ports, privileged
-  domains may also allocate ports in other domains.
-\item[EVTCHNOP\_bind\_interdomain]
-  Bind an event channel for interdomain communications.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item Remote domain must exist.
-  \item Remote port must be allocated and currently unbound.
-  \item Remote port must be expecting the caller domain as the ``remote''.
-  \end{itemize}
-\item[EVTCHNOP\_bind\_virq]
-  Allocate a port and bind a VIRQ to it.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item VIRQ must be valid.
-  \item VCPU must exist.
-  \item VIRQ must not currently be bound to an event channel.
-  \end{itemize}
-\item[EVTCHNOP\_bind\_ipi]
-  Allocate and bind a port for notifying other virtual CPUs.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item VCPU must exist.
-  \end{itemize}
-\item[EVTCHNOP\_bind\_pirq]
-  Allocate and bind a port to a real IRQ.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item PIRQ must be within the valid range.
-  \item Another binding for this PIRQ must not exist for this domain.
-  \item Caller must have an available port.
-  \end{itemize}
-\item[EVTCHNOP\_close]
-  Close an event channel (no more events will be received).
-  \begin{itemize}
-  \item Port must be valid (currently allocated).
-  \end{itemize}
-\item[EVTCHNOP\_send] Send a notification on an event channel attached
-  to a port.
-  \begin{itemize}
-  \item Port must be valid.
-  \item Only valid for Interdomain, IPI or Allocated Unbound ports.
-  \end{itemize}
-\item[EVTCHNOP\_status] Query the status of a port; what kind of port,
-  whether it is bound, what remote domain is expected, what PIRQ or
-  VIRQ it is bound to, what VCPU will be notified, etc.
-  Unprivileged domains may only query the state of their own ports.
-  Privileged domains may query any port.
-\item[EVTCHNOP\_bind\_vcpu] Bind event channel to a particular VCPU -
-  receive notification upcalls only on that VCPU.
-  \begin{itemize}
-  \item VCPU must exist.
-  \item Port must be valid.
-  \item Event channel must be either: allocated but unbound, bound to
-  an interdomain event channel, bound to a PIRQ.
-  \end{itemize}
-
-\end{description}
-
-%%
-%% grant_tables.tex
-%% 
-%% Made by Mark Williamson
-%% Login   <mark@maw48>
-%%
-
-\chapter{Grant tables}
-\label{c:granttables}
-
-Xen's grant tables provide a generic mechanism to memory sharing
-between domains.  This shared memory interface underpins the split
-device drivers for block and network IO.
-
-Each domain has its own {\bf grant table}.  This is a data structure
-that is shared with Xen; it allows the domain to tell Xen what kind of
-permissions other domains have on its pages.  Entries in the grant
-table are identified by {\bf grant references}.  A grant reference is
-an integer, which indexes into the grant table.  It acts as a
-capability which the grantee can use to perform operations on the
-granter's memory.
-
-This capability-based system allows shared-memory communications
-between unprivileged domains.  A grant reference also encapsulates the
-details of a shared page, removing the need for a domain to know the
-real machine address of a page it is sharing.  This makes it possible
-to share memory correctly with domains running in fully virtualised
-memory.
-
-\section{Interface}
-
-\subsection{Grant table manipulation}
-
-Creating and destroying grant references is done by direct access to
-the grant table.  This removes the need to involve Xen when creating
-grant references, modifying access permissions, etc.  The grantee
-domain will invoke hypercalls to use the grant references.  Four main
-operations can be accomplished by directly manipulating the table:
-
-\begin{description}
-\item[Grant foreign access] allocate a new entry in the grant table
-  and fill out the access permissions accordingly.  The access
-  permissions will be looked up by Xen when the grantee attempts to
-  use the reference to map the granted frame.
-\item[End foreign access] check that the grant reference is not
-  currently in use, then remove the mapping permissions for the frame.
-  This prevents further mappings from taking place but does not allow
-  forced revocations of existing mappings.
-\item[Grant foreign transfer] allocate a new entry in the table
-  specifying transfer permissions for the grantee.  Xen will look up
-  this entry when the grantee attempts to transfer a frame to the
-  granter.
-\item[End foreign transfer] remove permissions to prevent a transfer
-  occurring in future.  If the transfer is already committed,
-  modifying the grant table cannot prevent it from completing.
-\end{description}
-
-\subsection{Hypercalls}
-
-Use of grant references is accomplished via a hypercall.  The grant
-table op hypercall takes three arguments:
-
-\hypercall{grant\_table\_op(unsigned int cmd, void *uop, unsigned int count)}
-
-{\bf cmd} indicates the grant table operation of interest.  {\bf uop}
-is a pointer to a structure (or an array of structures) describing the
-operation to be performed.  The {\bf count} field describes how many
-grant table operations are being batched together.
-
-The core logic is situated in {\bf xen/common/grant\_table.c}.  The
-grant table operation hypercall can be used to perform the following
-actions:
-
-\begin{description}
-\item[GNTTABOP\_map\_grant\_ref] Given a grant reference from another
-  domain, map the referred page into the caller's address space.
-\item[GNTTABOP\_unmap\_grant\_ref] Remove a mapping to a granted frame
-  from the caller's address space.  This is used to voluntarily
-  relinquish a mapping to a granted page.
-\item[GNTTABOP\_setup\_table] Setup grant table for caller domain.
-\item[GNTTABOP\_dump\_table] Debugging operation.
-\item[GNTTABOP\_transfer] Given a transfer reference from another
-  domain, transfer ownership of a page frame to that domain.
-\end{description}
-
-%%
-%% xenstore.tex
-%% 
-%% Made by Mark Williamson
-%% Login   <mark@maw48>
-%% 
-
-\chapter{Xenstore}
-
-Xenstore is the mechanism by which control-plane activities occur.
-These activities include:
-
-\begin{itemize}
-\item Setting up shared memory regions and event channels for use with
-  the split device drivers.
-\item Notifying the guest of control events (e.g. balloon driver
-  requests)
-\item Reporting back status information from the guest
-  (e.g. performance-related statistics, etc).
-\end{itemize}
-
-The store is arranged as a hierarchical collection of key-value pairs.
-Each domain has a directory hierarchy containing data related to its
-configuration.  Domains are permitted to register for notifications
-about changes in subtrees of the store, and to apply changes to the
-store transactionally.
-
-\section{Guidelines}
-
-A few principles govern the operation of the store:
-
-\begin{itemize}
-\item Domains should only modify the contents of their own
-  directories.
-\item The setup protocol for a device channel should simply consist of
-  entering the configuration data into the store.
-\item The store should allow device discovery without requiring the
-  relevant device drivers to be loaded: a Xen ``bus'' should be
-  visible to probing code in the guest.
-\item The store should be usable for inter-tool communications,
-  allowing the tools themselves to be decomposed into a number of
-  smaller utilities, rather than a single monolithic entity.  This
-  also facilitates the development of alternate user interfaces to the
-  same functionality.
-\end{itemize}
-
-\section{Store layout}
-
-There are three main paths in XenStore:
-
-\begin{description}
-\item[/vm] stores configuration information about domain
-\item[/local/domain] stores information about the domain on the local node (domid, etc.)
-\item[/tool] stores information for the various tools
-\end{description}
-
-The {\bf /vm} path stores configuration information for a domain.
-This information doesn't change and is indexed by the domain's UUID.
-A {\bf /vm} entry contains the following information:
-
-\begin{description}
-\item[uuid] uuid of the domain (somewhat redundant)
-\item[on\_reboot] the action to take on a domain reboot request (destroy or restart)
-\item[on\_poweroff] the action to take on a domain halt request (destroy or restart)
-\item[on\_crash] the action to take on a domain crash (destroy or restart)
-\item[vcpus] the number of allocated vcpus for the domain
-\item[memory] the amount of memory (in megabytes) for the domain Note: appears to sometimes be empty for domain-0
-\item[vcpu\_avail] the number of active vcpus for the domain (vcpus - number of disabled vcpus)
-\item[name] the name of the domain
-\end{description}
-
-
-{\bf /vm/$<$uuid$>$/image/}
-
-The image path is only available for Domain-Us and contains:
-\begin{description}
-\item[ostype] identifies the builder type (linux or vmx)
-\item[kernel] path to kernel on domain-0
-\item[cmdline] command line to pass to domain-U kernel
-\item[ramdisk] path to ramdisk on domain-0
-\end{description}
-
-{\bf /local}
-
-The {\tt /local} path currently only contains one directory, {\tt
-/local/domain} that is indexed by domain id.  It contains the running
-domain information.  The reason to have two storage areas is that
-during migration, the uuid doesn't change but the domain id does.  The
-{\tt /local/domain} directory can be created and populated before
-finalizing the migration enabling localhost to localhost migration.
-
-{\bf /local/domain/$<$domid$>$}
-
-This path contains:
-
-\begin{description}
-\item[cpu\_time] xend start time (this is only around for domain-0)
-\item[handle] private handle for xend
-\item[name] see /vm
-\item[on\_reboot] see /vm
-\item[on\_poweroff] see /vm
-\item[on\_crash] see /vm
-\item[vm] the path to the VM directory for the domain
-\item[domid] the domain id (somewhat redundant)
-\item[running] indicates that the domain is currently running
-\item[memory] the current memory in megabytes for the domain (empty for domain-0?)
-\item[maxmem\_KiB] the maximum memory for the domain (in kilobytes)
-\item[memory\_KiB] the memory allocated to the domain (in kilobytes)
-\item[cpu] the current CPU the domain is pinned to (empty for domain-0?)
-\item[cpu\_weight] the weight assigned to the domain
-\item[vcpu\_avail] a bitmap telling the domain whether it may use a given VCPU
-\item[online\_vcpus] how many vcpus are currently online
-\item[vcpus] the total number of vcpus allocated to the domain
-\item[console/] a directory for console information
-  \begin{description}
-  \item[ring-ref] the grant table reference of the console ring queue
-  \item[port] the event channel being used for the console ring queue (local port)
-  \item[tty] the current tty the console data is being exposed of
-  \item[limit] the limit (in bytes) of console data to buffer
-  \end{description}
-\item[backend/] a directory containing all backends the domain hosts
-  \begin{description}
-  \item[vbd/] a directory containing vbd backends
-    \begin{description}
-    \item[$<$domid$>$/] a directory containing vbd's for domid
-      \begin{description}
-      \item[$<$virtual-device$>$/] a directory for a particular
-	virtual-device on domid
-	\begin{description}
-	\item[frontend-id] domain id of frontend
-	\item[frontend] the path to the frontend domain
-	\item[physical-device] backend device number
-	\item[sector-size] backend sector size
-	\item[info] 0 read/write, 1 read-only (is this right?)
-	\item[domain] name of frontend domain
-	\item[params] parameters for device
-	\item[type] the type of the device
-	\item[dev] the virtual device (as given by the user)
-	\item[node] output from block creation script
-	\end{description}
-      \end{description}
-    \end{description}
-  
-  \item[vif/] a directory containing vif backends
-    \begin{description}
-    \item[$<$domid$>$/] a directory containing vif's for domid
-      \begin{description}
-      \item[$<$vif number$>$/] a directory for each vif
-      \item[frontend-id] the domain id of the frontend
-      \item[frontend] the path to the frontend
-      \item[mac] the mac address of the vif
-      \item[bridge] the bridge the vif is connected to
-      \item[handle] the handle of the vif
-      \item[script] the script used to create/stop the vif
-      \item[domain] the name of the frontend
-      \end{description}
-    \end{description}
-
-  \item[vtpm/] a directory containing vtpm backends
-    \begin{description}
-    \item[$<$domid$>$/] a directory containing vtpm's for domid
-      \begin{description}
-      \item[$<$vtpm number$>$/] a directory for each vtpm
-      \item[frontend-id] the domain id of the frontend
-      \item[frontend] the path to the frontend
-      \item[instance] the instance of the virtual TPM that is used
-      \item[pref{\textunderscore}instance] the instance number as given in the VM configuration file;
-           may be different from {\bf instance}
-      \item[domain] the name of the domain of the frontend
-      \end{description}
-    \end{description}
-
-  \end{description}
-
-  \item[device/] a directory containing the frontend devices for the
-    domain
-    \begin{description}
-    \item[vbd/] a directory containing vbd frontend devices for the
-      domain
-      \begin{description}
-      \item[$<$virtual-device$>$/] a directory containing the vbd frontend for
-	virtual-device
-	\begin{description}
-	\item[virtual-device] the device number of the frontend device
-	\item[backend-id] the domain id of the backend
-	\item[backend] the path of the backend in the store (/local/domain
-	  path)
-	\item[ring-ref] the grant table reference for the block request
-	  ring queue
-	\item[event-channel] the event channel used for the block request
-	  ring queue
-	\end{description}
-	
-      \item[vif/] a directory containing vif frontend devices for the
-	domain
-	\begin{description}
-	\item[$<$id$>$/] a directory for vif id frontend device for the domain
-	  \begin{description}
-	  \item[backend-id] the backend domain id
-	  \item[mac] the mac address of the vif
-	  \item[handle] the internal vif handle
-	  \item[backend] a path to the backend's store entry
-	  \item[tx-ring-ref] the grant table reference for the transmission ring queue 
-	  \item[rx-ring-ref] the grant table reference for the receiving ring queue 
-	  \item[event-channel] the event channel used for the two ring queues 
-	  \end{description}
-	\end{description}
-
-      \item[vtpm/] a directory containing the vtpm frontend device for the
-        domain
-        \begin{description}
-        \item[$<$id$>$] a directory for vtpm id frontend device for the domain
-          \begin{description}
-	  \item[backend-id] the backend domain id
-          \item[backend] a path to the backend's store entry
-          \item[ring-ref] the grant table reference for the tx/rx ring
-          \item[event-channel] the event channel used for the ring
-          \end{description}
-        \end{description}
-	
-      \item[device-misc/] miscellaneous information for devices 
-	\begin{description}
-	\item[vif/] miscellaneous information for vif devices
-	  \begin{description}
-	  \item[nextDeviceID] the next device id to use 
-	  \end{description}
-	\end{description}
-      \end{description}
-    \end{description}
-
-  \item[security/] access control information for the domain
-    \begin{description}
-    \item[ssidref] security reference identifier used inside the hypervisor
-    \item[access\_control/] security label used by management tools
-      \begin{description}
-       \item[label] security label name
-       \item[policy] security policy name
-      \end{description}
-    \end{description}
-
-  \item[store/] per-domain information for the store
-    \begin{description}
-    \item[port] the event channel used for the store ring queue 
-    \item[ring-ref] - the grant table reference used for the store's
-      communication channel 
-    \end{description}
-    
-  \item[image] - private xend information 
-\end{description}
-
-
-\chapter{Devices}
-\label{c:devices}
-
-Virtual devices under Xen are provided by a {\bf split device driver}
-architecture.  The illusion of the virtual device is provided by two
-co-operating drivers: the {\bf frontend}, which runs an the
-unprivileged domain and the {\bf backend}, which runs in a domain with
-access to the real device hardware (often called a {\bf driver
-domain}; in practice domain 0 usually fulfills this function).
-
-The frontend driver appears to the unprivileged guest as if it were a
-real device, for instance a block or network device.  It receives IO
-requests from its kernel as usual, however since it does not have
-access to the physical hardware of the system it must then issue
-requests to the backend.  The backend driver is responsible for
-receiving these IO requests, verifying that they are safe and then
-issuing them to the real device hardware.  The backend driver appears
-to its kernel as a normal user of in-kernel IO functionality.  When
-the IO completes the backend notifies the frontend that the data is
-ready for use; the frontend is then able to report IO completion to
-its own kernel.
-
-Frontend drivers are designed to be simple; most of the complexity is
-in the backend, which has responsibility for translating device
-addresses, verifying that requests are well-formed and do not violate
-isolation guarantees, etc.
-
-Split drivers exchange requests and responses in shared memory, with
-an event channel for asynchronous notifications of activity.  When the
-frontend driver comes up, it uses Xenstore to set up a shared memory
-frame and an interdomain event channel for communications with the
-backend.  Once this connection is established, the two can communicate
-directly by placing requests / responses into shared memory and then
-sending notifications on the event channel.  This separation of
-notification from data transfer allows message batching, and results
-in very efficient device access.
-
-This chapter focuses on some individual split device interfaces
-available to Xen guests.
-
-        
-\section{Network I/O}
-
-Virtual network device services are provided by shared memory
-communication with a backend domain.  From the point of view of other
-domains, the backend may be viewed as a virtual ethernet switch
-element with each domain having one or more virtual network interfaces
-connected to it.
-
-From the point of view of the backend domain itself, the network
-backend driver consists of a number of ethernet devices.  Each of
-these has a logical direct connection to a virtual network device in
-another domain.  This allows the backend domain to route, bridge,
-firewall, etc the traffic to / from the other domains using normal
-operating system mechanisms.
-
-\subsection{Backend Packet Handling}
-
-The backend driver is responsible for a variety of actions relating to
-the transmission and reception of packets from the physical device.
-With regard to transmission, the backend performs these key actions:
-
-\begin{itemize}
-\item {\bf Validation:} To ensure that domains do not attempt to
-  generate invalid (e.g. spoofed) traffic, the backend driver may
-  validate headers ensuring that source MAC and IP addresses match the
-  interface that they have been sent from.
-
-  Validation functions can be configured using standard firewall rules
-  ({\small{\tt iptables}} in the case of Linux).
-  
-\item {\bf Scheduling:} Since a number of domains can share a single
-  physical network interface, the backend must mediate access when
-  several domains each have packets queued for transmission.  This
-  general scheduling function subsumes basic shaping or rate-limiting
-  schemes.
-  
-\item {\bf Logging and Accounting:} The backend domain can be
-  configured with classifier rules that control how packets are
-  accounted or logged.  For example, log messages might be generated
-  whenever a domain attempts to send a TCP packet containing a SYN.
-\end{itemize}
-
-On receipt of incoming packets, the backend acts as a simple
-demultiplexer: Packets are passed to the appropriate virtual interface
-after any necessary logging and accounting have been carried out.
-
-\subsection{Data Transfer}
-
-Each virtual interface uses two ``descriptor rings'', one for
-transmit, the other for receive.  Each descriptor identifies a block
-of contiguous machine memory allocated to the domain.
-
-The transmit ring carries packets to transmit from the guest to the
-backend domain.  The return path of the transmit ring carries messages
-indicating that the contents have been physically transmitted and the
-backend no longer requires the associated pages of memory.
-
-To receive packets, the guest places descriptors of unused pages on
-the receive ring.  The backend will return received packets by
-exchanging these pages in the domain's memory with new pages
-containing the received data, and passing back descriptors regarding
-the new packets on the ring.  This zero-copy approach allows the
-backend to maintain a pool of free pages to receive packets into, and
-then deliver them to appropriate domains after examining their
-headers.
-
-% Real physical addresses are used throughout, with the domain
-% performing translation from pseudo-physical addresses if that is
-% necessary.
-
-If a domain does not keep its receive ring stocked with empty buffers
-then packets destined to it may be dropped.  This provides some
-defence against receive livelock problems because an overloaded domain
-will cease to receive further data.  Similarly, on the transmit path,
-it provides the application with feedback on the rate at which packets
-are able to leave the system.
-
-Flow control on rings is achieved by including a pair of producer
-indexes on the shared ring page.  Each side will maintain a private
-consumer index indicating the next outstanding message.  In this
-manner, the domains cooperate to divide the ring into two message
-lists, one in each direction.  Notification is decoupled from the
-immediate placement of new messages on the ring; the event channel
-will be used to generate notification when {\em either} a certain
-number of outstanding messages are queued, {\em or} a specified number
-of nanoseconds have elapsed since the oldest message was placed on the
-ring.
-
-%% Not sure if my version is any better -- here is what was here
-%% before: Synchronization between the backend domain and the guest is
-%% achieved using counters held in shared memory that is accessible to
-%% both.  Each ring has associated producer and consumer indices
-%% indicating the area in the ring that holds descriptors that contain
-%% data.  After receiving {\it n} packets or {\t nanoseconds} after
-%% receiving the first packet, the hypervisor sends an event to the
-%% domain.
-
-
-\subsection{Network ring interface}
-
-The network device uses two shared memory rings for communication: one
-for transmit, one for receive.
-
-Transmit requests are described by the following structure:
-
-\scriptsize
-\begin{verbatim}
-typedef struct netif_tx_request {
-    grant_ref_t gref;      /* Reference to buffer page */
-    uint16_t offset;       /* Offset within buffer page */
-    uint16_t flags;        /* NETTXF_* */
-    uint16_t id;           /* Echoed in response message. */
-    uint16_t size;         /* Packet size in bytes.       */
-} netif_tx_request_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[gref] Grant reference for the network buffer
-\item[offset] Offset to data
-\item[flags] Transmit flags (currently only NETTXF\_csum\_blank is
-  supported, to indicate that the protocol checksum field is
-  incomplete).
-\item[id] Echoed to guest by the backend in the ring-level response so
-  that the guest can match it to this request
-\item[size] Buffer size
-\end{description}
-
-Each transmit request is followed by a transmit response at some later
-date.  This is part of the shared-memory communication protocol and
-allows the guest to (potentially) retire internal structures related
-to the request.  It does not imply a network-level response.  This
-structure is as follows:
-
-\scriptsize
-\begin{verbatim}
-typedef struct netif_tx_response {
-    uint16_t id;
-    int16_t  status;
-} netif_tx_response_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[id] Echo of the ID field in the corresponding transmit request.
-\item[status] Success / failure status of the transmit request.
-\end{description}
-
-Receive requests must be queued by the frontend, accompanied by a
-donation of page-frames to the backend.  The backend transfers page
-frames full of data back to the guest
-
-\scriptsize
-\begin{verbatim}
-typedef struct {
-    uint16_t    id;        /* Echoed in response message.        */
-    grant_ref_t gref;      /* Reference to incoming granted frame */
-} netif_rx_request_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[id] Echoed by the frontend to identify this request when
-  responding.
-\item[gref] Transfer reference - the backend will use this reference
-  to transfer a frame of network data to us.
-\end{description}
-
-Receive response descriptors are queued for each received frame.  Note
-that these may only be queued in reply to an existing receive request,
-providing an in-built form of traffic throttling.
-
-\scriptsize
-\begin{verbatim}
-typedef struct {
-    uint16_t id;
-    uint16_t offset;       /* Offset in page of start of received packet  */
-    uint16_t flags;        /* NETRXF_* */
-    int16_t  status;       /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
-} netif_rx_response_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[id] ID echoed from the original request, used by the guest to
-  match this response to the original request.
-\item[offset] Offset to data within the transferred frame.
-\item[flags] Transmit flags (currently only NETRXF\_csum\_valid is
-  supported, to indicate that the protocol checksum field has already
-  been validated).
-\item[status] Success / error status for this operation.
-\end{description}
-
-Note that the receive protocol includes a mechanism for guests to
-receive incoming memory frames but there is no explicit transfer of
-frames in the other direction.  Guests are expected to return memory
-to the hypervisor in order to use the network interface.  They {\em
-must} do this or they will exceed their maximum memory reservation and
-will not be able to receive incoming frame transfers.  When necessary,
-the backend is able to replenish its pool of free network buffers by
-claiming some of this free memory from the hypervisor.
-
-\section{Block I/O}
-
-All guest OS disk access goes through the virtual block device VBD
-interface.  This interface allows domains access to portions of block
-storage devices visible to the the block backend device.  The VBD
-interface is a split driver, similar to the network interface
-described above.  A single shared memory ring is used between the
-frontend and backend drivers for each virtual device, across which
-IO requests and responses are sent.
-
-Any block device accessible to the backend domain, including
-network-based block (iSCSI, *NBD, etc), loopback and LVM/MD devices,
-can be exported as a VBD.  Each VBD is mapped to a device node in the
-guest, specified in the guest's startup configuration.
-
-\subsection{Data Transfer}
-
-The per-(virtual)-device ring between the guest and the block backend
-supports two messages:
-
-\begin{description}
-\item [{\small {\tt READ}}:] Read data from the specified block
-  device.  The front end identifies the device and location to read
-  from and attaches pages for the data to be copied to (typically via
-  DMA from the device).  The backend acknowledges completed read
-  requests as they finish.
-
-\item [{\small {\tt WRITE}}:] Write data to the specified block
-  device.  This functions essentially as {\small {\tt READ}}, except
-  that the data moves to the device instead of from it.
-\end{description}
-
-%% Rather than copying data, the backend simply maps the domain's
-%% buffers in order to enable direct DMA to them.  The act of mapping
-%% the buffers also increases the reference counts of the underlying
-%% pages, so that the unprivileged domain cannot try to return them to
-%% the hypervisor, install them as page tables, or any other unsafe
-%% behaviour.
-%%
-%% % block API here
-
-\subsection{Block ring interface}
-
-The block interface is defined by the structures passed over the
-shared memory interface.  These structures are either requests (from
-the frontend to the backend) or responses (from the backend to the
-frontend).
-
-The request structure is defined as follows:
-
-\scriptsize
-\begin{verbatim}
-typedef struct blkif_request {
-    uint8_t        operation;    /* BLKIF_OP_???                         */
-    uint8_t        nr_segments;  /* number of segments                   */
-    blkif_vdev_t   handle;       /* only for read/write requests         */
-    uint64_t       id;           /* private guest value, echoed in resp  */
-    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
-    struct blkif_request_segment {
-        grant_ref_t gref;        /* reference to I/O buffer frame        */
-        /* @first_sect: first sector in frame to transfer (inclusive).   */
-        /* @last_sect: last sector in frame to transfer (inclusive).     */
-        uint8_t     first_sect, last_sect;
-    } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
-} blkif_request_t;
-\end{verbatim}
-\normalsize
-
-The fields are as follows:
-
-\begin{description}
-\item[operation] operation ID: one of the operations described above
-\item[nr\_segments] number of segments for scatter / gather IO
-  described by this request
-\item[handle] identifier for a particular virtual device on this
-  interface
-\item[id] this value is echoed in the response message for this IO;
-  the guest may use it to identify the original request
-\item[sector\_number] start sector on the virtual device for this
-  request
-\item[frame\_and\_sects] This array contains structures encoding
-  scatter-gather IO to be performed:
-  \begin{description}
-  \item[gref] The grant reference for the foreign I/O buffer page.
-  \item[first\_sect] First sector to access within the buffer page (0 to 7).
-  \item[last\_sect] Last sector to access within the buffer page (0 to 7).
-  \end{description}
-  Data will be transferred into frames at an offset determined by the
-  value of {\tt first\_sect}.
-\end{description}
-
-\section{Virtual TPM}
-
-Virtual TPM (VTPM) support provides TPM functionality to each virtual
-machine that requests this functionality in its configuration file.
-The interface enables domains to access their own private TPM like it
-was a hardware TPM built into the machine.
-
-The virtual TPM interface is implemented as a split driver,
-similar to the network and block interfaces described above.
-The user domain hosting the frontend exports a character device /dev/tpm0
-to user-level applications for communicating with the virtual TPM.
-This is the same device interface that is also offered if a hardware TPM
-is available in the system. The backend provides a single interface
-/dev/vtpm where the virtual TPM is waiting for commands from all domains
-that have located their backend in a given domain.
-
-\subsection{Data Transfer}
-
-A single shared memory ring is used between the frontend and backend
-drivers. TPM requests and responses are sent in pages where a pointer
-to those pages and other information is placed into the ring such that
-the backend can map the pages into its memory space using the grant
-table mechanism.
-
-The backend driver has been implemented to only accept well-formed
-TPM requests. To meet this requirement, the length indicator in the
-TPM request must correctly indicate the length of the request.
-Otherwise an error message is automatically sent back by the device driver.
-
-The virtual TPM implementation listens for TPM request on /dev/vtpm. Since
-it must be able to apply the TPM request packet to the virtual TPM instance
-associated with the virtual machine, a 4-byte virtual TPM instance
-identifier is pretended to each packet by the backend driver (in network
-byte order) for internal routing of the request.
-
-\subsection{Virtual TPM ring interface}
-
-The TPM protocol is a strict request/response protocol and therefore
-only one ring is used to send requests from the frontend to the backend
-and responses on the reverse path.
-
-The request/response structure is defined as follows:
-
-\scriptsize
-\begin{verbatim}
-typedef struct {
-    unsigned long addr;     /* Machine address of packet.     */
-    grant_ref_t ref;        /* grant table access reference.  */
-    uint16_t unused;        /* unused                         */
-    uint16_t size;          /* Packet size in bytes.          */
-} tpmif_tx_request_t;
-\end{verbatim}
-\normalsize
-
-The fields are as follows:
-
-\begin{description}
-\item[addr] The machine address of the page associated with the TPM
-            request/response; a request/response may span multiple
-            pages
-\item[ref]  The grant table reference associated with the address.
-\item[size] The size of the remaining packet; up to
-            PAGE{\textunderscore}SIZE bytes can be found in the
-            page referenced by 'addr'
-\end{description}
-
-The frontend initially allocates several pages whose addresses
-are stored in the ring. Only these pages are used for exchange of
-requests and responses.
-
-
-\chapter{Further Information}
-
-If you have questions that are not answered by this manual, the
-sources of information listed below may be of interest to you.  Note
-that bug reports, suggestions and contributions related to the
-software (or the documentation) should be sent to the Xen developers'
-mailing list (address below).
-
-
-\section{Other documentation}
-
-If you are mainly interested in using (rather than developing for)
-Xen, the \emph{Xen Users' Manual} is distributed in the {\tt docs/}
-directory of the Xen source distribution.
-
-% Various HOWTOs are also available in {\tt docs/HOWTOS}.
-
-
-\section{Online references}
-
-The official Xen web site can be found at:
-\begin{quote} {\tt http://www.xensource.com}
-\end{quote}
-
-
-This contains links to the latest versions of all online
-documentation, including the latest version of the FAQ.
-
-Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
-The Xen project uses Bugzilla as its bug tracking system. You'll find
-the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
-
-
-\section{Mailing lists}
-
-There are several mailing lists that are used to discuss Xen related
-topics. The most widely relevant are listed below. An official page of
-mailing lists and subscription information can be found at \begin{quote}
-  {\tt http://lists.xensource.com/} \end{quote}
-
-\begin{description}
-\item[xen-devel@lists.xensource.com] Used for development
-  discussions and bug reports.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-devel}}
-\item[xen-users@lists.xensource.com] Used for installation and usage
-  discussions and requests for help.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-users}}
-\item[xen-announce@lists.xensource.com] Used for announcements only.
-  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-announce}}
-\item[xen-changelog@lists.xensource.com] Changelog feed
-  from the unstable and 2.0 trees - developer oriented.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-changelog}}
-\end{description}
-
-\appendix
-
-
-\chapter{Xen Hypercalls}
-\label{a:hypercalls}
-
-Hypercalls represent the procedural interface to Xen; this appendix 
-categorizes and describes the current set of hypercalls. 
-
-\section{Invoking Hypercalls} 
-
-Hypercalls are invoked in a manner analogous to system calls in a
-conventional operating system; a software interrupt is issued which
-vectors to an entry point within Xen. On x86/32 machines the
-instruction required is {\tt int \$82}; the (real) IDT is setup so
-that this may only be issued from within ring 1. The particular 
-hypercall to be invoked is contained in {\tt EAX} --- a list 
-mapping these values to symbolic hypercall names can be found 
-in {\tt xen/include/public/xen.h}. 
-
-On some occasions a set of hypercalls will be required to carry
-out a higher-level function; a good example is when a guest 
-operating wishes to context switch to a new process which 
-requires updating various privileged CPU state. As an optimization
-for these cases, there is a generic mechanism to issue a set of 
-hypercalls as a batch: 
-
-\begin{quote}
-\hypercall{multicall(void *call\_list, int nr\_calls)}
-
-Execute a series of hypervisor calls; {\tt nr\_calls} is the length of
-the array of {\tt multicall\_entry\_t} structures pointed to be {\tt
-call\_list}. Each entry contains the hypercall operation code followed
-by up to 7 word-sized arguments.
-\end{quote}
-
-Note that multicalls are provided purely as an optimization; there is
-no requirement to use them when first porting a guest operating
-system.
-
-
-\section{Virtual CPU Setup} 
-
-At start of day, a guest operating system needs to setup the virtual
-CPU it is executing on. This includes installing vectors for the
-virtual IDT so that the guest OS can handle interrupts, page faults,
-etc. However the very first thing a guest OS must setup is a pair 
-of hypervisor callbacks: these are the entry points which Xen will
-use when it wishes to notify the guest OS of an occurrence. 
-
-\begin{quote}
-\hypercall{set\_callbacks(unsigned long event\_selector, unsigned long
-  event\_address, unsigned long failsafe\_selector, unsigned long
-  failsafe\_address) }
-
-Register the normal (``event'') and failsafe callbacks for 
-event processing. In each case the code segment selector and 
-address within that segment are provided. The selectors must
-have RPL 1; in XenLinux we simply use the kernel's CS for both 
-{\bf event\_selector} and {\bf failsafe\_selector}.
-
-The value {\bf event\_address} specifies the address of the guest OSes
-event handling and dispatch routine; the {\bf failsafe\_address}
-specifies a separate entry point which is used only if a fault occurs
-when Xen attempts to use the normal callback. 
-
-\end{quote} 
-
-On x86/64 systems the hypercall takes slightly different
-arguments. This is because callback CS does not need to be specified
-(since teh callbacks are entered via SYSRET), and also because an
-entry address needs to be specified for SYSCALLs from guest user
-space:
-
-\begin{quote}
-\hypercall{set\_callbacks(unsigned long event\_address, unsigned long
-  failsafe\_address, unsigned long syscall\_address)}
-\end{quote} 
-
-
-After installing the hypervisor callbacks, the guest OS can 
-install a `virtual IDT' by using the following hypercall: 
-
-\begin{quote} 
-\hypercall{set\_trap\_table(trap\_info\_t *table)} 
-
-Install one or more entries into the per-domain 
-trap handler table (essentially a software version of the IDT). 
-Each entry in the array pointed to by {\bf table} includes the 
-exception vector number with the corresponding segment selector 
-and entry point. Most guest OSes can use the same handlers on 
-Xen as when running on the real hardware.
-
-
-\end{quote} 
-
-A further hypercall is provided for the management of virtual CPUs:
-
-\begin{quote}
-\hypercall{vcpu\_op(int cmd, int vcpuid, void *extra\_args)}
-
-This hypercall can be used to bootstrap VCPUs, to bring them up and
-down and to test their current status.
-
-\end{quote}
-
-\section{Scheduling and Timer}
-
-Domains are preemptively scheduled by Xen according to the 
-parameters installed by domain 0 (see Section~\ref{s:dom0ops}). 
-In addition, however, a domain may choose to explicitly 
-control certain behavior with the following hypercall: 
-
-\begin{quote} 
-\hypercall{sched\_op\_new(int cmd, void *extra\_args)}
-
-Request scheduling operation from hypervisor. The following
-sub-commands are available:
-
-\begin{description}
-\item[SCHEDOP\_yield] voluntarily yields the CPU, but leaves the
-caller marked as runnable. No extra arguments are passed to this
-command. 
-\item[SCHEDOP\_block] removes the calling domain from the run queue
-and causes it to sleep until an event is delivered to it. No extra 
-arguments are passed to this command. 
-\item[SCHEDOP\_shutdown] is used to end the calling domain's
-execution. The extra argument is a {\bf sched\_shutdown} structure
-which indicates the reason why the domain suspended (e.g., for reboot,
-halt, power-off).
-\item[SCHEDOP\_poll] allows a VCPU to wait on a set of event channels
-with an optional timeout (all of which are specified in the {\bf
-sched\_poll} extra argument). The semantics are similar to the UNIX
-{\bf poll} system call. The caller must have event-channel upcalls
-masked when executing this command.
-\end{description}
-\end{quote} 
-
-{\bf sched\_op\_new}  was not available prior to Xen 3.0.2. Older versions
-provide only the following hypercall:
-
-\begin{quote} 
-\hypercall{sched\_op(int cmd, unsigned long extra\_arg)}
-
-This hypercall supports the following subset of {\bf sched\_op\_new} commands:
-
-\begin{description}
-\item[SCHEDOP\_yield] (extra argument is 0).
-\item[SCHEDOP\_block] (extra argument is 0).
-\item[SCHEDOP\_shutdown] (extra argument is numeric reason code).
-\end{description}
-\end{quote}
-
-To aid the implementation of a process scheduler within a guest OS,
-Xen provides a virtual programmable timer:
-
-\begin{quote}
-\hypercall{set\_timer\_op(uint64\_t timeout)} 
-
-Request a timer event to be sent at the specified system time (time 
-in nanoseconds since system boot).
-
-\end{quote} 
-
-Note that calling {\bf set\_timer\_op} prior to {\bf sched\_op} 
-allows block-with-timeout semantics. 
-
-
-\section{Page Table Management} 
-
-Since guest operating systems have read-only access to their page 
-tables, Xen must be involved when making any changes. The following
-multi-purpose hypercall can be used to modify page-table entries, 
-update the machine-to-physical mapping table, flush the TLB, install 
-a new page-table base pointer, and more.
-
-\begin{quote} 
-\hypercall{mmu\_update(mmu\_update\_t *req, int count, int *success\_count)} 
-
-Update the page table for the domain; a set of {\bf count} updates are
-submitted for processing in a batch, with {\bf success\_count} being 
-updated to report the number of successful updates.  
-
-Each element of {\bf req[]} contains a pointer (address) and value; 
-the least significant 2-bits of the pointer are used to distinguish 
-the type of update requested as follows:
-\begin{description} 
-
-\item[MMU\_NORMAL\_PT\_UPDATE:] update a page directory entry or
-page table entry to the associated value; Xen will check that the
-update is safe, as described in Chapter~\ref{c:memory}.
-
-\item[MMU\_MACHPHYS\_UPDATE:] update an entry in the
-  machine-to-physical table. The calling domain must own the machine
-  page in question (or be privileged).
-\end{description}
-
-\end{quote}
-
-Explicitly updating batches of page table entries is extremely
-efficient, but can require a number of alterations to the guest
-OS. Using the writable page table mode (Chapter~\ref{c:memory}) is
-recommended for new OS ports.
-
-Regardless of which page table update mode is being used, however,
-there are some occasions (notably handling a demand page fault) where
-a guest OS will wish to modify exactly one PTE rather than a
-batch, and where that PTE is mapped into the current address space.
-This is catered for by the following:
-
-\begin{quote} 
-\hypercall{update\_va\_mapping(unsigned long va, uint64\_t val,
-                         unsigned long flags)}
-
-Update the currently installed PTE that maps virtual address {\bf va}
-to new value {\bf val}. As with {\bf mmu\_update}, Xen checks the
-modification  is safe before applying it. The {\bf flags} determine
-which kind of TLB flush, if any, should follow the update. 
-
-\end{quote} 
-
-Finally, sufficiently privileged domains may occasionally wish to manipulate 
-the pages of others: 
-
-\begin{quote}
-\hypercall{update\_va\_mapping\_otherdomain(unsigned long va, uint64\_t val,
-                         unsigned long flags, domid\_t domid)}
-
-Identical to {\bf update\_va\_mapping} save that the pages being
-mapped must belong to the domain {\bf domid}. 
-
-\end{quote}
-
-An additional MMU hypercall provides an ``extended command''
-interface.  This provides additional functionality beyond the basic
-table updating commands:
-
-\begin{quote}
-
-\hypercall{mmuext\_op(struct mmuext\_op *op, int count, int *success\_count, domid\_t domid)}
-
-This hypercall is used to perform additional MMU operations.  These
-include updating {\tt cr3} (or just re-installing it for a TLB flush),
-requesting various kinds of TLB flush, flushing the cache, installing
-a new LDT, or pinning \& unpinning page-table pages (to ensure their
-reference count doesn't drop to zero which would require a
-revalidation of all entries).  Some of the operations available are
-restricted to domains with sufficient system privileges.
-
-It is also possible for privileged domains to reassign page ownership
-via an extended MMU operation, although grant tables are used instead
-of this where possible; see Section~\ref{s:idc}.
-
-\end{quote}
-
-Finally, a hypercall interface is exposed to activate and deactivate
-various optional facilities provided by Xen for memory management.
-
-\begin{quote} 
-\hypercall{vm\_assist(unsigned int cmd, unsigned int type)}
-
-Toggle various memory management modes (in particular writable page
-tables).
-
-\end{quote} 
-
-\section{Segmentation Support}
-
-Xen allows guest OSes to install a custom GDT if they require it; 
-this is context switched transparently whenever a domain is 
-[de]scheduled.  The following hypercall is effectively a 
-`safe' version of {\tt lgdt}: 
-
-\begin{quote}
-\hypercall{set\_gdt(unsigned long *frame\_list, int entries)} 
-
-Install a global descriptor table for a domain; {\bf frame\_list} is
-an array of up to 16 machine page frames within which the GDT resides,
-with {\bf entries} being the actual number of descriptor-entry
-slots. All page frames must be mapped read-only within the guest's
-address space, and the table must be large enough to contain Xen's
-reserved entries (see {\bf xen/include/public/arch-x86\_32.h}).
-
-\end{quote}
-
-Many guest OSes will also wish to install LDTs; this is achieved by
-using {\bf mmu\_update} with an extended command, passing the
-linear address of the LDT base along with the number of entries. No
-special safety checks are required; Xen needs to perform this task
-simply since {\tt lldt} requires CPL 0.
-
-
-Xen also allows guest operating systems to update just an 
-individual segment descriptor in the GDT or LDT:  
-
-\begin{quote}
-\hypercall{update\_descriptor(uint64\_t ma, uint64\_t desc)}
-
-Update the GDT/LDT entry at machine address {\bf ma}; the new
-8-byte descriptor is stored in {\bf desc}.
-Xen performs a number of checks to ensure the descriptor is 
-valid. 
-
-\end{quote}
-
-Guest OSes can use the above in place of context switching entire 
-LDTs (or the GDT) when the number of changing descriptors is small. 
-
-\section{Context Switching} 
-
-When a guest OS wishes to context switch between two processes, 
-it can use the page table and segmentation hypercalls described
-above to perform the the bulk of the privileged work. In addition, 
-however, it will need to invoke Xen to switch the kernel (ring 1) 
-stack pointer: 
-
-\begin{quote} 
-\hypercall{stack\_switch(unsigned long ss, unsigned long esp)} 
-
-Request kernel stack switch from hypervisor; {\bf ss} is the new 
-stack segment, which {\bf esp} is the new stack pointer. 
-
-\end{quote} 
-
-A useful hypercall for context switching allows ``lazy'' save and
-restore of floating point state:
-
-\begin{quote}
-\hypercall{fpu\_taskswitch(int set)} 
-
-This call instructs Xen to set the {\tt TS} bit in the {\tt cr0}
-control register; this means that the next attempt to use floating
-point will cause a trap which the guest OS can trap. Typically it will
-then save/restore the FP state, and clear the {\tt TS} bit, using the
-same call.
-\end{quote} 
-
-This is provided as an optimization only; guest OSes can also choose
-to save and restore FP state on all context switches for simplicity. 
-
-Finally, a hypercall is provided for entering vm86 mode:
-
-\begin{quote}
-\hypercall{switch\_vm86}
-
-This allows the guest to run code in vm86 mode, which is needed for
-some legacy software.
-\end{quote}
-
-\section{Physical Memory Management}
-
-As mentioned previously, each domain has a maximum and current 
-memory allocation. The maximum allocation, set at domain creation 
-time, cannot be modified. However a domain can choose to reduce 
-and subsequently grow its current allocation by using the
-following call: 
-
-\begin{quote} 
-\hypercall{memory\_op(unsigned int op, void *arg)}
-
-Increase or decrease current memory allocation (as determined by 
-the value of {\bf op}).  The available operations are:
-
-\begin{description}
-\item[XENMEM\_increase\_reservation] Request an increase in machine
-  memory allocation; {\bf arg} must point to a {\bf
-  xen\_memory\_reservation} structure.
-\item[XENMEM\_decrease\_reservation] Request a decrease in machine
-  memory allocation; {\bf arg} must point to a {\bf
-  xen\_memory\_reservation} structure.
-\item[XENMEM\_maximum\_ram\_page] Request the frame number of the
-  highest-addressed frame of machine memory in the system.  {\bf arg}
-  must point to an {\bf unsigned long} where this value will be
-  stored.
-\item[XENMEM\_current\_reservation] Returns current memory reservation
-  of the specified domain.
-\item[XENMEM\_maximum\_reservation] Returns maximum memory reservation
-  of the specified domain.
-\end{description}
-
-\end{quote} 
-
-In addition to simply reducing or increasing the current memory
-allocation via a `balloon driver', this call is also useful for 
-obtaining contiguous regions of machine memory when required (e.g. 
-for certain PCI devices, or if using superpages).  
-
-
-\section{Inter-Domain Communication}
-\label{s:idc} 
-
-Xen provides a simple asynchronous notification mechanism via
-\emph{event channels}. Each domain has a set of end-points (or
-\emph{ports}) which may be bound to an event source (e.g. a physical
-IRQ, a virtual IRQ, or an port in another domain). When a pair of
-end-points in two different domains are bound together, then a `send'
-operation on one will cause an event to be received by the destination
-domain.
-
-The control and use of event channels involves the following hypercall: 
-
-\begin{quote}
-\hypercall{event\_channel\_op(evtchn\_op\_t *op)} 
-
-Inter-domain event-channel management; {\bf op} is a discriminated 
-union which allows the following 7 operations: 
-
-\begin{description} 
-
-\item[alloc\_unbound:] allocate a free (unbound) local
-  port and prepare for connection from a specified domain. 
-\item[bind\_virq:] bind a local port to a virtual 
-IRQ; any particular VIRQ can be bound to at most one port per domain. 
-\item[bind\_pirq:] bind a local port to a physical IRQ;
-once more, a given pIRQ can be bound to at most one port per
-domain. Furthermore the calling domain must be sufficiently
-privileged.
-\item[bind\_interdomain:] construct an interdomain event 
-channel; in general, the target domain must have previously allocated 
-an unbound port for this channel, although this can be bypassed by 
-privileged domains during domain setup. 
-\item[close:] close an interdomain event channel. 
-\item[send:] send an event to the remote end of a 
-interdomain event channel. 
-\item[status:] determine the current status of a local port. 
-\end{description} 
-
-For more details see
-{\bf xen/include/public/event\_channel.h}. 
-
-\end{quote} 
-
-Event channels are the fundamental communication primitive between 
-Xen domains and seamlessly support SMP. However they provide little
-bandwidth for communication {\sl per se}, and hence are typically 
-married with a piece of shared memory to produce effective and 
-high-performance inter-domain communication. 
-
-Safe sharing of memory pages between guest OSes is carried out by
-granting access on a per page basis to individual domains. This is
-achieved by using the {\tt grant\_table\_op} hypercall.
-
-\begin{quote}
-\hypercall{grant\_table\_op(unsigned int cmd, void *uop, unsigned int count)}
-
-Used to invoke operations on a grant reference, to setup the grant
-table and to dump the tables' contents for debugging.
-
-\end{quote} 
-
-\section{IO Configuration} 
-
-Domains with physical device access (i.e.\ driver domains) receive
-limited access to certain PCI devices (bus address space and
-interrupts). However many guest operating systems attempt to 
-determine the PCI configuration by directly access the PCI BIOS, 
-which cannot be allowed for safety. 
-
-Instead, Xen provides the following hypercall: 
-
-\begin{quote}
-\hypercall{physdev\_op(void *physdev\_op)}
-
-Set and query IRQ configuration details, set the system IOPL, set the
-TSS IO bitmap.
-
-\end{quote} 
-
-
-For examples of using {\tt physdev\_op}, see the 
-Xen-specific PCI code in the linux sparse tree. 
-
-\section{Administrative Operations}
-\label{s:dom0ops}
-
-A large number of control operations are available to a sufficiently
-privileged domain (typically domain 0). These allow the creation and
-management of new domains, for example. A complete list is given 
-below: for more details on any or all of these, please see 
-{\tt xen/include/public/dom0\_ops.h} 
-
-
-\begin{quote}
-\hypercall{dom0\_op(dom0\_op\_t *op)} 
-
-Administrative domain operations for domain management. The options are:
-
-\begin{description} 
-\item [DOM0\_GETMEMLIST:] get list of pages used by the domain
-
-\item [DOM0\_SCHEDCTL:]
-
-\item [DOM0\_ADJUSTDOM:] adjust scheduling priorities for domain
-
-\item [DOM0\_CREATEDOMAIN:] create a new domain
-
-\item [DOM0\_DESTROYDOMAIN:] deallocate all resources associated
-with a domain
-
-\item [DOM0\_PAUSEDOMAIN:] remove a domain from the scheduler run 
-queue. 
-
-\item [DOM0\_UNPAUSEDOMAIN:] mark a paused domain as schedulable
-  once again. 
-
-\item [DOM0\_GETDOMAININFO:] get statistics about the domain
-
-\item [DOM0\_SETDOMAININFO:] set VCPU-related attributes
-
-\item [DOM0\_MSR:] read or write model specific registers
-
-\item [DOM0\_DEBUG:] interactively invoke the debugger
-
-\item [DOM0\_SETTIME:] set system time
-
-\item [DOM0\_GETPAGEFRAMEINFO:] 
-
-\item [DOM0\_READCONSOLE:] read console content from hypervisor buffer ring
-
-\item [DOM0\_PINCPUDOMAIN:] pin domain to a particular CPU
-
-\item [DOM0\_TBUFCONTROL:] get and set trace buffer attributes
-
-\item [DOM0\_PHYSINFO:] get information about the host machine
-
-\item [DOM0\_SCHED\_ID:] get the ID of the current Xen scheduler
-
-\item [DOM0\_SHADOW\_CONTROL:] switch between shadow page-table modes
-
-\item [DOM0\_SETDOMAINMAXMEM:] set maximum memory allocation of a domain
-
-\item [DOM0\_GETPAGEFRAMEINFO2:] batched interface for getting
-page frame info
-
-\item [DOM0\_ADD\_MEMTYPE:] set MTRRs
-
-\item [DOM0\_DEL\_MEMTYPE:] remove a memory type range
-
-\item [DOM0\_READ\_MEMTYPE:] read MTRR
-
-\item [DOM0\_PERFCCONTROL:] control Xen's software performance
-counters
-
-\item [DOM0\_MICROCODE:] update CPU microcode
-
-\item [DOM0\_IOPORT\_PERMISSION:] modify domain permissions for an
-IO port range (enable / disable a range for a particular domain)
-
-\item [DOM0\_GETVCPUCONTEXT:] get context from a VCPU
-
-\item [DOM0\_GETVCPUINFO:] get current state for a VCPU
-\item [DOM0\_GETDOMAININFOLIST:] batched interface to get domain
-info
-
-\item [DOM0\_PLATFORM\_QUIRK:] inform Xen of a platform quirk it
-needs to handle (e.g. noirqbalance)
-
-\item [DOM0\_PHYSICAL\_MEMORY\_MAP:] get info about dom0's memory
-map
-
-\item [DOM0\_MAX\_VCPUS:] change max number of VCPUs for a domain
-
-\item [DOM0\_SETDOMAINHANDLE:] set the handle for a domain
-
-\end{description} 
-\end{quote} 
-
-Most of the above are best understood by looking at the code 
-implementing them (in {\tt xen/common/dom0\_ops.c}) and in 
-the user-space tools that use them (mostly in {\tt tools/libxc}). 
-
-\section{Debugging Hypercalls} 
-
-A few additional hypercalls are mainly useful for debugging: 
-
-\begin{quote} 
-\hypercall{console\_io(int cmd, int count, char *str)}
-
-Use Xen to interact with the console; operations are:
-
-{CONSOLEIO\_write}: Output count characters from buffer str.
-
-{CONSOLEIO\_read}: Input at most count characters into buffer str.
-\end{quote} 
-
-A pair of hypercalls allows access to the underlying debug registers: 
-\begin{quote}
-\hypercall{set\_debugreg(int reg, unsigned long value)}
-
-Set debug register {\bf reg} to {\bf value} 
-
-\hypercall{get\_debugreg(int reg)}
-
-Return the contents of the debug register {\bf reg}
-\end{quote}
-
-And finally: 
-\begin{quote}
-\hypercall{xen\_version(int cmd)}
-
-Request Xen version number.
-\end{quote} 
-
-This is useful to ensure that user-space tools are in sync 
-with the underlying hypervisor. 
-
-
-\end{document}
diff -r a2a8089b1ffb -r 4271634e4c86 docs/src/user.tex
--- a/docs/src/user.tex	Tue Jan 24 16:46:17 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3235 +0,0 @@
-\documentclass[11pt,twoside,final,openright]{report}
-\usepackage{a4,graphicx,html,parskip,setspace,times,xspace,url}
-\setstretch{1.15}
-
-\renewcommand{\ttdefault}{pcr}
-
-\def\Xend{{Xend}\xspace}
-\def\xend{{xend}\xspace}
-
-\latexhtml{\renewcommand{\path}[1]{{\small {\tt #1}}}}{\renewcommand{\path}[1]{{\tt #1}}}
-
-
-\begin{document}
-
-% TITLE PAGE
-\pagestyle{empty}
-\begin{center}
-\vspace*{\fill}
-\includegraphics{figs/xenlogo.eps}
-\vfill
-\vfill
-\vfill
-\begin{tabular}{l}
-{\Huge \bf Users' Manual} \\[4mm]
-{\huge Xen v3.3} \\[80mm]
-\end{tabular}
-\end{center}
-
-{\bf DISCLAIMER: This documentation is always under active development
-and as such there may be mistakes and omissions --- watch out for
-these and please report any you find to the developers' mailing list,
-xen-devel@lists.xensource.com. The latest version is always available
-on-line. Contributions of material, suggestions and corrections are
-welcome.}
-
-\vfill
-\clearpage
-
-
-% COPYRIGHT NOTICE
-\pagestyle{empty}
-
-\vspace*{\fill}
-
-Xen is Copyright \copyright  2002-2008, Citrix Systems, Inc., University of Cambridge, UK, XenSource Inc., IBM Corp., Hewlett-Packard Co., Intel Corp., AMD Inc., and others.  All rights reserved.
-
-Xen is an open-source project.  Most portions of Xen are licensed for copying
-under the terms of the GNU General Public License, version 2.  Other portions
-are licensed under the terms of the GNU Lesser General Public License, the
-Zope Public License 2.0, or under ``BSD-style'' licenses.  Please refer to the
-COPYING file for details.
-
-Xen includes software by Christopher Clark.  This software is covered by the
-following licence:
-
-\begin{quote}
-Copyright (c) 2002, Christopher Clark.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-\begin{itemize}
-\item Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-
-\item 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.
-
-\item Neither the name of the original author; nor the names of any
-contributors may be used to endorse or promote products derived from this
-software without specific prior written permission.
-\end{itemize}
-
-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.
-\end{quote}
-
-\cleardoublepage
-
-
-% TABLE OF CONTENTS
-\pagestyle{plain}
-\pagenumbering{roman}
-{ \parskip 0pt plus 1pt
-  \tableofcontents }
-\cleardoublepage
-
-
-% PREPARE FOR MAIN TEXT
-\pagenumbering{arabic}
-\raggedbottom
-\widowpenalty=10000
-\clubpenalty=10000
-\parindent=0pt
-\parskip=5pt
-\renewcommand{\topfraction}{.8}
-\renewcommand{\bottomfraction}{.8}
-\renewcommand{\textfraction}{.2}
-\renewcommand{\floatpagefraction}{.8}
-\setstretch{1.1}
-
-
-%% Chapter Introduction moved to introduction.tex
-\chapter{Introduction}
-
-
-Xen is an open-source \emph{para-virtualizing} virtual machine monitor
-(VMM), or ``hypervisor'', for a variety of processor architectures including x86. Xen can securely execute multiple virtual machines on a single physical system with near native performance.  Xen facilitates enterprise-grade functionality, including:
-
-\begin{itemize}
-\item Virtual machines with performance close to native hardware.
-\item Live migration of running virtual machines between physical hosts.
-\item Up to 32\footnote{IA64 supports up to 64 virtual CPUs per guest virtual machine} virtual CPUs per guest virtual machine, with VCPU hotplug.
-\item x86/32 with PAE, x86/64, and IA64 platform support.
-\item Intel and AMD Virtualization Technology for unmodified guest operating systems (including Microsoft Windows).
-\item Excellent hardware support (supports almost all Linux device
-  drivers). 
-\end{itemize}
-
-
-\section{Usage Scenarios}
-
-Usage scenarios for Xen include:
-
-\begin{description}
-\item [Server Consolidation.] Move multiple servers onto a single
-  physical host with performance and fault isolation provided at the
-  virtual machine boundaries.
-\item [Hardware Independence.] Allow legacy applications and operating 
-  systems to exploit new hardware.
-\item [Multiple OS configurations.] Run multiple operating systems
-  simultaneously, for development or testing purposes.
-\item [Kernel Development.] Test and debug kernel modifications in a
-  sand-boxed virtual machine --- no need for a separate test machine.
-\item [Cluster Computing.] Management at VM granularity provides more
-  flexibility than separately managing each physical host, but better
-  control and isolation than single-system image solutions,
-  particularly by using live migration for load balancing.
-\item [Hardware support for custom OSes.] Allow development of new
-  OSes while benefiting from the wide-ranging hardware support of
-  existing OSes such as Linux.
-\end{description}
-
-
-\section{Operating System Support}
-
-Para-virtualization permits very high performance virtualization, even
-on architectures like x86 that are traditionally very hard to
-virtualize.
-
-This approach requires operating systems to be \emph{ported} to run on
-Xen. Porting an OS to run on Xen is similar to supporting a new
-hardware platform, however the process is simplified because the
-para-virtual machine architecture is very similar to the underlying
-native hardware. Even though operating system kernels must explicitly
-support Xen, a key feature is that user space applications and
-libraries \emph{do not} require modification.
-
-With hardware CPU virtualization as provided by Intel VT and AMD
-SVM technology, the ability to run an unmodified guest OS kernel
-is available.  No porting of the OS is required, although some
-additional driver support is necessary within Xen itself.  Unlike
-traditional full virtualization hypervisors, which suffer a tremendous
-performance overhead, the combination of Xen and VT or Xen and
-Pacifica technology complement one another to offer superb performance
-for para-virtualized guest operating systems and full support for
-unmodified guests running natively on the processor.
-
-Paravirtualized Xen support is available for increasingly many
-operating systems: currently, mature Linux support is available and
-included in the standard distribution.  Other OS ports, including
-NetBSD, FreeBSD and Solaris are also complete. 
-
-
-\section{Hardware Support}
-
-Xen currently runs on the IA64 and x86 architectures. Multiprocessor
-machines are supported, and there is support for HyperThreading (SMT).
-
-The default 32-bit Xen requires processor support for Physical
-Addressing Extensions (PAE), which enables the hypervisor to address
-up to 16GB of physical memory. Xen also supports x86/64 platforms
-such as Intel EM64T and AMD Opteron which can currently address up to
-1TB of physical memory.
-
-Xen offloads most of the hardware support issues to the guest OS
-running in the \emph{Domain~0} management virtual machine. Xen itself
-contains only the code required to detect and start secondary
-processors, set up interrupt routing, and perform PCI bus
-enumeration. Device drivers run within a privileged guest OS rather
-than within Xen itself. This approach provides compatibility with the
-majority of device hardware supported by Linux. The default XenLinux
-build contains support for most server-class network and disk
-hardware, but you can add support for other hardware by configuring
-your XenLinux kernel in the normal way.
-
-
-\section{Structure of a Xen-Based System}
-
-A Xen system has multiple layers, the lowest and most privileged of
-which is Xen itself.
-
-Xen may host multiple \emph{guest} operating systems, each of which is
-executed within a secure virtual machine. In Xen terminology, a
-\emph{domain}. Domains are scheduled by Xen to make effective use of the
-available physical CPUs. Each guest OS manages its own applications.
-This management includes the responsibility of scheduling each
-application within the time allotted to the VM by Xen.
-
-The first domain, \emph{domain~0}, is created automatically when the
-system boots and has special management privileges. Domain~0 builds
-other domains and manages their virtual devices. It also performs
-administrative tasks such as suspending, resuming and migrating other
-virtual machines.
-
-Within domain~0, a process called \emph{xend} runs to manage the system.
-\Xend\ is responsible for managing virtual machines and providing access
-to their consoles. Commands are issued to \xend\ over an HTTP interface,
-via a command-line tool.
-
-
-\section{History}
-
-Xen was originally developed by the Systems Research Group at the
-University of Cambridge Computer Laboratory as part of the XenoServers
-project, funded by the UK-EPSRC\@.
-
-XenoServers aim to provide a ``public infrastructure for global
-distributed computing''. Xen plays a key part in that, allowing one to
-efficiently partition a single machine to enable multiple independent
-clients to run their operating systems and applications in an
-environment. This environment provides protection, resource isolation
-and accounting. The project web page contains further information along
-with pointers to papers and technical reports:
-\path{http://www.cl.cam.ac.uk/xeno}
-
-Xen has grown into a fully-fledged project in its own right, enabling us
-to investigate interesting research issues regarding the best techniques
-for virtualizing resources such as the CPU, memory, disk and network.
-Project contributors now include Citrix, Intel, IBM, HP, AMD, Novell,
-RedHat, Sun, Fujitsu, and Samsung.
-
-Xen was first described in a paper presented at SOSP in
-2003\footnote{\tt
-  http://www.cl.cam.ac.uk/netos/papers/2003-xensosp.pdf}, and the first
-public release (1.0) was made that October. Since then, Xen has
-significantly matured and is now used in production scenarios on many
-sites.
-
-\section{What's New}
-
-Xen 3.3.0 offers:
-
-\begin{itemize}
-\item IO Emulation (stub domains) for HVM IO performance and scailability
-\item Replacement of Intel VT vmxassist by new 16b emulation code
-\item Improved VT-d device pass-through e.g. for graphics devices
-\item Enhanced C and P state power management
-\item Exploitation of multi-queue support on modern NICs
-\item Removal of domain lock for improved PV guest scalability
-\item 2MB page support for HVM and PV guests
-\item CPU Portability
-\end{itemize}
-
-Xen 3.3 delivers the capabilities needed by enterprise customers and gives computing industry leaders a solid, secure platform to build upon for their virtualization solutions. This latest release establishes Xen as the definitive open source solution for virtualization.
-
-
-
-\part{Installation}
-
-%% Chapter Basic Installation
-\chapter{Basic Installation}
-
-The Xen distribution includes three main components: Xen itself, ports
-of Linux and NetBSD to run on Xen, and the userspace tools required to
-manage a Xen-based system. This chapter describes how to install the
-Xen~3.3 distribution from source. Alternatively, there may be pre-built
-packages available as part of your operating system distribution.
-
-
-\section{Prerequisites}
-\label{sec:prerequisites}
-
-The following is a full list of prerequisites. Items marked `$\dag$' are
-required by the \xend\ control tools, and hence required if you want to
-run more than one virtual machine; items marked `$*$' are only required
-if you wish to build from source.
-\begin{itemize}
-\item A working Linux distribution using the GRUB bootloader and running
-  on a P6-class or newer CPU\@.
-\item [$\dag$] The \path{iproute2} package.
-\item [$\dag$] The Linux bridge-utils\footnote{Available from {\tt
-      http://bridge.sourceforge.net}} (e.g., \path{/sbin/brctl})
-\item [$\dag$] The Linux hotplug system\footnote{Available from {\tt
-      http://linux-hotplug.sourceforge.net/}} (e.g.,
-      \path{/sbin/hotplug} and related scripts).  On newer distributions,
-      this is included alongside the Linux udev system\footnote{See {\tt
-      http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html/}}.
-\item [$*$] Build tools (gcc v3.2.x or v3.3.x, binutils, GNU make).
-\item [$*$] Development installation of zlib (e.g.,\ zlib-dev).
-\item [$*$] Development installation of Python v2.2 or later (e.g.,\
-  python-dev).
-\item [$*$] \LaTeX\ and transfig are required to build the
-  documentation.
-\end{itemize}
-
-Once you have satisfied these prerequisites, you can now install either
-a binary or source distribution of Xen.
-
-\section{Installing from Binary Tarball}
-
-Pre-built tarballs are available for download from the XenSource downloads
-page:
-\begin{quote} {\tt http://www.xensource.com/downloads/}
-\end{quote}
-
-Once you've downloaded the tarball, simply unpack and install:
-\begin{verbatim}
-# tar zxvf xen-3.0-install.tgz
-# cd xen-3.0-install
-# sh ./install.sh
-\end{verbatim}
-
-Once you've installed the binaries you need to configure your system as
-described in Section~\ref{s:configure}.
-
-\section{Installing from RPMs}
-Pre-built RPMs are available for download from the XenSource downloads
-page:
-\begin{quote} {\tt http://www.xensource.com/downloads/}
-\end{quote}
-
-Once you've downloaded the RPMs, you typically install them via the 
-RPM commands: 
-
-\verb|# rpm -iv rpmname| 
-
-See the instructions and the Release Notes for each RPM set referenced at:
-  \begin{quote}
-    {\tt http://www.xensource.com/downloads/}.
-  \end{quote}
- 
-\section{Installing from Source}
-
-This section describes how to obtain, build and install Xen from source.
-
-\subsection{Obtaining the Source}
-
-The Xen source tree is available as either a compressed source tarball
-or as a clone of our master Mercurial repository.
-
-\begin{description}
-\item[Obtaining the Source Tarball]\mbox{} \\
-  Stable versions and daily snapshots of the Xen source tree are
-  available from the Xen download page:
-  \begin{quote} {\tt \tt http://www.xensource.com/downloads/}
-  \end{quote}
-\item[Obtaining the source via Mercurial]\mbox{} \\
-  The source tree may also be obtained via the public Mercurial
-  repository at:
-  \begin{quote}{\tt http://xenbits.xensource.com}
-  \end{quote} See the instructions and the Getting Started Guide
-  referenced at:
-  \begin{quote}
-    {\tt http://www.xensource.com/downloads/}
-  \end{quote}
-\end{description}
-
-% \section{The distribution}
-%
-% The Xen source code repository is structured as follows:
-%
-% \begin{description}
-% \item[\path{tools/}] Xen node controller daemon (Xend), command line
-%   tools, control libraries
-% \item[\path{xen/}] The Xen VMM.
-% \item[\path{buildconfigs/}] Build configuration files
-% \item[\path{linux-*-xen-sparse/}] Xen support for Linux.
-% \item[\path{patches/}] Experimental patches for Linux.
-% \item[\path{docs/}] Various documentation files for users and
-%   developers.
-% \item[\path{extras/}] Bonus extras.
-% \end{description}
-
-\subsection{Building from Source}
-
-The top-level Xen Makefile includes a target ``world'' that will do the
-following:
-
-\begin{itemize}
-\item Build Xen.
-\item Build the control tools, including \xend.
-\item Download (if necessary) and unpack the Linux 2.6 source code, and
-  patch it for use with Xen.
-\item Build a Linux kernel to use in domain~0 and a smaller unprivileged
-  kernel, which can be used for unprivileged virtual machines.
-\end{itemize}
-
-After the build has completed you should have a top-level directory
-called \path{dist/} in which all resulting targets will be placed. Of
-particular interest are the two XenLinux kernel images, one with a
-``-xen0'' extension which contains hardware device drivers and drivers
-for Xen's virtual devices, and one with a ``-xenU'' extension that
-just contains the virtual ones. These are found in
-\path{dist/install/boot/} along with the image for Xen itself and the
-configuration files used during the build.
-
-%The NetBSD port can be built using:
-%\begin{quote}
-%\begin{verbatim}
-%# make netbsd20
-%\end{verbatim}\end{quote}
-%NetBSD port is built using a snapshot of the netbsd-2-0 cvs branch.
-%The snapshot is downloaded as part of the build process if it is not
-%yet present in the \path{NETBSD\_SRC\_PATH} search path.  The build
-%process also downloads a toolchain which includes all of the tools
-%necessary to build the NetBSD kernel under Linux.
-
-To customize the set of kernels built you need to edit the top-level
-Makefile. Look for the line:
-\begin{quote}
-\begin{verbatim}
-KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
-\end{verbatim}
-\end{quote}
-
-You can edit this line to include any set of operating system kernels
-which have configurations in the top-level \path{buildconfigs/}
-directory.
-
-%% Inspect the Makefile if you want to see what goes on during a
-%% build.  Building Xen and the tools is straightforward, but XenLinux
-%% is more complicated.  The makefile needs a `pristine' Linux kernel
-%% tree to which it will then add the Xen architecture files.  You can
-%% tell the makefile the location of the appropriate Linux compressed
-%% tar file by
-%% setting the LINUX\_SRC environment variable, e.g. \\
-%% \verb!# LINUX_SRC=/tmp/linux-2.6.11.tar.bz2 make world! \\ or by
-%% placing the tar file somewhere in the search path of {\tt
-%%   LINUX\_SRC\_PATH} which defaults to `{\tt .:..}'.  If the
-%% makefile can't find a suitable kernel tar file it attempts to
-%% download it from kernel.org (this won't work if you're behind a
-%% firewall).
-
-%% After untaring the pristine kernel tree, the makefile uses the {\tt
-%%   mkbuildtree} script to add the Xen patches to the kernel.
-
-%% \framebox{\parbox{5in}{
-%%     {\bf Distro specific:} \\
-%%     {\it Gentoo} --- if not using udev (most installations,
-%%     currently), you'll need to enable devfs and devfs mount at boot
-%%     time in the xen0 config.  }}
-
-\subsection{Custom Kernels}
-
-% If you have an SMP machine you may wish to give the {\tt '-j4'}
-% argument to make to get a parallel build.
-
-If you wish to build a customized XenLinux kernel (e.g.\ to support
-additional devices or enable distribution-required features), you can
-use the standard Linux configuration mechanisms, specifying that the
-architecture being built for is \path{xen}, e.g:
-\begin{quote}
-\begin{verbatim}
-# cd linux-2.6.12-xen0
-# make ARCH=xen xconfig
-# cd ..
-# make
-\end{verbatim}
-\end{quote}
-
-You can also copy an existing Linux configuration (\path{.config}) into
-e.g.\ \path{linux-2.6.12-xen0} and execute:
-\begin{quote}
-\begin{verbatim}
-# make ARCH=xen oldconfig
-\end{verbatim}
-\end{quote}
-
-You may be prompted with some Xen-specific options. We advise accepting
-the defaults for these options.
-
-Note that the only difference between the two types of Linux kernels
-that are built is the configuration file used for each. The ``U''
-suffixed (unprivileged) versions don't contain any of the physical
-hardware device drivers, leading to a 30\% reduction in size; hence you
-may prefer these for your non-privileged domains. The ``0'' suffixed
-privileged versions can be used to boot the system, as well as in driver
-domains and unprivileged domains.
-
-\subsection{Installing Generated Binaries}
-
-The files produced by the build process are stored under the
-\path{dist/install/} directory. To install them in their default
-locations, do:
-\begin{quote}
-\begin{verbatim}
-# make install
-\end{verbatim}
-\end{quote}
-
-Alternatively, users with special installation requirements may wish to
-install them manually by copying the files to their appropriate
-destinations.
-
-%% Files in \path{install/boot/} include:
-%% \begin{itemize}
-%% \item \path{install/boot/xen-3.0.gz} Link to the Xen 'kernel'
-%% \item \path{install/boot/vmlinuz-2.6-xen0} Link to domain 0
-%%   XenLinux kernel
-%% \item \path{install/boot/vmlinuz-2.6-xenU} Link to unprivileged
-%%   XenLinux kernel
-%% \end{itemize}
-
-The \path{dist/install/boot} directory will also contain the config
-files used for building the XenLinux kernels, and also versions of Xen
-and XenLinux kernels that contain debug symbols such as
-(\path{xen-syms-3.0.0} and \path{vmlinux-syms-2.6.12.6-xen0}) which are
-essential for interpreting crash dumps. Retain these files as the
-developers may wish to see them if you post on the mailing list.
-
-
-\section{Configuration}
-\label{s:configure}
-
-Once you have built and installed the Xen distribution, it is simple to
-prepare the machine for booting and running Xen.
-
-\subsection{GRUB Configuration}
-
-An entry should be added to \path{grub.conf} (often found under
-\path{/boot/} or \path{/boot/grub/}) to allow Xen / XenLinux to boot.
-This file is sometimes called \path{menu.lst}, depending on your
-distribution. The entry should look something like the following:
-
-%% KMSelf Thu Dec  1 19:06:13 PST 2005 262144 is useful for RHEL/RH and
-%% related Dom0s.
-{\small
-\begin{verbatim}
-title Xen 3.0 / XenLinux 2.6
-  kernel /boot/xen-3.0.gz dom0_mem=262144
-  module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro console=tty0
-\end{verbatim}
-}
-
-The kernel line tells GRUB where to find Xen itself and what boot
-parameters should be passed to it (in this case, setting the domain~0
-memory allocation in kilobytes and the settings for the serial port).
-For more details on the various Xen boot parameters see
-Section~\ref{s:xboot}.
-
-The module line of the configuration describes the location of the
-XenLinux kernel that Xen should start and the parameters that should be
-passed to it. These are standard Linux parameters, identifying the root
-device and specifying it be initially mounted read only and instructing
-that console output be sent to the screen. Some distributions such as
-SuSE do not require the \path{ro} parameter.
-
-%% \framebox{\parbox{5in}{
-%%     {\bf Distro specific:} \\
-%%     {\it SuSE} --- Omit the {\tt ro} option from the XenLinux
-%%     kernel command line, since the partition won't be remounted rw
-%%     during boot.  }}
-
-To use an initrd, add another \path{module} line to the configuration,
-like: {\small
-\begin{verbatim}
-  module /boot/my_initrd.gz
-\end{verbatim}
-}
-
-%% KMSelf Thu Dec  1 19:05:30 PST 2005 Other configs as an appendix?
-
-When installing a new kernel, it is recommended that you do not delete
-existing menu options from \path{menu.lst}, as you may wish to boot your
-old Linux kernel in future, particularly if you have problems.
-
-\subsection{Serial Console (optional)}
-
-Serial console access allows you to manage, monitor, and interact with
-your system over a serial console.  This can allow access from another
-nearby system via a null-modem (``LapLink'') cable or remotely via a serial
-concentrator.
-
-You system's BIOS, bootloader (GRUB), Xen, Linux, and login access must
-each be individually configured for serial console access.  It is
-\emph{not} strictly necessary to have each component fully functional,
-but it can be quite useful.
-
-For general information on serial console configuration under Linux,
-refer to the ``Remote Serial Console HOWTO'' at The Linux Documentation
-Project: \url{http://www.tldp.org} 
-
-\subsubsection{Serial Console BIOS configuration}
-
-Enabling system serial console output neither enables nor disables
-serial capabilities in GRUB, Xen, or Linux, but may make remote
-management of your system more convenient by displaying POST and other
-boot messages over serial port and allowing remote BIOS configuration.
-
-Refer to your hardware vendor's documentation for capabilities and
-procedures to enable BIOS serial redirection.
-
-
-\subsubsection{Serial Console GRUB configuration}
-
-Enabling GRUB serial console output neither enables nor disables Xen or
-Linux serial capabilities, but may made remote management of your system
-more convenient by displaying GRUB prompts, menus, and actions over
-serial port and allowing remote GRUB management.
-
-Adding the following two lines to your GRUB configuration file,
-typically either \path{/boot/grub/menu.lst} or \path{/boot/grub/grub.conf}
-depending on your distro, will enable GRUB serial output.
-
-\begin{quote} 
-{\small \begin{verbatim}
-  serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-  terminal --timeout=10 serial console
-\end{verbatim}}
-\end{quote}
-
-Note that when both the serial port and the local monitor and keyboard
-are enabled, the text ``\emph{Press any key to continue}'' will appear
-at both.  Pressing a key on one device will cause GRUB to display to
-that device.  The other device will see no output.  If no key is
-pressed before the timeout period expires, the system will boot to the
-default GRUB boot entry.
-
-Please refer to the GRUB documentation for further information.
-
-
-\subsubsection{Serial Console Xen configuration}
-
-Enabling Xen serial console output neither enables nor disables Linux
-kernel output or logging in to Linux over serial port.  It does however
-allow you to monitor and log the Xen boot process via serial console and
-can be very useful in debugging.
-
-%% kernel /boot/xen-2.0.gz dom0_mem=131072 console=com1,vga com1=115200,8n1
-%% module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro
-
-In order to configure Xen serial console output, it is necessary to
-add a boot option to your GRUB config; e.g.\ replace the previous
-example kernel line with:
-\begin{quote} {\small \begin{verbatim}
-   kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1 console=com1,vga
-\end{verbatim}}
-\end{quote}
-
-This configures Xen to output on COM1 at 115,200 baud, 8 data bits, no
-parity and 1 stop bit. Modify these parameters for your environment.
-See Section~\ref{s:xboot} for an explanation of all boot parameters.
-
-One can also configure XenLinux to share the serial console; to achieve
-this append ``\path{console=ttyS0}'' to your module line.
-
-
-\subsubsection{Serial Console Linux configuration}
-
-Enabling Linux serial console output at boot neither enables nor
-disables logging in to Linux over serial port.  It does however allow
-you to monitor and log the Linux boot process via serial console and can be
-very useful in debugging.
-
-To enable Linux output at boot time, add the parameter
-\path{console=ttyS0} (or ttyS1, ttyS2, etc.) to your kernel GRUB line.
-Under Xen, this might be:
-\begin{quote} 
-{\footnotesize \begin{verbatim}
-  module /vmlinuz-2.6-xen0 ro root=/dev/VolGroup00/LogVol00 \
-  console=ttyS0, 115200
-\end{verbatim}}
-\end{quote}
-to enable output over ttyS0 at 115200 baud.
-
-
-
-\subsubsection{Serial Console Login configuration}
-
-Logging in to Linux via serial console, under Xen or otherwise, requires
-specifying a login prompt be started on the serial port.  To permit root
-logins over serial console, the serial port must be added to
-\path{/etc/securetty}.
-
-\newpage
-To automatically start a login prompt over the serial port, 
-add the line: \begin{quote} {\small {\tt c:2345:respawn:/sbin/mingetty
-ttyS0}} \end{quote} to \path{/etc/inittab}.   Run \path{init q} to force
-a reload of your inttab and start getty.
-
-To enable root logins, add \path{ttyS0} to \path{/etc/securetty} if not
-already present.
-
-Your distribution may use an alternate getty; options include getty,
-mgetty and agetty.  Consult your distribution's documentation
-for further information.
-
-
-\subsection{TLS Libraries}
-
-Users of the XenLinux 2.6 kernel should disable Thread Local Storage
-(TLS) (e.g.\ by doing a \path{mv /lib/tls /lib/tls.disabled}) before
-attempting to boot a XenLinux kernel\footnote{If you boot without first
-  disabling TLS, you will get a warning message during the boot process.
-  In this case, simply perform the rename after the machine is up and
-  then run \path{/sbin/ldconfig} to make it take effect.}. You can
-always reenable TLS by restoring the directory to its original location
-(i.e.\ \path{mv /lib/tls.disabled /lib/tls}).
-
-The reason for this is that the current TLS implementation uses
-segmentation in a way that is not permissible under Xen. If TLS is not
-disabled, an emulation mode is used within Xen which reduces performance
-substantially. To ensure full performance you should install a 
-`Xen-friendly' (nosegneg) version of the library. 
-
-
-\section{Booting Xen}
-
-It should now be possible to restart the system and use Xen. Reboot and
-choose the new Xen option when the Grub screen appears.
-
-What follows should look much like a conventional Linux boot. The first
-portion of the output comes from Xen itself, supplying low level
-information about itself and the underlying hardware. The last portion
-of the output comes from XenLinux.
-
-You may see some error messages during the XenLinux boot. These are not
-necessarily anything to worry about---they may result from kernel
-configuration differences between your XenLinux kernel and the one you
-usually use.
-
-When the boot completes, you should be able to log into your system as
-usual. If you are unable to log in, you should still be able to reboot
-with your normal Linux kernel by selecting it at the GRUB prompt.
-
-
-% Booting Xen
-\chapter{Booting a Xen System}
-
-Booting the system into Xen will bring you up into the privileged
-management domain, Domain0. At that point you are ready to create
-guest domains and ``boot'' them using the \texttt{xm create} command.
-
-\section{Booting Domain0}
-
-After installation and configuration is complete, reboot the system
-and and choose the new Xen option when the Grub screen appears.
-
-What follows should look much like a conventional Linux boot.  The
-first portion of the output comes from Xen itself, supplying low level
-information about itself and the underlying hardware.  The last
-portion of the output comes from XenLinux.
-
-%% KMSelf Wed Nov 30 18:09:37 PST 2005:  We should specify what these are.
-
-When the boot completes, you should be able to log into your system as
-usual.  If you are unable to log in, you should still be able to
-reboot with your normal Linux kernel by selecting it at the GRUB prompt.
-
-The first step in creating a new domain is to prepare a root
-filesystem for it to boot.  Typically, this might be stored in a normal
-partition, an LVM or other volume manager partition, a disk file or on
-an NFS server.  A simple way to do this is simply to boot from your
-standard OS install CD and install the distribution into another
-partition on your hard drive.
-
-To start the \xend\ control daemon, type
-\begin{quote}
-  \verb!# xend start!
-\end{quote}
-
-If you wish the daemon to start automatically, see the instructions in
-Section~\ref{s:xend}. Once the daemon is running, you can use the
-\path{xm} tool to monitor and maintain the domains running on your
-system. This chapter provides only a brief tutorial. We provide full
-details of the \path{xm} tool in the next chapter.
-
-% \section{From the web interface}
-%
-% Boot the Xen machine and start Xensv (see Chapter~\ref{cha:xensv}
-% for more details) using the command: \\
-% \verb_# xensv start_ \\
-% This will also start Xend (see Chapter~\ref{cha:xend} for more
-% information).
-%
-% The domain management interface will then be available at {\tt
-%   http://your\_machine:8080/}.  This provides a user friendly wizard
-% for starting domains and functions for managing running domains.
-%
-% \section{From the command line}
-\section{Booting Guest Domains}
-
-\subsection{Creating a Domain Configuration File}
-
-Before you can start an additional domain, you must create a
-configuration file. We provide two example files which you can use as
-a starting point:
-\begin{itemize}
-\item \path{/etc/xen/xmexample1} is a simple template configuration
-  file for describing a single VM\@.
-\item \path{/etc/xen/xmexample2} file is a template description that
-  is intended to be reused for multiple virtual machines.  Setting the
-  value of the \path{vmid} variable on the \path{xm} command line
-  fills in parts of this template.
-\end{itemize}
-
-There are also a number of other examples which you may find useful.
-Copy one of these files and edit it as appropriate.  Typical values
-you may wish to edit include:
-
-\begin{quote}
-\begin{description}
-\item[kernel] Set this to the path of the kernel you compiled for use
-  with Xen (e.g.\ \path{kernel = ``/boot/vmlinuz-2.6-xenU''})
-\item[memory] Set this to the size of the domain's memory in megabytes
-  (e.g.\ \path{memory = 64})
-\item[disk] Set the first entry in this list to calculate the offset
-  of the domain's root partition, based on the domain ID\@.  Set the
-  second to the location of \path{/usr} if you are sharing it between
-  domains (e.g.\ \path{disk = ['phy:your\_hard\_drive\%d,sda1,w' \%
-    (base\_partition\_number + vmid),
-    'phy:your\_usr\_partition,sda6,r' ]}
-\item[dhcp] Uncomment the dhcp variable, so that the domain will
-  receive its IP address from a DHCP server (e.g.\ \path{dhcp=``dhcp''})
-\end{description}
-\end{quote}
-
-You may also want to edit the {\bf vif} variable in order to choose
-the MAC address of the virtual ethernet interface yourself.  For
-example:
-
-\begin{quote}
-\verb_vif = ['mac=00:16:3E:F6:BB:B3']_
-\end{quote}
-If you do not set this variable, \xend\ will automatically generate a
-random MAC address from the range 00:16:3E:xx:xx:xx, assigned by IEEE to
-XenSource as an OUI (organizationally unique identifier).  XenSource
-Inc. gives permission for anyone to use addresses randomly allocated
-from this range for use by their Xen domains.
-
-For a list of IEEE OUI assignments, see 
-\url{http://standards.ieee.org/regauth/oui/oui.txt} 
-
-
-\subsection{Booting the Guest Domain}
-
-The \path{xm} tool provides a variety of commands for managing
-domains.  Use the \path{create} command to start new domains. Assuming
-you've created a configuration file \path{myvmconf} based around
-\path{/etc/xen/xmexample2}, to start a domain with virtual machine
-ID~1 you should type:
-
-\begin{quote}
-\begin{verbatim}
-# xm create -c myvmconf vmid=1
-\end{verbatim}
-\end{quote}
-
-The \path{-c} switch causes \path{xm} to turn into the domain's
-console after creation.  The \path{vmid=1} sets the \path{vmid}
-variable used in the \path{myvmconf} file.
-
-You should see the console boot messages from the new domain appearing
-in the terminal in which you typed the command, culminating in a login
-prompt.
-
-
-\section{Starting / Stopping Domains Automatically}
-
-It is possible to have certain domains start automatically at boot
-time and to have dom0 wait for all running domains to shutdown before
-it shuts down the system.
-
-To specify a domain is to start at boot-time, place its configuration
-file (or a link to it) under \path{/etc/xen/auto/}.
-
-A Sys-V style init script for Red Hat and LSB-compliant systems is
-provided and will be automatically copied to \path{/etc/init.d/}
-during install.  You can then enable it in the appropriate way for
-your distribution.
-
-For instance, on Red Hat:
-
-\begin{quote}
-  \verb_# chkconfig --add xendomains_
-\end{quote}
-
-By default, this will start the boot-time domains in runlevels 3, 4
-and 5.
-
-You can also use the \path{service} command to run this script
-manually, e.g:
-
-\begin{quote}
-  \verb_# service xendomains start_
-
-  Starts all the domains with config files under /etc/xen/auto/.
-\end{quote}
-
-\begin{quote}
-  \verb_# service xendomains stop_
-
-  Shuts down all running Xen domains.
-\end{quote}
-
-
-
-\part{Configuration and Management}
-
-%% Chapter Domain Management Tools and Daemons
-\chapter{Domain Management Tools}
-
-This chapter summarizes the management software and tools available.
-
-
-\section{\Xend\ }
-\label{s:xend}
-
-
-The \Xend\ node control daemon performs system management functions
-related to virtual machines. It forms a central point of control of
-virtualized resources, and must be running in order to start and manage
-virtual machines. \Xend\ must be run as root because it needs access to
-privileged system management functions.
-
-An initialization script named \texttt{/etc/init.d/xend} is provided to
-start \Xend\ at boot time. Use the tool appropriate (i.e. chkconfig) for
-your Linux distribution to specify the runlevels at which this script
-should be executed, or manually create symbolic links in the correct
-runlevel directories.
-
-\Xend\ can be started on the command line as well, and supports the
-following set of parameters:
-
-\begin{tabular}{ll}
-  \verb!# xend start! & start \xend, if not already running \\
-  \verb!# xend stop!  & stop \xend\ if already running       \\
-  \verb!# xend restart! & restart \xend\ if running, otherwise start it \\
-  % \verb!# xend trace_start! & start \xend, with very detailed debug logging \\
-  \verb!# xend status! & indicates \xend\ status by its return code
-\end{tabular}
-
-A SysV init script called {\tt xend} is provided to start \xend\ at
-boot time. {\tt make install} installs this script in
-\path{/etc/init.d}. To enable it, you have to make symbolic links in
-the appropriate runlevel directories or use the {\tt chkconfig} tool,
-where available.  Once \xend\ is running, administration can be done
-using the \texttt{xm} tool.
-
-\subsection{Logging}
-
-As \xend\ runs, events will be logged to \path{/var/log/xen/xend.log} and
-(less frequently) to \path{/var/log/xen/xend-debug.log}. These, along with
-the standard syslog files, are useful when troubleshooting problems.
-
-\subsection{Configuring \Xend\ }
-
-\Xend\ is written in Python. At startup, it reads its configuration
-information from the file \path{/etc/xen/xend-config.sxp}. The Xen
-installation places an example \texttt{xend-config.sxp} file in the
-\texttt{/etc/xen} subdirectory which should work for most installations.
-
-See the example configuration file \texttt{xend-debug.sxp} and the
-section 5 man page \texttt{xend-config.sxp} for a full list of
-parameters and more detailed information. Some of the most important
-parameters are discussed below.
-
-An HTTP interface and a Unix domain socket API are available to
-communicate with \Xend. This allows remote users to pass commands to the
-daemon. By default, \Xend does not start an HTTP server. It does start a
-Unix domain socket management server, as the low level utility
-\texttt{xm} requires it. For support of cross-machine migration, \Xend\
-can start a relocation server. This support is not enabled by default
-for security reasons.
-
-Note: the example \texttt{xend} configuration file modifies the defaults and
-starts up \Xend\ as an HTTP server as well as a relocation server.
-
-From the file:
-
-\begin{verbatim}
-#(xend-http-server no)
-(xend-http-server yes)
-#(xend-unix-server yes)
-#(xend-relocation-server no)
-(xend-relocation-server yes)
-\end{verbatim}
-
-Comment or uncomment lines in that file to disable or enable features
-that you require.
-
-Connections from remote hosts are disabled by default:
-
-\begin{verbatim}
-# Address xend should listen on for HTTP connections, if xend-http-server is
-# set.
-# Specifying 'localhost' prevents remote connections.
-# Specifying the empty string '' (the default) allows all connections.
-#(xend-address '')
-(xend-address localhost)
-\end{verbatim}
-
-It is recommended that if migration support is not needed, the
-\texttt{xend-relocation-server} parameter value be changed to
-``\texttt{no}'' or commented out.
-
-\section{Xm}
-\label{s:xm}
-
-The xm tool is the primary tool for managing Xen from the console. The
-general format of an xm command line is:
-
-\begin{verbatim}
-# xm command [switches] [arguments] [variables]
-\end{verbatim}
-
-The available \emph{switches} and \emph{arguments} are dependent on the
-\emph{command} chosen. The \emph{variables} may be set using
-declarations of the form {\tt variable=value} and command line
-declarations override any of the values in the configuration file being
-used, including the standard variables described above and any custom
-variables (for instance, the \path{xmdefconfig} file uses a {\tt vmid}
-variable).
-
-For online help for the commands available, type:
-
-\begin{quote}
-\begin{verbatim}
-# xm help
-\end{verbatim}
-\end{quote}
-
-This will list the most commonly used commands.  The full list can be obtained
-using \verb_xm help --long_.  You can also type \path{xm help $<$command$>$}
-for more information on a given command.
-
-\subsection{Basic Management Commands}
-
-One useful command is \verb_# xm list_ which lists all domains running in rows
-of the following format:
-\begin{center} {\tt name domid memory vcpus state cputime}
-\end{center}
-
-The meaning of each field is as follows: 
-\begin{quote}
-  \begin{description}
-  \item[name] The descriptive name of the virtual machine.
-  \item[domid] The number of the domain ID this virtual machine is
-    running in.
-  \item[memory] Memory size in megabytes.
-  \item[vcpus] The number of virtual CPUs this domain has.
-  \item[state] Domain state consists of 5 fields:
-    \begin{description}
-    \item[r] running
-    \item[b] blocked
-    \item[p] paused
-    \item[s] shutdown
-    \item[c] crashed
-    \end{description}
-  \item[cputime] How much CPU time (in seconds) the domain has used so
-    far.
-  \end{description}
-\end{quote}
-
-The \path{xm list} command also supports a long output format when the
-\path{-l} switch is used.  This outputs the full details of the
-running domains in \xend's SXP configuration format.
-
-If you want to know how long your domains have been running for, then 
-you can use the \verb_# xm uptime_ command.
-
-
-You can get access to the console of a particular domain using 
-the \verb_# xm console_ command  (e.g.\ \verb_# xm console myVM_). 
-
-\subsection{Domain Scheduling Management Commands}
-
-The credit CPU scheduler automatically load balances guest VCPUs
-across all available physical CPUs on an SMP host. The user need
-not manually pin VCPUs to load balance the system. However, she
-can restrict which CPUs a particular VCPU may run on using
-the \path{xm vcpu-pin} command.
-
-Each guest domain is assigned a \path{weight} and a \path{cap}.
-
-A domain with a weight of 512 will get twice as much CPU as a
-domain with a weight of 256 on a contended host. Legal weights
-range from 1 to 65535 and the default is 256.
-
-The cap optionally fixes the maximum amount of CPU a guest will
-be able to consume, even if the host system has idle CPU cycles.
-The cap is expressed in percentage of one physical CPU: 100 is
-1 physical CPU, 50 is half a CPU, 400 is 4 CPUs, etc... The
-default, 0, means there is no upper cap.
-
-When you are running with the credit scheduler, you can check and
-modify your domains' weights and caps using the \path{xm sched-credit}
-command:
-
-\begin{tabular}{ll}
-\verb!xm sched-credit -d <domain>! & lists weight and cap \\
-\verb!xm sched-credit -d <domain> -w <weight>! & sets the weight \\
-\verb!xm sched-credit -d <domain> -c <cap>! & sets the cap
-\end{tabular}
-
-
-
-%% Chapter Domain Configuration
-\chapter{Domain Configuration}
-\label{cha:config}
-
-The following contains the syntax of the domain configuration files
-and description of how to further specify networking, driver domain
-and general scheduling behavior.
-
-
-\section{Configuration Files}
-\label{s:cfiles}
-
-Xen configuration files contain the following standard variables.
-Unless otherwise stated, configuration items should be enclosed in
-quotes: see the configuration scripts in \path{/etc/xen/} 
-for concrete examples. 
-
-\begin{description}
-\item[kernel] Path to the kernel image.
-\item[ramdisk] Path to a ramdisk image (optional).
-  % \item[builder] The name of the domain build function (e.g.
-  %   {\tt'linux'} or {\tt'netbsd'}.
-\item[memory] Memory size in megabytes.
-\item[vcpus] The number of virtual CPUs. 
-\item[console] Port to export the domain console on (default 9600 +
-  domain ID).
-\item[vif] Network interface configuration.  This may simply contain
-an empty string for each desired interface, or may override various
-settings, e.g.\ 
-\begin{verbatim}
-vif = [ 'mac=00:16:3E:00:00:11, bridge=xen-br0',
-        'bridge=xen-br1' ]
-\end{verbatim}
-  to assign a MAC address and bridge to the first interface and assign
-  a different bridge to the second interface, leaving \xend\ to choose
-  the MAC address.  The settings that may be overridden in this way are
-  type, mac, bridge, ip, script, backend, and vifname.
-\item[disk] List of block devices to export to the domain e.g. 
-  \verb_disk = [ 'phy:hda1,sda1,r' ]_ 
-  exports physical device \path{/dev/hda1} to the domain as
-  \path{/dev/sda1} with read-only access. Exporting a disk read-write
-  which is currently mounted is dangerous -- if you are \emph{certain}
-  you wish to do this, you can specify \path{w!} as the mode.
-\item[dhcp] Set to {\tt `dhcp'} if you want to use DHCP to configure
-  networking.
-\item[netmask] Manually configured IP netmask.
-\item[gateway] Manually configured IP gateway.
-\item[hostname] Set the hostname for the virtual machine.
-\item[root] Specify the root device parameter on the kernel command
-  line.
-\item[nfs\_server] IP address for the NFS server (if any).
-\item[nfs\_root] Path of the root filesystem on the NFS server (if
-  any).
-\item[extra] Extra string to append to the kernel command line (if
-  any)
-\end{description}
-
-Additional fields are documented in the example configuration files 
-(e.g. to configure virtual TPM functionality). 
-
-For additional flexibility, it is also possible to include Python
-scripting commands in configuration files.  An example of this is the
-\path{xmexample2} file, which uses Python code to handle the
-\path{vmid} variable.
-
-
-%\part{Advanced Topics}
-
-
-\section{Network Configuration}
-
-For many users, the default installation should work ``out of the
-box''.  More complicated network setups, for instance with multiple
-Ethernet interfaces and/or existing bridging setups will require some
-special configuration.
-
-The purpose of this section is to describe the mechanisms provided by
-\xend\ to allow a flexible configuration for Xen's virtual networking.
-
-\subsection{Xen virtual network topology}
-
-Each domain network interface is connected to a virtual network
-interface in dom0 by a point to point link (effectively a ``virtual
-crossover cable'').  These devices are named {\tt
-  vif$<$domid$>$.$<$vifid$>$} (e.g.\ {\tt vif1.0} for the first
-interface in domain~1, {\tt vif3.1} for the second interface in
-domain~3).
-
-Traffic on these virtual interfaces is handled in domain~0 using
-standard Linux mechanisms for bridging, routing, rate limiting, etc.
-Xend calls on two shell scripts to perform initial configuration of
-the network and configuration of new virtual interfaces.  By default,
-these scripts configure a single bridge for all the virtual
-interfaces.  Arbitrary routing / bridging configurations can be
-configured by customizing the scripts, as described in the following
-section.
-
-\subsection{Xen networking scripts}
-
-Xen's virtual networking is configured by two shell scripts (by
-default \path{network-bridge} and \path{vif-bridge}).  These are called
-automatically by \xend\ when certain events occur, with arguments to
-the scripts providing further contextual information.  These scripts
-are found by default in \path{/etc/xen/scripts}.  The names and
-locations of the scripts can be configured in
-\path{/etc/xen/xend-config.sxp}.
-
-\begin{description}
-\item[network-bridge:] This script is called whenever \xend\ is started or
-  stopped to respectively initialize or tear down the Xen virtual
-  network. In the default configuration initialization creates the
-  bridge `xen-br0' and moves eth0 onto that bridge, modifying the
-  routing accordingly. When \xend\ exits, it deletes the Xen bridge
-  and removes eth0, restoring the normal IP and routing configuration.
-
-  %% In configurations where the bridge already exists, this script
-  %% could be replaced with a link to \path{/bin/true} (for instance).
-
-\item[vif-bridge:] This script is called for every domain virtual
-  interface and can configure firewalling rules and add the vif to the
-  appropriate bridge. By default, this adds and removes VIFs on the
-  default Xen bridge.
-\end{description}
-
-Other example scripts are available (\path{network-route} and
-\path{vif-route}, \path{network-nat} and \path{vif-nat}).
-For more complex network setups (e.g.\ where routing is required or
-integrate with existing bridges) these scripts may be replaced with
-customized variants for your site's preferred configuration.
-
-\section{Driver Domain Configuration}
-\label{s:ddconf}
-
-\subsection{PCI}
-\label{ss:pcidd}
-
-Individual PCI devices can be assigned to a given domain (a PCI driver domain)
-to allow that domain direct access to the PCI hardware.
-
-While PCI Driver Domains can increase the stability and security of a system
-by addressing a number of security concerns, there are some security issues
-that remain that you can read about in Section~\ref{s:ddsecurity}.
-
-\subsubsection{Compile-Time Setup}
-To use this functionality, ensure
-that the PCI Backend is compiled in to a privileged domain (e.g. domain 0)
-and that the domains which will be assigned PCI devices have the PCI Frontend
-compiled in. In XenLinux, the PCI Backend is available under the Xen
-configuration section while the PCI Frontend is under the
-architecture-specific "Bus Options" section. You may compile both the backend
-and the frontend into the same kernel; they will not affect each other.
-
-\subsubsection{PCI Backend Configuration - Binding at Boot}
-The PCI devices you wish to assign to unprivileged domains must be "hidden"
-from your backend domain (usually domain 0) so that it does not load a driver
-for them. Use the \path{pciback.hide} kernel parameter which is specified on
-the kernel command-line and is configurable through GRUB (see
-Section~\ref{s:configure}). Note that devices are not really hidden from the
-backend domain. The PCI Backend appears to the Linux kernel as a regular PCI
-device driver. The PCI Backend ensures that no other device driver loads
-for the devices by binding itself as the device driver for those devices.
-PCI devices are identified by hexadecimal slot/function numbers (on Linux,
-use \path{lspci} to determine slot/function numbers of your devices) and
-can be specified with or without the PCI domain: \\
-\centerline{  {\tt ({\em bus}:{\em slot}.{\em func})} example {\tt (02:1d.3)}} \\
-\centerline{  {\tt ({\em domain}:{\em bus}:{\em slot}.{\em func})} example {\tt (0000:02:1d.3)}} \\
-
-An example kernel command-line which hides two PCI devices might be: \\
-\centerline{ {\tt root=/dev/sda4 ro console=tty0 pciback.hide=(02:01.f)(0000:04:1d.0) } } \\
-
-\subsubsection{PCI Backend Configuration - Late Binding}
-PCI devices can also be bound to the PCI Backend after boot through the manual
-binding/unbinding facilities provided by the Linux kernel in sysfs (allowing
-for a Xen user to give PCI devices to driver domains that were not specified
-on the kernel command-line). There are several attributes with the PCI
-Backend's sysfs directory (\path{/sys/bus/pci/drivers/pciback}) that can be
-used to bind/unbind devices:
-
-\begin{description}
-\item[slots] lists all of the PCI slots that the PCI Backend will try to seize
-  (or "hide" from Domain 0). A PCI slot must appear in this list before it can
-  be bound to the PCI Backend through the \path{bind} attribute.
-\item[new\_slot] write the name of a slot here (in 0000:00:00.0 format) to
-  have the PCI Backend seize the device in this slot.
-\item[remove\_slot] write the name of a slot here (same format as
-  \path{new\_slot}) to have the PCI Backend no longer try to seize devices in
-  this slot. Note that this does not unbind the driver from a device it has
-  already seized.
-\item[bind] write the name of a slot here (in 0000:00:00.0 format) to have
-  the Linux kernel attempt to bind the device in that slot to the PCI Backend
-  driver.
-\item[unbind] write the name of a skit here (same format as \path{bind}) to have
-  the Linux kernel unbind the device from the PCI Backend. DO NOT unbind a
-  device while it is currently given to a PCI driver domain!
-\end{description}
-
-Some examples:
-
-Bind a device to the PCI Backend which is not bound to any other driver.
-\begin{verbatim}
-# # Add a new slot to the PCI Backend's list
-# echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/new_slot
-# # Now that the backend is watching for the slot, bind to it
-# echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/bind
-\end{verbatim}
-
-Unbind a device from its driver and bind to the PCI Backend.
-\begin{verbatim}
-# # Unbind a PCI network card from its network driver
-# echo -n 0000:05:02.0 > /sys/bus/pci/drivers/3c905/unbind
-# # And now bind it to the PCI Backend
-# echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/new_slot
-# echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/bind
-\end{verbatim}
-
-Note that the "-n" option in the example is important as it causes echo to not
-output a new-line.
-
-\subsubsection{PCI Backend Configuration - User-space Quirks}
-Quirky devices (such as the Broadcom Tigon 3) may need write access to their
-configuration space registers.  Xen can be instructed to allow specified PCI
-devices write access to specific configuration space registers.  The policy may
-be found in:
-
-\centerline{ \path{/etc/xen/xend-pci-quirks.sxp} }
-
-The policy file is heavily commented and is intended to provide enough
-documentation for developers to extend it.
-
-\subsubsection{PCI Backend Configuration - Permissive Flag}
-If the user-space quirks approach doesn't meet your needs you may want to enable
-the permissive flag for that device.  To do so, first get the PCI domain, bus,
-slot, and function information from dom0 via \path{lspci}.  Then augment the
-user-space policy for permissive devices.  The permissive policy can be found
-in:
-
-\centerline{ \path{/etc/xen/xend-pci-permissive.sxp} }
-
-Currently, the only way to reset the permissive flag is to unbind the device
-from the PCI Backend driver.
-
-\subsubsection{PCI Backend - Checking Status}
-There two important sysfs nodes that provide a mechanism to view specifics on
-quirks and permissive devices:
-\begin{description}
-\item \path{/sys/bus/drivers/pciback/permissive} \\
- Use \path{cat} on this file to view a list of permissive slots.
-\item \path{/sys/bus/drivers/pciback/quirks} \\
- Use \path{cat} on this file view a hierarchical view of devices bound to the
-PCI backend, their PCI vendor/device ID, and any quirks that are associated with
-that particular slot.  
-\end{description}
-
-You may notice that every device bound to the PCI backend has 17 quirks standard 
-"quirks" regardless of \path{xend-pci-quirks.sxp}.  These default entries are
-necessary to support interactions between the PCI bus manager and the device bound
-to it.  Even non-quirky devices should have these standard entries.  
-
-In this case, preference was given to accuracy over aesthetics by choosing to
-show the standard quirks in the quirks list rather than hide them from the
-inquiring user 
-
-\subsubsection{PCI Frontend Configuration}
-To configure a domU to receive a PCI device:
-
-\begin{description}
-\item[Command-line:]
-  Use the {\em pci} command-line flag. For multiple devices, use the option
-  multiple times. \\
-\centerline{  {\tt xm create netcard-dd pci=01:00.0 pci=02:03.0 }} \\
-
-\item[Flat Format configuration file:]
-  Specify all of your PCI devices in a python list named {\em pci}. \\
-\centerline{  {\tt pci=['01:00.0','02:03.0'] }} \\
-
-\item[SXP Format configuration file:]
-  Use a single PCI device section for all of your devices (specify the numbers
-  in hexadecimal with the preceding '0x'). Note that {\em domain} here refers
-  to the PCI domain, not a virtual machine within Xen.
-{\small
-\begin{verbatim}
-(device (pci
-    (dev (domain 0x0)(bus 0x3)(slot 0x1a)(func 0x1)
-    (dev (domain 0x0)(bus 0x1)(slot 0x5)(func 0x0)
-)
-\end{verbatim}
-}
-\end{description}
-
-%% There are two possible types of privileges: IO privileges and
-%% administration privileges.
-
-\section{Support for virtual Trusted Platform Module (vTPM)}
-\label{ss:vtpm}
-
-Paravirtualized domains can be given access to a virtualized version
-of a TPM. This enables applications in these domains to use the services
-of the TPM device for example through a TSS stack
-\footnote{Trousers TSS stack: http://sourceforge.net/projects/trousers}.
-The Xen source repository provides the necessary software components to
-enable virtual TPM access. Support is provided through several
-different pieces. First, a TPM emulator has been modified to provide TPM's
-functionality for the virtual TPM subsystem. Second, a virtual TPM Manager
-coordinates the virtual TPMs efforts, manages their creation, and provides
-protected key storage using the TPM. Third, a device driver pair providing
-a TPM front- and backend is available for XenLinux to deliver TPM commands
-from the domain to the virtual TPM manager, which dispatches it to a
-software TPM. Since the TPM Manager relies on a HW TPM for protected key
-storage, therefore this subsystem requires a Linux-supported hardware TPM.
-For development purposes, a TPM emulator is available for use on non-TPM
-enabled platforms.
-
-\subsubsection{Compile-Time Setup}
-To enable access to the virtual TPM, the virtual TPM backend driver must
-be compiled for a privileged domain (e.g. domain 0). Using the XenLinux
-configuration, the necessary driver can be selected in the Xen configuration
-section. Unless the driver has been compiled into the kernel, its module
-must be activated using the following command:
-
-\begin{verbatim}
-modprobe tpmbk
-\end{verbatim}
-
-Similarly, the TPM frontend driver must be compiled for the kernel trying
-to use TPM functionality. Its driver can be selected in the kernel
-configuration section Device Driver / Character Devices / TPM Devices.
-Along with that the TPM driver for the built-in TPM must be selected.
-If the virtual TPM driver has been compiled as module, it
-must be activated using the following command:
-
-\begin{verbatim}
-modprobe tpm_xenu
-\end{verbatim}
-
-Furthermore, it is necessary to build the virtual TPM manager and software
-TPM by making changes to entries in Xen build configuration files.
-The following entry in the file Config.mk in the Xen root source
-directory must be made:
-
-\begin{verbatim}
-VTPM_TOOLS ?= y
-\end{verbatim}
-
-After a build of the Xen tree and a reboot of the machine, the TPM backend
-drive must be loaded. Once loaded, the virtual TPM manager daemon
-must be started before TPM-enabled guest domains may be launched.
-To enable being the destination of a virtual TPM Migration, the virtual TPM
-migration daemon must also be loaded.
-
-\begin{verbatim}
-vtpm_managerd
-\end{verbatim}
-\begin{verbatim}
-vtpm_migratord
-\end{verbatim}
-
-Once the VTPM manager is running, the VTPM can be accessed by loading the
-front end driver in a guest domain.
-
-\subsubsection{Development and Testing TPM Emulator}
-For development and testing on non-TPM enabled platforms, a TPM emulator
-can be used in replacement of a platform TPM. First, the entry in the file
-tools/vtpm/Rules.mk must look as follows:
-
-\begin{verbatim}
-BUILD_EMULATOR = y
-\end{verbatim}
-
-Second, the entry in the file tool/vtpm\_manager/Rules.mk must be uncommented
-as follows:
-
-\begin{verbatim}
-# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
-CFLAGS += -DDUMMY_TPM
-\end{verbatim}
-
-Before starting the virtual TPM Manager, start the emulator by executing
-the following in dom0:
-
-\begin{verbatim}
-tpm_emulator clear
-\end{verbatim}
-
-\subsubsection{vTPM Frontend Configuration}
-To provide TPM functionality to a user domain, a line must be added to
-the virtual TPM configuration file using the following format:
-
-\begin{verbatim}
-vtpm = ['instance=<instance number>, backend=<domain id>']
-\end{verbatim}
-
-The { \it instance number} reflects the preferred virtual TPM instance
-to associate with the domain. If the selected instance is
-already associated with another domain, the system will automatically
-select the next available instance. An instance number greater than
-zero must be provided. It is possible to omit the instance
-parameter from the configuration file.
-
-The {\it domain id} provides the ID of the domain where the
-virtual TPM backend driver and virtual TPM are running in. It should
-currently always be set to '0'.
-
-
-Examples for valid vtpm entries in the configuration file are
-
-\begin{verbatim}
- vtpm = ['instance=1, backend=0']
-\end{verbatim}
-and
-\begin{verbatim}
- vtpm = ['backend=0'].
-\end{verbatim}
-
-\subsubsection{Using the virtual TPM}
-
-Access to TPM functionality is provided by the virtual TPM frontend driver.
-Similar to existing hardware TPM drivers, this driver provides basic TPM
-status information through the {\it sysfs} filesystem. In a Xen user domain
-the sysfs entries can be found in /sys/devices/xen/vtpm-0.
-
-Commands can be sent to the virtual TPM instance using the character
-device /dev/tpm0 (major 10, minor 224).
-
-% Chapter Storage and FileSytem Management
-\chapter{Storage and File System Management}
-
-Storage can be made available to virtual machines in a number of
-different ways.  This chapter covers some possible configurations.
-
-The most straightforward method is to export a physical block device (a
-hard drive or partition) from dom0 directly to the guest domain as a
-virtual block device (VBD).
-
-Storage may also be exported from a filesystem image or a partitioned
-filesystem image as a \emph{file-backed VBD}.
-
-Finally, standard network storage protocols such as NBD, iSCSI, NFS,
-etc., can be used to provide storage to virtual machines.
-
-
-\section{Exporting Physical Devices as VBDs}
-\label{s:exporting-physical-devices-as-vbds}
-
-One of the simplest configurations is to directly export individual
-partitions from domain~0 to other domains. To achieve this use the
-\path{phy:} specifier in your domain configuration file. For example a
-line like
-\begin{quote}
-  \verb_disk = ['phy:hda3,sda1,w']_
-\end{quote}
-specifies that the partition \path{/dev/hda3} in domain~0 should be
-exported read-write to the new domain as \path{/dev/sda1}; one could
-equally well export it as \path{/dev/hda} or \path{/dev/sdb5} should
-one wish.
-
-In addition to local disks and partitions, it is possible to export
-any device that Linux considers to be ``a disk'' in the same manner.
-For example, if you have iSCSI disks or GNBD volumes imported into
-domain~0 you can export these to other domains using the \path{phy:}
-disk syntax. E.g.:
-\begin{quote}
-  \verb_disk = ['phy:vg/lvm1,sda2,w']_
-\end{quote}
-
-\begin{center}
-  \framebox{\bf Warning: Block device sharing}
-\end{center}
-\begin{quote}
-  Block devices should typically only be shared between domains in a
-  read-only fashion otherwise the Linux kernel's file systems will get
-  very confused as the file system structure may change underneath
-  them (having the same ext3 partition mounted \path{rw} twice is a
-  sure fire way to cause irreparable damage)!  \Xend\ will attempt to
-  prevent you from doing this by checking that the device is not
-  mounted read-write in domain~0, and hasn't already been exported
-  read-write to another domain.  If you want read-write sharing,
-  export the directory to other domains via NFS from domain~0 (or use
-  a cluster file system such as GFS or ocfs2).
-\end{quote}
-
-
-\section{Using File-backed VBDs}
-
-It is also possible to use a file in Domain~0 as the primary storage
-for a virtual machine.  As well as being convenient, this also has the
-advantage that the virtual block device will be \emph{sparse} ---
-space will only really be allocated as parts of the file are used.  So
-if a virtual machine uses only half of its disk space then the file
-really takes up half of the size allocated.
-
-For example, to create a 2GB sparse file-backed virtual block device
-(actually only consumes no disk space at all):
-\begin{quote}
-  \verb_# dd if=/dev/zero of=vm1disk bs=1k seek=2048k count=0_
-\end{quote}
-
-Make a file system in the disk file:
-\begin{quote}
-  \verb_# mkfs -t ext3 vm1disk_
-\end{quote}
-
-(when the tool asks for confirmation, answer `y')
-
-Populate the file system e.g.\ by copying from the current root:
-\begin{quote}
-\begin{verbatim}
-# mount -o loop vm1disk /mnt
-# cp -ax /{root,dev,var,etc,usr,bin,sbin,lib} /mnt
-# mkdir /mnt/{proc,sys,home,tmp}
-\end{verbatim}
-\end{quote}
-
-Tailor the file system by editing \path{/etc/fstab},
-\path{/etc/hostname}, etc.\ Don't forget to edit the files in the
-mounted file system, instead of your domain~0 filesystem, e.g.\ you
-would edit \path{/mnt/etc/fstab} instead of \path{/etc/fstab}.  For
-this example put \path{/dev/sda1} to root in fstab.
-
-Now unmount (this is important!):
-\begin{quote}
-  \verb_# umount /mnt_
-\end{quote}
-
-In the configuration file set:
-\begin{quote}
-  \verb_disk = ['tap:aio:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-
-As the virtual machine writes to its `disk', the sparse file will be
-filled in and consume more space up to the original 2GB.
-
-{\em{Note:}} Users that have worked with file-backed VBDs on Xen in previous
-versions will be interested to know that this support is now provided through
-the blktap driver instead of the loopback driver.  This change results in
-file-based block devices that are higher-performance, more scalable, and which
-provide better safety properties for VBD data.  All that is required to update
-your existing file-backed VM configurations is to change VBD configuration
-lines from:
-\begin{quote}
-  \verb_disk = ['file:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-to:
-\begin{quote}
-  \verb_disk = ['tap:aio:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-
-
-\subsection{Loopback-mounted file-backed VBDs (deprecated)}
-
-{\em{{\bf{Note:}} Loopback mounted VBDs have now been replaced with
-    blktap-based support for raw image files, as described above.  This
-    section remains to detail a configuration that was used by older Xen
-    versions.}}
-
-Raw image file-backed VBDs may also be attached to VMs using the 
-Linux loopback driver.  The only required change to the raw file 
-instructions above are to specify the configuration entry as:
-\begin{quote}
-  \verb_disk = ['file:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-
-{\bf Note that loopback file-backed VBDs may not be appropriate for backing
-  I/O-intensive domains.}  This approach is known to experience
-substantial slowdowns under heavy I/O workloads, due to the I/O
-handling by the loopback block device used to support file-backed VBDs
-in dom0.  Loopback support remains for old Xen installations, and users
-are strongly encouraged to use the blktap-based file support (using 
-``{\tt{tap:aio}}'' as described above).
-
-Additionally, Linux supports a maximum of eight loopback file-backed 
-VBDs across all domains by default.  This limit can be statically 
-increased by using the \emph{max\_loop} module parameter if 
-CONFIG\_BLK\_DEV\_LOOP is compiled as a module in the dom0 kernel, or 
-by using the \emph{max\_loop=n} boot option if CONFIG\_BLK\_DEV\_LOOP 
-is compiled directly into the dom0 kernel.  Again, users are encouraged
-to use the blktap-based file support described above which scales to much 
-larger number of active VBDs.
-
-
-\section{Using LVM-backed VBDs}
-\label{s:using-lvm-backed-vbds}
-
-A particularly appealing solution is to use LVM volumes as backing for
-domain file-systems since this allows dynamic growing/shrinking of
-volumes as well as snapshot and other features.
-
-To initialize a partition to support LVM volumes:
-\begin{quote}
-\begin{verbatim}
-# pvcreate /dev/sda10           
-\end{verbatim} 
-\end{quote}
-
-Create a volume group named `vg' on the physical partition:
-\begin{quote}
-\begin{verbatim}
-# vgcreate vg /dev/sda10
-\end{verbatim} 
-\end{quote}
-
-Create a logical volume of size 4GB named `myvmdisk1':
-\begin{quote}
-\begin{verbatim}
-# lvcreate -L4096M -n myvmdisk1 vg
-\end{verbatim}
-\end{quote}
-
-You should now see that you have a \path{/dev/vg/myvmdisk1} Make a
-filesystem, mount it and populate it, e.g.:
-\begin{quote}
-\begin{verbatim}
-# mkfs -t ext3 /dev/vg/myvmdisk1
-# mount /dev/vg/myvmdisk1 /mnt
-# cp -ax / /mnt
-# umount /mnt
-\end{verbatim}
-\end{quote}
-
-Now configure your VM with the following disk configuration:
-\begin{quote}
-\begin{verbatim}
- disk = [ 'phy:vg/myvmdisk1,sda1,w' ]
-\end{verbatim}
-\end{quote}
-
-LVM enables you to grow the size of logical volumes, but you'll need
-to resize the corresponding file system to make use of the new space.
-Some file systems (e.g.\ ext3) now support online resize.  See the LVM
-manuals for more details.
-
-You can also use LVM for creating copy-on-write (CoW) clones of LVM
-volumes (known as writable persistent snapshots in LVM terminology).
-This facility is new in Linux 2.6.8, so isn't as stable as one might
-hope.  In particular, using lots of CoW LVM disks consumes a lot of
-dom0 memory, and error conditions such as running out of disk space
-are not handled well. Hopefully this will improve in future.
-
-To create two copy-on-write clones of the above file system you would
-use the following commands:
-
-\begin{quote}
-\begin{verbatim}
-# lvcreate -s -L1024M -n myclonedisk1 /dev/vg/myvmdisk1
-# lvcreate -s -L1024M -n myclonedisk2 /dev/vg/myvmdisk1
-\end{verbatim}
-\end{quote}
-
-Each of these can grow to have 1GB of differences from the master
-volume. You can grow the amount of space for storing the differences
-using the lvextend command, e.g.:
-\begin{quote}
-\begin{verbatim}
-# lvextend +100M /dev/vg/myclonedisk1
-\end{verbatim}
-\end{quote}
-
-Don't let the `differences volume' ever fill up otherwise LVM gets
-rather confused. It may be possible to automate the growing process by
-using \path{dmsetup wait} to spot the volume getting full and then
-issue an \path{lvextend}.
-
-In principle, it is possible to continue writing to the volume that
-has been cloned (the changes will not be visible to the clones), but
-we wouldn't recommend this: have the cloned volume as a `pristine'
-file system install that isn't mounted directly by any of the virtual
-machines.
-
-
-\section{Using NFS Root}
-
-First, populate a root filesystem in a directory on the server
-machine. This can be on a distinct physical machine, or simply run
-within a virtual machine on the same node.
-
-Now configure the NFS server to export this filesystem over the
-network by adding a line to \path{/etc/exports}, for instance:
-
-\begin{quote}
-  \begin{small}
-\begin{verbatim}
-/export/vm1root      192.0.2.4/24 (rw,sync,no_root_squash)
-\end{verbatim}
-  \end{small}
-\end{quote}
-
-Finally, configure the domain to use NFS root.  In addition to the
-normal variables, you should make sure to set the following values in
-the domain's configuration file:
-
-\begin{quote}
-  \begin{small}
-\begin{verbatim}
-root       = '/dev/nfs'
-nfs_server = '2.3.4.5'       # substitute IP address of server
-nfs_root   = '/path/to/root' # path to root FS on the server
-\end{verbatim}
-  \end{small}
-\end{quote}
-
-The domain will need network access at boot time, so either statically
-configure an IP address using the config variables \path{ip},
-\path{netmask}, \path{gateway}, \path{hostname}; or enable DHCP
-(\path{dhcp='dhcp'}).
-
-Note that the Linux NFS root implementation is known to have stability
-problems under high load (this is not a Xen-specific problem), so this
-configuration may not be appropriate for critical servers.
-
-
-\chapter{CPU Management}
-
-%% KMS Something sage about CPU / processor management.
-
-Xen allows a domain's virtual CPU(s) to be associated with one or more
-host CPUs.  This can be used to allocate real resources among one or
-more guests, or to make optimal use of processor resources when
-utilizing dual-core, hyperthreading, or other advanced CPU technologies.
-
-Xen enumerates physical CPUs in a `depth first' fashion.  For a system
-with both hyperthreading and multiple cores, this would be all the
-hyperthreads on a given core, then all the cores on a given socket,
-and then all sockets.  I.e.  if you had a two socket, dual core,
-hyperthreaded Xeon the CPU order would be:
-
-
-\begin{center}
-\begin{tabular}{l|l|l|l|l|l|l|r}
-\multicolumn{4}{c|}{socket0}     &  \multicolumn{4}{c}{socket1} \\ \hline
-\multicolumn{2}{c|}{core0}  &  \multicolumn{2}{c|}{core1}  &
-\multicolumn{2}{c|}{core0}  &  \multicolumn{2}{c}{core1} \\ \hline
-ht0 & ht1 & ht0 & ht1 & ht0 & ht1 & ht0 & ht1 \\
-\#0 & \#1 & \#2 & \#3 & \#4 & \#5 & \#6 & \#7 \\
-\end{tabular}
-\end{center}
-
-
-Having multiple vcpus belonging to the same domain mapped to the same
-physical CPU is very likely to lead to poor performance. It's better to
-use `vcpus-set' to hot-unplug one of the vcpus and ensure the others are
-pinned on different CPUs.
-
-If you are running IO intensive tasks, its typically better to dedicate
-either a hyperthread or whole core to running domain 0, and hence pin
-other domains so that they can't use CPU 0. If your workload is mostly
-compute intensive, you may want to pin vcpus such that all physical CPU
-threads are available for guest domains.
-
-\chapter{Migrating Domains}
-
-\section{Domain Save and Restore}
-
-The administrator of a Xen system may suspend a virtual machine's
-current state into a disk file in domain~0, allowing it to be resumed at
-a later time.
-
-For example you can suspend a domain called ``VM1'' to disk using the
-command:
-\begin{verbatim}
-# xm save VM1 VM1.chk
-\end{verbatim}
-
-This will stop the domain named ``VM1'' and save its current state
-into a file called \path{VM1.chk}.
-
-To resume execution of this domain, use the \path{xm restore} command:
-\begin{verbatim}
-# xm restore VM1.chk
-\end{verbatim}
-
-This will restore the state of the domain and resume its execution.
-The domain will carry on as before and the console may be reconnected
-using the \path{xm console} command, as described earlier.
-
-\section{Migration and Live Migration}
-
-Migration is used to transfer a domain between physical hosts. There
-are two varieties: regular and live migration. The former moves a
-virtual machine from one host to another by pausing it, copying its
-memory contents, and then resuming it on the destination. The latter
-performs the same logical functionality but without needing to pause
-the domain for the duration. In general when performing live migration
-the domain continues its usual activities and---from the user's
-perspective---the migration should be imperceptible.
-
-To perform a live migration, both hosts must be running Xen / \xend\ and
-the destination host must have sufficient resources (e.g.\ memory
-capacity) to accommodate the domain after the move. Furthermore we
-currently require both source and destination machines to be on the same
-L2 subnet.
-
-Currently, there is no support for providing automatic remote access
-to filesystems stored on local disk when a domain is migrated.
-Administrators should choose an appropriate storage solution (i.e.\
-SAN, NAS, etc.) to ensure that domain filesystems are also available
-on their destination node. GNBD is a good method for exporting a
-volume from one machine to another. iSCSI can do a similar job, but is
-more complex to set up.
-
-When a domain migrates, it's MAC and IP address move with it, thus it is
-only possible to migrate VMs within the same layer-2 network and IP
-subnet. If the destination node is on a different subnet, the
-administrator would need to manually configure a suitable etherip or IP
-tunnel in the domain~0 of the remote node.
-
-A domain may be migrated using the \path{xm migrate} command. To live
-migrate a domain to another machine, we would use the command:
-
-\begin{verbatim}
-# xm migrate --live mydomain destination.ournetwork.com
-\end{verbatim}
-
-Without the \path{--live} flag, \xend\ simply stops the domain and
-copies the memory image over to the new node and restarts it. Since
-domains can have large allocations this can be quite time consuming,
-even on a Gigabit network. With the \path{--live} flag \xend\ attempts
-to keep the domain running while the migration is in progress, resulting
-in typical down times of just 60--300ms.
-
-For now it will be necessary to reconnect to the domain's console on the
-new machine using the \path{xm console} command. If a migrated domain
-has any open network connections then they will be preserved, so SSH
-connections do not have this limitation.
-
-
-%% Chapter Securing Xen
-\chapter{Securing Xen}
-
-This chapter describes how to secure a Xen system. It describes a number
-of scenarios and provides a corresponding set of best practices. It
-begins with a section devoted to understanding the security implications
-of a Xen system.
-
-
-\section{Xen Security Considerations}
-
-When deploying a Xen system, one must be sure to secure the management
-domain (Domain-0) as much as possible. If the management domain is
-compromised, all other domains are also vulnerable. The following are a
-set of best practices for Domain-0:
-
-\begin{enumerate}
-\item \textbf{Run the smallest number of necessary services.} The less
-  things that are present in a management partition, the better.
-  Remember, a service running as root in the management domain has full
-  access to all other domains on the system.
-\item \textbf{Use a firewall to restrict the traffic to the management
-    domain.} A firewall with default-reject rules will help prevent
-  attacks on the management domain.
-\item \textbf{Do not allow users to access Domain-0.} The Linux kernel
-  has been known to have local-user root exploits. If you allow normal
-  users to access Domain-0 (even as unprivileged users) you run the risk
-  of a kernel exploit making all of your domains vulnerable.
-\end{enumerate}
-
-\section{Driver Domain Security Considerations}
-\label{s:ddsecurity}
-
-Driver domains address a range of security problems that exist regarding
-the use of device drivers and hardware. On many operating systems in common
-use today, device drivers run within the kernel with the same privileges as
-the kernel. Few or no mechanisms exist to protect the integrity of the kernel
-from a misbehaving (read "buggy") or malicious device driver. Driver
-domains exist to aid in isolating a device driver within its own virtual
-machine where it cannot affect the stability and integrity of other
-domains. If a driver crashes, the driver domain can be restarted rather than
-have the entire machine crash (and restart) with it. Drivers written by
-unknown or untrusted third-parties can be confined to an isolated space.
-Driver domains thus address a number of security and stability issues with
-device drivers.
-
-However, due to limitations in current hardware, a number of security
-concerns remain that need to be considered when setting up driver domains (it
-should be noted that the following list is not intended to be exhaustive).
-
-\begin{enumerate}
-\item \textbf{Without an IOMMU, a hardware device can DMA to memory regions
-  outside of its controlling domain.} Architectures which do not have an
-  IOMMU (e.g. most x86-based platforms) to restrict DMA usage by hardware
-  are vulnerable. A hardware device which can perform arbitrary memory reads
-  and writes can read/write outside of the memory of its controlling domain.
-  A malicious or misbehaving domain could use a hardware device it controls
-  to send data overwriting memory in another domain or to read arbitrary
-  regions of memory in another domain.
-\item \textbf{Shared buses are vulnerable to sniffing.} Devices that share
-  a data bus can sniff (and possible spoof) each others' data. Device A that
-  is assigned to Domain A could eavesdrop on data being transmitted by
-  Domain B to Device B and then relay that data back to Domain A.
-\item \textbf{Devices which share interrupt lines can either prevent the
-  reception of that interrupt by the driver domain or can trigger the
-  interrupt service routine of that guest needlessly.} A devices which shares
-  a level-triggered interrupt (e.g. PCI devices) with another device can
-  raise an interrupt and never clear it. This effectively blocks other devices
-  which share that interrupt line from notifying their controlling driver
-  domains that they need to be serviced. A device which shares an
-  any type of interrupt line can trigger its interrupt continually which
-  forces execution time to be spent (in multiple guests) in the interrupt
-  service routine (potentially denying time to other processes within that
-  guest). System architectures which allow each device to have its own
-  interrupt line (e.g. PCI's Message Signaled Interrupts) are less
-  vulnerable to this denial-of-service problem.
-\item \textbf{Devices may share the use of I/O memory address space.} Xen can
-  only restrict access to a device's physical I/O resources at a certain
-  granularity. For interrupt lines and I/O port address space, that
-  granularity is very fine (per interrupt line and per I/O port). However,
-  Xen can only restrict access to I/O memory address space on a page size
-  basis. If more than one device shares use of a page in I/O memory address
-  space, the domains to which those devices are assigned will be able to
-  access the I/O memory address space of each other's devices.
-\end{enumerate}
-
-
-\section{Security Scenarios}
-
-
-\subsection{The Isolated Management Network}
-
-In this scenario, each node has two network cards in the cluster. One
-network card is connected to the outside world and one network card is a
-physically isolated management network specifically for Xen instances to
-use.
-
-As long as all of the management partitions are trusted equally, this is
-the most secure scenario. No additional configuration is needed other
-than forcing Xend to bind to the management interface for relocation.
-
-
-\subsection{A Subnet Behind a Firewall}
-
-In this scenario, each node has only one network card but the entire
-cluster sits behind a firewall. This firewall should do at least the
-following:
-
-\begin{enumerate}
-\item Prevent IP spoofing from outside of the subnet.
-\item Prevent access to the relocation port of any of the nodes in the
-  cluster except from within the cluster.
-\end{enumerate}
-
-The following iptables rules can be used on each node to prevent
-migrations to that node from outside the subnet assuming the main
-firewall does not do this for you:
-
-\begin{verbatim}
-# this command disables all access to the Xen relocation
-# port:
-iptables -A INPUT -p tcp --destination-port 8002 -j REJECT
-
-# this command enables Xen relocations only from the specific
-# subnet:
-iptables -I INPUT -p tcp -{}-source 192.0.2.0/24 \
-    --destination-port 8002 -j ACCEPT
-\end{verbatim}
-
-\subsection{Nodes on an Untrusted Subnet}
-
-Migration on an untrusted subnet is not safe in current versions of Xen.
-It may be possible to perform migrations through a secure tunnel via an
-VPN or SSH. The only safe option in the absence of a secure tunnel is to
-disable migration completely. The easiest way to do this is with
-iptables:
-
-\begin{verbatim}
-# this command disables all access to the Xen relocation port
-iptables -A INPUT -p tcp -{}-destination-port 8002 -j REJECT
-\end{verbatim}
-
-\part{Reference}
-
-%% Chapter Build and Boot Options
-\chapter{Build and Boot Options} 
-
-This chapter describes the build- and boot-time options which may be
-used to tailor your Xen system.
-
-\section{Top-level Configuration Options} 
-
-Top-level configuration is achieved by editing one of two 
-files: \path{Config.mk} and \path{Makefile}. 
-
-The former allows the overall build target architecture to be 
-specified. You will typically not need to modify this unless 
-you are cross-compiling. Additional configuration options are
-documented in the \path{Config.mk} file. 
-
-The top-level \path{Makefile} is chiefly used to customize the set of
-kernels built. Look for the line: 
-\begin{quote}
-\begin{verbatim}
-KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
-\end{verbatim}
-\end{quote}
-
-Allowable options here are any kernels which have a corresponding 
-build configuration file in the \path{buildconfigs/} directory. 
-
-
-
-\section{Xen Build Options}
-
-Xen provides a number of build-time options which should be set as
-environment variables or passed on make's command-line.
-
-\begin{description}
-\item[verbose=y] Enable debugging messages when Xen detects an
-  unexpected condition.  Also enables console output from all domains.
-\item[debug=y] Enable debug assertions.  Implies {\bf verbose=y}.
-  (Primarily useful for tracing bugs in Xen).
-\item[debugger=y] Enable the in-Xen debugger. This can be used to
-  debug Xen, guest OSes, and applications.
-\item[perfc=y] Enable performance counters for significant events
-  within Xen. The counts can be reset or displayed on Xen's console
-  via console control keys.
-\end{description}
-
-
-\section{Xen Boot Options}
-\label{s:xboot}
-
-These options are used to configure Xen's behaviour at runtime.  They
-should be appended to Xen's command line, either manually or by
-editing \path{grub.conf}.
-
-\begin{description}
-\item [ noreboot ] Don't reboot the machine automatically on errors.
-  This is useful to catch debug output if you aren't catching console
-  messages via the serial line.
-\item [ nosmp ] Disable SMP support.  This option is implied by
-  `ignorebiostables'.
-\item [ watchdog ] Enable NMI watchdog which can report certain
-  failures.
-\item [ noirqbalance ] Disable software IRQ balancing and affinity.
-  This can be used on systems such as Dell 1850/2850 that have
-  workarounds in hardware for IRQ-routing issues.
-\item [ badpage=$<$page number$>$,$<$page number$>$, \ldots ] Specify
-  a list of pages not to be allocated for use because they contain bad
-  bytes. For example, if your memory tester says that byte 0x12345678
-  is bad, you would place `badpage=0x12345' on Xen's command line.
-\item [ serial\_tx\_buffer=$<$size$>$ ] Size of serial transmit
-  buffers. Default is 16kB.
-\item [ com1=$<$baud$>$,DPS,($<$io\_base$>$$|$pci$|$amt),$<$irq$>$
-  com2=$<$baud$>$,DPS,($<$io\_base$>$$|$pci$|$amt),$<$irq$>$] \mbox{}\\
-  Xen supports up to two 16550-compatible serial ports.  For example:
-  `com1=9600, 8n1, 0x408, 5' maps COM1 to a 9600-baud port, 8 data
-  bits, no parity, 1 stop bit, I/O port base 0x408, IRQ 5.  If some
-  configuration options are standard (e.g., I/O base and IRQ), then
-  only a prefix of the full configuration string need be specified. If
-  the baud rate is pre-configured (e.g., by the bootloader) then you
-  can specify `auto' in place of a numeric baud rate.
-  For PCI serial devices, such as Intel AMT you can use the {\bf amt}
-  option to automatically find the I/O base. For PCI serial devices,
-  such as NetMos, you can use {\bf pci} to probe for the I/O base.
-  Both options will set the IRQ to zero - meaning they will poll the device.
-\item [ console=$<$specifier list$>$ ] Specify the destination for Xen
-  console I/O.  This is a comma-separated list of, for example:
-  \begin{description}
-  \item[ vga ] Use VGA console (until domain 0 boots, unless {\bf
-  vga=...keep } is specified).
-  \item[ com1 ] Use serial port com1.
-  \item[ com2H ] Use serial port com2. Transmitted chars will have the
-    MSB set. Received chars must have MSB set.
-  \item[ com2L] Use serial port com2. Transmitted chars will have the
-    MSB cleared. Received chars must have MSB cleared.
-  \end{description}
-  The latter two examples allow a single port to be shared by two
-  subsystems (e.g.\ console and debugger). Sharing is controlled by
-  MSB of each transmitted/received character.  [NB. Default for this
-  option is `com1,vga']
-\item [ vga=$<$mode$>$(,keep) ] The mode is one of the following options:
-  \begin{description}
-  \item[ ask ] Display a vga menu allowing manual selection of video
-  mode.
-  \item[ current ] Use existing vga mode without modification.
-  \item[ text-$<$mode$>$ ] Select text-mode resolution, where mode is
-  one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60.
-  \item[ gfx-$<$mode$>$ ] Select VESA graphics mode
-  $<$width$>$x$<$height$>$x$<$depth$>$ (e.g., `vga=gfx-1024x768x32').
-  \item[ mode-$<$mode$>$ ] Specify a mode number as discovered by `vga
-  ask'. Note that the numbers are displayed in hex and hence must be
-  prefixed by `0x' here (e.g., `vga=mode-0x0335').
-  \end{description}
-The mode may optionally be followed by `{\bf,keep}' to cause Xen to keep
-writing to the VGA console after domain 0 starts booting (e.g., `vga=text-80x50,keep').
-\item [ no-real-mode ] (x86 only) Do not execute real-mode bootstrap
-  code when booting Xen. This option should not be used except for
-  debugging. It will effectively disable the {\bf vga} option, which
-  relies on real mode to set the video mode.
-\item [ edid=no,force ] (x86 only) Either force retrieval of monitor
-  EDID information via VESA DDC, or disable it (edid=no). This option
-  should not normally be required except for debugging purposes.
-\item [ edd=off,on,skipmbr ] (x86 only) Control retrieval of Extended
-  Disc Data (EDD) from the BIOS during boot.
-\item [ console\_to\_ring ] Place guest console output into the
-  hypervisor console ring buffer. This is disabled by default.
-  When enabled, both hypervisor output and guest console output
-  is available from the ring buffer. This can be useful for logging
-  and/or remote presentation of console data.
-\item [ sync\_console ] Force synchronous console output. This is
-  useful if you system fails unexpectedly before it has sent all
-  available output to the console. In most cases Xen will
-  automatically enter synchronous mode when an exceptional event
-  occurs, but this option provides a manual fallback.
-\item [ conswitch=$<$switch-char$><$auto-switch-char$>$ ] Specify how
-  to switch serial-console input between Xen and DOM0. The required
-  sequence is CTRL-$<$switch-char$>$ pressed three times. Specifying
-  the backtick character disables switching.  The
-  $<$auto-switch-char$>$ specifies whether Xen should auto-switch
-  input to DOM0 when it boots --- if it is `x' then auto-switching is
-  disabled.  Any other value, or omitting the character, enables
-  auto-switching.  [NB. Default switch-char is `a'.]
-\item [ loglvl=$<$level$>/<$level$>$ ]
-  Specify logging level. Messages of the specified severity level (and
-  higher) will be printed to the Xen console. Valid levels are `none',
-  `error', `warning', `info', `debug', and `all'. The second level
-  specifier is optional: it is used to specify message severities
-  which are to be rate limited. Default is `loglvl=warning'.
-\item [ guest\_loglvl=$<$level$>/<$level$>$ ] As for loglvl, but
-  applies to messages relating to guests. Default is
-  `guest\_loglvl=none/warning'. 
-\item [ console\_timestamps ] 
-  Adds a timestamp prefix to each line of Xen console output.
-\item [ nmi=xxx ]
-  Specify what to do with an NMI parity or I/O error. \\
-  `nmi=fatal':  Xen prints a diagnostic and then hangs. \\
-  `nmi=dom0':   Inform DOM0 of the NMI. \\
-  `nmi=ignore': Ignore the NMI.
-\item [ mem=xxx ] Set the physical RAM address limit. Any RAM
-  appearing beyond this physical address in the memory map will be
-  ignored. This parameter may be specified with a B, K, M or G suffix,
-  representing bytes, kilobytes, megabytes and gigabytes respectively.
-  The default unit, if no suffix is specified, is kilobytes.
-\item [ dom0\_mem=$<$specifier list$>$ ] Set the amount of memory to
-  be allocated to domain 0. This is a comma-separated list containing
-  the following optional components:
-  \begin{description}
-  \item[ min:$<$min\_amt$>$ ] Minimum amount to allocate to domain 0
-  \item[ max:$<$min\_amt$>$ ] Maximum amount to allocate to domain 0
-  \item[ $<$amt$>$ ] Precise amount to allocate to domain 0
-  \end{description}
-  Each numeric parameter may be specified with a B, K, M or
-  G suffix, representing bytes, kilobytes, megabytes and gigabytes
-  respectively; if no suffix is specified, the parameter defaults to
-  kilobytes. Negative values are subtracted from total available
-  memory. If $<$amt$>$ is not specified, it defaults to all available
-  memory less a small amount (clamped to 128MB) for uses such as DMA
-  buffers.
-\item [ dom0\_vcpus\_pin ] Pins domain 0 VCPUs on their respective
-  physical CPUS (default=false).
-\item [ tbuf\_size=xxx ] Set the size of the per-cpu trace buffers, in
-  pages (default 0).  
-\item [ sched=xxx ] Select the CPU scheduler Xen should use.  The
-  current possibilities are `credit' (default), and `sedf'.
-\item [ apic\_verbosity=debug,verbose ] Print more detailed
-  information about local APIC and IOAPIC configuration.
-\item [ lapic ] Force use of local APIC even when left disabled by
-  uniprocessor BIOS.
-\item [ nolapic ] Ignore local APIC in a uniprocessor system, even if
-  enabled by the BIOS.
-\item [ apic=bigsmp,default,es7000,summit ] Specify NUMA platform.
-  This can usually be probed automatically.
-\item [ dma\_bits=xxx ] Specify width of DMA addresses in bits. This
-  is used in NUMA systems to prevent this special DMA memory from
-  being exhausted in one node when remote nodes have available memory.
-\item [ vcpu\_migration\_delay=$<$minimum\_time$>$] Set minimum time of 
-  vcpu migration in microseconds (default 0). This parameter avoids agressive
-  vcpu migration. For example, the linux kernel uses 0.5ms by default.
-\item [ irq\_vector\_map=xxx ] Enable irq vector non-sharing maps.  Setting 'global' 
-  will ensure that no  IRQs will share vectors.  Setting 'per-device' will ensure 
-  that no IRQs from the same device will share vectors.  Setting to 'none' will
-  disable it entirely, overriding any defaults the IOMMU code may set.
-\end{description}
-
-In addition, the following options may be specified on the Xen command
-line. Since domain 0 shares responsibility for booting the platform,
-Xen will automatically propagate these options to its command line.
-These options are taken from Linux's command-line syntax with
-unchanged semantics.
-
-\begin{description}
-\item [ acpi=off,force,strict,ht,noirq,\ldots ] Modify how Xen (and
-  domain 0) parses the BIOS ACPI tables.
-\item [ acpi\_skip\_timer\_override ] Instruct Xen (and domain~0) to
-  ignore timer-interrupt override instructions specified by the BIOS
-  ACPI tables.
-\item [ noapic ] Instruct Xen (and domain~0) to ignore any IOAPICs
-  that are present in the system, and instead continue to use the
-  legacy PIC.
-\end{description} 
-
-
-\section{XenLinux Boot Options}
-
-In addition to the standard Linux kernel boot options, we support:
-\begin{description}
-\item[ xencons=xxx ] Specify the device node to which the Xen virtual
-  console driver is attached. The following options are supported:
-  \begin{center}
-    \begin{tabular}{l}
-      `xencons=off': disable virtual console \\
-      `xencons=tty': attach console to /dev/tty1 (tty0 at boot-time) \\
-      `xencons=ttyS': attach console to /dev/ttyS0 \\
-      `xencons=xvc': attach console to /dev/xvc0
-    \end{tabular}
-\end{center}
-The default is ttyS for dom0 and xvc for all other domains.
-\end{description}
-
-
-%% Chapter Further Support
-\chapter{Further Support}
-
-If you have questions that are not answered by this manual, the
-sources of information listed below may be of interest to you.  Note
-that bug reports, suggestions and contributions related to the
-software (or the documentation) should be sent to the Xen developers'
-mailing list (address below).
-
-
-\section{Other Documentation}
-
-For developers interested in porting operating systems to Xen, the
-\emph{Xen Interface Manual} is distributed in the \path{docs/}
-directory of the Xen source distribution.
-
-
-\section{Online References}
-
-The official Xen web site can be found at:
-\begin{quote} {\tt http://www.xen.org}
-\end{quote}
-
-This contains links to the latest versions of all online
-documentation, including the latest version of the FAQ.
-
-Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
-The Xen project uses Bugzilla as its bug tracking system. You'll find
-the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
-
-
-\section{Mailing Lists}
-
-There are several mailing lists that are used to discuss Xen related
-topics. The most widely relevant are listed below. An official page of
-mailing lists and subscription information can be found at \begin{quote}
-  {\tt http://lists.xensource.com/} \end{quote}
-
-\begin{description}
-\item[xen-devel@lists.xensource.com] Used for development
-  discussions and bug reports.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-devel}}
-\item[xen-users@lists.xensource.com] Used for installation and usage
-  discussions and requests for help.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-users}}
-\item[xen-announce@lists.xensource.com] Used for announcements only.
-  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-announce}}
-\item[xen-changelog@lists.xensource.com] Changelog feed
-  from the unstable and 3.x trees - developer oriented.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-changelog}}
-\end{description}
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\appendix
-
-\chapter{Unmodified (HVM) guest domains in Xen with Hardware support for Virtualization}
-
-Xen supports guest domains running unmodified guest operating systems using
-virtualization extensions available on recent processors. Currently processors
-featuring the Intel Virtualization Extension (Intel-VT) or the AMD extension
-(AMD-V) are supported. The technology covering both implementations is
-called HVM (for Hardware Virtual Machine) in Xen. More information about the
-virtualization extensions are available on the respective websites:
- {\small {\tt http://www.intel.com/technology/computing/vptech}}
-
-
- {\small {\tt http://www.amd.com/us-en/assets/content\_type/white\_papers\_and\_tech\_docs/24593.pdf}}
-
-\section{Building Xen with HVM support}
-
-The following packages need to be installed in order to build Xen with HVM support. Some Linux distributions do not provide these packages by default.
-
-\begin{tabular}{lp{11.0cm}}
-{\bfseries Package} & {\bfseries Description} \\
-
-dev86 & The dev86 package provides an assembler and linker for real mode 80x86 instructions. You need to have this package installed in order to build the BIOS code which runs in (virtual) real mode. 
-
-If the dev86 package is not available on the x86\_64 distribution, you can install the i386 version of it. The dev86 rpm package for various distributions can be found at {\scriptsize {\tt http://www.rpmfind.net/linux/rpm2html/search.php?query=dev86\&submit=Search}} \\
-
-SDL-devel, SDL & Simple DirectMedia Layer (SDL) is another way of virtualizing the unmodified guest console. It provides an X window for the guest console. 
-
-If the SDL and SDL-devel packages are not installed by default on the build system, they can be obtained from  {\scriptsize {\tt http://www.rpmfind.net/linux/rpm2html/search.php?query=SDL\&amp;submit=Search}}
-
-
-{\scriptsize {\tt http://www.rpmfind.net/linux/rpm2html/search.php?query=SDL-devel\&submit=Search}} \\
-
-\end{tabular}
-
-\section{Configuration file for unmodified HVM guests}
-
-The Xen installation includes a sample configuration file, {\small {\tt /etc/xen/xmexample.hvm}}. There are comments describing all the options. In addition to the common options that are the same as those for paravirtualized guest configurations, HVM guest configurations have the following settings:
-
-\begin{tabular}{lp{11.0cm}}
-
-{\bfseries Parameter} & {\bfseries Description} \\
-
-kernel &        The HVM firmware loader, {\small {\tt /usr/lib/xen/boot/hvmloader}}\\
-
-builder &       The domain build function. The HVM domain uses the 'hvm' builder.\\
-
-acpi & Enable HVM guest ACPI, default=1 (enabled)\\
-
-apic & Enable HVM guest APIC, default=1 (enabled)\\
-
-pae & Enable HVM guest PAE, default=1 (enabled)\\
-
-hap & Enable hardware-assisted paging support, such as AMD-V's nested paging
-or Intel\textregistered VT's extended paging. If available, Xen will
-use hardware-assisted paging instead of shadow paging for this guest's memory
-management.\\
-
-vif     & Optionally defines MAC address and/or bridge for the network interfaces. Random MACs are assigned if not given. {\small {\tt type=ioemu}} means ioemu is used to virtualize the HVM NIC. If no type is specified, vbd is used, as with paravirtualized guests.\\
-
-disk & Defines the disk devices you want the domain to have access to, and what you want them accessible as. If using a physical device as the HVM guest's disk, each disk entry is of the form 
-
-{\small {\tt phy:UNAME,ioemu:DEV,MODE,}}
-
-where UNAME is the host device file, DEV is the device name the domain will see, and MODE is r for read-only, w for read-write. ioemu means the disk will use ioemu to virtualize the HVM disk. If not adding ioemu, it uses vbd like paravirtualized guests.
-
-If using disk image file, its form should be like 
-
-{\small {\tt file:FILEPATH,ioemu:DEV,MODE}}
-
-Optical devices can be emulated by appending cdrom to the device type
-
-{\small {\tt ',hdc:cdrom,r'}}
-
-If using more than one disk, there should be a comma between each disk entry. For example:
-
-{\scriptsize {\tt disk = ['file:/var/images/image1.img,ioemu:hda,w', 'phy:hda1,hdb1,w', 'file:/var/images/install1.iso,hdc:cdrom,r']}}\\
-
-boot & Boot from floppy (a), hard disk (c) or CD-ROM (d). For example, to boot from CD-ROM and fallback to HD, the entry should be:
-
-boot='dc'\\
-
-device\_model & The device emulation tool for HVM guests. This parameter should not be changed.\\
-
-sdl &   Enable SDL library for graphics, default = 0 (disabled)\\
-
-vnc &   Enable VNC library for graphics, default = 1 (enabled)\\
-
-vncconsole &     Enable spawning of the vncviewer (only valid when vnc=1), default = 0 (disabled)
-
-If vnc=1 and vncconsole=0, user can use vncviewer to manually connect HVM from remote. For example:
-
-{\small {\tt vncviewer domain0\_IP\_address:HVM\_domain\_id}} \\
-
-serial &        Enable redirection of HVM serial output to pty device\\
-
-\end{tabular}
-
-\begin{tabular}{lp{10cm}}
-
-usb &           Enable USB support without defining a specific USB device.
-This option defaults to 0 (disabled) unless the option usbdevice is
-specified in which case this option then defaults to 1 (enabled).\\
-
-usbdevice &     Enable USB support and also enable support for the given
-device.  Devices that can be specified are {\small {\tt mouse}} (a PS/2 style
-mouse), {\small {\tt tablet}} (an absolute pointing device) and
-{\small {\tt host:id1:id2}} (a physical USB device on the host machine whose
-ids are {\small {\tt id1}} and {\small {\tt id2}}).  The advantage
-of {\small {\tt tablet}} is that Windows guests will automatically recognize
-and support this device so specifying the config line
-
-{\small
-\begin{verbatim}
-    usbdevice='tablet'
-\end{verbatim}
-}
-
-will create a mouse that works transparently with Windows guests under VNC.
-Linux doesn't recognize the USB tablet yet so Linux guests under VNC will
-still need the Summagraphics emulation.
-Details about mouse emulation are provided in section \textbf{A.4.3}.\\
-
-localtime &     Set the real time clock to local time [default=0, that is, set to UTC].\\
-
-soundhw   &     Enable sound card support and specify the hardware to emulate. Values can be sb16, es1370 or all. Default is none.\\
-
-full-screen   & Start in full screen.\\
-
-nographic &     Another way to redirect serial output. If enabled, no 'sdl' or 'vnc' can work. Not recommended.\\
-
-\end{tabular}
-
-
-\section{Creating virtual disks from scratch}
-\subsection{Using physical disks}
-If you are using a physical disk or physical disk partition, you need to install a Linux OS on the disk first. Then the boot loader should be installed in the correct place. For example {\small {\tt dev/sda}} for booting from the whole disk, or {\small {\tt /dev/sda1}} for booting from partition 1.
-
-\subsection{Using disk image files}
-You need to create a large empty disk image file first; then, you need to install a Linux OS onto it. There are two methods you can choose. One is directly installing it using a HVM guest while booting from the OS installation CD-ROM. The other is copying an installed OS into it. The boot loader will also need to be installed.
-
-\subsubsection*{To create the image file:}
-The image size should be big enough to accommodate the entire OS. This example assumes the size is 1G (which is probably too small for most OSes).
-
-{\small {\tt \# dd if=/dev/zero of=hd.img bs=1M count=0 seek=1024}}
-
-\subsubsection*{To directly install Linux OS into an image file using a HVM guest:}
-
-Install Xen and create HVM with the original image file with booting from CD-ROM. Then it is just like a normal Linux OS installation. The HVM configuration file should have a stanza for the CD-ROM as well as a boot device specification:
-
-{\small {\tt disk=['file:/var/images/your-hd.img,hda,w', ',hdc:cdrom,r' ]
-boot='d'}}
-
-If this method does not succeed, you can choose the following method of copying an installed Linux OS into an image file.
-
-\subsubsection*{To copy a installed OS into an image file:}
-Directly installing is an easier way to make partitions and install an OS in a disk image file. But if you want to create a specific OS in your disk image, then you will most likely want to use this method.
-
-\begin{enumerate}
-\item {\bfseries Install a normal Linux OS on the host machine}\\
-You can choose any way to install Linux, such as using yum to install Red Hat Linux or YAST to install Novell SuSE Linux. The rest of this example assumes the Linux OS is installed in {\small {\tt /var/guestos/}}.
-
-\item {\bfseries Make the partition table}\\
-The image file will be treated as hard disk, so you should make the partition table in the image file. For example:
-
-{\scriptsize {\tt \# losetup /dev/loop0 hd.img\\
-\# fdisk -b 512 -C 4096 -H 16 -S 32 /dev/loop0\\
-press 'n' to add new partition\\
-press 'p' to choose primary partition\\
-press '1' to set partition number\\
-press "Enter" keys to choose default value of "First Cylinder" parameter.\\
-press "Enter" keys to choose default value of "Last Cylinder" parameter.\\
-press 'w' to write partition table and exit\\
-\# losetup -d /dev/loop0}}
-
-\item {\bfseries Make the file system and install grub}\\
-{\scriptsize {\tt \# ln -s /dev/loop0 /dev/loop\\
-\# losetup /dev/loop0 hd.img\\
-\# losetup -o 16384 /dev/loop1 hd.img\\
-\# mkfs.ext3 /dev/loop1\\
-\# mount /dev/loop1 /mnt\\
-\# mkdir -p /mnt/boot/grub\\
-\# cp /boot/grub/stage* /boot/grub/e2fs\_stage1\_5 /mnt/boot/grub\\
-\# umount /mnt\\
-\# grub\\
-grub> device (hd0) /dev/loop\\
-grub> root (hd0,0)\\
-grub> setup (hd0)\\
-grub> quit\\
-\# rm /dev/loop\\
-\# losetup -d /dev/loop0\\
-\# losetup -d /dev/loop1}}
-
-The {\small {\tt losetup}} option {\small {\tt -o 16384}} skips the partition table in the image file. It is the number of sectors times 512. We need {\small {\tt /dev/loop}} because grub is expecting a disk device \emph{name}, where \emph{name} represents the entire disk and \emph{name1} represents the first partition.
-
-\item {\bfseries Copy the OS files to the image}\\ 
-If you have Xen installed, you can easily use {\small {\tt lomount}} instead of {\small {\tt losetup}} and {\small {\tt mount}} when coping files to some partitions. {\small {\tt lomount}} just needs the partition information.
-
-{\scriptsize {\tt \# lomount -t ext3 -diskimage hd.img -partition 1 /mnt/guest\\
-\# cp -ax /var/guestos/\{root,dev,var,etc,usr,bin,sbin,lib\} /mnt/guest\\
-\# mkdir /mnt/guest/\{proc,sys,home,tmp\}}}
-
-\item {\bfseries Edit the {\small {\tt /etc/fstab}} of the guest image}\\
-The fstab should look like this:
-
-{\scriptsize {\tt \# vim /mnt/guest/etc/fstab\\
-/dev/hda1       /               ext3            defaults 1 1\\
-none            /dev/pts        devpts  gid=5,mode=620 0 0\\
-none            /dev/shm        tmpfs           defaults 0 0\\
-none            /proc           proc            defaults 0 0\\
-none            /sys            sysfs           efaults 0 0}}
-
-\item {\bfseries umount the image file}\\
-{\small {\tt \# umount /mnt/guest}}
-\end{enumerate}
-
-Now, the guest OS image {\small {\tt hd.img}} is ready. You can also reference {\small {\tt http://free.oszoo.org}} for quickstart images. But make sure to install the boot loader.
-
-\section{HVM Guests}
-\subsection{Editing the Xen HVM config file}
-Make a copy of the example HVM configuration file {\small {\tt /etc/xen/xmexample.hvm}} and edit the line that reads
-
-{\small {\tt disk = [ 'file:/var/images/\emph{min-el3-i386.img},hda,w' ]}}
-
-replacing \emph{min-el3-i386.img} with the name of the guest OS image file you just made.
-
-\subsection{Creating HVM guests}
-Simply follow the usual method of creating the guest, providing the filename of your HVM configuration file:\\
-
-{\small {\tt \# xend start\\
-\# xm create /etc/xen/hvmguest.hvm}}
-
-In the default configuration, VNC is on and SDL is off. Therefore VNC windows will open when HVM guests are created. If you want to use SDL to create HVM guests, set {\small {\tt sdl=1}} in your HVM configuration file. You can also turn off VNC by setting {\small {\tt vnc=0}}.
- 
-\subsection{Mouse issues, especially under VNC}
-Mouse handling when using VNC is a little problematic.
-The problem is that the VNC viewer provides a virtual pointer which is
-located at an absolute location in the VNC window and only absolute
-coordinates are provided.
-The HVM device model converts these absolute mouse coordinates
-into the relative motion deltas that are expected by the PS/2
-mouse driver running in the guest.
-Unfortunately,
-it is impossible to keep these generated mouse deltas
-accurate enough for the guest cursor to exactly match
-the VNC pointer.
-This can lead to situations where the guest's cursor
-is in the center of the screen and there's no way to
-move that cursor to the left
-(it can happen that the VNC pointer is at the left
-edge of the screen and,
-therefore,
-there are no longer any left mouse deltas that
-can be provided by the device model emulation code.)
-
-To deal with these mouse issues there are 4 different
-mouse emulations available from the HVM device model:
-
-\begin{description}
-\item[PS/2 mouse over the PS/2 port.]
-This is the default mouse
-that works perfectly well under SDL.
-Under VNC the guest cursor will get
-out of sync with the VNC pointer.
-When this happens you can re-synchronize
-the guest cursor to the VNC pointer by
-holding down the
-\textbf{left-ctl}
-and
-\textbf{left-alt}
-keys together.
-While these keys are down VNC pointer motions
-will not be reported to the guest so
-that the VNC pointer can be moved
-to a place where it is possible
-to move the guest cursor again.
-
-\item[Summagraphics mouse over the serial port.]
-The device model also provides emulation
-for a Summagraphics tablet,
-an absolute pointer device.
-This emulation is provided over the second
-serial port,
-\textbf{/dev/ttyS1}
-for Linux guests and
-\textbf{COM2}
-for Windows guests.
-Unfortunately,
-neither Linux nor Windows provides
-default support for the Summagraphics
-tablet so the guest will have to be
-manually configured for this mouse.
-
-\textbf{Linux configuration.}
-
-First,
-configure the GPM service to use the Summagraphics tablet.
-This can vary between distributions but,
-typically,
-all that needs to be done is modify the file
-\path{/etc/sysconfig/mouse} to contain the lines:
-
-{\small
-\begin{verbatim}
-    MOUSETYPE="summa"
-    XMOUSETYPE="SUMMA"
-    DEVICE=/dev/ttyS1
-\end{verbatim}
-}
-
-and then restart the GPM daemon.
-
-Next,
-modify the X11 config
-\path{/etc/X11/xorg.conf}
-to support the Summgraphics tablet by replacing
-the input device stanza with the following:
-
-{\small
-\begin{verbatim}
-    Section "InputDevice"
-        Identifier "Mouse0"
-        Driver "summa"
-        Option "Device" "/dev/ttyS1"
-        Option "InputFashion" "Tablet"
-        Option "Mode" "Absolute"
-        Option "Name" "EasyPen"
-        Option "Compatible" "True"
-        Option "Protocol" "Auto"
-        Option "SendCoreEvents" "on"
-        Option "Vendor" "GENIUS"
-    EndSection
-\end{verbatim}
-}
-
-Restart X and the X cursor should now properly
-track the VNC pointer.
-
-
-\textbf{Windows configuration.}
-
-Get the file
-\path{http://www.cad-plan.de/files/download/tw2k.exe}
-and execute that file on the guest,
-answering the questions as follows:
-
-\begin{enumerate}
-\item When the program asks for \textbf{model},
-scroll down and select \textbf{SummaSketch (MM Compatible)}.
-
-\item When the program asks for \textbf{COM Port} specify \textbf{com2}.
-
-\item When the programs asks for a \textbf{Cursor Type} specify
-\textbf{4 button cursor/puck}.
-
-\item The guest system will then reboot and,
-when it comes back up,
-the guest cursor will now properly track
-the VNC pointer.
-\end{enumerate}
-
-\item[PS/2 mouse over USB port.]
-This is just the same PS/2 emulation except it is
-provided over a USB port.
-This emulation is enabled by the configuration flag:
-{\small
-\begin{verbatim}
-    usbdevice='mouse'
-\end{verbatim}
-}
-
-\item[USB tablet over USB port.]
-The USB tablet is an absolute pointing device
-that has the advantage that it is automatically
-supported under Windows guests,
-although Linux guests still require some
-manual configuration.
-This mouse emulation is enabled by the
-configuration flag:
-{\small
-\begin{verbatim}
-    usbdevice='tablet'
-\end{verbatim}
-}
-
-\textbf{Linux configuration.}
-
-Unfortunately,
-there is no GPM support for the
-USB tablet at this point in time.
-If you intend to use a GPM pointing
-device under VNC you should
-configure the guest for Summagraphics
-emulation.
-
-Support for X11 is available by following
-the instructions at\\
-\verb+http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html+\\
-with one minor change.
-The
-\path{xorg.conf}
-given in those instructions
-uses the wrong values for the X \& Y minimums and maximums,
-use the following config stanza instead:
-
-{\small
-\begin{verbatim}
-    Section "InputDevice"
-        Identifier      "Tablet"
-        Driver          "evtouch"
-        Option          "Device" "/dev/input/event2"
-        Option          "DeviceName" "touchscreen"
-        Option          "MinX" "0"
-        Option          "MinY" "0"
-        Option          "MaxX" "32256"
-        Option          "MaxY" "32256"
-        Option          "ReportingMode" "Raw"
-        Option          "Emulate3Buttons"
-        Option          "Emulate3Timeout" "50"
-        Option          "SendCoreEvents" "On"
-    EndSection
-\end{verbatim}
-}
-
-\textbf{Windows configuration.}
-
-Just enabling the USB tablet in the
-guest's configuration file is sufficient,
-Windows will automatically recognize and
-configure device drivers for this
-pointing device.
-
-\end{description}
-
-\subsection{USB Support}
-There is support for an emulated USB mouse,
-an emulated USB tablet
-and physical low speed USB devices
-(support for high speed USB 2.0 devices is
-still under development).
-
-\begin{description}
-\item[USB PS/2 style mouse.]
-Details on the USB mouse emulation are
-given in sections
-\textbf{A.2}
-and
-\textbf{A.4.3}.
-Enabling USB PS/2 style mouse emulation
-is just a matter of adding the line
-
-{\small
-\begin{verbatim}
-    usbdevice='mouse'
-\end{verbatim}
-}
-
-to the configuration file.
-\item[USB tablet.]
-Details on the USB tablet emulation are
-given in sections
-\textbf{A.2}
-and
-\textbf{A.4.3}.
-Enabling USB tablet emulation
-is just a matter of adding the line
-
-{\small
-\begin{verbatim}
-    usbdevice='tablet'
-\end{verbatim}
-}
-
-to the configuration file.
-\item[USB physical devices.]
-Access to a physical (low speed) USB device
-is enabled by adding a line of the form
-
-{\small
-\begin{verbatim}
-    usbdevice='host:vid:pid'
-\end{verbatim}
-}
-
-into the the configuration file.\footnote{
-There is an alternate
-way of specifying a USB device that
-uses the syntax
-\textbf{host:bus.addr}
-but this syntax suffers from
-a major problem that makes
-it effectively useless.
-The problem is that the
-\textbf{addr}
-portion of this address
-changes every time the USB device
-is plugged into the system.
-For this reason this addressing
-scheme is not recommended and
-will not be documented further.
-}
-\textbf{vid}
-and
-\textbf{pid}
-are a
-product id and
-vendor id
-that uniquely identify
-the USB device.
-These ids can be identified
-in two ways:
-
-\begin{enumerate}
-\item Through the control window.
-As described in section
-\textbf{A.4.6}
-the control window
-is activated by pressing
-\textbf{ctl-alt-2}
-in the guest VGA window.
-As long as USB support is
-enabled in the guest by including
-the config file line
-{\small
-\begin{verbatim}
-    usb=1
-\end{verbatim}
-}
-then executing the command
-{\small
-\begin{verbatim}
-    info usbhost
-\end{verbatim}
-}
-in the control window
-will display a list of all
-usb devices and their ids.
-For example,
-this output:
-{\small
-\begin{verbatim}
-    Device 1.3, speed 1.5 Mb/s
-      Class 00: USB device 04b3:310b
-\end{verbatim}
-}
-was created from a USB mouse with
-vendor id
-\textbf{04b3}
-and product id
-\textbf{310b}.
-This device could be made available
-to the HVM guest by including the
-config file entry
-{\small
-\begin{verbatim}
-    usbdevice='host:04be:310b'
-\end{verbatim}
-}
-
-It is also possible to
-enable access to a USB
-device dynamically through
-the control window.
-The control window command
-{\small
-\begin{verbatim}
-    usb_add host:vid:pid
-\end{verbatim}
-}
-will also allow access to a
-USB device with vendor id
-\textbf{vid}
-and product id
-\textbf{pid}.
-\item Through the
-\path{/proc} file system.
-The contents of the pseudo file
-\path{/proc/bus/usb/devices}
-can also be used to identify
-vendor and product ids.
-Looking at this file,
-the line starting with
-\textbf{P:}
-has a field
-\textbf{Vendor}
-giving the vendor id and
-another field
-\textbf{ProdID}
-giving the product id.
-The contents of
-\path{/proc/bus/usb/devices}
-for the example mouse is as
-follows:
-{\small
-\begin{verbatim}
-T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=1.5 MxCh= 0
-D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
-P:  Vendor=04b3 ProdID=310b Rev= 1.60
-C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
-I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=(none)
-E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=10ms
-\end{verbatim}
-}
-Note that the
-\textbf{P:}
-line correctly identifies the
-vendor id and product id
-for this mouse as
-\textbf{04b3:310b}.
-\end{enumerate}
-There is one other issue to
-be aware of when accessing a
-physical USB device from the guest.
-The Dom0 kernel must not have
-a device driver loaded for
-the device that the guest wishes
-to access.
-This means that the Dom0
-kernel must not have that
-device driver compiled into
-the kernel or,
-if using modules,
-that driver module must
-not be loaded.
-Note that this is the device
-specific USB driver that must
-not be loaded,
-either the
-\textbf{UHCI}
-or
-\textbf{OHCI}
-USB controller driver must
-still be loaded.
-
-Going back to the USB mouse
-as an example,
-if \textbf{lsmod}
-gives the output:
-
-{\small
-\begin{verbatim}
-Module                  Size  Used by
-usbmouse                4128  0 
-usbhid                 28996  0
-uhci_hcd               35409  0
-\end{verbatim}
-}
-
-then the USB mouse is being
-used by the Dom0 kernel and is
-not available to the guest.
-Executing the command
-\textbf{rmmod usbhid}\footnote{
-Turns out the
-\textbf{usbhid}
-driver is the significant
-one for the USB mouse,
-the presence or absence of
-the module
-\textbf{usbmouse}
-has no effect on whether or
-not the guest can see a USB mouse.}
-will remove the USB mouse
-driver from the Dom0 kernel
-and the mouse will now be
-accessible by the HVM guest.
-
-Be aware the the Linux USB
-hotplug system will reload
-the drivers if a USB device
-is removed and plugged back
-in.
-This means that just unloading
-the driver module might not
-be sufficient if the USB device
-is removed and added back.
-A more reliable technique is
-to first
-\textbf{rmmod}
-the driver and then rename the
-driver file in the
-\path{/lib/modules}
-directory,
-just to make sure it doesn't get
-reloaded.
-\end{description}
-
-\subsection{Destroy HVM guests}
-HVM guests can be destroyed in the same way as can paravirtualized guests. We recommend that you shut-down the guest using the guest OS' provided method, for Linux, type the command
-
-{\small {\tt poweroff}} 
-
-in the HVM guest's console, for Windows use Start -> Shutdown first to prevent
-data loss. Depending on the configuration the guest will be automatically
-destroyed, otherwise execute the command 
-
-{\small {\tt xm destroy \emph{vmx\_guest\_id} }} 
-
-at the Domain0 console.
-
-\subsection{HVM window (X or VNC) Hot Key}
-If you are running in the X environment after creating a HVM guest, an X window is created. There are several hot keys for control of the HVM guest that can be used in the window.
- 
-{\bfseries Ctrl+Alt+2} switches from guest VGA window to the control window. Typing {\small {\tt help }} shows the control commands help. For example, 'q' is the command to destroy the HVM guest.\\
-{\bfseries Ctrl+Alt+1} switches back to HVM guest's VGA.\\
-{\bfseries Ctrl+Alt+3} switches to serial port output. It captures serial output from the HVM guest. It works only if the HVM guest was configured to use the serial port. \\
-
-
-%% Chapter Glossary of Terms moved to glossary.tex
-\chapter{Glossary of Terms}
-
-\begin{description}
-
-\item[Domain] A domain is the execution context that contains a
-  running {\bf virtual machine}.  The relationship between virtual
-  machines and domains on Xen is similar to that between programs and
-  processes in an operating system: a virtual machine is a persistent
-  entity that resides on disk (somewhat like a program).  When it is
-  loaded for execution, it runs in a domain.  Each domain has a {\bf
-    domain ID}.
-
-\item[Domain 0] The first domain to be started on a Xen machine.
-  Domain 0 is responsible for managing the system.
-
-\item[Domain ID] A unique identifier for a {\bf domain}, analogous to
-  a process ID in an operating system.
-
-\item[Full virtualization] An approach to virtualization which
-  requires no modifications to the hosted operating system, providing
-  the illusion of a complete system of real hardware devices.
-
-\item[Hypervisor] An alternative term for {\bf VMM}, used because it
-  means `beyond supervisor', since it is responsible for managing
-  multiple `supervisor' kernels.
-
-\item[Live migration] A technique for moving a running virtual machine
-  to another physical host, without stopping it or the services
-  running on it.
-
-\item[Paravirtualization] An approach to virtualization which requires
-  modifications to the operating system in order to run in a virtual
-  machine.  Xen uses paravirtualization but preserves binary
-  compatibility for user space applications.
-
-\item[Shadow pagetables] A technique for hiding the layout of machine
-  memory from a virtual machine's operating system.  Used in some {\bf
-  VMMs} to provide the illusion of contiguous physical memory, in
-  Xen this is used during {\bf live migration}.
-
-\item[Virtual Block Device] Persistent storage available to a virtual
-  machine, providing the abstraction of an actual block storage device.
-  {\bf VBD}s may be actual block devices, filesystem images, or
-  remote/network storage.
-
-\item[Virtual Machine] The environment in which a hosted operating
-  system runs, providing the abstraction of a dedicated machine.  A
-  virtual machine may be identical to the underlying hardware (as in
-  {\bf full virtualization}, or it may differ, as in {\bf
-  paravirtualization}).
-
-\item[VMM] Virtual Machine Monitor - the software that allows multiple
-  virtual machines to be multiplexed on a single physical machine.
-
-\item[Xen] Xen is a paravirtualizing virtual machine monitor,
-  developed primarily by the Systems Research Group at the University
-  of Cambridge Computer Laboratory.
-
-\item[XenLinux] A name for the port of the Linux kernel that
-  runs on Xen.
-
-\end{description}
-
-
-\end{document}
-
-
-%% Other stuff without a home
-
-%% Instructions Re Python API
-
-%% Other Control Tasks using Python
-%% ================================
-
-%% A Python module 'Xc' is installed as part of the tools-install
-%% process. This can be imported, and an 'xc object' instantiated, to
-%% provide access to privileged command operations:
-
-%% # import Xc
-%% # xc = Xc.new()
-%% # dir(xc)
-%% # help(xc.domain_create)
-
-%% In this way you can see that the class 'xc' contains useful
-%% documentation for you to consult.
-
-%% A further package of useful routines (xenctl) is also installed:
-
-%% # import xenctl.utils
-%% # help(xenctl.utils)
-
-%% You can use these modules to write your own custom scripts or you
-%% can customise the scripts supplied in the Xen distribution.
-
-
-
-% Explain about AGP GART
-
-
-%% If you're not intending to configure the new domain with an IP
-%% address on your LAN, then you'll probably want to use NAT. The
-%% 'xen_nat_enable' installs a few useful iptables rules into domain0
-%% to enable NAT. [NB: We plan to support RSIP in future]
-
-
-
-%% Installing the file systems from the CD
-%% =======================================
-
-%% If you haven't got an existing Linux installation onto which you
-%% can just drop down the Xen and Xenlinux images, then the file
-%% systems on the CD provide a quick way of doing an install. However,
-%% you would be better off in the long run doing a proper install of
-%% your preferred distro and installing Xen onto that, rather than
-%% just doing the hack described below:
-
-%% Choose one or two partitions, depending on whether you want a
-%% separate /usr or not. Make file systems on it/them e.g.:
-%% mkfs -t ext3 /dev/hda3
-%% [or mkfs -t ext2 /dev/hda3 && tune2fs -j /dev/hda3 if using an old
-%% version of mkfs]
-
-%% Next, mount the file system(s) e.g.:
-%%   mkdir /mnt/root && mount /dev/hda3 /mnt/root
-%%   [mkdir /mnt/usr && mount /dev/hda4 /mnt/usr]
-  
-%% To install the root file system, simply untar /usr/XenDemoCD/root.tar.gz:
-%%   cd /mnt/root && tar -zxpf /usr/XenDemoCD/root.tar.gz
-
-%% You'll need to edit /mnt/root/etc/fstab to reflect your file system
-%% configuration. Changing the password file (etc/shadow) is probably a
-%% good idea too.
-
-%% To install the usr file system, copy the file system from CD on
-%% /usr, though leaving out the "XenDemoCD" and "boot" directories:
-%%   cd /usr && cp -a X11R6 etc java libexec root src bin dict kerberos
-%%    local sbin tmp doc include lib man share /mnt/usr
-
-%% If you intend to boot off these file systems (i.e. use them for
-%% domain 0), then you probably want to copy the /usr/boot
-%% directory on the cd over the top of the current symlink to /boot
-%% on your root filesystem (after deleting the current symlink)
-%% i.e.:
-%%   cd /mnt/root ; rm boot ; cp -a /usr/boot .

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

From xen-changelog-bounces@lists.xensource.com Thu Jan 26 00:44:35 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jan 2012 00:44: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.xensource.com>)
	id 1RqDS1-0003MG-1C; Thu, 26 Jan 2012 00:44:29 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RqDRy-0003M4-Qa
	for xen-changelog@lists.xensource.com; Thu, 26 Jan 2012 00:44:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327538650!3099405!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23036 invoked from network); 26 Jan 2012 00:44:11 -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;
	26 Jan 2012 00:44:11 -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 1RqDRh-0006zb-B0
	for xen-changelog@lists.xensource.com; Thu, 26 Jan 2012 00:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RqDRg-0001EK-MG
	for xen-changelog@lists.xensource.com; Thu, 26 Jan 2012 00:44:08 +0000
Message-Id: <E1RqDRg-0001EK-MG@xenbits.xen.org>
Date: Thu, 26 Jan 2012 00:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: Remove outdated LaTex
	documentation.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1327506767 0
# Node ID 4271634e4c86568b6bf2241ebf9be4a82ab430bf
# Parent  a2a8089b1ffbf5757ca3191cb8f74a5f1ed7fed1
docs: Remove outdated LaTex documentation.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r a2a8089b1ffb -r 4271634e4c86 Makefile
--- a/Makefile	Tue Jan 24 16:46:17 2012 +0000
+++ b/Makefile	Wed Jan 25 15:52:47 2012 +0000
@@ -104,7 +104,7 @@
 
 .PHONY: install-docs
 install-docs:
-	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
+	$(MAKE) -C docs install || true
 
 .PHONY: dev-docs
 dev-docs:
diff -r a2a8089b1ffb -r 4271634e4c86 docs/INDEX
--- a/docs/INDEX	Tue Jan 24 16:46:17 2012 +0000
+++ b/docs/INDEX	Wed Jan 25 15:52:47 2012 +0000
@@ -5,7 +5,3 @@
 misc				Miscellaneous Documentation
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 misc/console			Xen PV Console notes
-
-# These are not all that useful anymore, hide them from the index
-reference/interface/index	NO-INDEX
-reference/user/index		NO-INDEX
diff -r a2a8089b1ffb -r 4271634e4c86 docs/Makefile
--- a/docs/Makefile	Tue Jan 24 16:46:17 2012 +0000
+++ b/docs/Makefile	Wed Jan 25 15:52:47 2012 +0000
@@ -10,12 +10,8 @@
 DOC_MAN1SRC	:= $(wildcard man/*.pod.1)
 DOC_MAN1	:= $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
 DOC_MAN5	:= $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
-DOC_TEX		:= src/user.tex src/interface.tex
 DOC_MARKDOWN	:= $(wildcard misc/*.markdown)
-DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
-DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
-DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
-		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+DOC_HTML	:= $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
 		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt)) \
@@ -25,13 +21,11 @@
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC))
 
-GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
-
 .PHONY: all
 all: build
 
 .PHONY: build
-build: ps pdf html txt man-pages
+build: html txt man-pages
 	@if which $(DOT) 1>/dev/null 2>/dev/null ; then              \
 	$(MAKE) -C xen-api build ; else                              \
         echo "Graphviz (dot) not installed; skipping xen-api." ; fi
@@ -40,12 +34,6 @@
 .PHONY: dev-docs
 dev-docs: python-dev-docs
 
-.PHONY: ps
-ps: $(DOC_PS)
-
-.PHONY: pdf
-pdf: $(DOC_PDF)
-
 .PHONY: html
 html: $(DOC_HTML) html/index.html
 
@@ -82,7 +70,7 @@
 	$(MAKE) -C xen-api clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
-	rm -rf $(GFX) ps pdf html txt
+	rm -rf html txt
 	rm -rf api
 	rm -rf man5
 	rm -rf man1
@@ -97,39 +85,11 @@
 
 	$(MAKE) -C xen-api install
 
-	cp -dR ps $(DESTDIR)$(DOCDIR)
-	cp -dR pdf $(DESTDIR)$(DOCDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
 	cp -dR man1 $(DESTDIR)$(MANDIR)
 	cp -dR man5 $(DESTDIR)$(MANDIR)
 	[ ! -d html ] || cp -dR html $(DESTDIR)$(DOCDIR)
 
-pdf/%.pdf: ps/%.ps
-	$(INSTALL_DIR) $(@D)
-	$(PS2PDF) $< $@.new
-	mv $@.new $@
-
-ps/%.ps: %.dvi
-	$(INSTALL_DIR) $(@D)
-	$(DVIPS) -Ppdf -G0 -o $@.new $<
-	mv $@.new $@
-
-%.dvi: src/%.tex $(GFX)
-	$(LATEX) $< >/dev/null
-	if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
-
-%.eps: %.fig
-	$(FIG2DEV) -L eps $< $@
-
-html/reference/%/index.html: src/%.tex
-	@$(INSTALL_DIR) $(@D)
-	@set -e ; if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
-        echo "Running latex2html to generate reference/$*/index.html ... "; \
-	$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
-	-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
-	$< 1>/dev/null 2>/dev/null ; else \
-	echo "latex2html not installed; skipping reference/$*."; fi
-
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
 
diff -r a2a8089b1ffb -r 4271634e4c86 docs/check_pkgs
--- a/docs/check_pkgs	Tue Jan 24 16:46:17 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-
-silent_which ()
-{
-        which $1 1>/dev/null 2>/dev/null || {
-                echo "================================================="
-                echo "================================================="
-                echo "= WARNING: Package '$1' is required"
-                echo "=          to build Xen documentation"
-                echo "================================================="
-                echo "================================================="
-        }
-        which $1 1>/dev/null 2>/dev/null
-}
-
-silent_which latex      || exit 1
-silent_which dvips      || exit 1
-silent_which ps2pdf     || exit 1
-silent_which fig2dev    || exit 1
-
-exit 0
diff -r a2a8089b1ffb -r 4271634e4c86 docs/src/interface.tex
--- a/docs/src/interface.tex	Tue Jan 24 16:46:17 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2216 +0,0 @@
-\documentclass[11pt,twoside,final,openright,a4paper]{report}
-\usepackage{graphicx,html,setspace,times}
-\usepackage{parskip}
-\setstretch{1.15}
-
-% LIBRARY FUNCTIONS
-
-\newcommand{\hypercall}[1]{\vspace{2mm}{\sf #1}}
-
-\begin{document}
-
-% TITLE PAGE
-\pagestyle{empty}
-\begin{center}
-\vspace*{\fill}
-\includegraphics{figs/xenlogo.eps}
-\vfill
-\vfill
-\vfill
-\begin{tabular}{l}
-{\Huge \bf Interface manual} \\[4mm]
-{\huge Xen v3.0 for x86} \\[80mm]
-
-{\Large Xen is Copyright (c) 2002-2005, The Xen Team} \\[3mm]
-{\Large University of Cambridge, UK} \\[20mm]
-\end{tabular}
-\end{center}
-
-{\bf DISCLAIMER: This documentation is always under active development
-and as such there may be mistakes and omissions --- watch out for
-these and please report any you find to the developer's mailing list.
-The latest version is always available on-line.  Contributions of
-material, suggestions and corrections are welcome.  }
-
-\vfill
-\cleardoublepage
-
-% TABLE OF CONTENTS
-\pagestyle{plain}
-\pagenumbering{roman}
-{ \parskip 0pt plus 1pt
-  \tableofcontents }
-\cleardoublepage
-
-% PREPARE FOR MAIN TEXT
-\pagenumbering{arabic}
-\raggedbottom
-\widowpenalty=10000
-\clubpenalty=10000
-\parindent=0pt
-\parskip=5pt
-\renewcommand{\topfraction}{.8}
-\renewcommand{\bottomfraction}{.8}
-\renewcommand{\textfraction}{.2}
-\renewcommand{\floatpagefraction}{.8}
-\setstretch{1.1}
-
-\chapter{Introduction}
-
-Xen allows the hardware resources of a machine to be virtualized and
-dynamically partitioned, allowing multiple different {\em guest}
-operating system images to be run simultaneously.  Virtualizing the
-machine in this manner provides considerable flexibility, for example
-allowing different users to choose their preferred operating system
-(e.g., Linux, NetBSD, or a custom operating system).  Furthermore, Xen
-provides secure partitioning between virtual machines (known as
-{\em domains} in Xen terminology), and enables better resource
-accounting and QoS isolation than can be achieved with a conventional
-operating system. 
-
-Xen essentially takes a `whole machine' virtualization approach as
-pioneered by IBM VM/370.  However, unlike VM/370 or more recent
-efforts such as VMware and Virtual PC, Xen does not attempt to
-completely virtualize the underlying hardware.  Instead parts of the
-hosted guest operating systems are modified to work with the VMM; the
-operating system is effectively ported to a new target architecture,
-typically requiring changes in just the machine-dependent code.  The
-user-level API is unchanged, and so existing binaries and operating
-system distributions work without modification.
-
-In addition to exporting virtualized instances of CPU, memory, network
-and block devices, Xen exposes a control interface to manage how these
-resources are shared between the running domains. Access to the
-control interface is restricted: it may only be used by one
-specially-privileged VM, known as {\em domain 0}.  This domain is a
-required part of any Xen-based server and runs the application software
-that manages the control-plane aspects of the platform.  Running the
-control software in {\it domain 0}, distinct from the hypervisor
-itself, allows the Xen framework to separate the notions of 
-mechanism and policy within the system.
-
-
-\chapter{Virtual Architecture}
-
-In a Xen/x86 system, only the hypervisor runs with full processor
-privileges ({\it ring 0} in the x86 four-ring model). It has full
-access to the physical memory available in the system and is
-responsible for allocating portions of it to running domains.  
-
-On a 32-bit x86 system, guest operating systems may use {\it rings 1},
-{\it 2} and {\it 3} as they see fit.  Segmentation is used to prevent
-the guest OS from accessing the portion of the address space that is
-reserved for Xen.  We expect most guest operating systems will use
-ring 1 for their own operation and place applications in ring 3.
-
-On 64-bit systems it is not possible to protect the hypervisor from
-untrusted guest code running in rings 1 and 2. Guests are therefore
-restricted to run in ring 3 only. The guest kernel is protected from its
-applications by context switching between the kernel and currently
-running application.
-
-In this chapter we consider the basic virtual architecture provided by
-Xen: CPU state, exception and interrupt handling, and time.
-Other aspects such as memory and device access are discussed in later
-chapters.
-
-
-\section{CPU state}
-
-All privileged state must be handled by Xen.  The guest OS has no
-direct access to CR3 and is not permitted to update privileged bits in
-EFLAGS. Guest OSes use \emph{hypercalls} to invoke operations in Xen;
-these are analogous to system calls but occur from ring 1 to ring 0.
-
-A list of all hypercalls is given in Appendix~\ref{a:hypercalls}.
-
-
-\section{Exceptions}
-
-A virtual IDT is provided --- a domain can submit a table of trap
-handlers to Xen via the {\bf set\_trap\_table} hypercall.  The
-exception stack frame presented to a virtual trap handler is identical
-to its native equivalent.
-
-
-\section{Interrupts and events}
-
-Interrupts are virtualized by mapping them to \emph{event channels},
-which are delivered asynchronously to the target domain using a callback
-supplied via the {\bf set\_callbacks} hypercall.  A guest OS can map
-these events onto its standard interrupt dispatch mechanisms.  Xen is
-responsible for determining the target domain that will handle each
-physical interrupt source. For more details on the binding of event
-sources to event channels, see Chapter~\ref{c:devices}.
-
-
-\section{Time}
-
-Guest operating systems need to be aware of the passage of both real
-(or wallclock) time and their own `virtual time' (the time for which
-they have been executing). Furthermore, Xen has a notion of time which
-is used for scheduling. The following notions of time are provided:
-
-\begin{description}
-\item[Cycle counter time.]
-
-  This provides a fine-grained time reference.  The cycle counter time
-  is used to accurately extrapolate the other time references.  On SMP
-  machines it is currently assumed that the cycle counter time is
-  synchronized between CPUs.  The current x86-based implementation
-  achieves this within inter-CPU communication latencies.
-
-\item[System time.]
-
-  This is a 64-bit counter which holds the number of nanoseconds that
-  have elapsed since system boot.
-
-\item[Wall clock time.]
-
-  This is the time of day in a Unix-style {\bf struct timeval}
-  (seconds and microseconds since 1 January 1970, adjusted by leap
-  seconds).  An NTP client hosted by {\it domain 0} can keep this
-  value accurate.
-
-\item[Domain virtual time.]
-
-  This progresses at the same pace as system time, but only while a
-  domain is executing --- it stops while a domain is de-scheduled.
-  Therefore the share of the CPU that a domain receives is indicated
-  by the rate at which its virtual time increases.
-
-\end{description}
-
-
-Xen exports timestamps for system time and wall-clock time to guest
-operating systems through a shared page of memory.  Xen also provides
-the cycle counter time at the instant the timestamps were calculated,
-and the CPU frequency in Hertz.  This allows the guest to extrapolate
-system and wall-clock times accurately based on the current cycle
-counter time.
-
-Since all time stamps need to be updated and read \emph{atomically}
-a version number is also stored in the shared info page, which is
-incremented before and after updating the timestamps. Thus a guest can
-be sure that it read a consistent state by checking the two version
-numbers are equal and even.
-
-Xen includes a periodic ticker which sends a timer event to the
-currently executing domain every 10ms.  The Xen scheduler also sends a
-timer event whenever a domain is scheduled; this allows the guest OS
-to adjust for the time that has passed while it has been inactive.  In
-addition, Xen allows each domain to request that they receive a timer
-event sent at a specified system time by using the {\bf
-  set\_timer\_op} hypercall.  Guest OSes may use this timer to
-implement timeout values when they block.
-
-
-\section{Xen CPU Scheduling}
-
-Xen offers a uniform API for CPU schedulers.  It is possible to choose
-from a number of schedulers at boot and it should be easy to add more.
-The SEDF and Credit schedulers are part of the normal Xen
-distribution.  SEDF will be going away and its use should be
-avoided once the credit scheduler has stabilized and become the default.
-The Credit scheduler provides proportional fair shares of the
-host's CPUs to the running domains. It does this while transparently
-load balancing runnable VCPUs across the whole system.
-
-\paragraph*{Note: SMP host support}
-Xen has always supported SMP host systems. When using the credit scheduler,
-a domain's VCPUs will be dynamically moved across physical CPUs to maximise
-domain and system throughput. VCPUs can also be manually restricted to be
-mapped only on a subset of the host's physical CPUs, using the pinning
-mechanism.
-
-
-%% More information on the characteristics and use of these schedulers
-%% is available in {\bf Sched-HOWTO.txt}.
-
-
-\section{Privileged operations}
-
-Xen exports an extended interface to privileged domains (viz.\ {\it
-  Domain 0}). This allows such domains to build and boot other domains
-on the server, and provides control interfaces for managing
-scheduling, memory, networking, and block devices.
-
-\chapter{Memory}
-\label{c:memory} 
-
-Xen is responsible for managing the allocation of physical memory to
-domains, and for ensuring safe use of the paging and segmentation
-hardware.
-
-
-\section{Memory Allocation}
-
-As well as allocating a portion of physical memory for its own private
-use, Xen also reserves s small fixed portion of every virtual address
-space. This is located in the top 64MB on 32-bit systems, the top
-168MB on PAE systems, and a larger portion in the middle of the
-address space on 64-bit systems. Unreserved physical memory is
-available for allocation to domains at a page granularity.  Xen tracks
-the ownership and use of each page, which allows it to enforce secure
-partitioning between domains.
-
-Each domain has a maximum and current physical memory allocation.  A
-guest OS may run a `balloon driver' to dynamically adjust its current
-memory allocation up to its limit.
-
-
-\section{Pseudo-Physical Memory}
-
-Since physical memory is allocated and freed on a page granularity,
-there is no guarantee that a domain will receive a contiguous stretch
-of physical memory. However most operating systems do not have good
-support for operating in a fragmented physical address space. To aid
-porting such operating systems to run on top of Xen, we make a
-distinction between \emph{machine memory} and \emph{pseudo-physical
-  memory}.
-
-Put simply, machine memory refers to the entire amount of memory
-installed in the machine, including that reserved by Xen, in use by
-various domains, or currently unallocated. We consider machine memory
-to comprise a set of 4kB \emph{machine page frames} numbered
-consecutively starting from 0. Machine frame numbers mean the same
-within Xen or any domain.
-
-Pseudo-physical memory, on the other hand, is a per-domain
-abstraction. It allows a guest operating system to consider its memory
-allocation to consist of a contiguous range of physical page frames
-starting at physical frame 0, despite the fact that the underlying
-machine page frames may be sparsely allocated and in any order.
-
-To achieve this, Xen maintains a globally readable {\it
-  machine-to-physical} table which records the mapping from machine
-page frames to pseudo-physical ones. In addition, each domain is
-supplied with a {\it physical-to-machine} table which performs the
-inverse mapping. Clearly the machine-to-physical table has size
-proportional to the amount of RAM installed in the machine, while each
-physical-to-machine table has size proportional to the memory
-allocation of the given domain.
-
-Architecture dependent code in guest operating systems can then use
-the two tables to provide the abstraction of pseudo-physical memory.
-In general, only certain specialized parts of the operating system
-(such as page table management) needs to understand the difference
-between machine and pseudo-physical addresses.
-
-
-\section{Page Table Updates}
-
-In the default mode of operation, Xen enforces read-only access to
-page tables and requires guest operating systems to explicitly request
-any modifications.  Xen validates all such requests and only applies
-updates that it deems safe.  This is necessary to prevent domains from
-adding arbitrary mappings to their page tables.
-
-To aid validation, Xen associates a type and reference count with each
-memory page. A page has one of the following mutually-exclusive types
-at any point in time: page directory ({\sf PD}), page table ({\sf
-  PT}), local descriptor table ({\sf LDT}), global descriptor table
-({\sf GDT}), or writable ({\sf RW}). Note that a guest OS may always
-create readable mappings of its own memory regardless of its current
-type.
-
-%%% XXX: possibly explain more about ref count 'lifecyle' here?
-This mechanism is used to maintain the invariants required for safety;
-for example, a domain cannot have a writable mapping to any part of a
-page table as this would require the page concerned to simultaneously
-be of types {\sf PT} and {\sf RW}.
-
-\hypercall{mmu\_update(mmu\_update\_t *req, int count, int *success\_count, domid\_t domid)}
-
-This hypercall is used to make updates to either the domain's
-pagetables or to the machine to physical mapping table.  It supports
-submitting a queue of updates, allowing batching for maximal
-performance.  Explicitly queuing updates using this interface will
-cause any outstanding writable pagetable state to be flushed from the
-system.
-
-\section{Writable Page Tables}
-
-Xen also provides an alternative mode of operation in which guests
-have the illusion that their page tables are directly writable.  Of
-course this is not really the case, since Xen must still validate
-modifications to ensure secure partitioning. To this end, Xen traps
-any write attempt to a memory page of type {\sf PT} (i.e., that is
-currently part of a page table).  If such an access occurs, Xen
-temporarily allows write access to that page while at the same time
-\emph{disconnecting} it from the page table that is currently in use.
-This allows the guest to safely make updates to the page because the
-newly-updated entries cannot be used by the MMU until Xen revalidates
-and reconnects the page.  Reconnection occurs automatically in a
-number of situations: for example, when the guest modifies a different
-page-table page, when the domain is preempted, or whenever the guest
-uses Xen's explicit page-table update interfaces.
-
-Writable pagetable functionality is enabled when the guest requests
-it, using a {\bf vm\_assist} hypercall.  Writable pagetables do {\em
-not} provide full virtualisation of the MMU, so the memory management
-code of the guest still needs to be aware that it is running on Xen.
-Since the guest's page tables are used directly, it must translate
-pseudo-physical addresses to real machine addresses when building page
-table entries.  The guest may not attempt to map its own pagetables
-writably, since this would violate the memory type invariants; page
-tables will automatically be made writable by the hypervisor, as
-necessary.
-
-\section{Shadow Page Tables}
-
-Finally, Xen also supports a form of \emph{shadow page tables} in
-which the guest OS uses a independent copy of page tables which are
-unknown to the hardware (i.e.\ which are never pointed to by {\tt
-  cr3}). Instead Xen propagates changes made to the guest's tables to
-the real ones, and vice versa. This is useful for logging page writes
-(e.g.\ for live migration or checkpoint). A full version of the shadow
-page tables also allows guest OS porting with less effort.
-
-
-\section{Segment Descriptor Tables}
-
-At start of day a guest is supplied with a default GDT, which does not reside
-within its own memory allocation.  If the guest wishes to use other
-than the default `flat' ring-1 and ring-3 segments that this GDT
-provides, it must register a custom GDT and/or LDT with Xen, allocated
-from its own memory.
-
-The following hypercall is used to specify a new GDT:
-
-\begin{quote}
-  int {\bf set\_gdt}(unsigned long *{\em frame\_list}, int {\em
-    entries})
-
-  \emph{frame\_list}: An array of up to 14 machine page frames within
-  which the GDT resides.  Any frame registered as a GDT frame may only
-  be mapped read-only within the guest's address space (e.g., no
-  writable mappings, no use as a page-table page, and so on). Only 14
-  pages may be specified because pages 15 and 16 are reserved for
-  the hypervisor's GDT entries.
-
-  \emph{entries}: The number of descriptor-entry slots in the GDT.
-\end{quote}
-
-The LDT is updated via the generic MMU update mechanism (i.e., via the
-{\bf mmu\_update} hypercall.
-
-\section{Start of Day}
-
-The start-of-day environment for guest operating systems is rather
-different to that provided by the underlying hardware. In particular,
-the processor is already executing in protected mode with paging
-enabled.
-
-{\it Domain 0} is created and booted by Xen itself. For all subsequent
-domains, the analogue of the boot-loader is the {\it domain builder},
-user-space software running in {\it domain 0}. The domain builder is
-responsible for building the initial page tables for a domain and
-loading its kernel image at the appropriate virtual address.
-
-\section{VM assists}
-
-Xen provides a number of ``assists'' for guest memory management.
-These are available on an ``opt-in'' basis to provide commonly-used
-extra functionality to a guest.
-
-\hypercall{vm\_assist(unsigned int cmd, unsigned int type)}
-
-The {\bf cmd} parameter describes the action to be taken, whilst the
-{\bf type} parameter describes the kind of assist that is being
-referred to.  Available commands are as follows:
-
-\begin{description}
-\item[VMASST\_CMD\_enable] Enable a particular assist type
-\item[VMASST\_CMD\_disable] Disable a particular assist type
-\end{description}
-
-And the available types are:
-
-\begin{description}
-\item[VMASST\_TYPE\_4gb\_segments] Provide emulated support for
-  instructions that rely on 4GB segments (such as the techniques used
-  by some TLS solutions).
-\item[VMASST\_TYPE\_4gb\_segments\_notify] Provide a callback (via trap number
-  15) to the guest if the above segment fixups are used: allows the guest to
-  display a warning message during boot.
-\item[VMASST\_TYPE\_writable\_pagetables] Enable writable pagetable
-  mode - described above.
-\end{description}
-
-
-\chapter{Xen Info Pages}
-
-The {\bf Shared info page} is used to share various CPU-related state
-between the guest OS and the hypervisor.  This information includes VCPU
-status, time information and event channel (virtual interrupt) state.
-The {\bf Start info page} is used to pass build-time information to
-the guest when it boots and when it is resumed from a suspended state.
-This chapter documents the fields included in the {\bf
-shared\_info\_t} and {\bf start\_info\_t} structures for use by the
-guest OS.
-
-\section{Shared info page}
-
-The {\bf shared\_info\_t} is accessed at run time by both Xen and the
-guest OS.  It is used to pass information relating to the
-virtual CPU and virtual machine state between the OS and the
-hypervisor.
-
-The structure is declared in {\bf xen/include/public/xen.h}:
-
-\scriptsize
-\begin{verbatim}
-typedef struct shared_info {
-    vcpu_info_t vcpu_info[XEN_LEGACY_MAX_VCPUS];
-
-    /*
-     * A domain can create "event channels" on which it can send and receive
-     * asynchronous event notifications. There are three classes of event that
-     * are delivered by this mechanism:
-     *  1. Bi-directional inter- and intra-domain connections. Domains must
-     *     arrange out-of-band to set up a connection (usually by allocating
-     *     an unbound 'listener' port and advertising that via a storage service
-     *     such as xenstore).
-     *  2. Physical interrupts. A domain with suitable hardware-access
-     *     privileges can bind an event-channel port to a physical interrupt
-     *     source.
-     *  3. Virtual interrupts ('events'). A domain can bind an event-channel
-     *     port to a virtual interrupt source, such as the virtual-timer
-     *     device or the emergency console.
-     * 
-     * Event channels are addressed by a "port index". Each channel is
-     * associated with two bits of information:
-     *  1. PENDING -- notifies the domain that there is a pending notification
-     *     to be processed. This bit is cleared by the guest.
-     *  2. MASK -- if this bit is clear then a 0->1 transition of PENDING
-     *     will cause an asynchronous upcall to be scheduled. This bit is only
-     *     updated by the guest. It is read-only within Xen. If a channel
-     *     becomes pending while the channel is masked then the 'edge' is lost
-     *     (i.e., when the channel is unmasked, the guest must manually handle
-     *     pending notifications as no upcall will be scheduled by Xen).
-     * 
-     * To expedite scanning of pending notifications, any 0->1 pending
-     * transition on an unmasked channel causes a corresponding bit in a
-     * per-vcpu selector word to be set. Each bit in the selector covers a
-     * 'C long' in the PENDING bitfield array.
-     */
-    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
-    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
-
-    /*
-     * Wallclock time: updated only by control software. Guests should base
-     * their gettimeofday() syscall on this wallclock-base value.
-     */
-    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.  */
-
-    arch_shared_info_t arch;
-
-} shared_info_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[vcpu\_info] An array of {\bf vcpu\_info\_t} structures, each of
-  which holds either runtime information about a virtual CPU, or is
-  ``empty'' if the corresponding VCPU does not exist.
-\item[evtchn\_pending] Guest-global array, with one bit per event
-  channel.  Bits are set if an event is currently pending on that
-  channel.
-\item[evtchn\_mask] Guest-global array for masking notifications on
-  event channels.
-\item[wc\_version] Version counter for current wallclock time.
-\item[wc\_sec] Whole seconds component of current wallclock time.
-\item[wc\_nsec] Nanoseconds component of current wallclock time.
-\item[arch] Host architecture-dependent portion of the shared info
-  structure.
-\end{description}
-
-\subsection{vcpu\_info\_t}
-
-\scriptsize
-\begin{verbatim}
-typedef struct vcpu_info {
-    /*
-     * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
-     * a pending notification for a particular VCPU. It is then cleared 
-     * by the guest OS /before/ checking for pending work, thus avoiding
-     * a set-and-check race. Note that the mask is only accessed by Xen
-     * on the CPU that is currently hosting the VCPU. This means that the
-     * pending and mask flags can be updated by the guest without special
-     * synchronisation (i.e., no need for the x86 LOCK prefix).
-     * This may seem suboptimal because if the pending flag is set by
-     * a different CPU then an IPI may be scheduled even when the mask
-     * is set. However, note:
-     *  1. The task of 'interrupt holdoff' is covered by the per-event-
-     *     channel mask bits. A 'noisy' event that is continually being
-     *     triggered can be masked at source at this very precise
-     *     granularity.
-     *  2. The main purpose of the per-VCPU mask is therefore to restrict
-     *     reentrant execution: whether for concurrency control, or to
-     *     prevent unbounded stack usage. Whatever the purpose, we expect
-     *     that the mask will be asserted only for short periods at a time,
-     *     and so the likelihood of a 'spurious' IPI is suitably small.
-     * The mask is read before making an event upcall to the guest: a
-     * non-zero mask therefore guarantees that the VCPU will not receive
-     * an upcall activation. The mask is cleared when the VCPU requests
-     * to block: this avoids wakeup-waiting races.
-     */
-    uint8_t evtchn_upcall_pending;
-    uint8_t evtchn_upcall_mask;
-    unsigned long evtchn_pending_sel;
-    arch_vcpu_info_t arch;
-    vcpu_time_info_t time;
-} vcpu_info_t; /* 64 bytes (x86) */
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[evtchn\_upcall\_pending] This is set non-zero by Xen to indicate
-  that there are pending events to be received.
-\item[evtchn\_upcall\_mask] This is set non-zero to disable all
-  interrupts for this CPU for short periods of time.  If individual
-  event channels need to be masked, the {\bf evtchn\_mask} in the {\bf
-  shared\_info\_t} is used instead.
-\item[evtchn\_pending\_sel] When an event is delivered to this VCPU, a
-  bit is set in this selector to indicate which word of the {\bf
-  evtchn\_pending} array in the {\bf shared\_info\_t} contains the
-  event in question.
-\item[arch] Architecture-specific VCPU info. On x86 this contains the
-  virtualized CR2 register (page fault linear address) for this VCPU.
-\item[time] Time values for this VCPU.
-\end{description}
-
-\subsection{vcpu\_time\_info}
-
-\scriptsize
-\begin{verbatim}
-typedef struct vcpu_time_info {
-    /*
-     * Updates to the following values are preceded and followed by an
-     * increment of 'version'. The guest can therefore detect updates by
-     * looking for changes to 'version'. If the least-significant bit of
-     * the version number is set then an update is in progress and the guest
-     * must wait to read a consistent set of values.
-     * The correct way to interact with the version number is similar to
-     * Linux's seqlock: see the implementations of read_seqbegin/read_seqretry.
-     */
-    uint32_t version;
-    uint32_t pad0;
-    uint64_t tsc_timestamp;   /* TSC at last update of time vals.  */
-    uint64_t system_time;     /* Time, in nanosecs, since boot.    */
-    /*
-     * Current system time:
-     *   system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
-     * CPU frequency (Hz):
-     *   ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
-     */
-    uint32_t tsc_to_system_mul;
-    int8_t   tsc_shift;
-    int8_t   pad1[3];
-} vcpu_time_info_t; /* 32 bytes */
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[version] Used to ensure the guest gets consistent time updates.
-\item[tsc\_timestamp] Cycle counter timestamp of last time value;
-  could be used to expolate in between updates, for instance.
-\item[system\_time] Time since boot (nanoseconds).
-\item[tsc\_to\_system\_mul] Cycle counter to nanoseconds multiplier
-(used in extrapolating current time).
-\item[tsc\_shift] Cycle counter to nanoseconds shift (used in
-extrapolating current time).
-\end{description}
-
-\subsection{arch\_shared\_info\_t}
-
-On x86, the {\bf arch\_shared\_info\_t} is defined as follows (from
-xen/public/arch-x86\_32.h):
-
-\scriptsize
-\begin{verbatim}
-typedef struct arch_shared_info {
-    unsigned long max_pfn;                  /* max pfn that appears in table */
-    /* Frame containing list of mfns containing list of mfns containing p2m. */
-    unsigned long pfn_to_mfn_frame_list_list; 
-} arch_shared_info_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[max\_pfn] The maximum PFN listed in the physical-to-machine
-  mapping table (P2M table).
-\item[pfn\_to\_mfn\_frame\_list\_list] Machine address of the frame
-  that contains the machine addresses of the P2M table frames.
-\end{description}
-
-\section{Start info page}
-
-The start info structure is declared as the following (in {\bf
-xen/include/public/xen.h}):
-
-\scriptsize
-\begin{verbatim}
-#define MAX_GUEST_CMDLINE 1024
-typedef struct start_info {
-    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
-    char magic[32];             /* "Xen-<version>.<subversion>". */
-    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
-    unsigned long shared_info;  /* MACHINE address of shared info struct. */
-    uint32_t flags;             /* SIF_xxx flags.                         */
-    unsigned long store_mfn;    /* MACHINE page number of shared page.    */
-    uint32_t store_evtchn;      /* Event channel for store communication. */
-    unsigned long console_mfn;  /* MACHINE address of console page.       */
-    uint32_t console_evtchn;    /* Event channel for console messages.    */
-    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
-    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
-    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
-    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
-    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module.  */
-    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
-    int8_t cmd_line[MAX_GUEST_CMDLINE];
-} start_info_t;
-\end{verbatim}
-\normalsize
-
-The fields are in two groups: the first group are always filled in
-when a domain is booted or resumed, the second set are only used at
-boot time.
-
-The always-available group is as follows:
-
-\begin{description}
-\item[magic] A text string identifying the Xen version to the guest.
-\item[nr\_pages] The number of real machine pages available to the
-  guest.
-\item[shared\_info] Machine address of the shared info structure,
-  allowing the guest to map it during initialisation.
-\item[flags] Flags for describing optional extra settings to the
-  guest.
-\item[store\_mfn] Machine address of the Xenstore communications page.
-\item[store\_evtchn] Event channel to communicate with the store.
-\item[console\_mfn] Machine address of the console data page.
-\item[console\_evtchn] Event channel to notify the console backend.
-\end{description}
-
-The boot-only group may only be safely referred to during system boot:
-
-\begin{description}
-\item[pt\_base] Virtual address of the page directory created for us
-  by the domain builder.
-\item[nr\_pt\_frames] Number of frames used by the builders' bootstrap
-  pagetables.
-\item[mfn\_list] Virtual address of the list of machine frames this
-  domain owns.
-\item[mod\_start] Virtual address of any pre-loaded modules
-  (e.g. ramdisk)
-\item[mod\_len] Size of pre-loaded module (if any).
-\item[cmd\_line] Kernel command line passed by the domain builder.
-\end{description}
-
-
-% by Mark Williamson <mark.williamson@cl.cam.ac.uk>
-
-\chapter{Event Channels}
-\label{c:eventchannels}
-
-Event channels are the basic primitive provided by Xen for event
-notifications.  An event is the Xen equivalent of a hardware
-interrupt.  They essentially store one bit of information, the event
-of interest is signalled by transitioning this bit from 0 to 1.
-
-Notifications are received by a guest via an upcall from Xen,
-indicating when an event arrives (setting the bit).  Further
-notifications are masked until the bit is cleared again (therefore,
-guests must check the value of the bit after re-enabling event
-delivery to ensure no missed notifications).
-
-Event notifications can be masked by setting a flag; this is
-equivalent to disabling interrupts and can be used to ensure atomicity
-of certain operations in the guest kernel.
-
-\section{Hypercall interface}
-
-\hypercall{event\_channel\_op(evtchn\_op\_t *op)}
-
-The event channel operation hypercall is used for all operations on
-event channels / ports.  Operations are distinguished by the value of
-the {\bf cmd} field of the {\bf op} structure.  The possible commands
-are described below:
-
-\begin{description}
-
-\item[EVTCHNOP\_alloc\_unbound]
-  Allocate a new event channel port, ready to be connected to by a
-  remote domain.
-  \begin{itemize}
-  \item Specified domain must exist.
-  \item A free port must exist in that domain.
-  \end{itemize}
-  Unprivileged domains may only allocate their own ports, privileged
-  domains may also allocate ports in other domains.
-\item[EVTCHNOP\_bind\_interdomain]
-  Bind an event channel for interdomain communications.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item Remote domain must exist.
-  \item Remote port must be allocated and currently unbound.
-  \item Remote port must be expecting the caller domain as the ``remote''.
-  \end{itemize}
-\item[EVTCHNOP\_bind\_virq]
-  Allocate a port and bind a VIRQ to it.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item VIRQ must be valid.
-  \item VCPU must exist.
-  \item VIRQ must not currently be bound to an event channel.
-  \end{itemize}
-\item[EVTCHNOP\_bind\_ipi]
-  Allocate and bind a port for notifying other virtual CPUs.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item VCPU must exist.
-  \end{itemize}
-\item[EVTCHNOP\_bind\_pirq]
-  Allocate and bind a port to a real IRQ.
-  \begin{itemize}
-  \item Caller domain must have a free port to bind.
-  \item PIRQ must be within the valid range.
-  \item Another binding for this PIRQ must not exist for this domain.
-  \item Caller must have an available port.
-  \end{itemize}
-\item[EVTCHNOP\_close]
-  Close an event channel (no more events will be received).
-  \begin{itemize}
-  \item Port must be valid (currently allocated).
-  \end{itemize}
-\item[EVTCHNOP\_send] Send a notification on an event channel attached
-  to a port.
-  \begin{itemize}
-  \item Port must be valid.
-  \item Only valid for Interdomain, IPI or Allocated Unbound ports.
-  \end{itemize}
-\item[EVTCHNOP\_status] Query the status of a port; what kind of port,
-  whether it is bound, what remote domain is expected, what PIRQ or
-  VIRQ it is bound to, what VCPU will be notified, etc.
-  Unprivileged domains may only query the state of their own ports.
-  Privileged domains may query any port.
-\item[EVTCHNOP\_bind\_vcpu] Bind event channel to a particular VCPU -
-  receive notification upcalls only on that VCPU.
-  \begin{itemize}
-  \item VCPU must exist.
-  \item Port must be valid.
-  \item Event channel must be either: allocated but unbound, bound to
-  an interdomain event channel, bound to a PIRQ.
-  \end{itemize}
-
-\end{description}
-
-%%
-%% grant_tables.tex
-%% 
-%% Made by Mark Williamson
-%% Login   <mark@maw48>
-%%
-
-\chapter{Grant tables}
-\label{c:granttables}
-
-Xen's grant tables provide a generic mechanism to memory sharing
-between domains.  This shared memory interface underpins the split
-device drivers for block and network IO.
-
-Each domain has its own {\bf grant table}.  This is a data structure
-that is shared with Xen; it allows the domain to tell Xen what kind of
-permissions other domains have on its pages.  Entries in the grant
-table are identified by {\bf grant references}.  A grant reference is
-an integer, which indexes into the grant table.  It acts as a
-capability which the grantee can use to perform operations on the
-granter's memory.
-
-This capability-based system allows shared-memory communications
-between unprivileged domains.  A grant reference also encapsulates the
-details of a shared page, removing the need for a domain to know the
-real machine address of a page it is sharing.  This makes it possible
-to share memory correctly with domains running in fully virtualised
-memory.
-
-\section{Interface}
-
-\subsection{Grant table manipulation}
-
-Creating and destroying grant references is done by direct access to
-the grant table.  This removes the need to involve Xen when creating
-grant references, modifying access permissions, etc.  The grantee
-domain will invoke hypercalls to use the grant references.  Four main
-operations can be accomplished by directly manipulating the table:
-
-\begin{description}
-\item[Grant foreign access] allocate a new entry in the grant table
-  and fill out the access permissions accordingly.  The access
-  permissions will be looked up by Xen when the grantee attempts to
-  use the reference to map the granted frame.
-\item[End foreign access] check that the grant reference is not
-  currently in use, then remove the mapping permissions for the frame.
-  This prevents further mappings from taking place but does not allow
-  forced revocations of existing mappings.
-\item[Grant foreign transfer] allocate a new entry in the table
-  specifying transfer permissions for the grantee.  Xen will look up
-  this entry when the grantee attempts to transfer a frame to the
-  granter.
-\item[End foreign transfer] remove permissions to prevent a transfer
-  occurring in future.  If the transfer is already committed,
-  modifying the grant table cannot prevent it from completing.
-\end{description}
-
-\subsection{Hypercalls}
-
-Use of grant references is accomplished via a hypercall.  The grant
-table op hypercall takes three arguments:
-
-\hypercall{grant\_table\_op(unsigned int cmd, void *uop, unsigned int count)}
-
-{\bf cmd} indicates the grant table operation of interest.  {\bf uop}
-is a pointer to a structure (or an array of structures) describing the
-operation to be performed.  The {\bf count} field describes how many
-grant table operations are being batched together.
-
-The core logic is situated in {\bf xen/common/grant\_table.c}.  The
-grant table operation hypercall can be used to perform the following
-actions:
-
-\begin{description}
-\item[GNTTABOP\_map\_grant\_ref] Given a grant reference from another
-  domain, map the referred page into the caller's address space.
-\item[GNTTABOP\_unmap\_grant\_ref] Remove a mapping to a granted frame
-  from the caller's address space.  This is used to voluntarily
-  relinquish a mapping to a granted page.
-\item[GNTTABOP\_setup\_table] Setup grant table for caller domain.
-\item[GNTTABOP\_dump\_table] Debugging operation.
-\item[GNTTABOP\_transfer] Given a transfer reference from another
-  domain, transfer ownership of a page frame to that domain.
-\end{description}
-
-%%
-%% xenstore.tex
-%% 
-%% Made by Mark Williamson
-%% Login   <mark@maw48>
-%% 
-
-\chapter{Xenstore}
-
-Xenstore is the mechanism by which control-plane activities occur.
-These activities include:
-
-\begin{itemize}
-\item Setting up shared memory regions and event channels for use with
-  the split device drivers.
-\item Notifying the guest of control events (e.g. balloon driver
-  requests)
-\item Reporting back status information from the guest
-  (e.g. performance-related statistics, etc).
-\end{itemize}
-
-The store is arranged as a hierarchical collection of key-value pairs.
-Each domain has a directory hierarchy containing data related to its
-configuration.  Domains are permitted to register for notifications
-about changes in subtrees of the store, and to apply changes to the
-store transactionally.
-
-\section{Guidelines}
-
-A few principles govern the operation of the store:
-
-\begin{itemize}
-\item Domains should only modify the contents of their own
-  directories.
-\item The setup protocol for a device channel should simply consist of
-  entering the configuration data into the store.
-\item The store should allow device discovery without requiring the
-  relevant device drivers to be loaded: a Xen ``bus'' should be
-  visible to probing code in the guest.
-\item The store should be usable for inter-tool communications,
-  allowing the tools themselves to be decomposed into a number of
-  smaller utilities, rather than a single monolithic entity.  This
-  also facilitates the development of alternate user interfaces to the
-  same functionality.
-\end{itemize}
-
-\section{Store layout}
-
-There are three main paths in XenStore:
-
-\begin{description}
-\item[/vm] stores configuration information about domain
-\item[/local/domain] stores information about the domain on the local node (domid, etc.)
-\item[/tool] stores information for the various tools
-\end{description}
-
-The {\bf /vm} path stores configuration information for a domain.
-This information doesn't change and is indexed by the domain's UUID.
-A {\bf /vm} entry contains the following information:
-
-\begin{description}
-\item[uuid] uuid of the domain (somewhat redundant)
-\item[on\_reboot] the action to take on a domain reboot request (destroy or restart)
-\item[on\_poweroff] the action to take on a domain halt request (destroy or restart)
-\item[on\_crash] the action to take on a domain crash (destroy or restart)
-\item[vcpus] the number of allocated vcpus for the domain
-\item[memory] the amount of memory (in megabytes) for the domain Note: appears to sometimes be empty for domain-0
-\item[vcpu\_avail] the number of active vcpus for the domain (vcpus - number of disabled vcpus)
-\item[name] the name of the domain
-\end{description}
-
-
-{\bf /vm/$<$uuid$>$/image/}
-
-The image path is only available for Domain-Us and contains:
-\begin{description}
-\item[ostype] identifies the builder type (linux or vmx)
-\item[kernel] path to kernel on domain-0
-\item[cmdline] command line to pass to domain-U kernel
-\item[ramdisk] path to ramdisk on domain-0
-\end{description}
-
-{\bf /local}
-
-The {\tt /local} path currently only contains one directory, {\tt
-/local/domain} that is indexed by domain id.  It contains the running
-domain information.  The reason to have two storage areas is that
-during migration, the uuid doesn't change but the domain id does.  The
-{\tt /local/domain} directory can be created and populated before
-finalizing the migration enabling localhost to localhost migration.
-
-{\bf /local/domain/$<$domid$>$}
-
-This path contains:
-
-\begin{description}
-\item[cpu\_time] xend start time (this is only around for domain-0)
-\item[handle] private handle for xend
-\item[name] see /vm
-\item[on\_reboot] see /vm
-\item[on\_poweroff] see /vm
-\item[on\_crash] see /vm
-\item[vm] the path to the VM directory for the domain
-\item[domid] the domain id (somewhat redundant)
-\item[running] indicates that the domain is currently running
-\item[memory] the current memory in megabytes for the domain (empty for domain-0?)
-\item[maxmem\_KiB] the maximum memory for the domain (in kilobytes)
-\item[memory\_KiB] the memory allocated to the domain (in kilobytes)
-\item[cpu] the current CPU the domain is pinned to (empty for domain-0?)
-\item[cpu\_weight] the weight assigned to the domain
-\item[vcpu\_avail] a bitmap telling the domain whether it may use a given VCPU
-\item[online\_vcpus] how many vcpus are currently online
-\item[vcpus] the total number of vcpus allocated to the domain
-\item[console/] a directory for console information
-  \begin{description}
-  \item[ring-ref] the grant table reference of the console ring queue
-  \item[port] the event channel being used for the console ring queue (local port)
-  \item[tty] the current tty the console data is being exposed of
-  \item[limit] the limit (in bytes) of console data to buffer
-  \end{description}
-\item[backend/] a directory containing all backends the domain hosts
-  \begin{description}
-  \item[vbd/] a directory containing vbd backends
-    \begin{description}
-    \item[$<$domid$>$/] a directory containing vbd's for domid
-      \begin{description}
-      \item[$<$virtual-device$>$/] a directory for a particular
-	virtual-device on domid
-	\begin{description}
-	\item[frontend-id] domain id of frontend
-	\item[frontend] the path to the frontend domain
-	\item[physical-device] backend device number
-	\item[sector-size] backend sector size
-	\item[info] 0 read/write, 1 read-only (is this right?)
-	\item[domain] name of frontend domain
-	\item[params] parameters for device
-	\item[type] the type of the device
-	\item[dev] the virtual device (as given by the user)
-	\item[node] output from block creation script
-	\end{description}
-      \end{description}
-    \end{description}
-  
-  \item[vif/] a directory containing vif backends
-    \begin{description}
-    \item[$<$domid$>$/] a directory containing vif's for domid
-      \begin{description}
-      \item[$<$vif number$>$/] a directory for each vif
-      \item[frontend-id] the domain id of the frontend
-      \item[frontend] the path to the frontend
-      \item[mac] the mac address of the vif
-      \item[bridge] the bridge the vif is connected to
-      \item[handle] the handle of the vif
-      \item[script] the script used to create/stop the vif
-      \item[domain] the name of the frontend
-      \end{description}
-    \end{description}
-
-  \item[vtpm/] a directory containing vtpm backends
-    \begin{description}
-    \item[$<$domid$>$/] a directory containing vtpm's for domid
-      \begin{description}
-      \item[$<$vtpm number$>$/] a directory for each vtpm
-      \item[frontend-id] the domain id of the frontend
-      \item[frontend] the path to the frontend
-      \item[instance] the instance of the virtual TPM that is used
-      \item[pref{\textunderscore}instance] the instance number as given in the VM configuration file;
-           may be different from {\bf instance}
-      \item[domain] the name of the domain of the frontend
-      \end{description}
-    \end{description}
-
-  \end{description}
-
-  \item[device/] a directory containing the frontend devices for the
-    domain
-    \begin{description}
-    \item[vbd/] a directory containing vbd frontend devices for the
-      domain
-      \begin{description}
-      \item[$<$virtual-device$>$/] a directory containing the vbd frontend for
-	virtual-device
-	\begin{description}
-	\item[virtual-device] the device number of the frontend device
-	\item[backend-id] the domain id of the backend
-	\item[backend] the path of the backend in the store (/local/domain
-	  path)
-	\item[ring-ref] the grant table reference for the block request
-	  ring queue
-	\item[event-channel] the event channel used for the block request
-	  ring queue
-	\end{description}
-	
-      \item[vif/] a directory containing vif frontend devices for the
-	domain
-	\begin{description}
-	\item[$<$id$>$/] a directory for vif id frontend device for the domain
-	  \begin{description}
-	  \item[backend-id] the backend domain id
-	  \item[mac] the mac address of the vif
-	  \item[handle] the internal vif handle
-	  \item[backend] a path to the backend's store entry
-	  \item[tx-ring-ref] the grant table reference for the transmission ring queue 
-	  \item[rx-ring-ref] the grant table reference for the receiving ring queue 
-	  \item[event-channel] the event channel used for the two ring queues 
-	  \end{description}
-	\end{description}
-
-      \item[vtpm/] a directory containing the vtpm frontend device for the
-        domain
-        \begin{description}
-        \item[$<$id$>$] a directory for vtpm id frontend device for the domain
-          \begin{description}
-	  \item[backend-id] the backend domain id
-          \item[backend] a path to the backend's store entry
-          \item[ring-ref] the grant table reference for the tx/rx ring
-          \item[event-channel] the event channel used for the ring
-          \end{description}
-        \end{description}
-	
-      \item[device-misc/] miscellaneous information for devices 
-	\begin{description}
-	\item[vif/] miscellaneous information for vif devices
-	  \begin{description}
-	  \item[nextDeviceID] the next device id to use 
-	  \end{description}
-	\end{description}
-      \end{description}
-    \end{description}
-
-  \item[security/] access control information for the domain
-    \begin{description}
-    \item[ssidref] security reference identifier used inside the hypervisor
-    \item[access\_control/] security label used by management tools
-      \begin{description}
-       \item[label] security label name
-       \item[policy] security policy name
-      \end{description}
-    \end{description}
-
-  \item[store/] per-domain information for the store
-    \begin{description}
-    \item[port] the event channel used for the store ring queue 
-    \item[ring-ref] - the grant table reference used for the store's
-      communication channel 
-    \end{description}
-    
-  \item[image] - private xend information 
-\end{description}
-
-
-\chapter{Devices}
-\label{c:devices}
-
-Virtual devices under Xen are provided by a {\bf split device driver}
-architecture.  The illusion of the virtual device is provided by two
-co-operating drivers: the {\bf frontend}, which runs an the
-unprivileged domain and the {\bf backend}, which runs in a domain with
-access to the real device hardware (often called a {\bf driver
-domain}; in practice domain 0 usually fulfills this function).
-
-The frontend driver appears to the unprivileged guest as if it were a
-real device, for instance a block or network device.  It receives IO
-requests from its kernel as usual, however since it does not have
-access to the physical hardware of the system it must then issue
-requests to the backend.  The backend driver is responsible for
-receiving these IO requests, verifying that they are safe and then
-issuing them to the real device hardware.  The backend driver appears
-to its kernel as a normal user of in-kernel IO functionality.  When
-the IO completes the backend notifies the frontend that the data is
-ready for use; the frontend is then able to report IO completion to
-its own kernel.
-
-Frontend drivers are designed to be simple; most of the complexity is
-in the backend, which has responsibility for translating device
-addresses, verifying that requests are well-formed and do not violate
-isolation guarantees, etc.
-
-Split drivers exchange requests and responses in shared memory, with
-an event channel for asynchronous notifications of activity.  When the
-frontend driver comes up, it uses Xenstore to set up a shared memory
-frame and an interdomain event channel for communications with the
-backend.  Once this connection is established, the two can communicate
-directly by placing requests / responses into shared memory and then
-sending notifications on the event channel.  This separation of
-notification from data transfer allows message batching, and results
-in very efficient device access.
-
-This chapter focuses on some individual split device interfaces
-available to Xen guests.
-
-        
-\section{Network I/O}
-
-Virtual network device services are provided by shared memory
-communication with a backend domain.  From the point of view of other
-domains, the backend may be viewed as a virtual ethernet switch
-element with each domain having one or more virtual network interfaces
-connected to it.
-
-From the point of view of the backend domain itself, the network
-backend driver consists of a number of ethernet devices.  Each of
-these has a logical direct connection to a virtual network device in
-another domain.  This allows the backend domain to route, bridge,
-firewall, etc the traffic to / from the other domains using normal
-operating system mechanisms.
-
-\subsection{Backend Packet Handling}
-
-The backend driver is responsible for a variety of actions relating to
-the transmission and reception of packets from the physical device.
-With regard to transmission, the backend performs these key actions:
-
-\begin{itemize}
-\item {\bf Validation:} To ensure that domains do not attempt to
-  generate invalid (e.g. spoofed) traffic, the backend driver may
-  validate headers ensuring that source MAC and IP addresses match the
-  interface that they have been sent from.
-
-  Validation functions can be configured using standard firewall rules
-  ({\small{\tt iptables}} in the case of Linux).
-  
-\item {\bf Scheduling:} Since a number of domains can share a single
-  physical network interface, the backend must mediate access when
-  several domains each have packets queued for transmission.  This
-  general scheduling function subsumes basic shaping or rate-limiting
-  schemes.
-  
-\item {\bf Logging and Accounting:} The backend domain can be
-  configured with classifier rules that control how packets are
-  accounted or logged.  For example, log messages might be generated
-  whenever a domain attempts to send a TCP packet containing a SYN.
-\end{itemize}
-
-On receipt of incoming packets, the backend acts as a simple
-demultiplexer: Packets are passed to the appropriate virtual interface
-after any necessary logging and accounting have been carried out.
-
-\subsection{Data Transfer}
-
-Each virtual interface uses two ``descriptor rings'', one for
-transmit, the other for receive.  Each descriptor identifies a block
-of contiguous machine memory allocated to the domain.
-
-The transmit ring carries packets to transmit from the guest to the
-backend domain.  The return path of the transmit ring carries messages
-indicating that the contents have been physically transmitted and the
-backend no longer requires the associated pages of memory.
-
-To receive packets, the guest places descriptors of unused pages on
-the receive ring.  The backend will return received packets by
-exchanging these pages in the domain's memory with new pages
-containing the received data, and passing back descriptors regarding
-the new packets on the ring.  This zero-copy approach allows the
-backend to maintain a pool of free pages to receive packets into, and
-then deliver them to appropriate domains after examining their
-headers.
-
-% Real physical addresses are used throughout, with the domain
-% performing translation from pseudo-physical addresses if that is
-% necessary.
-
-If a domain does not keep its receive ring stocked with empty buffers
-then packets destined to it may be dropped.  This provides some
-defence against receive livelock problems because an overloaded domain
-will cease to receive further data.  Similarly, on the transmit path,
-it provides the application with feedback on the rate at which packets
-are able to leave the system.
-
-Flow control on rings is achieved by including a pair of producer
-indexes on the shared ring page.  Each side will maintain a private
-consumer index indicating the next outstanding message.  In this
-manner, the domains cooperate to divide the ring into two message
-lists, one in each direction.  Notification is decoupled from the
-immediate placement of new messages on the ring; the event channel
-will be used to generate notification when {\em either} a certain
-number of outstanding messages are queued, {\em or} a specified number
-of nanoseconds have elapsed since the oldest message was placed on the
-ring.
-
-%% Not sure if my version is any better -- here is what was here
-%% before: Synchronization between the backend domain and the guest is
-%% achieved using counters held in shared memory that is accessible to
-%% both.  Each ring has associated producer and consumer indices
-%% indicating the area in the ring that holds descriptors that contain
-%% data.  After receiving {\it n} packets or {\t nanoseconds} after
-%% receiving the first packet, the hypervisor sends an event to the
-%% domain.
-
-
-\subsection{Network ring interface}
-
-The network device uses two shared memory rings for communication: one
-for transmit, one for receive.
-
-Transmit requests are described by the following structure:
-
-\scriptsize
-\begin{verbatim}
-typedef struct netif_tx_request {
-    grant_ref_t gref;      /* Reference to buffer page */
-    uint16_t offset;       /* Offset within buffer page */
-    uint16_t flags;        /* NETTXF_* */
-    uint16_t id;           /* Echoed in response message. */
-    uint16_t size;         /* Packet size in bytes.       */
-} netif_tx_request_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[gref] Grant reference for the network buffer
-\item[offset] Offset to data
-\item[flags] Transmit flags (currently only NETTXF\_csum\_blank is
-  supported, to indicate that the protocol checksum field is
-  incomplete).
-\item[id] Echoed to guest by the backend in the ring-level response so
-  that the guest can match it to this request
-\item[size] Buffer size
-\end{description}
-
-Each transmit request is followed by a transmit response at some later
-date.  This is part of the shared-memory communication protocol and
-allows the guest to (potentially) retire internal structures related
-to the request.  It does not imply a network-level response.  This
-structure is as follows:
-
-\scriptsize
-\begin{verbatim}
-typedef struct netif_tx_response {
-    uint16_t id;
-    int16_t  status;
-} netif_tx_response_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[id] Echo of the ID field in the corresponding transmit request.
-\item[status] Success / failure status of the transmit request.
-\end{description}
-
-Receive requests must be queued by the frontend, accompanied by a
-donation of page-frames to the backend.  The backend transfers page
-frames full of data back to the guest
-
-\scriptsize
-\begin{verbatim}
-typedef struct {
-    uint16_t    id;        /* Echoed in response message.        */
-    grant_ref_t gref;      /* Reference to incoming granted frame */
-} netif_rx_request_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[id] Echoed by the frontend to identify this request when
-  responding.
-\item[gref] Transfer reference - the backend will use this reference
-  to transfer a frame of network data to us.
-\end{description}
-
-Receive response descriptors are queued for each received frame.  Note
-that these may only be queued in reply to an existing receive request,
-providing an in-built form of traffic throttling.
-
-\scriptsize
-\begin{verbatim}
-typedef struct {
-    uint16_t id;
-    uint16_t offset;       /* Offset in page of start of received packet  */
-    uint16_t flags;        /* NETRXF_* */
-    int16_t  status;       /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
-} netif_rx_response_t;
-\end{verbatim}
-\normalsize
-
-\begin{description}
-\item[id] ID echoed from the original request, used by the guest to
-  match this response to the original request.
-\item[offset] Offset to data within the transferred frame.
-\item[flags] Transmit flags (currently only NETRXF\_csum\_valid is
-  supported, to indicate that the protocol checksum field has already
-  been validated).
-\item[status] Success / error status for this operation.
-\end{description}
-
-Note that the receive protocol includes a mechanism for guests to
-receive incoming memory frames but there is no explicit transfer of
-frames in the other direction.  Guests are expected to return memory
-to the hypervisor in order to use the network interface.  They {\em
-must} do this or they will exceed their maximum memory reservation and
-will not be able to receive incoming frame transfers.  When necessary,
-the backend is able to replenish its pool of free network buffers by
-claiming some of this free memory from the hypervisor.
-
-\section{Block I/O}
-
-All guest OS disk access goes through the virtual block device VBD
-interface.  This interface allows domains access to portions of block
-storage devices visible to the the block backend device.  The VBD
-interface is a split driver, similar to the network interface
-described above.  A single shared memory ring is used between the
-frontend and backend drivers for each virtual device, across which
-IO requests and responses are sent.
-
-Any block device accessible to the backend domain, including
-network-based block (iSCSI, *NBD, etc), loopback and LVM/MD devices,
-can be exported as a VBD.  Each VBD is mapped to a device node in the
-guest, specified in the guest's startup configuration.
-
-\subsection{Data Transfer}
-
-The per-(virtual)-device ring between the guest and the block backend
-supports two messages:
-
-\begin{description}
-\item [{\small {\tt READ}}:] Read data from the specified block
-  device.  The front end identifies the device and location to read
-  from and attaches pages for the data to be copied to (typically via
-  DMA from the device).  The backend acknowledges completed read
-  requests as they finish.
-
-\item [{\small {\tt WRITE}}:] Write data to the specified block
-  device.  This functions essentially as {\small {\tt READ}}, except
-  that the data moves to the device instead of from it.
-\end{description}
-
-%% Rather than copying data, the backend simply maps the domain's
-%% buffers in order to enable direct DMA to them.  The act of mapping
-%% the buffers also increases the reference counts of the underlying
-%% pages, so that the unprivileged domain cannot try to return them to
-%% the hypervisor, install them as page tables, or any other unsafe
-%% behaviour.
-%%
-%% % block API here
-
-\subsection{Block ring interface}
-
-The block interface is defined by the structures passed over the
-shared memory interface.  These structures are either requests (from
-the frontend to the backend) or responses (from the backend to the
-frontend).
-
-The request structure is defined as follows:
-
-\scriptsize
-\begin{verbatim}
-typedef struct blkif_request {
-    uint8_t        operation;    /* BLKIF_OP_???                         */
-    uint8_t        nr_segments;  /* number of segments                   */
-    blkif_vdev_t   handle;       /* only for read/write requests         */
-    uint64_t       id;           /* private guest value, echoed in resp  */
-    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
-    struct blkif_request_segment {
-        grant_ref_t gref;        /* reference to I/O buffer frame        */
-        /* @first_sect: first sector in frame to transfer (inclusive).   */
-        /* @last_sect: last sector in frame to transfer (inclusive).     */
-        uint8_t     first_sect, last_sect;
-    } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
-} blkif_request_t;
-\end{verbatim}
-\normalsize
-
-The fields are as follows:
-
-\begin{description}
-\item[operation] operation ID: one of the operations described above
-\item[nr\_segments] number of segments for scatter / gather IO
-  described by this request
-\item[handle] identifier for a particular virtual device on this
-  interface
-\item[id] this value is echoed in the response message for this IO;
-  the guest may use it to identify the original request
-\item[sector\_number] start sector on the virtual device for this
-  request
-\item[frame\_and\_sects] This array contains structures encoding
-  scatter-gather IO to be performed:
-  \begin{description}
-  \item[gref] The grant reference for the foreign I/O buffer page.
-  \item[first\_sect] First sector to access within the buffer page (0 to 7).
-  \item[last\_sect] Last sector to access within the buffer page (0 to 7).
-  \end{description}
-  Data will be transferred into frames at an offset determined by the
-  value of {\tt first\_sect}.
-\end{description}
-
-\section{Virtual TPM}
-
-Virtual TPM (VTPM) support provides TPM functionality to each virtual
-machine that requests this functionality in its configuration file.
-The interface enables domains to access their own private TPM like it
-was a hardware TPM built into the machine.
-
-The virtual TPM interface is implemented as a split driver,
-similar to the network and block interfaces described above.
-The user domain hosting the frontend exports a character device /dev/tpm0
-to user-level applications for communicating with the virtual TPM.
-This is the same device interface that is also offered if a hardware TPM
-is available in the system. The backend provides a single interface
-/dev/vtpm where the virtual TPM is waiting for commands from all domains
-that have located their backend in a given domain.
-
-\subsection{Data Transfer}
-
-A single shared memory ring is used between the frontend and backend
-drivers. TPM requests and responses are sent in pages where a pointer
-to those pages and other information is placed into the ring such that
-the backend can map the pages into its memory space using the grant
-table mechanism.
-
-The backend driver has been implemented to only accept well-formed
-TPM requests. To meet this requirement, the length indicator in the
-TPM request must correctly indicate the length of the request.
-Otherwise an error message is automatically sent back by the device driver.
-
-The virtual TPM implementation listens for TPM request on /dev/vtpm. Since
-it must be able to apply the TPM request packet to the virtual TPM instance
-associated with the virtual machine, a 4-byte virtual TPM instance
-identifier is pretended to each packet by the backend driver (in network
-byte order) for internal routing of the request.
-
-\subsection{Virtual TPM ring interface}
-
-The TPM protocol is a strict request/response protocol and therefore
-only one ring is used to send requests from the frontend to the backend
-and responses on the reverse path.
-
-The request/response structure is defined as follows:
-
-\scriptsize
-\begin{verbatim}
-typedef struct {
-    unsigned long addr;     /* Machine address of packet.     */
-    grant_ref_t ref;        /* grant table access reference.  */
-    uint16_t unused;        /* unused                         */
-    uint16_t size;          /* Packet size in bytes.          */
-} tpmif_tx_request_t;
-\end{verbatim}
-\normalsize
-
-The fields are as follows:
-
-\begin{description}
-\item[addr] The machine address of the page associated with the TPM
-            request/response; a request/response may span multiple
-            pages
-\item[ref]  The grant table reference associated with the address.
-\item[size] The size of the remaining packet; up to
-            PAGE{\textunderscore}SIZE bytes can be found in the
-            page referenced by 'addr'
-\end{description}
-
-The frontend initially allocates several pages whose addresses
-are stored in the ring. Only these pages are used for exchange of
-requests and responses.
-
-
-\chapter{Further Information}
-
-If you have questions that are not answered by this manual, the
-sources of information listed below may be of interest to you.  Note
-that bug reports, suggestions and contributions related to the
-software (or the documentation) should be sent to the Xen developers'
-mailing list (address below).
-
-
-\section{Other documentation}
-
-If you are mainly interested in using (rather than developing for)
-Xen, the \emph{Xen Users' Manual} is distributed in the {\tt docs/}
-directory of the Xen source distribution.
-
-% Various HOWTOs are also available in {\tt docs/HOWTOS}.
-
-
-\section{Online references}
-
-The official Xen web site can be found at:
-\begin{quote} {\tt http://www.xensource.com}
-\end{quote}
-
-
-This contains links to the latest versions of all online
-documentation, including the latest version of the FAQ.
-
-Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
-The Xen project uses Bugzilla as its bug tracking system. You'll find
-the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
-
-
-\section{Mailing lists}
-
-There are several mailing lists that are used to discuss Xen related
-topics. The most widely relevant are listed below. An official page of
-mailing lists and subscription information can be found at \begin{quote}
-  {\tt http://lists.xensource.com/} \end{quote}
-
-\begin{description}
-\item[xen-devel@lists.xensource.com] Used for development
-  discussions and bug reports.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-devel}}
-\item[xen-users@lists.xensource.com] Used for installation and usage
-  discussions and requests for help.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-users}}
-\item[xen-announce@lists.xensource.com] Used for announcements only.
-  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-announce}}
-\item[xen-changelog@lists.xensource.com] Changelog feed
-  from the unstable and 2.0 trees - developer oriented.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-changelog}}
-\end{description}
-
-\appendix
-
-
-\chapter{Xen Hypercalls}
-\label{a:hypercalls}
-
-Hypercalls represent the procedural interface to Xen; this appendix 
-categorizes and describes the current set of hypercalls. 
-
-\section{Invoking Hypercalls} 
-
-Hypercalls are invoked in a manner analogous to system calls in a
-conventional operating system; a software interrupt is issued which
-vectors to an entry point within Xen. On x86/32 machines the
-instruction required is {\tt int \$82}; the (real) IDT is setup so
-that this may only be issued from within ring 1. The particular 
-hypercall to be invoked is contained in {\tt EAX} --- a list 
-mapping these values to symbolic hypercall names can be found 
-in {\tt xen/include/public/xen.h}. 
-
-On some occasions a set of hypercalls will be required to carry
-out a higher-level function; a good example is when a guest 
-operating wishes to context switch to a new process which 
-requires updating various privileged CPU state. As an optimization
-for these cases, there is a generic mechanism to issue a set of 
-hypercalls as a batch: 
-
-\begin{quote}
-\hypercall{multicall(void *call\_list, int nr\_calls)}
-
-Execute a series of hypervisor calls; {\tt nr\_calls} is the length of
-the array of {\tt multicall\_entry\_t} structures pointed to be {\tt
-call\_list}. Each entry contains the hypercall operation code followed
-by up to 7 word-sized arguments.
-\end{quote}
-
-Note that multicalls are provided purely as an optimization; there is
-no requirement to use them when first porting a guest operating
-system.
-
-
-\section{Virtual CPU Setup} 
-
-At start of day, a guest operating system needs to setup the virtual
-CPU it is executing on. This includes installing vectors for the
-virtual IDT so that the guest OS can handle interrupts, page faults,
-etc. However the very first thing a guest OS must setup is a pair 
-of hypervisor callbacks: these are the entry points which Xen will
-use when it wishes to notify the guest OS of an occurrence. 
-
-\begin{quote}
-\hypercall{set\_callbacks(unsigned long event\_selector, unsigned long
-  event\_address, unsigned long failsafe\_selector, unsigned long
-  failsafe\_address) }
-
-Register the normal (``event'') and failsafe callbacks for 
-event processing. In each case the code segment selector and 
-address within that segment are provided. The selectors must
-have RPL 1; in XenLinux we simply use the kernel's CS for both 
-{\bf event\_selector} and {\bf failsafe\_selector}.
-
-The value {\bf event\_address} specifies the address of the guest OSes
-event handling and dispatch routine; the {\bf failsafe\_address}
-specifies a separate entry point which is used only if a fault occurs
-when Xen attempts to use the normal callback. 
-
-\end{quote} 
-
-On x86/64 systems the hypercall takes slightly different
-arguments. This is because callback CS does not need to be specified
-(since teh callbacks are entered via SYSRET), and also because an
-entry address needs to be specified for SYSCALLs from guest user
-space:
-
-\begin{quote}
-\hypercall{set\_callbacks(unsigned long event\_address, unsigned long
-  failsafe\_address, unsigned long syscall\_address)}
-\end{quote} 
-
-
-After installing the hypervisor callbacks, the guest OS can 
-install a `virtual IDT' by using the following hypercall: 
-
-\begin{quote} 
-\hypercall{set\_trap\_table(trap\_info\_t *table)} 
-
-Install one or more entries into the per-domain 
-trap handler table (essentially a software version of the IDT). 
-Each entry in the array pointed to by {\bf table} includes the 
-exception vector number with the corresponding segment selector 
-and entry point. Most guest OSes can use the same handlers on 
-Xen as when running on the real hardware.
-
-
-\end{quote} 
-
-A further hypercall is provided for the management of virtual CPUs:
-
-\begin{quote}
-\hypercall{vcpu\_op(int cmd, int vcpuid, void *extra\_args)}
-
-This hypercall can be used to bootstrap VCPUs, to bring them up and
-down and to test their current status.
-
-\end{quote}
-
-\section{Scheduling and Timer}
-
-Domains are preemptively scheduled by Xen according to the 
-parameters installed by domain 0 (see Section~\ref{s:dom0ops}). 
-In addition, however, a domain may choose to explicitly 
-control certain behavior with the following hypercall: 
-
-\begin{quote} 
-\hypercall{sched\_op\_new(int cmd, void *extra\_args)}
-
-Request scheduling operation from hypervisor. The following
-sub-commands are available:
-
-\begin{description}
-\item[SCHEDOP\_yield] voluntarily yields the CPU, but leaves the
-caller marked as runnable. No extra arguments are passed to this
-command. 
-\item[SCHEDOP\_block] removes the calling domain from the run queue
-and causes it to sleep until an event is delivered to it. No extra 
-arguments are passed to this command. 
-\item[SCHEDOP\_shutdown] is used to end the calling domain's
-execution. The extra argument is a {\bf sched\_shutdown} structure
-which indicates the reason why the domain suspended (e.g., for reboot,
-halt, power-off).
-\item[SCHEDOP\_poll] allows a VCPU to wait on a set of event channels
-with an optional timeout (all of which are specified in the {\bf
-sched\_poll} extra argument). The semantics are similar to the UNIX
-{\bf poll} system call. The caller must have event-channel upcalls
-masked when executing this command.
-\end{description}
-\end{quote} 
-
-{\bf sched\_op\_new}  was not available prior to Xen 3.0.2. Older versions
-provide only the following hypercall:
-
-\begin{quote} 
-\hypercall{sched\_op(int cmd, unsigned long extra\_arg)}
-
-This hypercall supports the following subset of {\bf sched\_op\_new} commands:
-
-\begin{description}
-\item[SCHEDOP\_yield] (extra argument is 0).
-\item[SCHEDOP\_block] (extra argument is 0).
-\item[SCHEDOP\_shutdown] (extra argument is numeric reason code).
-\end{description}
-\end{quote}
-
-To aid the implementation of a process scheduler within a guest OS,
-Xen provides a virtual programmable timer:
-
-\begin{quote}
-\hypercall{set\_timer\_op(uint64\_t timeout)} 
-
-Request a timer event to be sent at the specified system time (time 
-in nanoseconds since system boot).
-
-\end{quote} 
-
-Note that calling {\bf set\_timer\_op} prior to {\bf sched\_op} 
-allows block-with-timeout semantics. 
-
-
-\section{Page Table Management} 
-
-Since guest operating systems have read-only access to their page 
-tables, Xen must be involved when making any changes. The following
-multi-purpose hypercall can be used to modify page-table entries, 
-update the machine-to-physical mapping table, flush the TLB, install 
-a new page-table base pointer, and more.
-
-\begin{quote} 
-\hypercall{mmu\_update(mmu\_update\_t *req, int count, int *success\_count)} 
-
-Update the page table for the domain; a set of {\bf count} updates are
-submitted for processing in a batch, with {\bf success\_count} being 
-updated to report the number of successful updates.  
-
-Each element of {\bf req[]} contains a pointer (address) and value; 
-the least significant 2-bits of the pointer are used to distinguish 
-the type of update requested as follows:
-\begin{description} 
-
-\item[MMU\_NORMAL\_PT\_UPDATE:] update a page directory entry or
-page table entry to the associated value; Xen will check that the
-update is safe, as described in Chapter~\ref{c:memory}.
-
-\item[MMU\_MACHPHYS\_UPDATE:] update an entry in the
-  machine-to-physical table. The calling domain must own the machine
-  page in question (or be privileged).
-\end{description}
-
-\end{quote}
-
-Explicitly updating batches of page table entries is extremely
-efficient, but can require a number of alterations to the guest
-OS. Using the writable page table mode (Chapter~\ref{c:memory}) is
-recommended for new OS ports.
-
-Regardless of which page table update mode is being used, however,
-there are some occasions (notably handling a demand page fault) where
-a guest OS will wish to modify exactly one PTE rather than a
-batch, and where that PTE is mapped into the current address space.
-This is catered for by the following:
-
-\begin{quote} 
-\hypercall{update\_va\_mapping(unsigned long va, uint64\_t val,
-                         unsigned long flags)}
-
-Update the currently installed PTE that maps virtual address {\bf va}
-to new value {\bf val}. As with {\bf mmu\_update}, Xen checks the
-modification  is safe before applying it. The {\bf flags} determine
-which kind of TLB flush, if any, should follow the update. 
-
-\end{quote} 
-
-Finally, sufficiently privileged domains may occasionally wish to manipulate 
-the pages of others: 
-
-\begin{quote}
-\hypercall{update\_va\_mapping\_otherdomain(unsigned long va, uint64\_t val,
-                         unsigned long flags, domid\_t domid)}
-
-Identical to {\bf update\_va\_mapping} save that the pages being
-mapped must belong to the domain {\bf domid}. 
-
-\end{quote}
-
-An additional MMU hypercall provides an ``extended command''
-interface.  This provides additional functionality beyond the basic
-table updating commands:
-
-\begin{quote}
-
-\hypercall{mmuext\_op(struct mmuext\_op *op, int count, int *success\_count, domid\_t domid)}
-
-This hypercall is used to perform additional MMU operations.  These
-include updating {\tt cr3} (or just re-installing it for a TLB flush),
-requesting various kinds of TLB flush, flushing the cache, installing
-a new LDT, or pinning \& unpinning page-table pages (to ensure their
-reference count doesn't drop to zero which would require a
-revalidation of all entries).  Some of the operations available are
-restricted to domains with sufficient system privileges.
-
-It is also possible for privileged domains to reassign page ownership
-via an extended MMU operation, although grant tables are used instead
-of this where possible; see Section~\ref{s:idc}.
-
-\end{quote}
-
-Finally, a hypercall interface is exposed to activate and deactivate
-various optional facilities provided by Xen for memory management.
-
-\begin{quote} 
-\hypercall{vm\_assist(unsigned int cmd, unsigned int type)}
-
-Toggle various memory management modes (in particular writable page
-tables).
-
-\end{quote} 
-
-\section{Segmentation Support}
-
-Xen allows guest OSes to install a custom GDT if they require it; 
-this is context switched transparently whenever a domain is 
-[de]scheduled.  The following hypercall is effectively a 
-`safe' version of {\tt lgdt}: 
-
-\begin{quote}
-\hypercall{set\_gdt(unsigned long *frame\_list, int entries)} 
-
-Install a global descriptor table for a domain; {\bf frame\_list} is
-an array of up to 16 machine page frames within which the GDT resides,
-with {\bf entries} being the actual number of descriptor-entry
-slots. All page frames must be mapped read-only within the guest's
-address space, and the table must be large enough to contain Xen's
-reserved entries (see {\bf xen/include/public/arch-x86\_32.h}).
-
-\end{quote}
-
-Many guest OSes will also wish to install LDTs; this is achieved by
-using {\bf mmu\_update} with an extended command, passing the
-linear address of the LDT base along with the number of entries. No
-special safety checks are required; Xen needs to perform this task
-simply since {\tt lldt} requires CPL 0.
-
-
-Xen also allows guest operating systems to update just an 
-individual segment descriptor in the GDT or LDT:  
-
-\begin{quote}
-\hypercall{update\_descriptor(uint64\_t ma, uint64\_t desc)}
-
-Update the GDT/LDT entry at machine address {\bf ma}; the new
-8-byte descriptor is stored in {\bf desc}.
-Xen performs a number of checks to ensure the descriptor is 
-valid. 
-
-\end{quote}
-
-Guest OSes can use the above in place of context switching entire 
-LDTs (or the GDT) when the number of changing descriptors is small. 
-
-\section{Context Switching} 
-
-When a guest OS wishes to context switch between two processes, 
-it can use the page table and segmentation hypercalls described
-above to perform the the bulk of the privileged work. In addition, 
-however, it will need to invoke Xen to switch the kernel (ring 1) 
-stack pointer: 
-
-\begin{quote} 
-\hypercall{stack\_switch(unsigned long ss, unsigned long esp)} 
-
-Request kernel stack switch from hypervisor; {\bf ss} is the new 
-stack segment, which {\bf esp} is the new stack pointer. 
-
-\end{quote} 
-
-A useful hypercall for context switching allows ``lazy'' save and
-restore of floating point state:
-
-\begin{quote}
-\hypercall{fpu\_taskswitch(int set)} 
-
-This call instructs Xen to set the {\tt TS} bit in the {\tt cr0}
-control register; this means that the next attempt to use floating
-point will cause a trap which the guest OS can trap. Typically it will
-then save/restore the FP state, and clear the {\tt TS} bit, using the
-same call.
-\end{quote} 
-
-This is provided as an optimization only; guest OSes can also choose
-to save and restore FP state on all context switches for simplicity. 
-
-Finally, a hypercall is provided for entering vm86 mode:
-
-\begin{quote}
-\hypercall{switch\_vm86}
-
-This allows the guest to run code in vm86 mode, which is needed for
-some legacy software.
-\end{quote}
-
-\section{Physical Memory Management}
-
-As mentioned previously, each domain has a maximum and current 
-memory allocation. The maximum allocation, set at domain creation 
-time, cannot be modified. However a domain can choose to reduce 
-and subsequently grow its current allocation by using the
-following call: 
-
-\begin{quote} 
-\hypercall{memory\_op(unsigned int op, void *arg)}
-
-Increase or decrease current memory allocation (as determined by 
-the value of {\bf op}).  The available operations are:
-
-\begin{description}
-\item[XENMEM\_increase\_reservation] Request an increase in machine
-  memory allocation; {\bf arg} must point to a {\bf
-  xen\_memory\_reservation} structure.
-\item[XENMEM\_decrease\_reservation] Request a decrease in machine
-  memory allocation; {\bf arg} must point to a {\bf
-  xen\_memory\_reservation} structure.
-\item[XENMEM\_maximum\_ram\_page] Request the frame number of the
-  highest-addressed frame of machine memory in the system.  {\bf arg}
-  must point to an {\bf unsigned long} where this value will be
-  stored.
-\item[XENMEM\_current\_reservation] Returns current memory reservation
-  of the specified domain.
-\item[XENMEM\_maximum\_reservation] Returns maximum memory reservation
-  of the specified domain.
-\end{description}
-
-\end{quote} 
-
-In addition to simply reducing or increasing the current memory
-allocation via a `balloon driver', this call is also useful for 
-obtaining contiguous regions of machine memory when required (e.g. 
-for certain PCI devices, or if using superpages).  
-
-
-\section{Inter-Domain Communication}
-\label{s:idc} 
-
-Xen provides a simple asynchronous notification mechanism via
-\emph{event channels}. Each domain has a set of end-points (or
-\emph{ports}) which may be bound to an event source (e.g. a physical
-IRQ, a virtual IRQ, or an port in another domain). When a pair of
-end-points in two different domains are bound together, then a `send'
-operation on one will cause an event to be received by the destination
-domain.
-
-The control and use of event channels involves the following hypercall: 
-
-\begin{quote}
-\hypercall{event\_channel\_op(evtchn\_op\_t *op)} 
-
-Inter-domain event-channel management; {\bf op} is a discriminated 
-union which allows the following 7 operations: 
-
-\begin{description} 
-
-\item[alloc\_unbound:] allocate a free (unbound) local
-  port and prepare for connection from a specified domain. 
-\item[bind\_virq:] bind a local port to a virtual 
-IRQ; any particular VIRQ can be bound to at most one port per domain. 
-\item[bind\_pirq:] bind a local port to a physical IRQ;
-once more, a given pIRQ can be bound to at most one port per
-domain. Furthermore the calling domain must be sufficiently
-privileged.
-\item[bind\_interdomain:] construct an interdomain event 
-channel; in general, the target domain must have previously allocated 
-an unbound port for this channel, although this can be bypassed by 
-privileged domains during domain setup. 
-\item[close:] close an interdomain event channel. 
-\item[send:] send an event to the remote end of a 
-interdomain event channel. 
-\item[status:] determine the current status of a local port. 
-\end{description} 
-
-For more details see
-{\bf xen/include/public/event\_channel.h}. 
-
-\end{quote} 
-
-Event channels are the fundamental communication primitive between 
-Xen domains and seamlessly support SMP. However they provide little
-bandwidth for communication {\sl per se}, and hence are typically 
-married with a piece of shared memory to produce effective and 
-high-performance inter-domain communication. 
-
-Safe sharing of memory pages between guest OSes is carried out by
-granting access on a per page basis to individual domains. This is
-achieved by using the {\tt grant\_table\_op} hypercall.
-
-\begin{quote}
-\hypercall{grant\_table\_op(unsigned int cmd, void *uop, unsigned int count)}
-
-Used to invoke operations on a grant reference, to setup the grant
-table and to dump the tables' contents for debugging.
-
-\end{quote} 
-
-\section{IO Configuration} 
-
-Domains with physical device access (i.e.\ driver domains) receive
-limited access to certain PCI devices (bus address space and
-interrupts). However many guest operating systems attempt to 
-determine the PCI configuration by directly access the PCI BIOS, 
-which cannot be allowed for safety. 
-
-Instead, Xen provides the following hypercall: 
-
-\begin{quote}
-\hypercall{physdev\_op(void *physdev\_op)}
-
-Set and query IRQ configuration details, set the system IOPL, set the
-TSS IO bitmap.
-
-\end{quote} 
-
-
-For examples of using {\tt physdev\_op}, see the 
-Xen-specific PCI code in the linux sparse tree. 
-
-\section{Administrative Operations}
-\label{s:dom0ops}
-
-A large number of control operations are available to a sufficiently
-privileged domain (typically domain 0). These allow the creation and
-management of new domains, for example. A complete list is given 
-below: for more details on any or all of these, please see 
-{\tt xen/include/public/dom0\_ops.h} 
-
-
-\begin{quote}
-\hypercall{dom0\_op(dom0\_op\_t *op)} 
-
-Administrative domain operations for domain management. The options are:
-
-\begin{description} 
-\item [DOM0\_GETMEMLIST:] get list of pages used by the domain
-
-\item [DOM0\_SCHEDCTL:]
-
-\item [DOM0\_ADJUSTDOM:] adjust scheduling priorities for domain
-
-\item [DOM0\_CREATEDOMAIN:] create a new domain
-
-\item [DOM0\_DESTROYDOMAIN:] deallocate all resources associated
-with a domain
-
-\item [DOM0\_PAUSEDOMAIN:] remove a domain from the scheduler run 
-queue. 
-
-\item [DOM0\_UNPAUSEDOMAIN:] mark a paused domain as schedulable
-  once again. 
-
-\item [DOM0\_GETDOMAININFO:] get statistics about the domain
-
-\item [DOM0\_SETDOMAININFO:] set VCPU-related attributes
-
-\item [DOM0\_MSR:] read or write model specific registers
-
-\item [DOM0\_DEBUG:] interactively invoke the debugger
-
-\item [DOM0\_SETTIME:] set system time
-
-\item [DOM0\_GETPAGEFRAMEINFO:] 
-
-\item [DOM0\_READCONSOLE:] read console content from hypervisor buffer ring
-
-\item [DOM0\_PINCPUDOMAIN:] pin domain to a particular CPU
-
-\item [DOM0\_TBUFCONTROL:] get and set trace buffer attributes
-
-\item [DOM0\_PHYSINFO:] get information about the host machine
-
-\item [DOM0\_SCHED\_ID:] get the ID of the current Xen scheduler
-
-\item [DOM0\_SHADOW\_CONTROL:] switch between shadow page-table modes
-
-\item [DOM0\_SETDOMAINMAXMEM:] set maximum memory allocation of a domain
-
-\item [DOM0\_GETPAGEFRAMEINFO2:] batched interface for getting
-page frame info
-
-\item [DOM0\_ADD\_MEMTYPE:] set MTRRs
-
-\item [DOM0\_DEL\_MEMTYPE:] remove a memory type range
-
-\item [DOM0\_READ\_MEMTYPE:] read MTRR
-
-\item [DOM0\_PERFCCONTROL:] control Xen's software performance
-counters
-
-\item [DOM0\_MICROCODE:] update CPU microcode
-
-\item [DOM0\_IOPORT\_PERMISSION:] modify domain permissions for an
-IO port range (enable / disable a range for a particular domain)
-
-\item [DOM0\_GETVCPUCONTEXT:] get context from a VCPU
-
-\item [DOM0\_GETVCPUINFO:] get current state for a VCPU
-\item [DOM0\_GETDOMAININFOLIST:] batched interface to get domain
-info
-
-\item [DOM0\_PLATFORM\_QUIRK:] inform Xen of a platform quirk it
-needs to handle (e.g. noirqbalance)
-
-\item [DOM0\_PHYSICAL\_MEMORY\_MAP:] get info about dom0's memory
-map
-
-\item [DOM0\_MAX\_VCPUS:] change max number of VCPUs for a domain
-
-\item [DOM0\_SETDOMAINHANDLE:] set the handle for a domain
-
-\end{description} 
-\end{quote} 
-
-Most of the above are best understood by looking at the code 
-implementing them (in {\tt xen/common/dom0\_ops.c}) and in 
-the user-space tools that use them (mostly in {\tt tools/libxc}). 
-
-\section{Debugging Hypercalls} 
-
-A few additional hypercalls are mainly useful for debugging: 
-
-\begin{quote} 
-\hypercall{console\_io(int cmd, int count, char *str)}
-
-Use Xen to interact with the console; operations are:
-
-{CONSOLEIO\_write}: Output count characters from buffer str.
-
-{CONSOLEIO\_read}: Input at most count characters into buffer str.
-\end{quote} 
-
-A pair of hypercalls allows access to the underlying debug registers: 
-\begin{quote}
-\hypercall{set\_debugreg(int reg, unsigned long value)}
-
-Set debug register {\bf reg} to {\bf value} 
-
-\hypercall{get\_debugreg(int reg)}
-
-Return the contents of the debug register {\bf reg}
-\end{quote}
-
-And finally: 
-\begin{quote}
-\hypercall{xen\_version(int cmd)}
-
-Request Xen version number.
-\end{quote} 
-
-This is useful to ensure that user-space tools are in sync 
-with the underlying hypervisor. 
-
-
-\end{document}
diff -r a2a8089b1ffb -r 4271634e4c86 docs/src/user.tex
--- a/docs/src/user.tex	Tue Jan 24 16:46:17 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3235 +0,0 @@
-\documentclass[11pt,twoside,final,openright]{report}
-\usepackage{a4,graphicx,html,parskip,setspace,times,xspace,url}
-\setstretch{1.15}
-
-\renewcommand{\ttdefault}{pcr}
-
-\def\Xend{{Xend}\xspace}
-\def\xend{{xend}\xspace}
-
-\latexhtml{\renewcommand{\path}[1]{{\small {\tt #1}}}}{\renewcommand{\path}[1]{{\tt #1}}}
-
-
-\begin{document}
-
-% TITLE PAGE
-\pagestyle{empty}
-\begin{center}
-\vspace*{\fill}
-\includegraphics{figs/xenlogo.eps}
-\vfill
-\vfill
-\vfill
-\begin{tabular}{l}
-{\Huge \bf Users' Manual} \\[4mm]
-{\huge Xen v3.3} \\[80mm]
-\end{tabular}
-\end{center}
-
-{\bf DISCLAIMER: This documentation is always under active development
-and as such there may be mistakes and omissions --- watch out for
-these and please report any you find to the developers' mailing list,
-xen-devel@lists.xensource.com. The latest version is always available
-on-line. Contributions of material, suggestions and corrections are
-welcome.}
-
-\vfill
-\clearpage
-
-
-% COPYRIGHT NOTICE
-\pagestyle{empty}
-
-\vspace*{\fill}
-
-Xen is Copyright \copyright  2002-2008, Citrix Systems, Inc., University of Cambridge, UK, XenSource Inc., IBM Corp., Hewlett-Packard Co., Intel Corp., AMD Inc., and others.  All rights reserved.
-
-Xen is an open-source project.  Most portions of Xen are licensed for copying
-under the terms of the GNU General Public License, version 2.  Other portions
-are licensed under the terms of the GNU Lesser General Public License, the
-Zope Public License 2.0, or under ``BSD-style'' licenses.  Please refer to the
-COPYING file for details.
-
-Xen includes software by Christopher Clark.  This software is covered by the
-following licence:
-
-\begin{quote}
-Copyright (c) 2002, Christopher Clark.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-\begin{itemize}
-\item Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-
-\item 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.
-
-\item Neither the name of the original author; nor the names of any
-contributors may be used to endorse or promote products derived from this
-software without specific prior written permission.
-\end{itemize}
-
-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.
-\end{quote}
-
-\cleardoublepage
-
-
-% TABLE OF CONTENTS
-\pagestyle{plain}
-\pagenumbering{roman}
-{ \parskip 0pt plus 1pt
-  \tableofcontents }
-\cleardoublepage
-
-
-% PREPARE FOR MAIN TEXT
-\pagenumbering{arabic}
-\raggedbottom
-\widowpenalty=10000
-\clubpenalty=10000
-\parindent=0pt
-\parskip=5pt
-\renewcommand{\topfraction}{.8}
-\renewcommand{\bottomfraction}{.8}
-\renewcommand{\textfraction}{.2}
-\renewcommand{\floatpagefraction}{.8}
-\setstretch{1.1}
-
-
-%% Chapter Introduction moved to introduction.tex
-\chapter{Introduction}
-
-
-Xen is an open-source \emph{para-virtualizing} virtual machine monitor
-(VMM), or ``hypervisor'', for a variety of processor architectures including x86. Xen can securely execute multiple virtual machines on a single physical system with near native performance.  Xen facilitates enterprise-grade functionality, including:
-
-\begin{itemize}
-\item Virtual machines with performance close to native hardware.
-\item Live migration of running virtual machines between physical hosts.
-\item Up to 32\footnote{IA64 supports up to 64 virtual CPUs per guest virtual machine} virtual CPUs per guest virtual machine, with VCPU hotplug.
-\item x86/32 with PAE, x86/64, and IA64 platform support.
-\item Intel and AMD Virtualization Technology for unmodified guest operating systems (including Microsoft Windows).
-\item Excellent hardware support (supports almost all Linux device
-  drivers). 
-\end{itemize}
-
-
-\section{Usage Scenarios}
-
-Usage scenarios for Xen include:
-
-\begin{description}
-\item [Server Consolidation.] Move multiple servers onto a single
-  physical host with performance and fault isolation provided at the
-  virtual machine boundaries.
-\item [Hardware Independence.] Allow legacy applications and operating 
-  systems to exploit new hardware.
-\item [Multiple OS configurations.] Run multiple operating systems
-  simultaneously, for development or testing purposes.
-\item [Kernel Development.] Test and debug kernel modifications in a
-  sand-boxed virtual machine --- no need for a separate test machine.
-\item [Cluster Computing.] Management at VM granularity provides more
-  flexibility than separately managing each physical host, but better
-  control and isolation than single-system image solutions,
-  particularly by using live migration for load balancing.
-\item [Hardware support for custom OSes.] Allow development of new
-  OSes while benefiting from the wide-ranging hardware support of
-  existing OSes such as Linux.
-\end{description}
-
-
-\section{Operating System Support}
-
-Para-virtualization permits very high performance virtualization, even
-on architectures like x86 that are traditionally very hard to
-virtualize.
-
-This approach requires operating systems to be \emph{ported} to run on
-Xen. Porting an OS to run on Xen is similar to supporting a new
-hardware platform, however the process is simplified because the
-para-virtual machine architecture is very similar to the underlying
-native hardware. Even though operating system kernels must explicitly
-support Xen, a key feature is that user space applications and
-libraries \emph{do not} require modification.
-
-With hardware CPU virtualization as provided by Intel VT and AMD
-SVM technology, the ability to run an unmodified guest OS kernel
-is available.  No porting of the OS is required, although some
-additional driver support is necessary within Xen itself.  Unlike
-traditional full virtualization hypervisors, which suffer a tremendous
-performance overhead, the combination of Xen and VT or Xen and
-Pacifica technology complement one another to offer superb performance
-for para-virtualized guest operating systems and full support for
-unmodified guests running natively on the processor.
-
-Paravirtualized Xen support is available for increasingly many
-operating systems: currently, mature Linux support is available and
-included in the standard distribution.  Other OS ports, including
-NetBSD, FreeBSD and Solaris are also complete. 
-
-
-\section{Hardware Support}
-
-Xen currently runs on the IA64 and x86 architectures. Multiprocessor
-machines are supported, and there is support for HyperThreading (SMT).
-
-The default 32-bit Xen requires processor support for Physical
-Addressing Extensions (PAE), which enables the hypervisor to address
-up to 16GB of physical memory. Xen also supports x86/64 platforms
-such as Intel EM64T and AMD Opteron which can currently address up to
-1TB of physical memory.
-
-Xen offloads most of the hardware support issues to the guest OS
-running in the \emph{Domain~0} management virtual machine. Xen itself
-contains only the code required to detect and start secondary
-processors, set up interrupt routing, and perform PCI bus
-enumeration. Device drivers run within a privileged guest OS rather
-than within Xen itself. This approach provides compatibility with the
-majority of device hardware supported by Linux. The default XenLinux
-build contains support for most server-class network and disk
-hardware, but you can add support for other hardware by configuring
-your XenLinux kernel in the normal way.
-
-
-\section{Structure of a Xen-Based System}
-
-A Xen system has multiple layers, the lowest and most privileged of
-which is Xen itself.
-
-Xen may host multiple \emph{guest} operating systems, each of which is
-executed within a secure virtual machine. In Xen terminology, a
-\emph{domain}. Domains are scheduled by Xen to make effective use of the
-available physical CPUs. Each guest OS manages its own applications.
-This management includes the responsibility of scheduling each
-application within the time allotted to the VM by Xen.
-
-The first domain, \emph{domain~0}, is created automatically when the
-system boots and has special management privileges. Domain~0 builds
-other domains and manages their virtual devices. It also performs
-administrative tasks such as suspending, resuming and migrating other
-virtual machines.
-
-Within domain~0, a process called \emph{xend} runs to manage the system.
-\Xend\ is responsible for managing virtual machines and providing access
-to their consoles. Commands are issued to \xend\ over an HTTP interface,
-via a command-line tool.
-
-
-\section{History}
-
-Xen was originally developed by the Systems Research Group at the
-University of Cambridge Computer Laboratory as part of the XenoServers
-project, funded by the UK-EPSRC\@.
-
-XenoServers aim to provide a ``public infrastructure for global
-distributed computing''. Xen plays a key part in that, allowing one to
-efficiently partition a single machine to enable multiple independent
-clients to run their operating systems and applications in an
-environment. This environment provides protection, resource isolation
-and accounting. The project web page contains further information along
-with pointers to papers and technical reports:
-\path{http://www.cl.cam.ac.uk/xeno}
-
-Xen has grown into a fully-fledged project in its own right, enabling us
-to investigate interesting research issues regarding the best techniques
-for virtualizing resources such as the CPU, memory, disk and network.
-Project contributors now include Citrix, Intel, IBM, HP, AMD, Novell,
-RedHat, Sun, Fujitsu, and Samsung.
-
-Xen was first described in a paper presented at SOSP in
-2003\footnote{\tt
-  http://www.cl.cam.ac.uk/netos/papers/2003-xensosp.pdf}, and the first
-public release (1.0) was made that October. Since then, Xen has
-significantly matured and is now used in production scenarios on many
-sites.
-
-\section{What's New}
-
-Xen 3.3.0 offers:
-
-\begin{itemize}
-\item IO Emulation (stub domains) for HVM IO performance and scailability
-\item Replacement of Intel VT vmxassist by new 16b emulation code
-\item Improved VT-d device pass-through e.g. for graphics devices
-\item Enhanced C and P state power management
-\item Exploitation of multi-queue support on modern NICs
-\item Removal of domain lock for improved PV guest scalability
-\item 2MB page support for HVM and PV guests
-\item CPU Portability
-\end{itemize}
-
-Xen 3.3 delivers the capabilities needed by enterprise customers and gives computing industry leaders a solid, secure platform to build upon for their virtualization solutions. This latest release establishes Xen as the definitive open source solution for virtualization.
-
-
-
-\part{Installation}
-
-%% Chapter Basic Installation
-\chapter{Basic Installation}
-
-The Xen distribution includes three main components: Xen itself, ports
-of Linux and NetBSD to run on Xen, and the userspace tools required to
-manage a Xen-based system. This chapter describes how to install the
-Xen~3.3 distribution from source. Alternatively, there may be pre-built
-packages available as part of your operating system distribution.
-
-
-\section{Prerequisites}
-\label{sec:prerequisites}
-
-The following is a full list of prerequisites. Items marked `$\dag$' are
-required by the \xend\ control tools, and hence required if you want to
-run more than one virtual machine; items marked `$*$' are only required
-if you wish to build from source.
-\begin{itemize}
-\item A working Linux distribution using the GRUB bootloader and running
-  on a P6-class or newer CPU\@.
-\item [$\dag$] The \path{iproute2} package.
-\item [$\dag$] The Linux bridge-utils\footnote{Available from {\tt
-      http://bridge.sourceforge.net}} (e.g., \path{/sbin/brctl})
-\item [$\dag$] The Linux hotplug system\footnote{Available from {\tt
-      http://linux-hotplug.sourceforge.net/}} (e.g.,
-      \path{/sbin/hotplug} and related scripts).  On newer distributions,
-      this is included alongside the Linux udev system\footnote{See {\tt
-      http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html/}}.
-\item [$*$] Build tools (gcc v3.2.x or v3.3.x, binutils, GNU make).
-\item [$*$] Development installation of zlib (e.g.,\ zlib-dev).
-\item [$*$] Development installation of Python v2.2 or later (e.g.,\
-  python-dev).
-\item [$*$] \LaTeX\ and transfig are required to build the
-  documentation.
-\end{itemize}
-
-Once you have satisfied these prerequisites, you can now install either
-a binary or source distribution of Xen.
-
-\section{Installing from Binary Tarball}
-
-Pre-built tarballs are available for download from the XenSource downloads
-page:
-\begin{quote} {\tt http://www.xensource.com/downloads/}
-\end{quote}
-
-Once you've downloaded the tarball, simply unpack and install:
-\begin{verbatim}
-# tar zxvf xen-3.0-install.tgz
-# cd xen-3.0-install
-# sh ./install.sh
-\end{verbatim}
-
-Once you've installed the binaries you need to configure your system as
-described in Section~\ref{s:configure}.
-
-\section{Installing from RPMs}
-Pre-built RPMs are available for download from the XenSource downloads
-page:
-\begin{quote} {\tt http://www.xensource.com/downloads/}
-\end{quote}
-
-Once you've downloaded the RPMs, you typically install them via the 
-RPM commands: 
-
-\verb|# rpm -iv rpmname| 
-
-See the instructions and the Release Notes for each RPM set referenced at:
-  \begin{quote}
-    {\tt http://www.xensource.com/downloads/}.
-  \end{quote}
- 
-\section{Installing from Source}
-
-This section describes how to obtain, build and install Xen from source.
-
-\subsection{Obtaining the Source}
-
-The Xen source tree is available as either a compressed source tarball
-or as a clone of our master Mercurial repository.
-
-\begin{description}
-\item[Obtaining the Source Tarball]\mbox{} \\
-  Stable versions and daily snapshots of the Xen source tree are
-  available from the Xen download page:
-  \begin{quote} {\tt \tt http://www.xensource.com/downloads/}
-  \end{quote}
-\item[Obtaining the source via Mercurial]\mbox{} \\
-  The source tree may also be obtained via the public Mercurial
-  repository at:
-  \begin{quote}{\tt http://xenbits.xensource.com}
-  \end{quote} See the instructions and the Getting Started Guide
-  referenced at:
-  \begin{quote}
-    {\tt http://www.xensource.com/downloads/}
-  \end{quote}
-\end{description}
-
-% \section{The distribution}
-%
-% The Xen source code repository is structured as follows:
-%
-% \begin{description}
-% \item[\path{tools/}] Xen node controller daemon (Xend), command line
-%   tools, control libraries
-% \item[\path{xen/}] The Xen VMM.
-% \item[\path{buildconfigs/}] Build configuration files
-% \item[\path{linux-*-xen-sparse/}] Xen support for Linux.
-% \item[\path{patches/}] Experimental patches for Linux.
-% \item[\path{docs/}] Various documentation files for users and
-%   developers.
-% \item[\path{extras/}] Bonus extras.
-% \end{description}
-
-\subsection{Building from Source}
-
-The top-level Xen Makefile includes a target ``world'' that will do the
-following:
-
-\begin{itemize}
-\item Build Xen.
-\item Build the control tools, including \xend.
-\item Download (if necessary) and unpack the Linux 2.6 source code, and
-  patch it for use with Xen.
-\item Build a Linux kernel to use in domain~0 and a smaller unprivileged
-  kernel, which can be used for unprivileged virtual machines.
-\end{itemize}
-
-After the build has completed you should have a top-level directory
-called \path{dist/} in which all resulting targets will be placed. Of
-particular interest are the two XenLinux kernel images, one with a
-``-xen0'' extension which contains hardware device drivers and drivers
-for Xen's virtual devices, and one with a ``-xenU'' extension that
-just contains the virtual ones. These are found in
-\path{dist/install/boot/} along with the image for Xen itself and the
-configuration files used during the build.
-
-%The NetBSD port can be built using:
-%\begin{quote}
-%\begin{verbatim}
-%# make netbsd20
-%\end{verbatim}\end{quote}
-%NetBSD port is built using a snapshot of the netbsd-2-0 cvs branch.
-%The snapshot is downloaded as part of the build process if it is not
-%yet present in the \path{NETBSD\_SRC\_PATH} search path.  The build
-%process also downloads a toolchain which includes all of the tools
-%necessary to build the NetBSD kernel under Linux.
-
-To customize the set of kernels built you need to edit the top-level
-Makefile. Look for the line:
-\begin{quote}
-\begin{verbatim}
-KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
-\end{verbatim}
-\end{quote}
-
-You can edit this line to include any set of operating system kernels
-which have configurations in the top-level \path{buildconfigs/}
-directory.
-
-%% Inspect the Makefile if you want to see what goes on during a
-%% build.  Building Xen and the tools is straightforward, but XenLinux
-%% is more complicated.  The makefile needs a `pristine' Linux kernel
-%% tree to which it will then add the Xen architecture files.  You can
-%% tell the makefile the location of the appropriate Linux compressed
-%% tar file by
-%% setting the LINUX\_SRC environment variable, e.g. \\
-%% \verb!# LINUX_SRC=/tmp/linux-2.6.11.tar.bz2 make world! \\ or by
-%% placing the tar file somewhere in the search path of {\tt
-%%   LINUX\_SRC\_PATH} which defaults to `{\tt .:..}'.  If the
-%% makefile can't find a suitable kernel tar file it attempts to
-%% download it from kernel.org (this won't work if you're behind a
-%% firewall).
-
-%% After untaring the pristine kernel tree, the makefile uses the {\tt
-%%   mkbuildtree} script to add the Xen patches to the kernel.
-
-%% \framebox{\parbox{5in}{
-%%     {\bf Distro specific:} \\
-%%     {\it Gentoo} --- if not using udev (most installations,
-%%     currently), you'll need to enable devfs and devfs mount at boot
-%%     time in the xen0 config.  }}
-
-\subsection{Custom Kernels}
-
-% If you have an SMP machine you may wish to give the {\tt '-j4'}
-% argument to make to get a parallel build.
-
-If you wish to build a customized XenLinux kernel (e.g.\ to support
-additional devices or enable distribution-required features), you can
-use the standard Linux configuration mechanisms, specifying that the
-architecture being built for is \path{xen}, e.g:
-\begin{quote}
-\begin{verbatim}
-# cd linux-2.6.12-xen0
-# make ARCH=xen xconfig
-# cd ..
-# make
-\end{verbatim}
-\end{quote}
-
-You can also copy an existing Linux configuration (\path{.config}) into
-e.g.\ \path{linux-2.6.12-xen0} and execute:
-\begin{quote}
-\begin{verbatim}
-# make ARCH=xen oldconfig
-\end{verbatim}
-\end{quote}
-
-You may be prompted with some Xen-specific options. We advise accepting
-the defaults for these options.
-
-Note that the only difference between the two types of Linux kernels
-that are built is the configuration file used for each. The ``U''
-suffixed (unprivileged) versions don't contain any of the physical
-hardware device drivers, leading to a 30\% reduction in size; hence you
-may prefer these for your non-privileged domains. The ``0'' suffixed
-privileged versions can be used to boot the system, as well as in driver
-domains and unprivileged domains.
-
-\subsection{Installing Generated Binaries}
-
-The files produced by the build process are stored under the
-\path{dist/install/} directory. To install them in their default
-locations, do:
-\begin{quote}
-\begin{verbatim}
-# make install
-\end{verbatim}
-\end{quote}
-
-Alternatively, users with special installation requirements may wish to
-install them manually by copying the files to their appropriate
-destinations.
-
-%% Files in \path{install/boot/} include:
-%% \begin{itemize}
-%% \item \path{install/boot/xen-3.0.gz} Link to the Xen 'kernel'
-%% \item \path{install/boot/vmlinuz-2.6-xen0} Link to domain 0
-%%   XenLinux kernel
-%% \item \path{install/boot/vmlinuz-2.6-xenU} Link to unprivileged
-%%   XenLinux kernel
-%% \end{itemize}
-
-The \path{dist/install/boot} directory will also contain the config
-files used for building the XenLinux kernels, and also versions of Xen
-and XenLinux kernels that contain debug symbols such as
-(\path{xen-syms-3.0.0} and \path{vmlinux-syms-2.6.12.6-xen0}) which are
-essential for interpreting crash dumps. Retain these files as the
-developers may wish to see them if you post on the mailing list.
-
-
-\section{Configuration}
-\label{s:configure}
-
-Once you have built and installed the Xen distribution, it is simple to
-prepare the machine for booting and running Xen.
-
-\subsection{GRUB Configuration}
-
-An entry should be added to \path{grub.conf} (often found under
-\path{/boot/} or \path{/boot/grub/}) to allow Xen / XenLinux to boot.
-This file is sometimes called \path{menu.lst}, depending on your
-distribution. The entry should look something like the following:
-
-%% KMSelf Thu Dec  1 19:06:13 PST 2005 262144 is useful for RHEL/RH and
-%% related Dom0s.
-{\small
-\begin{verbatim}
-title Xen 3.0 / XenLinux 2.6
-  kernel /boot/xen-3.0.gz dom0_mem=262144
-  module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro console=tty0
-\end{verbatim}
-}
-
-The kernel line tells GRUB where to find Xen itself and what boot
-parameters should be passed to it (in this case, setting the domain~0
-memory allocation in kilobytes and the settings for the serial port).
-For more details on the various Xen boot parameters see
-Section~\ref{s:xboot}.
-
-The module line of the configuration describes the location of the
-XenLinux kernel that Xen should start and the parameters that should be
-passed to it. These are standard Linux parameters, identifying the root
-device and specifying it be initially mounted read only and instructing
-that console output be sent to the screen. Some distributions such as
-SuSE do not require the \path{ro} parameter.
-
-%% \framebox{\parbox{5in}{
-%%     {\bf Distro specific:} \\
-%%     {\it SuSE} --- Omit the {\tt ro} option from the XenLinux
-%%     kernel command line, since the partition won't be remounted rw
-%%     during boot.  }}
-
-To use an initrd, add another \path{module} line to the configuration,
-like: {\small
-\begin{verbatim}
-  module /boot/my_initrd.gz
-\end{verbatim}
-}
-
-%% KMSelf Thu Dec  1 19:05:30 PST 2005 Other configs as an appendix?
-
-When installing a new kernel, it is recommended that you do not delete
-existing menu options from \path{menu.lst}, as you may wish to boot your
-old Linux kernel in future, particularly if you have problems.
-
-\subsection{Serial Console (optional)}
-
-Serial console access allows you to manage, monitor, and interact with
-your system over a serial console.  This can allow access from another
-nearby system via a null-modem (``LapLink'') cable or remotely via a serial
-concentrator.
-
-You system's BIOS, bootloader (GRUB), Xen, Linux, and login access must
-each be individually configured for serial console access.  It is
-\emph{not} strictly necessary to have each component fully functional,
-but it can be quite useful.
-
-For general information on serial console configuration under Linux,
-refer to the ``Remote Serial Console HOWTO'' at The Linux Documentation
-Project: \url{http://www.tldp.org} 
-
-\subsubsection{Serial Console BIOS configuration}
-
-Enabling system serial console output neither enables nor disables
-serial capabilities in GRUB, Xen, or Linux, but may make remote
-management of your system more convenient by displaying POST and other
-boot messages over serial port and allowing remote BIOS configuration.
-
-Refer to your hardware vendor's documentation for capabilities and
-procedures to enable BIOS serial redirection.
-
-
-\subsubsection{Serial Console GRUB configuration}
-
-Enabling GRUB serial console output neither enables nor disables Xen or
-Linux serial capabilities, but may made remote management of your system
-more convenient by displaying GRUB prompts, menus, and actions over
-serial port and allowing remote GRUB management.
-
-Adding the following two lines to your GRUB configuration file,
-typically either \path{/boot/grub/menu.lst} or \path{/boot/grub/grub.conf}
-depending on your distro, will enable GRUB serial output.
-
-\begin{quote} 
-{\small \begin{verbatim}
-  serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-  terminal --timeout=10 serial console
-\end{verbatim}}
-\end{quote}
-
-Note that when both the serial port and the local monitor and keyboard
-are enabled, the text ``\emph{Press any key to continue}'' will appear
-at both.  Pressing a key on one device will cause GRUB to display to
-that device.  The other device will see no output.  If no key is
-pressed before the timeout period expires, the system will boot to the
-default GRUB boot entry.
-
-Please refer to the GRUB documentation for further information.
-
-
-\subsubsection{Serial Console Xen configuration}
-
-Enabling Xen serial console output neither enables nor disables Linux
-kernel output or logging in to Linux over serial port.  It does however
-allow you to monitor and log the Xen boot process via serial console and
-can be very useful in debugging.
-
-%% kernel /boot/xen-2.0.gz dom0_mem=131072 console=com1,vga com1=115200,8n1
-%% module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro
-
-In order to configure Xen serial console output, it is necessary to
-add a boot option to your GRUB config; e.g.\ replace the previous
-example kernel line with:
-\begin{quote} {\small \begin{verbatim}
-   kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1 console=com1,vga
-\end{verbatim}}
-\end{quote}
-
-This configures Xen to output on COM1 at 115,200 baud, 8 data bits, no
-parity and 1 stop bit. Modify these parameters for your environment.
-See Section~\ref{s:xboot} for an explanation of all boot parameters.
-
-One can also configure XenLinux to share the serial console; to achieve
-this append ``\path{console=ttyS0}'' to your module line.
-
-
-\subsubsection{Serial Console Linux configuration}
-
-Enabling Linux serial console output at boot neither enables nor
-disables logging in to Linux over serial port.  It does however allow
-you to monitor and log the Linux boot process via serial console and can be
-very useful in debugging.
-
-To enable Linux output at boot time, add the parameter
-\path{console=ttyS0} (or ttyS1, ttyS2, etc.) to your kernel GRUB line.
-Under Xen, this might be:
-\begin{quote} 
-{\footnotesize \begin{verbatim}
-  module /vmlinuz-2.6-xen0 ro root=/dev/VolGroup00/LogVol00 \
-  console=ttyS0, 115200
-\end{verbatim}}
-\end{quote}
-to enable output over ttyS0 at 115200 baud.
-
-
-
-\subsubsection{Serial Console Login configuration}
-
-Logging in to Linux via serial console, under Xen or otherwise, requires
-specifying a login prompt be started on the serial port.  To permit root
-logins over serial console, the serial port must be added to
-\path{/etc/securetty}.
-
-\newpage
-To automatically start a login prompt over the serial port, 
-add the line: \begin{quote} {\small {\tt c:2345:respawn:/sbin/mingetty
-ttyS0}} \end{quote} to \path{/etc/inittab}.   Run \path{init q} to force
-a reload of your inttab and start getty.
-
-To enable root logins, add \path{ttyS0} to \path{/etc/securetty} if not
-already present.
-
-Your distribution may use an alternate getty; options include getty,
-mgetty and agetty.  Consult your distribution's documentation
-for further information.
-
-
-\subsection{TLS Libraries}
-
-Users of the XenLinux 2.6 kernel should disable Thread Local Storage
-(TLS) (e.g.\ by doing a \path{mv /lib/tls /lib/tls.disabled}) before
-attempting to boot a XenLinux kernel\footnote{If you boot without first
-  disabling TLS, you will get a warning message during the boot process.
-  In this case, simply perform the rename after the machine is up and
-  then run \path{/sbin/ldconfig} to make it take effect.}. You can
-always reenable TLS by restoring the directory to its original location
-(i.e.\ \path{mv /lib/tls.disabled /lib/tls}).
-
-The reason for this is that the current TLS implementation uses
-segmentation in a way that is not permissible under Xen. If TLS is not
-disabled, an emulation mode is used within Xen which reduces performance
-substantially. To ensure full performance you should install a 
-`Xen-friendly' (nosegneg) version of the library. 
-
-
-\section{Booting Xen}
-
-It should now be possible to restart the system and use Xen. Reboot and
-choose the new Xen option when the Grub screen appears.
-
-What follows should look much like a conventional Linux boot. The first
-portion of the output comes from Xen itself, supplying low level
-information about itself and the underlying hardware. The last portion
-of the output comes from XenLinux.
-
-You may see some error messages during the XenLinux boot. These are not
-necessarily anything to worry about---they may result from kernel
-configuration differences between your XenLinux kernel and the one you
-usually use.
-
-When the boot completes, you should be able to log into your system as
-usual. If you are unable to log in, you should still be able to reboot
-with your normal Linux kernel by selecting it at the GRUB prompt.
-
-
-% Booting Xen
-\chapter{Booting a Xen System}
-
-Booting the system into Xen will bring you up into the privileged
-management domain, Domain0. At that point you are ready to create
-guest domains and ``boot'' them using the \texttt{xm create} command.
-
-\section{Booting Domain0}
-
-After installation and configuration is complete, reboot the system
-and and choose the new Xen option when the Grub screen appears.
-
-What follows should look much like a conventional Linux boot.  The
-first portion of the output comes from Xen itself, supplying low level
-information about itself and the underlying hardware.  The last
-portion of the output comes from XenLinux.
-
-%% KMSelf Wed Nov 30 18:09:37 PST 2005:  We should specify what these are.
-
-When the boot completes, you should be able to log into your system as
-usual.  If you are unable to log in, you should still be able to
-reboot with your normal Linux kernel by selecting it at the GRUB prompt.
-
-The first step in creating a new domain is to prepare a root
-filesystem for it to boot.  Typically, this might be stored in a normal
-partition, an LVM or other volume manager partition, a disk file or on
-an NFS server.  A simple way to do this is simply to boot from your
-standard OS install CD and install the distribution into another
-partition on your hard drive.
-
-To start the \xend\ control daemon, type
-\begin{quote}
-  \verb!# xend start!
-\end{quote}
-
-If you wish the daemon to start automatically, see the instructions in
-Section~\ref{s:xend}. Once the daemon is running, you can use the
-\path{xm} tool to monitor and maintain the domains running on your
-system. This chapter provides only a brief tutorial. We provide full
-details of the \path{xm} tool in the next chapter.
-
-% \section{From the web interface}
-%
-% Boot the Xen machine and start Xensv (see Chapter~\ref{cha:xensv}
-% for more details) using the command: \\
-% \verb_# xensv start_ \\
-% This will also start Xend (see Chapter~\ref{cha:xend} for more
-% information).
-%
-% The domain management interface will then be available at {\tt
-%   http://your\_machine:8080/}.  This provides a user friendly wizard
-% for starting domains and functions for managing running domains.
-%
-% \section{From the command line}
-\section{Booting Guest Domains}
-
-\subsection{Creating a Domain Configuration File}
-
-Before you can start an additional domain, you must create a
-configuration file. We provide two example files which you can use as
-a starting point:
-\begin{itemize}
-\item \path{/etc/xen/xmexample1} is a simple template configuration
-  file for describing a single VM\@.
-\item \path{/etc/xen/xmexample2} file is a template description that
-  is intended to be reused for multiple virtual machines.  Setting the
-  value of the \path{vmid} variable on the \path{xm} command line
-  fills in parts of this template.
-\end{itemize}
-
-There are also a number of other examples which you may find useful.
-Copy one of these files and edit it as appropriate.  Typical values
-you may wish to edit include:
-
-\begin{quote}
-\begin{description}
-\item[kernel] Set this to the path of the kernel you compiled for use
-  with Xen (e.g.\ \path{kernel = ``/boot/vmlinuz-2.6-xenU''})
-\item[memory] Set this to the size of the domain's memory in megabytes
-  (e.g.\ \path{memory = 64})
-\item[disk] Set the first entry in this list to calculate the offset
-  of the domain's root partition, based on the domain ID\@.  Set the
-  second to the location of \path{/usr} if you are sharing it between
-  domains (e.g.\ \path{disk = ['phy:your\_hard\_drive\%d,sda1,w' \%
-    (base\_partition\_number + vmid),
-    'phy:your\_usr\_partition,sda6,r' ]}
-\item[dhcp] Uncomment the dhcp variable, so that the domain will
-  receive its IP address from a DHCP server (e.g.\ \path{dhcp=``dhcp''})
-\end{description}
-\end{quote}
-
-You may also want to edit the {\bf vif} variable in order to choose
-the MAC address of the virtual ethernet interface yourself.  For
-example:
-
-\begin{quote}
-\verb_vif = ['mac=00:16:3E:F6:BB:B3']_
-\end{quote}
-If you do not set this variable, \xend\ will automatically generate a
-random MAC address from the range 00:16:3E:xx:xx:xx, assigned by IEEE to
-XenSource as an OUI (organizationally unique identifier).  XenSource
-Inc. gives permission for anyone to use addresses randomly allocated
-from this range for use by their Xen domains.
-
-For a list of IEEE OUI assignments, see 
-\url{http://standards.ieee.org/regauth/oui/oui.txt} 
-
-
-\subsection{Booting the Guest Domain}
-
-The \path{xm} tool provides a variety of commands for managing
-domains.  Use the \path{create} command to start new domains. Assuming
-you've created a configuration file \path{myvmconf} based around
-\path{/etc/xen/xmexample2}, to start a domain with virtual machine
-ID~1 you should type:
-
-\begin{quote}
-\begin{verbatim}
-# xm create -c myvmconf vmid=1
-\end{verbatim}
-\end{quote}
-
-The \path{-c} switch causes \path{xm} to turn into the domain's
-console after creation.  The \path{vmid=1} sets the \path{vmid}
-variable used in the \path{myvmconf} file.
-
-You should see the console boot messages from the new domain appearing
-in the terminal in which you typed the command, culminating in a login
-prompt.
-
-
-\section{Starting / Stopping Domains Automatically}
-
-It is possible to have certain domains start automatically at boot
-time and to have dom0 wait for all running domains to shutdown before
-it shuts down the system.
-
-To specify a domain is to start at boot-time, place its configuration
-file (or a link to it) under \path{/etc/xen/auto/}.
-
-A Sys-V style init script for Red Hat and LSB-compliant systems is
-provided and will be automatically copied to \path{/etc/init.d/}
-during install.  You can then enable it in the appropriate way for
-your distribution.
-
-For instance, on Red Hat:
-
-\begin{quote}
-  \verb_# chkconfig --add xendomains_
-\end{quote}
-
-By default, this will start the boot-time domains in runlevels 3, 4
-and 5.
-
-You can also use the \path{service} command to run this script
-manually, e.g:
-
-\begin{quote}
-  \verb_# service xendomains start_
-
-  Starts all the domains with config files under /etc/xen/auto/.
-\end{quote}
-
-\begin{quote}
-  \verb_# service xendomains stop_
-
-  Shuts down all running Xen domains.
-\end{quote}
-
-
-
-\part{Configuration and Management}
-
-%% Chapter Domain Management Tools and Daemons
-\chapter{Domain Management Tools}
-
-This chapter summarizes the management software and tools available.
-
-
-\section{\Xend\ }
-\label{s:xend}
-
-
-The \Xend\ node control daemon performs system management functions
-related to virtual machines. It forms a central point of control of
-virtualized resources, and must be running in order to start and manage
-virtual machines. \Xend\ must be run as root because it needs access to
-privileged system management functions.
-
-An initialization script named \texttt{/etc/init.d/xend} is provided to
-start \Xend\ at boot time. Use the tool appropriate (i.e. chkconfig) for
-your Linux distribution to specify the runlevels at which this script
-should be executed, or manually create symbolic links in the correct
-runlevel directories.
-
-\Xend\ can be started on the command line as well, and supports the
-following set of parameters:
-
-\begin{tabular}{ll}
-  \verb!# xend start! & start \xend, if not already running \\
-  \verb!# xend stop!  & stop \xend\ if already running       \\
-  \verb!# xend restart! & restart \xend\ if running, otherwise start it \\
-  % \verb!# xend trace_start! & start \xend, with very detailed debug logging \\
-  \verb!# xend status! & indicates \xend\ status by its return code
-\end{tabular}
-
-A SysV init script called {\tt xend} is provided to start \xend\ at
-boot time. {\tt make install} installs this script in
-\path{/etc/init.d}. To enable it, you have to make symbolic links in
-the appropriate runlevel directories or use the {\tt chkconfig} tool,
-where available.  Once \xend\ is running, administration can be done
-using the \texttt{xm} tool.
-
-\subsection{Logging}
-
-As \xend\ runs, events will be logged to \path{/var/log/xen/xend.log} and
-(less frequently) to \path{/var/log/xen/xend-debug.log}. These, along with
-the standard syslog files, are useful when troubleshooting problems.
-
-\subsection{Configuring \Xend\ }
-
-\Xend\ is written in Python. At startup, it reads its configuration
-information from the file \path{/etc/xen/xend-config.sxp}. The Xen
-installation places an example \texttt{xend-config.sxp} file in the
-\texttt{/etc/xen} subdirectory which should work for most installations.
-
-See the example configuration file \texttt{xend-debug.sxp} and the
-section 5 man page \texttt{xend-config.sxp} for a full list of
-parameters and more detailed information. Some of the most important
-parameters are discussed below.
-
-An HTTP interface and a Unix domain socket API are available to
-communicate with \Xend. This allows remote users to pass commands to the
-daemon. By default, \Xend does not start an HTTP server. It does start a
-Unix domain socket management server, as the low level utility
-\texttt{xm} requires it. For support of cross-machine migration, \Xend\
-can start a relocation server. This support is not enabled by default
-for security reasons.
-
-Note: the example \texttt{xend} configuration file modifies the defaults and
-starts up \Xend\ as an HTTP server as well as a relocation server.
-
-From the file:
-
-\begin{verbatim}
-#(xend-http-server no)
-(xend-http-server yes)
-#(xend-unix-server yes)
-#(xend-relocation-server no)
-(xend-relocation-server yes)
-\end{verbatim}
-
-Comment or uncomment lines in that file to disable or enable features
-that you require.
-
-Connections from remote hosts are disabled by default:
-
-\begin{verbatim}
-# Address xend should listen on for HTTP connections, if xend-http-server is
-# set.
-# Specifying 'localhost' prevents remote connections.
-# Specifying the empty string '' (the default) allows all connections.
-#(xend-address '')
-(xend-address localhost)
-\end{verbatim}
-
-It is recommended that if migration support is not needed, the
-\texttt{xend-relocation-server} parameter value be changed to
-``\texttt{no}'' or commented out.
-
-\section{Xm}
-\label{s:xm}
-
-The xm tool is the primary tool for managing Xen from the console. The
-general format of an xm command line is:
-
-\begin{verbatim}
-# xm command [switches] [arguments] [variables]
-\end{verbatim}
-
-The available \emph{switches} and \emph{arguments} are dependent on the
-\emph{command} chosen. The \emph{variables} may be set using
-declarations of the form {\tt variable=value} and command line
-declarations override any of the values in the configuration file being
-used, including the standard variables described above and any custom
-variables (for instance, the \path{xmdefconfig} file uses a {\tt vmid}
-variable).
-
-For online help for the commands available, type:
-
-\begin{quote}
-\begin{verbatim}
-# xm help
-\end{verbatim}
-\end{quote}
-
-This will list the most commonly used commands.  The full list can be obtained
-using \verb_xm help --long_.  You can also type \path{xm help $<$command$>$}
-for more information on a given command.
-
-\subsection{Basic Management Commands}
-
-One useful command is \verb_# xm list_ which lists all domains running in rows
-of the following format:
-\begin{center} {\tt name domid memory vcpus state cputime}
-\end{center}
-
-The meaning of each field is as follows: 
-\begin{quote}
-  \begin{description}
-  \item[name] The descriptive name of the virtual machine.
-  \item[domid] The number of the domain ID this virtual machine is
-    running in.
-  \item[memory] Memory size in megabytes.
-  \item[vcpus] The number of virtual CPUs this domain has.
-  \item[state] Domain state consists of 5 fields:
-    \begin{description}
-    \item[r] running
-    \item[b] blocked
-    \item[p] paused
-    \item[s] shutdown
-    \item[c] crashed
-    \end{description}
-  \item[cputime] How much CPU time (in seconds) the domain has used so
-    far.
-  \end{description}
-\end{quote}
-
-The \path{xm list} command also supports a long output format when the
-\path{-l} switch is used.  This outputs the full details of the
-running domains in \xend's SXP configuration format.
-
-If you want to know how long your domains have been running for, then 
-you can use the \verb_# xm uptime_ command.
-
-
-You can get access to the console of a particular domain using 
-the \verb_# xm console_ command  (e.g.\ \verb_# xm console myVM_). 
-
-\subsection{Domain Scheduling Management Commands}
-
-The credit CPU scheduler automatically load balances guest VCPUs
-across all available physical CPUs on an SMP host. The user need
-not manually pin VCPUs to load balance the system. However, she
-can restrict which CPUs a particular VCPU may run on using
-the \path{xm vcpu-pin} command.
-
-Each guest domain is assigned a \path{weight} and a \path{cap}.
-
-A domain with a weight of 512 will get twice as much CPU as a
-domain with a weight of 256 on a contended host. Legal weights
-range from 1 to 65535 and the default is 256.
-
-The cap optionally fixes the maximum amount of CPU a guest will
-be able to consume, even if the host system has idle CPU cycles.
-The cap is expressed in percentage of one physical CPU: 100 is
-1 physical CPU, 50 is half a CPU, 400 is 4 CPUs, etc... The
-default, 0, means there is no upper cap.
-
-When you are running with the credit scheduler, you can check and
-modify your domains' weights and caps using the \path{xm sched-credit}
-command:
-
-\begin{tabular}{ll}
-\verb!xm sched-credit -d <domain>! & lists weight and cap \\
-\verb!xm sched-credit -d <domain> -w <weight>! & sets the weight \\
-\verb!xm sched-credit -d <domain> -c <cap>! & sets the cap
-\end{tabular}
-
-
-
-%% Chapter Domain Configuration
-\chapter{Domain Configuration}
-\label{cha:config}
-
-The following contains the syntax of the domain configuration files
-and description of how to further specify networking, driver domain
-and general scheduling behavior.
-
-
-\section{Configuration Files}
-\label{s:cfiles}
-
-Xen configuration files contain the following standard variables.
-Unless otherwise stated, configuration items should be enclosed in
-quotes: see the configuration scripts in \path{/etc/xen/} 
-for concrete examples. 
-
-\begin{description}
-\item[kernel] Path to the kernel image.
-\item[ramdisk] Path to a ramdisk image (optional).
-  % \item[builder] The name of the domain build function (e.g.
-  %   {\tt'linux'} or {\tt'netbsd'}.
-\item[memory] Memory size in megabytes.
-\item[vcpus] The number of virtual CPUs. 
-\item[console] Port to export the domain console on (default 9600 +
-  domain ID).
-\item[vif] Network interface configuration.  This may simply contain
-an empty string for each desired interface, or may override various
-settings, e.g.\ 
-\begin{verbatim}
-vif = [ 'mac=00:16:3E:00:00:11, bridge=xen-br0',
-        'bridge=xen-br1' ]
-\end{verbatim}
-  to assign a MAC address and bridge to the first interface and assign
-  a different bridge to the second interface, leaving \xend\ to choose
-  the MAC address.  The settings that may be overridden in this way are
-  type, mac, bridge, ip, script, backend, and vifname.
-\item[disk] List of block devices to export to the domain e.g. 
-  \verb_disk = [ 'phy:hda1,sda1,r' ]_ 
-  exports physical device \path{/dev/hda1} to the domain as
-  \path{/dev/sda1} with read-only access. Exporting a disk read-write
-  which is currently mounted is dangerous -- if you are \emph{certain}
-  you wish to do this, you can specify \path{w!} as the mode.
-\item[dhcp] Set to {\tt `dhcp'} if you want to use DHCP to configure
-  networking.
-\item[netmask] Manually configured IP netmask.
-\item[gateway] Manually configured IP gateway.
-\item[hostname] Set the hostname for the virtual machine.
-\item[root] Specify the root device parameter on the kernel command
-  line.
-\item[nfs\_server] IP address for the NFS server (if any).
-\item[nfs\_root] Path of the root filesystem on the NFS server (if
-  any).
-\item[extra] Extra string to append to the kernel command line (if
-  any)
-\end{description}
-
-Additional fields are documented in the example configuration files 
-(e.g. to configure virtual TPM functionality). 
-
-For additional flexibility, it is also possible to include Python
-scripting commands in configuration files.  An example of this is the
-\path{xmexample2} file, which uses Python code to handle the
-\path{vmid} variable.
-
-
-%\part{Advanced Topics}
-
-
-\section{Network Configuration}
-
-For many users, the default installation should work ``out of the
-box''.  More complicated network setups, for instance with multiple
-Ethernet interfaces and/or existing bridging setups will require some
-special configuration.
-
-The purpose of this section is to describe the mechanisms provided by
-\xend\ to allow a flexible configuration for Xen's virtual networking.
-
-\subsection{Xen virtual network topology}
-
-Each domain network interface is connected to a virtual network
-interface in dom0 by a point to point link (effectively a ``virtual
-crossover cable'').  These devices are named {\tt
-  vif$<$domid$>$.$<$vifid$>$} (e.g.\ {\tt vif1.0} for the first
-interface in domain~1, {\tt vif3.1} for the second interface in
-domain~3).
-
-Traffic on these virtual interfaces is handled in domain~0 using
-standard Linux mechanisms for bridging, routing, rate limiting, etc.
-Xend calls on two shell scripts to perform initial configuration of
-the network and configuration of new virtual interfaces.  By default,
-these scripts configure a single bridge for all the virtual
-interfaces.  Arbitrary routing / bridging configurations can be
-configured by customizing the scripts, as described in the following
-section.
-
-\subsection{Xen networking scripts}
-
-Xen's virtual networking is configured by two shell scripts (by
-default \path{network-bridge} and \path{vif-bridge}).  These are called
-automatically by \xend\ when certain events occur, with arguments to
-the scripts providing further contextual information.  These scripts
-are found by default in \path{/etc/xen/scripts}.  The names and
-locations of the scripts can be configured in
-\path{/etc/xen/xend-config.sxp}.
-
-\begin{description}
-\item[network-bridge:] This script is called whenever \xend\ is started or
-  stopped to respectively initialize or tear down the Xen virtual
-  network. In the default configuration initialization creates the
-  bridge `xen-br0' and moves eth0 onto that bridge, modifying the
-  routing accordingly. When \xend\ exits, it deletes the Xen bridge
-  and removes eth0, restoring the normal IP and routing configuration.
-
-  %% In configurations where the bridge already exists, this script
-  %% could be replaced with a link to \path{/bin/true} (for instance).
-
-\item[vif-bridge:] This script is called for every domain virtual
-  interface and can configure firewalling rules and add the vif to the
-  appropriate bridge. By default, this adds and removes VIFs on the
-  default Xen bridge.
-\end{description}
-
-Other example scripts are available (\path{network-route} and
-\path{vif-route}, \path{network-nat} and \path{vif-nat}).
-For more complex network setups (e.g.\ where routing is required or
-integrate with existing bridges) these scripts may be replaced with
-customized variants for your site's preferred configuration.
-
-\section{Driver Domain Configuration}
-\label{s:ddconf}
-
-\subsection{PCI}
-\label{ss:pcidd}
-
-Individual PCI devices can be assigned to a given domain (a PCI driver domain)
-to allow that domain direct access to the PCI hardware.
-
-While PCI Driver Domains can increase the stability and security of a system
-by addressing a number of security concerns, there are some security issues
-that remain that you can read about in Section~\ref{s:ddsecurity}.
-
-\subsubsection{Compile-Time Setup}
-To use this functionality, ensure
-that the PCI Backend is compiled in to a privileged domain (e.g. domain 0)
-and that the domains which will be assigned PCI devices have the PCI Frontend
-compiled in. In XenLinux, the PCI Backend is available under the Xen
-configuration section while the PCI Frontend is under the
-architecture-specific "Bus Options" section. You may compile both the backend
-and the frontend into the same kernel; they will not affect each other.
-
-\subsubsection{PCI Backend Configuration - Binding at Boot}
-The PCI devices you wish to assign to unprivileged domains must be "hidden"
-from your backend domain (usually domain 0) so that it does not load a driver
-for them. Use the \path{pciback.hide} kernel parameter which is specified on
-the kernel command-line and is configurable through GRUB (see
-Section~\ref{s:configure}). Note that devices are not really hidden from the
-backend domain. The PCI Backend appears to the Linux kernel as a regular PCI
-device driver. The PCI Backend ensures that no other device driver loads
-for the devices by binding itself as the device driver for those devices.
-PCI devices are identified by hexadecimal slot/function numbers (on Linux,
-use \path{lspci} to determine slot/function numbers of your devices) and
-can be specified with or without the PCI domain: \\
-\centerline{  {\tt ({\em bus}:{\em slot}.{\em func})} example {\tt (02:1d.3)}} \\
-\centerline{  {\tt ({\em domain}:{\em bus}:{\em slot}.{\em func})} example {\tt (0000:02:1d.3)}} \\
-
-An example kernel command-line which hides two PCI devices might be: \\
-\centerline{ {\tt root=/dev/sda4 ro console=tty0 pciback.hide=(02:01.f)(0000:04:1d.0) } } \\
-
-\subsubsection{PCI Backend Configuration - Late Binding}
-PCI devices can also be bound to the PCI Backend after boot through the manual
-binding/unbinding facilities provided by the Linux kernel in sysfs (allowing
-for a Xen user to give PCI devices to driver domains that were not specified
-on the kernel command-line). There are several attributes with the PCI
-Backend's sysfs directory (\path{/sys/bus/pci/drivers/pciback}) that can be
-used to bind/unbind devices:
-
-\begin{description}
-\item[slots] lists all of the PCI slots that the PCI Backend will try to seize
-  (or "hide" from Domain 0). A PCI slot must appear in this list before it can
-  be bound to the PCI Backend through the \path{bind} attribute.
-\item[new\_slot] write the name of a slot here (in 0000:00:00.0 format) to
-  have the PCI Backend seize the device in this slot.
-\item[remove\_slot] write the name of a slot here (same format as
-  \path{new\_slot}) to have the PCI Backend no longer try to seize devices in
-  this slot. Note that this does not unbind the driver from a device it has
-  already seized.
-\item[bind] write the name of a slot here (in 0000:00:00.0 format) to have
-  the Linux kernel attempt to bind the device in that slot to the PCI Backend
-  driver.
-\item[unbind] write the name of a skit here (same format as \path{bind}) to have
-  the Linux kernel unbind the device from the PCI Backend. DO NOT unbind a
-  device while it is currently given to a PCI driver domain!
-\end{description}
-
-Some examples:
-
-Bind a device to the PCI Backend which is not bound to any other driver.
-\begin{verbatim}
-# # Add a new slot to the PCI Backend's list
-# echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/new_slot
-# # Now that the backend is watching for the slot, bind to it
-# echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/bind
-\end{verbatim}
-
-Unbind a device from its driver and bind to the PCI Backend.
-\begin{verbatim}
-# # Unbind a PCI network card from its network driver
-# echo -n 0000:05:02.0 > /sys/bus/pci/drivers/3c905/unbind
-# # And now bind it to the PCI Backend
-# echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/new_slot
-# echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/bind
-\end{verbatim}
-
-Note that the "-n" option in the example is important as it causes echo to not
-output a new-line.
-
-\subsubsection{PCI Backend Configuration - User-space Quirks}
-Quirky devices (such as the Broadcom Tigon 3) may need write access to their
-configuration space registers.  Xen can be instructed to allow specified PCI
-devices write access to specific configuration space registers.  The policy may
-be found in:
-
-\centerline{ \path{/etc/xen/xend-pci-quirks.sxp} }
-
-The policy file is heavily commented and is intended to provide enough
-documentation for developers to extend it.
-
-\subsubsection{PCI Backend Configuration - Permissive Flag}
-If the user-space quirks approach doesn't meet your needs you may want to enable
-the permissive flag for that device.  To do so, first get the PCI domain, bus,
-slot, and function information from dom0 via \path{lspci}.  Then augment the
-user-space policy for permissive devices.  The permissive policy can be found
-in:
-
-\centerline{ \path{/etc/xen/xend-pci-permissive.sxp} }
-
-Currently, the only way to reset the permissive flag is to unbind the device
-from the PCI Backend driver.
-
-\subsubsection{PCI Backend - Checking Status}
-There two important sysfs nodes that provide a mechanism to view specifics on
-quirks and permissive devices:
-\begin{description}
-\item \path{/sys/bus/drivers/pciback/permissive} \\
- Use \path{cat} on this file to view a list of permissive slots.
-\item \path{/sys/bus/drivers/pciback/quirks} \\
- Use \path{cat} on this file view a hierarchical view of devices bound to the
-PCI backend, their PCI vendor/device ID, and any quirks that are associated with
-that particular slot.  
-\end{description}
-
-You may notice that every device bound to the PCI backend has 17 quirks standard 
-"quirks" regardless of \path{xend-pci-quirks.sxp}.  These default entries are
-necessary to support interactions between the PCI bus manager and the device bound
-to it.  Even non-quirky devices should have these standard entries.  
-
-In this case, preference was given to accuracy over aesthetics by choosing to
-show the standard quirks in the quirks list rather than hide them from the
-inquiring user 
-
-\subsubsection{PCI Frontend Configuration}
-To configure a domU to receive a PCI device:
-
-\begin{description}
-\item[Command-line:]
-  Use the {\em pci} command-line flag. For multiple devices, use the option
-  multiple times. \\
-\centerline{  {\tt xm create netcard-dd pci=01:00.0 pci=02:03.0 }} \\
-
-\item[Flat Format configuration file:]
-  Specify all of your PCI devices in a python list named {\em pci}. \\
-\centerline{  {\tt pci=['01:00.0','02:03.0'] }} \\
-
-\item[SXP Format configuration file:]
-  Use a single PCI device section for all of your devices (specify the numbers
-  in hexadecimal with the preceding '0x'). Note that {\em domain} here refers
-  to the PCI domain, not a virtual machine within Xen.
-{\small
-\begin{verbatim}
-(device (pci
-    (dev (domain 0x0)(bus 0x3)(slot 0x1a)(func 0x1)
-    (dev (domain 0x0)(bus 0x1)(slot 0x5)(func 0x0)
-)
-\end{verbatim}
-}
-\end{description}
-
-%% There are two possible types of privileges: IO privileges and
-%% administration privileges.
-
-\section{Support for virtual Trusted Platform Module (vTPM)}
-\label{ss:vtpm}
-
-Paravirtualized domains can be given access to a virtualized version
-of a TPM. This enables applications in these domains to use the services
-of the TPM device for example through a TSS stack
-\footnote{Trousers TSS stack: http://sourceforge.net/projects/trousers}.
-The Xen source repository provides the necessary software components to
-enable virtual TPM access. Support is provided through several
-different pieces. First, a TPM emulator has been modified to provide TPM's
-functionality for the virtual TPM subsystem. Second, a virtual TPM Manager
-coordinates the virtual TPMs efforts, manages their creation, and provides
-protected key storage using the TPM. Third, a device driver pair providing
-a TPM front- and backend is available for XenLinux to deliver TPM commands
-from the domain to the virtual TPM manager, which dispatches it to a
-software TPM. Since the TPM Manager relies on a HW TPM for protected key
-storage, therefore this subsystem requires a Linux-supported hardware TPM.
-For development purposes, a TPM emulator is available for use on non-TPM
-enabled platforms.
-
-\subsubsection{Compile-Time Setup}
-To enable access to the virtual TPM, the virtual TPM backend driver must
-be compiled for a privileged domain (e.g. domain 0). Using the XenLinux
-configuration, the necessary driver can be selected in the Xen configuration
-section. Unless the driver has been compiled into the kernel, its module
-must be activated using the following command:
-
-\begin{verbatim}
-modprobe tpmbk
-\end{verbatim}
-
-Similarly, the TPM frontend driver must be compiled for the kernel trying
-to use TPM functionality. Its driver can be selected in the kernel
-configuration section Device Driver / Character Devices / TPM Devices.
-Along with that the TPM driver for the built-in TPM must be selected.
-If the virtual TPM driver has been compiled as module, it
-must be activated using the following command:
-
-\begin{verbatim}
-modprobe tpm_xenu
-\end{verbatim}
-
-Furthermore, it is necessary to build the virtual TPM manager and software
-TPM by making changes to entries in Xen build configuration files.
-The following entry in the file Config.mk in the Xen root source
-directory must be made:
-
-\begin{verbatim}
-VTPM_TOOLS ?= y
-\end{verbatim}
-
-After a build of the Xen tree and a reboot of the machine, the TPM backend
-drive must be loaded. Once loaded, the virtual TPM manager daemon
-must be started before TPM-enabled guest domains may be launched.
-To enable being the destination of a virtual TPM Migration, the virtual TPM
-migration daemon must also be loaded.
-
-\begin{verbatim}
-vtpm_managerd
-\end{verbatim}
-\begin{verbatim}
-vtpm_migratord
-\end{verbatim}
-
-Once the VTPM manager is running, the VTPM can be accessed by loading the
-front end driver in a guest domain.
-
-\subsubsection{Development and Testing TPM Emulator}
-For development and testing on non-TPM enabled platforms, a TPM emulator
-can be used in replacement of a platform TPM. First, the entry in the file
-tools/vtpm/Rules.mk must look as follows:
-
-\begin{verbatim}
-BUILD_EMULATOR = y
-\end{verbatim}
-
-Second, the entry in the file tool/vtpm\_manager/Rules.mk must be uncommented
-as follows:
-
-\begin{verbatim}
-# TCS talks to fifo's rather than /dev/tpm. TPM Emulator assumed on fifos
-CFLAGS += -DDUMMY_TPM
-\end{verbatim}
-
-Before starting the virtual TPM Manager, start the emulator by executing
-the following in dom0:
-
-\begin{verbatim}
-tpm_emulator clear
-\end{verbatim}
-
-\subsubsection{vTPM Frontend Configuration}
-To provide TPM functionality to a user domain, a line must be added to
-the virtual TPM configuration file using the following format:
-
-\begin{verbatim}
-vtpm = ['instance=<instance number>, backend=<domain id>']
-\end{verbatim}
-
-The { \it instance number} reflects the preferred virtual TPM instance
-to associate with the domain. If the selected instance is
-already associated with another domain, the system will automatically
-select the next available instance. An instance number greater than
-zero must be provided. It is possible to omit the instance
-parameter from the configuration file.
-
-The {\it domain id} provides the ID of the domain where the
-virtual TPM backend driver and virtual TPM are running in. It should
-currently always be set to '0'.
-
-
-Examples for valid vtpm entries in the configuration file are
-
-\begin{verbatim}
- vtpm = ['instance=1, backend=0']
-\end{verbatim}
-and
-\begin{verbatim}
- vtpm = ['backend=0'].
-\end{verbatim}
-
-\subsubsection{Using the virtual TPM}
-
-Access to TPM functionality is provided by the virtual TPM frontend driver.
-Similar to existing hardware TPM drivers, this driver provides basic TPM
-status information through the {\it sysfs} filesystem. In a Xen user domain
-the sysfs entries can be found in /sys/devices/xen/vtpm-0.
-
-Commands can be sent to the virtual TPM instance using the character
-device /dev/tpm0 (major 10, minor 224).
-
-% Chapter Storage and FileSytem Management
-\chapter{Storage and File System Management}
-
-Storage can be made available to virtual machines in a number of
-different ways.  This chapter covers some possible configurations.
-
-The most straightforward method is to export a physical block device (a
-hard drive or partition) from dom0 directly to the guest domain as a
-virtual block device (VBD).
-
-Storage may also be exported from a filesystem image or a partitioned
-filesystem image as a \emph{file-backed VBD}.
-
-Finally, standard network storage protocols such as NBD, iSCSI, NFS,
-etc., can be used to provide storage to virtual machines.
-
-
-\section{Exporting Physical Devices as VBDs}
-\label{s:exporting-physical-devices-as-vbds}
-
-One of the simplest configurations is to directly export individual
-partitions from domain~0 to other domains. To achieve this use the
-\path{phy:} specifier in your domain configuration file. For example a
-line like
-\begin{quote}
-  \verb_disk = ['phy:hda3,sda1,w']_
-\end{quote}
-specifies that the partition \path{/dev/hda3} in domain~0 should be
-exported read-write to the new domain as \path{/dev/sda1}; one could
-equally well export it as \path{/dev/hda} or \path{/dev/sdb5} should
-one wish.
-
-In addition to local disks and partitions, it is possible to export
-any device that Linux considers to be ``a disk'' in the same manner.
-For example, if you have iSCSI disks or GNBD volumes imported into
-domain~0 you can export these to other domains using the \path{phy:}
-disk syntax. E.g.:
-\begin{quote}
-  \verb_disk = ['phy:vg/lvm1,sda2,w']_
-\end{quote}
-
-\begin{center}
-  \framebox{\bf Warning: Block device sharing}
-\end{center}
-\begin{quote}
-  Block devices should typically only be shared between domains in a
-  read-only fashion otherwise the Linux kernel's file systems will get
-  very confused as the file system structure may change underneath
-  them (having the same ext3 partition mounted \path{rw} twice is a
-  sure fire way to cause irreparable damage)!  \Xend\ will attempt to
-  prevent you from doing this by checking that the device is not
-  mounted read-write in domain~0, and hasn't already been exported
-  read-write to another domain.  If you want read-write sharing,
-  export the directory to other domains via NFS from domain~0 (or use
-  a cluster file system such as GFS or ocfs2).
-\end{quote}
-
-
-\section{Using File-backed VBDs}
-
-It is also possible to use a file in Domain~0 as the primary storage
-for a virtual machine.  As well as being convenient, this also has the
-advantage that the virtual block device will be \emph{sparse} ---
-space will only really be allocated as parts of the file are used.  So
-if a virtual machine uses only half of its disk space then the file
-really takes up half of the size allocated.
-
-For example, to create a 2GB sparse file-backed virtual block device
-(actually only consumes no disk space at all):
-\begin{quote}
-  \verb_# dd if=/dev/zero of=vm1disk bs=1k seek=2048k count=0_
-\end{quote}
-
-Make a file system in the disk file:
-\begin{quote}
-  \verb_# mkfs -t ext3 vm1disk_
-\end{quote}
-
-(when the tool asks for confirmation, answer `y')
-
-Populate the file system e.g.\ by copying from the current root:
-\begin{quote}
-\begin{verbatim}
-# mount -o loop vm1disk /mnt
-# cp -ax /{root,dev,var,etc,usr,bin,sbin,lib} /mnt
-# mkdir /mnt/{proc,sys,home,tmp}
-\end{verbatim}
-\end{quote}
-
-Tailor the file system by editing \path{/etc/fstab},
-\path{/etc/hostname}, etc.\ Don't forget to edit the files in the
-mounted file system, instead of your domain~0 filesystem, e.g.\ you
-would edit \path{/mnt/etc/fstab} instead of \path{/etc/fstab}.  For
-this example put \path{/dev/sda1} to root in fstab.
-
-Now unmount (this is important!):
-\begin{quote}
-  \verb_# umount /mnt_
-\end{quote}
-
-In the configuration file set:
-\begin{quote}
-  \verb_disk = ['tap:aio:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-
-As the virtual machine writes to its `disk', the sparse file will be
-filled in and consume more space up to the original 2GB.
-
-{\em{Note:}} Users that have worked with file-backed VBDs on Xen in previous
-versions will be interested to know that this support is now provided through
-the blktap driver instead of the loopback driver.  This change results in
-file-based block devices that are higher-performance, more scalable, and which
-provide better safety properties for VBD data.  All that is required to update
-your existing file-backed VM configurations is to change VBD configuration
-lines from:
-\begin{quote}
-  \verb_disk = ['file:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-to:
-\begin{quote}
-  \verb_disk = ['tap:aio:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-
-
-\subsection{Loopback-mounted file-backed VBDs (deprecated)}
-
-{\em{{\bf{Note:}} Loopback mounted VBDs have now been replaced with
-    blktap-based support for raw image files, as described above.  This
-    section remains to detail a configuration that was used by older Xen
-    versions.}}
-
-Raw image file-backed VBDs may also be attached to VMs using the 
-Linux loopback driver.  The only required change to the raw file 
-instructions above are to specify the configuration entry as:
-\begin{quote}
-  \verb_disk = ['file:/full/path/to/vm1disk,sda1,w']_
-\end{quote}
-
-{\bf Note that loopback file-backed VBDs may not be appropriate for backing
-  I/O-intensive domains.}  This approach is known to experience
-substantial slowdowns under heavy I/O workloads, due to the I/O
-handling by the loopback block device used to support file-backed VBDs
-in dom0.  Loopback support remains for old Xen installations, and users
-are strongly encouraged to use the blktap-based file support (using 
-``{\tt{tap:aio}}'' as described above).
-
-Additionally, Linux supports a maximum of eight loopback file-backed 
-VBDs across all domains by default.  This limit can be statically 
-increased by using the \emph{max\_loop} module parameter if 
-CONFIG\_BLK\_DEV\_LOOP is compiled as a module in the dom0 kernel, or 
-by using the \emph{max\_loop=n} boot option if CONFIG\_BLK\_DEV\_LOOP 
-is compiled directly into the dom0 kernel.  Again, users are encouraged
-to use the blktap-based file support described above which scales to much 
-larger number of active VBDs.
-
-
-\section{Using LVM-backed VBDs}
-\label{s:using-lvm-backed-vbds}
-
-A particularly appealing solution is to use LVM volumes as backing for
-domain file-systems since this allows dynamic growing/shrinking of
-volumes as well as snapshot and other features.
-
-To initialize a partition to support LVM volumes:
-\begin{quote}
-\begin{verbatim}
-# pvcreate /dev/sda10           
-\end{verbatim} 
-\end{quote}
-
-Create a volume group named `vg' on the physical partition:
-\begin{quote}
-\begin{verbatim}
-# vgcreate vg /dev/sda10
-\end{verbatim} 
-\end{quote}
-
-Create a logical volume of size 4GB named `myvmdisk1':
-\begin{quote}
-\begin{verbatim}
-# lvcreate -L4096M -n myvmdisk1 vg
-\end{verbatim}
-\end{quote}
-
-You should now see that you have a \path{/dev/vg/myvmdisk1} Make a
-filesystem, mount it and populate it, e.g.:
-\begin{quote}
-\begin{verbatim}
-# mkfs -t ext3 /dev/vg/myvmdisk1
-# mount /dev/vg/myvmdisk1 /mnt
-# cp -ax / /mnt
-# umount /mnt
-\end{verbatim}
-\end{quote}
-
-Now configure your VM with the following disk configuration:
-\begin{quote}
-\begin{verbatim}
- disk = [ 'phy:vg/myvmdisk1,sda1,w' ]
-\end{verbatim}
-\end{quote}
-
-LVM enables you to grow the size of logical volumes, but you'll need
-to resize the corresponding file system to make use of the new space.
-Some file systems (e.g.\ ext3) now support online resize.  See the LVM
-manuals for more details.
-
-You can also use LVM for creating copy-on-write (CoW) clones of LVM
-volumes (known as writable persistent snapshots in LVM terminology).
-This facility is new in Linux 2.6.8, so isn't as stable as one might
-hope.  In particular, using lots of CoW LVM disks consumes a lot of
-dom0 memory, and error conditions such as running out of disk space
-are not handled well. Hopefully this will improve in future.
-
-To create two copy-on-write clones of the above file system you would
-use the following commands:
-
-\begin{quote}
-\begin{verbatim}
-# lvcreate -s -L1024M -n myclonedisk1 /dev/vg/myvmdisk1
-# lvcreate -s -L1024M -n myclonedisk2 /dev/vg/myvmdisk1
-\end{verbatim}
-\end{quote}
-
-Each of these can grow to have 1GB of differences from the master
-volume. You can grow the amount of space for storing the differences
-using the lvextend command, e.g.:
-\begin{quote}
-\begin{verbatim}
-# lvextend +100M /dev/vg/myclonedisk1
-\end{verbatim}
-\end{quote}
-
-Don't let the `differences volume' ever fill up otherwise LVM gets
-rather confused. It may be possible to automate the growing process by
-using \path{dmsetup wait} to spot the volume getting full and then
-issue an \path{lvextend}.
-
-In principle, it is possible to continue writing to the volume that
-has been cloned (the changes will not be visible to the clones), but
-we wouldn't recommend this: have the cloned volume as a `pristine'
-file system install that isn't mounted directly by any of the virtual
-machines.
-
-
-\section{Using NFS Root}
-
-First, populate a root filesystem in a directory on the server
-machine. This can be on a distinct physical machine, or simply run
-within a virtual machine on the same node.
-
-Now configure the NFS server to export this filesystem over the
-network by adding a line to \path{/etc/exports}, for instance:
-
-\begin{quote}
-  \begin{small}
-\begin{verbatim}
-/export/vm1root      192.0.2.4/24 (rw,sync,no_root_squash)
-\end{verbatim}
-  \end{small}
-\end{quote}
-
-Finally, configure the domain to use NFS root.  In addition to the
-normal variables, you should make sure to set the following values in
-the domain's configuration file:
-
-\begin{quote}
-  \begin{small}
-\begin{verbatim}
-root       = '/dev/nfs'
-nfs_server = '2.3.4.5'       # substitute IP address of server
-nfs_root   = '/path/to/root' # path to root FS on the server
-\end{verbatim}
-  \end{small}
-\end{quote}
-
-The domain will need network access at boot time, so either statically
-configure an IP address using the config variables \path{ip},
-\path{netmask}, \path{gateway}, \path{hostname}; or enable DHCP
-(\path{dhcp='dhcp'}).
-
-Note that the Linux NFS root implementation is known to have stability
-problems under high load (this is not a Xen-specific problem), so this
-configuration may not be appropriate for critical servers.
-
-
-\chapter{CPU Management}
-
-%% KMS Something sage about CPU / processor management.
-
-Xen allows a domain's virtual CPU(s) to be associated with one or more
-host CPUs.  This can be used to allocate real resources among one or
-more guests, or to make optimal use of processor resources when
-utilizing dual-core, hyperthreading, or other advanced CPU technologies.
-
-Xen enumerates physical CPUs in a `depth first' fashion.  For a system
-with both hyperthreading and multiple cores, this would be all the
-hyperthreads on a given core, then all the cores on a given socket,
-and then all sockets.  I.e.  if you had a two socket, dual core,
-hyperthreaded Xeon the CPU order would be:
-
-
-\begin{center}
-\begin{tabular}{l|l|l|l|l|l|l|r}
-\multicolumn{4}{c|}{socket0}     &  \multicolumn{4}{c}{socket1} \\ \hline
-\multicolumn{2}{c|}{core0}  &  \multicolumn{2}{c|}{core1}  &
-\multicolumn{2}{c|}{core0}  &  \multicolumn{2}{c}{core1} \\ \hline
-ht0 & ht1 & ht0 & ht1 & ht0 & ht1 & ht0 & ht1 \\
-\#0 & \#1 & \#2 & \#3 & \#4 & \#5 & \#6 & \#7 \\
-\end{tabular}
-\end{center}
-
-
-Having multiple vcpus belonging to the same domain mapped to the same
-physical CPU is very likely to lead to poor performance. It's better to
-use `vcpus-set' to hot-unplug one of the vcpus and ensure the others are
-pinned on different CPUs.
-
-If you are running IO intensive tasks, its typically better to dedicate
-either a hyperthread or whole core to running domain 0, and hence pin
-other domains so that they can't use CPU 0. If your workload is mostly
-compute intensive, you may want to pin vcpus such that all physical CPU
-threads are available for guest domains.
-
-\chapter{Migrating Domains}
-
-\section{Domain Save and Restore}
-
-The administrator of a Xen system may suspend a virtual machine's
-current state into a disk file in domain~0, allowing it to be resumed at
-a later time.
-
-For example you can suspend a domain called ``VM1'' to disk using the
-command:
-\begin{verbatim}
-# xm save VM1 VM1.chk
-\end{verbatim}
-
-This will stop the domain named ``VM1'' and save its current state
-into a file called \path{VM1.chk}.
-
-To resume execution of this domain, use the \path{xm restore} command:
-\begin{verbatim}
-# xm restore VM1.chk
-\end{verbatim}
-
-This will restore the state of the domain and resume its execution.
-The domain will carry on as before and the console may be reconnected
-using the \path{xm console} command, as described earlier.
-
-\section{Migration and Live Migration}
-
-Migration is used to transfer a domain between physical hosts. There
-are two varieties: regular and live migration. The former moves a
-virtual machine from one host to another by pausing it, copying its
-memory contents, and then resuming it on the destination. The latter
-performs the same logical functionality but without needing to pause
-the domain for the duration. In general when performing live migration
-the domain continues its usual activities and---from the user's
-perspective---the migration should be imperceptible.
-
-To perform a live migration, both hosts must be running Xen / \xend\ and
-the destination host must have sufficient resources (e.g.\ memory
-capacity) to accommodate the domain after the move. Furthermore we
-currently require both source and destination machines to be on the same
-L2 subnet.
-
-Currently, there is no support for providing automatic remote access
-to filesystems stored on local disk when a domain is migrated.
-Administrators should choose an appropriate storage solution (i.e.\
-SAN, NAS, etc.) to ensure that domain filesystems are also available
-on their destination node. GNBD is a good method for exporting a
-volume from one machine to another. iSCSI can do a similar job, but is
-more complex to set up.
-
-When a domain migrates, it's MAC and IP address move with it, thus it is
-only possible to migrate VMs within the same layer-2 network and IP
-subnet. If the destination node is on a different subnet, the
-administrator would need to manually configure a suitable etherip or IP
-tunnel in the domain~0 of the remote node.
-
-A domain may be migrated using the \path{xm migrate} command. To live
-migrate a domain to another machine, we would use the command:
-
-\begin{verbatim}
-# xm migrate --live mydomain destination.ournetwork.com
-\end{verbatim}
-
-Without the \path{--live} flag, \xend\ simply stops the domain and
-copies the memory image over to the new node and restarts it. Since
-domains can have large allocations this can be quite time consuming,
-even on a Gigabit network. With the \path{--live} flag \xend\ attempts
-to keep the domain running while the migration is in progress, resulting
-in typical down times of just 60--300ms.
-
-For now it will be necessary to reconnect to the domain's console on the
-new machine using the \path{xm console} command. If a migrated domain
-has any open network connections then they will be preserved, so SSH
-connections do not have this limitation.
-
-
-%% Chapter Securing Xen
-\chapter{Securing Xen}
-
-This chapter describes how to secure a Xen system. It describes a number
-of scenarios and provides a corresponding set of best practices. It
-begins with a section devoted to understanding the security implications
-of a Xen system.
-
-
-\section{Xen Security Considerations}
-
-When deploying a Xen system, one must be sure to secure the management
-domain (Domain-0) as much as possible. If the management domain is
-compromised, all other domains are also vulnerable. The following are a
-set of best practices for Domain-0:
-
-\begin{enumerate}
-\item \textbf{Run the smallest number of necessary services.} The less
-  things that are present in a management partition, the better.
-  Remember, a service running as root in the management domain has full
-  access to all other domains on the system.
-\item \textbf{Use a firewall to restrict the traffic to the management
-    domain.} A firewall with default-reject rules will help prevent
-  attacks on the management domain.
-\item \textbf{Do not allow users to access Domain-0.} The Linux kernel
-  has been known to have local-user root exploits. If you allow normal
-  users to access Domain-0 (even as unprivileged users) you run the risk
-  of a kernel exploit making all of your domains vulnerable.
-\end{enumerate}
-
-\section{Driver Domain Security Considerations}
-\label{s:ddsecurity}
-
-Driver domains address a range of security problems that exist regarding
-the use of device drivers and hardware. On many operating systems in common
-use today, device drivers run within the kernel with the same privileges as
-the kernel. Few or no mechanisms exist to protect the integrity of the kernel
-from a misbehaving (read "buggy") or malicious device driver. Driver
-domains exist to aid in isolating a device driver within its own virtual
-machine where it cannot affect the stability and integrity of other
-domains. If a driver crashes, the driver domain can be restarted rather than
-have the entire machine crash (and restart) with it. Drivers written by
-unknown or untrusted third-parties can be confined to an isolated space.
-Driver domains thus address a number of security and stability issues with
-device drivers.
-
-However, due to limitations in current hardware, a number of security
-concerns remain that need to be considered when setting up driver domains (it
-should be noted that the following list is not intended to be exhaustive).
-
-\begin{enumerate}
-\item \textbf{Without an IOMMU, a hardware device can DMA to memory regions
-  outside of its controlling domain.} Architectures which do not have an
-  IOMMU (e.g. most x86-based platforms) to restrict DMA usage by hardware
-  are vulnerable. A hardware device which can perform arbitrary memory reads
-  and writes can read/write outside of the memory of its controlling domain.
-  A malicious or misbehaving domain could use a hardware device it controls
-  to send data overwriting memory in another domain or to read arbitrary
-  regions of memory in another domain.
-\item \textbf{Shared buses are vulnerable to sniffing.} Devices that share
-  a data bus can sniff (and possible spoof) each others' data. Device A that
-  is assigned to Domain A could eavesdrop on data being transmitted by
-  Domain B to Device B and then relay that data back to Domain A.
-\item \textbf{Devices which share interrupt lines can either prevent the
-  reception of that interrupt by the driver domain or can trigger the
-  interrupt service routine of that guest needlessly.} A devices which shares
-  a level-triggered interrupt (e.g. PCI devices) with another device can
-  raise an interrupt and never clear it. This effectively blocks other devices
-  which share that interrupt line from notifying their controlling driver
-  domains that they need to be serviced. A device which shares an
-  any type of interrupt line can trigger its interrupt continually which
-  forces execution time to be spent (in multiple guests) in the interrupt
-  service routine (potentially denying time to other processes within that
-  guest). System architectures which allow each device to have its own
-  interrupt line (e.g. PCI's Message Signaled Interrupts) are less
-  vulnerable to this denial-of-service problem.
-\item \textbf{Devices may share the use of I/O memory address space.} Xen can
-  only restrict access to a device's physical I/O resources at a certain
-  granularity. For interrupt lines and I/O port address space, that
-  granularity is very fine (per interrupt line and per I/O port). However,
-  Xen can only restrict access to I/O memory address space on a page size
-  basis. If more than one device shares use of a page in I/O memory address
-  space, the domains to which those devices are assigned will be able to
-  access the I/O memory address space of each other's devices.
-\end{enumerate}
-
-
-\section{Security Scenarios}
-
-
-\subsection{The Isolated Management Network}
-
-In this scenario, each node has two network cards in the cluster. One
-network card is connected to the outside world and one network card is a
-physically isolated management network specifically for Xen instances to
-use.
-
-As long as all of the management partitions are trusted equally, this is
-the most secure scenario. No additional configuration is needed other
-than forcing Xend to bind to the management interface for relocation.
-
-
-\subsection{A Subnet Behind a Firewall}
-
-In this scenario, each node has only one network card but the entire
-cluster sits behind a firewall. This firewall should do at least the
-following:
-
-\begin{enumerate}
-\item Prevent IP spoofing from outside of the subnet.
-\item Prevent access to the relocation port of any of the nodes in the
-  cluster except from within the cluster.
-\end{enumerate}
-
-The following iptables rules can be used on each node to prevent
-migrations to that node from outside the subnet assuming the main
-firewall does not do this for you:
-
-\begin{verbatim}
-# this command disables all access to the Xen relocation
-# port:
-iptables -A INPUT -p tcp --destination-port 8002 -j REJECT
-
-# this command enables Xen relocations only from the specific
-# subnet:
-iptables -I INPUT -p tcp -{}-source 192.0.2.0/24 \
-    --destination-port 8002 -j ACCEPT
-\end{verbatim}
-
-\subsection{Nodes on an Untrusted Subnet}
-
-Migration on an untrusted subnet is not safe in current versions of Xen.
-It may be possible to perform migrations through a secure tunnel via an
-VPN or SSH. The only safe option in the absence of a secure tunnel is to
-disable migration completely. The easiest way to do this is with
-iptables:
-
-\begin{verbatim}
-# this command disables all access to the Xen relocation port
-iptables -A INPUT -p tcp -{}-destination-port 8002 -j REJECT
-\end{verbatim}
-
-\part{Reference}
-
-%% Chapter Build and Boot Options
-\chapter{Build and Boot Options} 
-
-This chapter describes the build- and boot-time options which may be
-used to tailor your Xen system.
-
-\section{Top-level Configuration Options} 
-
-Top-level configuration is achieved by editing one of two 
-files: \path{Config.mk} and \path{Makefile}. 
-
-The former allows the overall build target architecture to be 
-specified. You will typically not need to modify this unless 
-you are cross-compiling. Additional configuration options are
-documented in the \path{Config.mk} file. 
-
-The top-level \path{Makefile} is chiefly used to customize the set of
-kernels built. Look for the line: 
-\begin{quote}
-\begin{verbatim}
-KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
-\end{verbatim}
-\end{quote}
-
-Allowable options here are any kernels which have a corresponding 
-build configuration file in the \path{buildconfigs/} directory. 
-
-
-
-\section{Xen Build Options}
-
-Xen provides a number of build-time options which should be set as
-environment variables or passed on make's command-line.
-
-\begin{description}
-\item[verbose=y] Enable debugging messages when Xen detects an
-  unexpected condition.  Also enables console output from all domains.
-\item[debug=y] Enable debug assertions.  Implies {\bf verbose=y}.
-  (Primarily useful for tracing bugs in Xen).
-\item[debugger=y] Enable the in-Xen debugger. This can be used to
-  debug Xen, guest OSes, and applications.
-\item[perfc=y] Enable performance counters for significant events
-  within Xen. The counts can be reset or displayed on Xen's console
-  via console control keys.
-\end{description}
-
-
-\section{Xen Boot Options}
-\label{s:xboot}
-
-These options are used to configure Xen's behaviour at runtime.  They
-should be appended to Xen's command line, either manually or by
-editing \path{grub.conf}.
-
-\begin{description}
-\item [ noreboot ] Don't reboot the machine automatically on errors.
-  This is useful to catch debug output if you aren't catching console
-  messages via the serial line.
-\item [ nosmp ] Disable SMP support.  This option is implied by
-  `ignorebiostables'.
-\item [ watchdog ] Enable NMI watchdog which can report certain
-  failures.
-\item [ noirqbalance ] Disable software IRQ balancing and affinity.
-  This can be used on systems such as Dell 1850/2850 that have
-  workarounds in hardware for IRQ-routing issues.
-\item [ badpage=$<$page number$>$,$<$page number$>$, \ldots ] Specify
-  a list of pages not to be allocated for use because they contain bad
-  bytes. For example, if your memory tester says that byte 0x12345678
-  is bad, you would place `badpage=0x12345' on Xen's command line.
-\item [ serial\_tx\_buffer=$<$size$>$ ] Size of serial transmit
-  buffers. Default is 16kB.
-\item [ com1=$<$baud$>$,DPS,($<$io\_base$>$$|$pci$|$amt),$<$irq$>$
-  com2=$<$baud$>$,DPS,($<$io\_base$>$$|$pci$|$amt),$<$irq$>$] \mbox{}\\
-  Xen supports up to two 16550-compatible serial ports.  For example:
-  `com1=9600, 8n1, 0x408, 5' maps COM1 to a 9600-baud port, 8 data
-  bits, no parity, 1 stop bit, I/O port base 0x408, IRQ 5.  If some
-  configuration options are standard (e.g., I/O base and IRQ), then
-  only a prefix of the full configuration string need be specified. If
-  the baud rate is pre-configured (e.g., by the bootloader) then you
-  can specify `auto' in place of a numeric baud rate.
-  For PCI serial devices, such as Intel AMT you can use the {\bf amt}
-  option to automatically find the I/O base. For PCI serial devices,
-  such as NetMos, you can use {\bf pci} to probe for the I/O base.
-  Both options will set the IRQ to zero - meaning they will poll the device.
-\item [ console=$<$specifier list$>$ ] Specify the destination for Xen
-  console I/O.  This is a comma-separated list of, for example:
-  \begin{description}
-  \item[ vga ] Use VGA console (until domain 0 boots, unless {\bf
-  vga=...keep } is specified).
-  \item[ com1 ] Use serial port com1.
-  \item[ com2H ] Use serial port com2. Transmitted chars will have the
-    MSB set. Received chars must have MSB set.
-  \item[ com2L] Use serial port com2. Transmitted chars will have the
-    MSB cleared. Received chars must have MSB cleared.
-  \end{description}
-  The latter two examples allow a single port to be shared by two
-  subsystems (e.g.\ console and debugger). Sharing is controlled by
-  MSB of each transmitted/received character.  [NB. Default for this
-  option is `com1,vga']
-\item [ vga=$<$mode$>$(,keep) ] The mode is one of the following options:
-  \begin{description}
-  \item[ ask ] Display a vga menu allowing manual selection of video
-  mode.
-  \item[ current ] Use existing vga mode without modification.
-  \item[ text-$<$mode$>$ ] Select text-mode resolution, where mode is
-  one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60.
-  \item[ gfx-$<$mode$>$ ] Select VESA graphics mode
-  $<$width$>$x$<$height$>$x$<$depth$>$ (e.g., `vga=gfx-1024x768x32').
-  \item[ mode-$<$mode$>$ ] Specify a mode number as discovered by `vga
-  ask'. Note that the numbers are displayed in hex and hence must be
-  prefixed by `0x' here (e.g., `vga=mode-0x0335').
-  \end{description}
-The mode may optionally be followed by `{\bf,keep}' to cause Xen to keep
-writing to the VGA console after domain 0 starts booting (e.g., `vga=text-80x50,keep').
-\item [ no-real-mode ] (x86 only) Do not execute real-mode bootstrap
-  code when booting Xen. This option should not be used except for
-  debugging. It will effectively disable the {\bf vga} option, which
-  relies on real mode to set the video mode.
-\item [ edid=no,force ] (x86 only) Either force retrieval of monitor
-  EDID information via VESA DDC, or disable it (edid=no). This option
-  should not normally be required except for debugging purposes.
-\item [ edd=off,on,skipmbr ] (x86 only) Control retrieval of Extended
-  Disc Data (EDD) from the BIOS during boot.
-\item [ console\_to\_ring ] Place guest console output into the
-  hypervisor console ring buffer. This is disabled by default.
-  When enabled, both hypervisor output and guest console output
-  is available from the ring buffer. This can be useful for logging
-  and/or remote presentation of console data.
-\item [ sync\_console ] Force synchronous console output. This is
-  useful if you system fails unexpectedly before it has sent all
-  available output to the console. In most cases Xen will
-  automatically enter synchronous mode when an exceptional event
-  occurs, but this option provides a manual fallback.
-\item [ conswitch=$<$switch-char$><$auto-switch-char$>$ ] Specify how
-  to switch serial-console input between Xen and DOM0. The required
-  sequence is CTRL-$<$switch-char$>$ pressed three times. Specifying
-  the backtick character disables switching.  The
-  $<$auto-switch-char$>$ specifies whether Xen should auto-switch
-  input to DOM0 when it boots --- if it is `x' then auto-switching is
-  disabled.  Any other value, or omitting the character, enables
-  auto-switching.  [NB. Default switch-char is `a'.]
-\item [ loglvl=$<$level$>/<$level$>$ ]
-  Specify logging level. Messages of the specified severity level (and
-  higher) will be printed to the Xen console. Valid levels are `none',
-  `error', `warning', `info', `debug', and `all'. The second level
-  specifier is optional: it is used to specify message severities
-  which are to be rate limited. Default is `loglvl=warning'.
-\item [ guest\_loglvl=$<$level$>/<$level$>$ ] As for loglvl, but
-  applies to messages relating to guests. Default is
-  `guest\_loglvl=none/warning'. 
-\item [ console\_timestamps ] 
-  Adds a timestamp prefix to each line of Xen console output.
-\item [ nmi=xxx ]
-  Specify what to do with an NMI parity or I/O error. \\
-  `nmi=fatal':  Xen prints a diagnostic and then hangs. \\
-  `nmi=dom0':   Inform DOM0 of the NMI. \\
-  `nmi=ignore': Ignore the NMI.
-\item [ mem=xxx ] Set the physical RAM address limit. Any RAM
-  appearing beyond this physical address in the memory map will be
-  ignored. This parameter may be specified with a B, K, M or G suffix,
-  representing bytes, kilobytes, megabytes and gigabytes respectively.
-  The default unit, if no suffix is specified, is kilobytes.
-\item [ dom0\_mem=$<$specifier list$>$ ] Set the amount of memory to
-  be allocated to domain 0. This is a comma-separated list containing
-  the following optional components:
-  \begin{description}
-  \item[ min:$<$min\_amt$>$ ] Minimum amount to allocate to domain 0
-  \item[ max:$<$min\_amt$>$ ] Maximum amount to allocate to domain 0
-  \item[ $<$amt$>$ ] Precise amount to allocate to domain 0
-  \end{description}
-  Each numeric parameter may be specified with a B, K, M or
-  G suffix, representing bytes, kilobytes, megabytes and gigabytes
-  respectively; if no suffix is specified, the parameter defaults to
-  kilobytes. Negative values are subtracted from total available
-  memory. If $<$amt$>$ is not specified, it defaults to all available
-  memory less a small amount (clamped to 128MB) for uses such as DMA
-  buffers.
-\item [ dom0\_vcpus\_pin ] Pins domain 0 VCPUs on their respective
-  physical CPUS (default=false).
-\item [ tbuf\_size=xxx ] Set the size of the per-cpu trace buffers, in
-  pages (default 0).  
-\item [ sched=xxx ] Select the CPU scheduler Xen should use.  The
-  current possibilities are `credit' (default), and `sedf'.
-\item [ apic\_verbosity=debug,verbose ] Print more detailed
-  information about local APIC and IOAPIC configuration.
-\item [ lapic ] Force use of local APIC even when left disabled by
-  uniprocessor BIOS.
-\item [ nolapic ] Ignore local APIC in a uniprocessor system, even if
-  enabled by the BIOS.
-\item [ apic=bigsmp,default,es7000,summit ] Specify NUMA platform.
-  This can usually be probed automatically.
-\item [ dma\_bits=xxx ] Specify width of DMA addresses in bits. This
-  is used in NUMA systems to prevent this special DMA memory from
-  being exhausted in one node when remote nodes have available memory.
-\item [ vcpu\_migration\_delay=$<$minimum\_time$>$] Set minimum time of 
-  vcpu migration in microseconds (default 0). This parameter avoids agressive
-  vcpu migration. For example, the linux kernel uses 0.5ms by default.
-\item [ irq\_vector\_map=xxx ] Enable irq vector non-sharing maps.  Setting 'global' 
-  will ensure that no  IRQs will share vectors.  Setting 'per-device' will ensure 
-  that no IRQs from the same device will share vectors.  Setting to 'none' will
-  disable it entirely, overriding any defaults the IOMMU code may set.
-\end{description}
-
-In addition, the following options may be specified on the Xen command
-line. Since domain 0 shares responsibility for booting the platform,
-Xen will automatically propagate these options to its command line.
-These options are taken from Linux's command-line syntax with
-unchanged semantics.
-
-\begin{description}
-\item [ acpi=off,force,strict,ht,noirq,\ldots ] Modify how Xen (and
-  domain 0) parses the BIOS ACPI tables.
-\item [ acpi\_skip\_timer\_override ] Instruct Xen (and domain~0) to
-  ignore timer-interrupt override instructions specified by the BIOS
-  ACPI tables.
-\item [ noapic ] Instruct Xen (and domain~0) to ignore any IOAPICs
-  that are present in the system, and instead continue to use the
-  legacy PIC.
-\end{description} 
-
-
-\section{XenLinux Boot Options}
-
-In addition to the standard Linux kernel boot options, we support:
-\begin{description}
-\item[ xencons=xxx ] Specify the device node to which the Xen virtual
-  console driver is attached. The following options are supported:
-  \begin{center}
-    \begin{tabular}{l}
-      `xencons=off': disable virtual console \\
-      `xencons=tty': attach console to /dev/tty1 (tty0 at boot-time) \\
-      `xencons=ttyS': attach console to /dev/ttyS0 \\
-      `xencons=xvc': attach console to /dev/xvc0
-    \end{tabular}
-\end{center}
-The default is ttyS for dom0 and xvc for all other domains.
-\end{description}
-
-
-%% Chapter Further Support
-\chapter{Further Support}
-
-If you have questions that are not answered by this manual, the
-sources of information listed below may be of interest to you.  Note
-that bug reports, suggestions and contributions related to the
-software (or the documentation) should be sent to the Xen developers'
-mailing list (address below).
-
-
-\section{Other Documentation}
-
-For developers interested in porting operating systems to Xen, the
-\emph{Xen Interface Manual} is distributed in the \path{docs/}
-directory of the Xen source distribution.
-
-
-\section{Online References}
-
-The official Xen web site can be found at:
-\begin{quote} {\tt http://www.xen.org}
-\end{quote}
-
-This contains links to the latest versions of all online
-documentation, including the latest version of the FAQ.
-
-Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xen.org/wiki/}\end{quote}
-The Xen project uses Bugzilla as its bug tracking system. You'll find
-the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
-
-
-\section{Mailing Lists}
-
-There are several mailing lists that are used to discuss Xen related
-topics. The most widely relevant are listed below. An official page of
-mailing lists and subscription information can be found at \begin{quote}
-  {\tt http://lists.xensource.com/} \end{quote}
-
-\begin{description}
-\item[xen-devel@lists.xensource.com] Used for development
-  discussions and bug reports.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-devel}}
-\item[xen-users@lists.xensource.com] Used for installation and usage
-  discussions and requests for help.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-users}}
-\item[xen-announce@lists.xensource.com] Used for announcements only.
-  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-announce}}
-\item[xen-changelog@lists.xensource.com] Changelog feed
-  from the unstable and 3.x trees - developer oriented.  Subscribe at: \\
-  {\small {\tt http://lists.xensource.com/xen-changelog}}
-\end{description}
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\appendix
-
-\chapter{Unmodified (HVM) guest domains in Xen with Hardware support for Virtualization}
-
-Xen supports guest domains running unmodified guest operating systems using
-virtualization extensions available on recent processors. Currently processors
-featuring the Intel Virtualization Extension (Intel-VT) or the AMD extension
-(AMD-V) are supported. The technology covering both implementations is
-called HVM (for Hardware Virtual Machine) in Xen. More information about the
-virtualization extensions are available on the respective websites:
- {\small {\tt http://www.intel.com/technology/computing/vptech}}
-
-
- {\small {\tt http://www.amd.com/us-en/assets/content\_type/white\_papers\_and\_tech\_docs/24593.pdf}}
-
-\section{Building Xen with HVM support}
-
-The following packages need to be installed in order to build Xen with HVM support. Some Linux distributions do not provide these packages by default.
-
-\begin{tabular}{lp{11.0cm}}
-{\bfseries Package} & {\bfseries Description} \\
-
-dev86 & The dev86 package provides an assembler and linker for real mode 80x86 instructions. You need to have this package installed in order to build the BIOS code which runs in (virtual) real mode. 
-
-If the dev86 package is not available on the x86\_64 distribution, you can install the i386 version of it. The dev86 rpm package for various distributions can be found at {\scriptsize {\tt http://www.rpmfind.net/linux/rpm2html/search.php?query=dev86\&submit=Search}} \\
-
-SDL-devel, SDL & Simple DirectMedia Layer (SDL) is another way of virtualizing the unmodified guest console. It provides an X window for the guest console. 
-
-If the SDL and SDL-devel packages are not installed by default on the build system, they can be obtained from  {\scriptsize {\tt http://www.rpmfind.net/linux/rpm2html/search.php?query=SDL\&amp;submit=Search}}
-
-
-{\scriptsize {\tt http://www.rpmfind.net/linux/rpm2html/search.php?query=SDL-devel\&submit=Search}} \\
-
-\end{tabular}
-
-\section{Configuration file for unmodified HVM guests}
-
-The Xen installation includes a sample configuration file, {\small {\tt /etc/xen/xmexample.hvm}}. There are comments describing all the options. In addition to the common options that are the same as those for paravirtualized guest configurations, HVM guest configurations have the following settings:
-
-\begin{tabular}{lp{11.0cm}}
-
-{\bfseries Parameter} & {\bfseries Description} \\
-
-kernel &        The HVM firmware loader, {\small {\tt /usr/lib/xen/boot/hvmloader}}\\
-
-builder &       The domain build function. The HVM domain uses the 'hvm' builder.\\
-
-acpi & Enable HVM guest ACPI, default=1 (enabled)\\
-
-apic & Enable HVM guest APIC, default=1 (enabled)\\
-
-pae & Enable HVM guest PAE, default=1 (enabled)\\
-
-hap & Enable hardware-assisted paging support, such as AMD-V's nested paging
-or Intel\textregistered VT's extended paging. If available, Xen will
-use hardware-assisted paging instead of shadow paging for this guest's memory
-management.\\
-
-vif     & Optionally defines MAC address and/or bridge for the network interfaces. Random MACs are assigned if not given. {\small {\tt type=ioemu}} means ioemu is used to virtualize the HVM NIC. If no type is specified, vbd is used, as with paravirtualized guests.\\
-
-disk & Defines the disk devices you want the domain to have access to, and what you want them accessible as. If using a physical device as the HVM guest's disk, each disk entry is of the form 
-
-{\small {\tt phy:UNAME,ioemu:DEV,MODE,}}
-
-where UNAME is the host device file, DEV is the device name the domain will see, and MODE is r for read-only, w for read-write. ioemu means the disk will use ioemu to virtualize the HVM disk. If not adding ioemu, it uses vbd like paravirtualized guests.
-
-If using disk image file, its form should be like 
-
-{\small {\tt file:FILEPATH,ioemu:DEV,MODE}}
-
-Optical devices can be emulated by appending cdrom to the device type
-
-{\small {\tt ',hdc:cdrom,r'}}
-
-If using more than one disk, there should be a comma between each disk entry. For example:
-
-{\scriptsize {\tt disk = ['file:/var/images/image1.img,ioemu:hda,w', 'phy:hda1,hdb1,w', 'file:/var/images/install1.iso,hdc:cdrom,r']}}\\
-
-boot & Boot from floppy (a), hard disk (c) or CD-ROM (d). For example, to boot from CD-ROM and fallback to HD, the entry should be:
-
-boot='dc'\\
-
-device\_model & The device emulation tool for HVM guests. This parameter should not be changed.\\
-
-sdl &   Enable SDL library for graphics, default = 0 (disabled)\\
-
-vnc &   Enable VNC library for graphics, default = 1 (enabled)\\
-
-vncconsole &     Enable spawning of the vncviewer (only valid when vnc=1), default = 0 (disabled)
-
-If vnc=1 and vncconsole=0, user can use vncviewer to manually connect HVM from remote. For example:
-
-{\small {\tt vncviewer domain0\_IP\_address:HVM\_domain\_id}} \\
-
-serial &        Enable redirection of HVM serial output to pty device\\
-
-\end{tabular}
-
-\begin{tabular}{lp{10cm}}
-
-usb &           Enable USB support without defining a specific USB device.
-This option defaults to 0 (disabled) unless the option usbdevice is
-specified in which case this option then defaults to 1 (enabled).\\
-
-usbdevice &     Enable USB support and also enable support for the given
-device.  Devices that can be specified are {\small {\tt mouse}} (a PS/2 style
-mouse), {\small {\tt tablet}} (an absolute pointing device) and
-{\small {\tt host:id1:id2}} (a physical USB device on the host machine whose
-ids are {\small {\tt id1}} and {\small {\tt id2}}).  The advantage
-of {\small {\tt tablet}} is that Windows guests will automatically recognize
-and support this device so specifying the config line
-
-{\small
-\begin{verbatim}
-    usbdevice='tablet'
-\end{verbatim}
-}
-
-will create a mouse that works transparently with Windows guests under VNC.
-Linux doesn't recognize the USB tablet yet so Linux guests under VNC will
-still need the Summagraphics emulation.
-Details about mouse emulation are provided in section \textbf{A.4.3}.\\
-
-localtime &     Set the real time clock to local time [default=0, that is, set to UTC].\\
-
-soundhw   &     Enable sound card support and specify the hardware to emulate. Values can be sb16, es1370 or all. Default is none.\\
-
-full-screen   & Start in full screen.\\
-
-nographic &     Another way to redirect serial output. If enabled, no 'sdl' or 'vnc' can work. Not recommended.\\
-
-\end{tabular}
-
-
-\section{Creating virtual disks from scratch}
-\subsection{Using physical disks}
-If you are using a physical disk or physical disk partition, you need to install a Linux OS on the disk first. Then the boot loader should be installed in the correct place. For example {\small {\tt dev/sda}} for booting from the whole disk, or {\small {\tt /dev/sda1}} for booting from partition 1.
-
-\subsection{Using disk image files}
-You need to create a large empty disk image file first; then, you need to install a Linux OS onto it. There are two methods you can choose. One is directly installing it using a HVM guest while booting from the OS installation CD-ROM. The other is copying an installed OS into it. The boot loader will also need to be installed.
-
-\subsubsection*{To create the image file:}
-The image size should be big enough to accommodate the entire OS. This example assumes the size is 1G (which is probably too small for most OSes).
-
-{\small {\tt \# dd if=/dev/zero of=hd.img bs=1M count=0 seek=1024}}
-
-\subsubsection*{To directly install Linux OS into an image file using a HVM guest:}
-
-Install Xen and create HVM with the original image file with booting from CD-ROM. Then it is just like a normal Linux OS installation. The HVM configuration file should have a stanza for the CD-ROM as well as a boot device specification:
-
-{\small {\tt disk=['file:/var/images/your-hd.img,hda,w', ',hdc:cdrom,r' ]
-boot='d'}}
-
-If this method does not succeed, you can choose the following method of copying an installed Linux OS into an image file.
-
-\subsubsection*{To copy a installed OS into an image file:}
-Directly installing is an easier way to make partitions and install an OS in a disk image file. But if you want to create a specific OS in your disk image, then you will most likely want to use this method.
-
-\begin{enumerate}
-\item {\bfseries Install a normal Linux OS on the host machine}\\
-You can choose any way to install Linux, such as using yum to install Red Hat Linux or YAST to install Novell SuSE Linux. The rest of this example assumes the Linux OS is installed in {\small {\tt /var/guestos/}}.
-
-\item {\bfseries Make the partition table}\\
-The image file will be treated as hard disk, so you should make the partition table in the image file. For example:
-
-{\scriptsize {\tt \# losetup /dev/loop0 hd.img\\
-\# fdisk -b 512 -C 4096 -H 16 -S 32 /dev/loop0\\
-press 'n' to add new partition\\
-press 'p' to choose primary partition\\
-press '1' to set partition number\\
-press "Enter" keys to choose default value of "First Cylinder" parameter.\\
-press "Enter" keys to choose default value of "Last Cylinder" parameter.\\
-press 'w' to write partition table and exit\\
-\# losetup -d /dev/loop0}}
-
-\item {\bfseries Make the file system and install grub}\\
-{\scriptsize {\tt \# ln -s /dev/loop0 /dev/loop\\
-\# losetup /dev/loop0 hd.img\\
-\# losetup -o 16384 /dev/loop1 hd.img\\
-\# mkfs.ext3 /dev/loop1\\
-\# mount /dev/loop1 /mnt\\
-\# mkdir -p /mnt/boot/grub\\
-\# cp /boot/grub/stage* /boot/grub/e2fs\_stage1\_5 /mnt/boot/grub\\
-\# umount /mnt\\
-\# grub\\
-grub> device (hd0) /dev/loop\\
-grub> root (hd0,0)\\
-grub> setup (hd0)\\
-grub> quit\\
-\# rm /dev/loop\\
-\# losetup -d /dev/loop0\\
-\# losetup -d /dev/loop1}}
-
-The {\small {\tt losetup}} option {\small {\tt -o 16384}} skips the partition table in the image file. It is the number of sectors times 512. We need {\small {\tt /dev/loop}} because grub is expecting a disk device \emph{name}, where \emph{name} represents the entire disk and \emph{name1} represents the first partition.
-
-\item {\bfseries Copy the OS files to the image}\\ 
-If you have Xen installed, you can easily use {\small {\tt lomount}} instead of {\small {\tt losetup}} and {\small {\tt mount}} when coping files to some partitions. {\small {\tt lomount}} just needs the partition information.
-
-{\scriptsize {\tt \# lomount -t ext3 -diskimage hd.img -partition 1 /mnt/guest\\
-\# cp -ax /var/guestos/\{root,dev,var,etc,usr,bin,sbin,lib\} /mnt/guest\\
-\# mkdir /mnt/guest/\{proc,sys,home,tmp\}}}
-
-\item {\bfseries Edit the {\small {\tt /etc/fstab}} of the guest image}\\
-The fstab should look like this:
-
-{\scriptsize {\tt \# vim /mnt/guest/etc/fstab\\
-/dev/hda1       /               ext3            defaults 1 1\\
-none            /dev/pts        devpts  gid=5,mode=620 0 0\\
-none            /dev/shm        tmpfs           defaults 0 0\\
-none            /proc           proc            defaults 0 0\\
-none            /sys            sysfs           efaults 0 0}}
-
-\item {\bfseries umount the image file}\\
-{\small {\tt \# umount /mnt/guest}}
-\end{enumerate}
-
-Now, the guest OS image {\small {\tt hd.img}} is ready. You can also reference {\small {\tt http://free.oszoo.org}} for quickstart images. But make sure to install the boot loader.
-
-\section{HVM Guests}
-\subsection{Editing the Xen HVM config file}
-Make a copy of the example HVM configuration file {\small {\tt /etc/xen/xmexample.hvm}} and edit the line that reads
-
-{\small {\tt disk = [ 'file:/var/images/\emph{min-el3-i386.img},hda,w' ]}}
-
-replacing \emph{min-el3-i386.img} with the name of the guest OS image file you just made.
-
-\subsection{Creating HVM guests}
-Simply follow the usual method of creating the guest, providing the filename of your HVM configuration file:\\
-
-{\small {\tt \# xend start\\
-\# xm create /etc/xen/hvmguest.hvm}}
-
-In the default configuration, VNC is on and SDL is off. Therefore VNC windows will open when HVM guests are created. If you want to use SDL to create HVM guests, set {\small {\tt sdl=1}} in your HVM configuration file. You can also turn off VNC by setting {\small {\tt vnc=0}}.
- 
-\subsection{Mouse issues, especially under VNC}
-Mouse handling when using VNC is a little problematic.
-The problem is that the VNC viewer provides a virtual pointer which is
-located at an absolute location in the VNC window and only absolute
-coordinates are provided.
-The HVM device model converts these absolute mouse coordinates
-into the relative motion deltas that are expected by the PS/2
-mouse driver running in the guest.
-Unfortunately,
-it is impossible to keep these generated mouse deltas
-accurate enough for the guest cursor to exactly match
-the VNC pointer.
-This can lead to situations where the guest's cursor
-is in the center of the screen and there's no way to
-move that cursor to the left
-(it can happen that the VNC pointer is at the left
-edge of the screen and,
-therefore,
-there are no longer any left mouse deltas that
-can be provided by the device model emulation code.)
-
-To deal with these mouse issues there are 4 different
-mouse emulations available from the HVM device model:
-
-\begin{description}
-\item[PS/2 mouse over the PS/2 port.]
-This is the default mouse
-that works perfectly well under SDL.
-Under VNC the guest cursor will get
-out of sync with the VNC pointer.
-When this happens you can re-synchronize
-the guest cursor to the VNC pointer by
-holding down the
-\textbf{left-ctl}
-and
-\textbf{left-alt}
-keys together.
-While these keys are down VNC pointer motions
-will not be reported to the guest so
-that the VNC pointer can be moved
-to a place where it is possible
-to move the guest cursor again.
-
-\item[Summagraphics mouse over the serial port.]
-The device model also provides emulation
-for a Summagraphics tablet,
-an absolute pointer device.
-This emulation is provided over the second
-serial port,
-\textbf{/dev/ttyS1}
-for Linux guests and
-\textbf{COM2}
-for Windows guests.
-Unfortunately,
-neither Linux nor Windows provides
-default support for the Summagraphics
-tablet so the guest will have to be
-manually configured for this mouse.
-
-\textbf{Linux configuration.}
-
-First,
-configure the GPM service to use the Summagraphics tablet.
-This can vary between distributions but,
-typically,
-all that needs to be done is modify the file
-\path{/etc/sysconfig/mouse} to contain the lines:
-
-{\small
-\begin{verbatim}
-    MOUSETYPE="summa"
-    XMOUSETYPE="SUMMA"
-    DEVICE=/dev/ttyS1
-\end{verbatim}
-}
-
-and then restart the GPM daemon.
-
-Next,
-modify the X11 config
-\path{/etc/X11/xorg.conf}
-to support the Summgraphics tablet by replacing
-the input device stanza with the following:
-
-{\small
-\begin{verbatim}
-    Section "InputDevice"
-        Identifier "Mouse0"
-        Driver "summa"
-        Option "Device" "/dev/ttyS1"
-        Option "InputFashion" "Tablet"
-        Option "Mode" "Absolute"
-        Option "Name" "EasyPen"
-        Option "Compatible" "True"
-        Option "Protocol" "Auto"
-        Option "SendCoreEvents" "on"
-        Option "Vendor" "GENIUS"
-    EndSection
-\end{verbatim}
-}
-
-Restart X and the X cursor should now properly
-track the VNC pointer.
-
-
-\textbf{Windows configuration.}
-
-Get the file
-\path{http://www.cad-plan.de/files/download/tw2k.exe}
-and execute that file on the guest,
-answering the questions as follows:
-
-\begin{enumerate}
-\item When the program asks for \textbf{model},
-scroll down and select \textbf{SummaSketch (MM Compatible)}.
-
-\item When the program asks for \textbf{COM Port} specify \textbf{com2}.
-
-\item When the programs asks for a \textbf{Cursor Type} specify
-\textbf{4 button cursor/puck}.
-
-\item The guest system will then reboot and,
-when it comes back up,
-the guest cursor will now properly track
-the VNC pointer.
-\end{enumerate}
-
-\item[PS/2 mouse over USB port.]
-This is just the same PS/2 emulation except it is
-provided over a USB port.
-This emulation is enabled by the configuration flag:
-{\small
-\begin{verbatim}
-    usbdevice='mouse'
-\end{verbatim}
-}
-
-\item[USB tablet over USB port.]
-The USB tablet is an absolute pointing device
-that has the advantage that it is automatically
-supported under Windows guests,
-although Linux guests still require some
-manual configuration.
-This mouse emulation is enabled by the
-configuration flag:
-{\small
-\begin{verbatim}
-    usbdevice='tablet'
-\end{verbatim}
-}
-
-\textbf{Linux configuration.}
-
-Unfortunately,
-there is no GPM support for the
-USB tablet at this point in time.
-If you intend to use a GPM pointing
-device under VNC you should
-configure the guest for Summagraphics
-emulation.
-
-Support for X11 is available by following
-the instructions at\\
-\verb+http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html+\\
-with one minor change.
-The
-\path{xorg.conf}
-given in those instructions
-uses the wrong values for the X \& Y minimums and maximums,
-use the following config stanza instead:
-
-{\small
-\begin{verbatim}
-    Section "InputDevice"
-        Identifier      "Tablet"
-        Driver          "evtouch"
-        Option          "Device" "/dev/input/event2"
-        Option          "DeviceName" "touchscreen"
-        Option          "MinX" "0"
-        Option          "MinY" "0"
-        Option          "MaxX" "32256"
-        Option          "MaxY" "32256"
-        Option          "ReportingMode" "Raw"
-        Option          "Emulate3Buttons"
-        Option          "Emulate3Timeout" "50"
-        Option          "SendCoreEvents" "On"
-    EndSection
-\end{verbatim}
-}
-
-\textbf{Windows configuration.}
-
-Just enabling the USB tablet in the
-guest's configuration file is sufficient,
-Windows will automatically recognize and
-configure device drivers for this
-pointing device.
-
-\end{description}
-
-\subsection{USB Support}
-There is support for an emulated USB mouse,
-an emulated USB tablet
-and physical low speed USB devices
-(support for high speed USB 2.0 devices is
-still under development).
-
-\begin{description}
-\item[USB PS/2 style mouse.]
-Details on the USB mouse emulation are
-given in sections
-\textbf{A.2}
-and
-\textbf{A.4.3}.
-Enabling USB PS/2 style mouse emulation
-is just a matter of adding the line
-
-{\small
-\begin{verbatim}
-    usbdevice='mouse'
-\end{verbatim}
-}
-
-to the configuration file.
-\item[USB tablet.]
-Details on the USB tablet emulation are
-given in sections
-\textbf{A.2}
-and
-\textbf{A.4.3}.
-Enabling USB tablet emulation
-is just a matter of adding the line
-
-{\small
-\begin{verbatim}
-    usbdevice='tablet'
-\end{verbatim}
-}
-
-to the configuration file.
-\item[USB physical devices.]
-Access to a physical (low speed) USB device
-is enabled by adding a line of the form
-
-{\small
-\begin{verbatim}
-    usbdevice='host:vid:pid'
-\end{verbatim}
-}
-
-into the the configuration file.\footnote{
-There is an alternate
-way of specifying a USB device that
-uses the syntax
-\textbf{host:bus.addr}
-but this syntax suffers from
-a major problem that makes
-it effectively useless.
-The problem is that the
-\textbf{addr}
-portion of this address
-changes every time the USB device
-is plugged into the system.
-For this reason this addressing
-scheme is not recommended and
-will not be documented further.
-}
-\textbf{vid}
-and
-\textbf{pid}
-are a
-product id and
-vendor id
-that uniquely identify
-the USB device.
-These ids can be identified
-in two ways:
-
-\begin{enumerate}
-\item Through the control window.
-As described in section
-\textbf{A.4.6}
-the control window
-is activated by pressing
-\textbf{ctl-alt-2}
-in the guest VGA window.
-As long as USB support is
-enabled in the guest by including
-the config file line
-{\small
-\begin{verbatim}
-    usb=1
-\end{verbatim}
-}
-then executing the command
-{\small
-\begin{verbatim}
-    info usbhost
-\end{verbatim}
-}
-in the control window
-will display a list of all
-usb devices and their ids.
-For example,
-this output:
-{\small
-\begin{verbatim}
-    Device 1.3, speed 1.5 Mb/s
-      Class 00: USB device 04b3:310b
-\end{verbatim}
-}
-was created from a USB mouse with
-vendor id
-\textbf{04b3}
-and product id
-\textbf{310b}.
-This device could be made available
-to the HVM guest by including the
-config file entry
-{\small
-\begin{verbatim}
-    usbdevice='host:04be:310b'
-\end{verbatim}
-}
-
-It is also possible to
-enable access to a USB
-device dynamically through
-the control window.
-The control window command
-{\small
-\begin{verbatim}
-    usb_add host:vid:pid
-\end{verbatim}
-}
-will also allow access to a
-USB device with vendor id
-\textbf{vid}
-and product id
-\textbf{pid}.
-\item Through the
-\path{/proc} file system.
-The contents of the pseudo file
-\path{/proc/bus/usb/devices}
-can also be used to identify
-vendor and product ids.
-Looking at this file,
-the line starting with
-\textbf{P:}
-has a field
-\textbf{Vendor}
-giving the vendor id and
-another field
-\textbf{ProdID}
-giving the product id.
-The contents of
-\path{/proc/bus/usb/devices}
-for the example mouse is as
-follows:
-{\small
-\begin{verbatim}
-T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=1.5 MxCh= 0
-D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
-P:  Vendor=04b3 ProdID=310b Rev= 1.60
-C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
-I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=(none)
-E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=10ms
-\end{verbatim}
-}
-Note that the
-\textbf{P:}
-line correctly identifies the
-vendor id and product id
-for this mouse as
-\textbf{04b3:310b}.
-\end{enumerate}
-There is one other issue to
-be aware of when accessing a
-physical USB device from the guest.
-The Dom0 kernel must not have
-a device driver loaded for
-the device that the guest wishes
-to access.
-This means that the Dom0
-kernel must not have that
-device driver compiled into
-the kernel or,
-if using modules,
-that driver module must
-not be loaded.
-Note that this is the device
-specific USB driver that must
-not be loaded,
-either the
-\textbf{UHCI}
-or
-\textbf{OHCI}
-USB controller driver must
-still be loaded.
-
-Going back to the USB mouse
-as an example,
-if \textbf{lsmod}
-gives the output:
-
-{\small
-\begin{verbatim}
-Module                  Size  Used by
-usbmouse                4128  0 
-usbhid                 28996  0
-uhci_hcd               35409  0
-\end{verbatim}
-}
-
-then the USB mouse is being
-used by the Dom0 kernel and is
-not available to the guest.
-Executing the command
-\textbf{rmmod usbhid}\footnote{
-Turns out the
-\textbf{usbhid}
-driver is the significant
-one for the USB mouse,
-the presence or absence of
-the module
-\textbf{usbmouse}
-has no effect on whether or
-not the guest can see a USB mouse.}
-will remove the USB mouse
-driver from the Dom0 kernel
-and the mouse will now be
-accessible by the HVM guest.
-
-Be aware the the Linux USB
-hotplug system will reload
-the drivers if a USB device
-is removed and plugged back
-in.
-This means that just unloading
-the driver module might not
-be sufficient if the USB device
-is removed and added back.
-A more reliable technique is
-to first
-\textbf{rmmod}
-the driver and then rename the
-driver file in the
-\path{/lib/modules}
-directory,
-just to make sure it doesn't get
-reloaded.
-\end{description}
-
-\subsection{Destroy HVM guests}
-HVM guests can be destroyed in the same way as can paravirtualized guests. We recommend that you shut-down the guest using the guest OS' provided method, for Linux, type the command
-
-{\small {\tt poweroff}} 
-
-in the HVM guest's console, for Windows use Start -> Shutdown first to prevent
-data loss. Depending on the configuration the guest will be automatically
-destroyed, otherwise execute the command 
-
-{\small {\tt xm destroy \emph{vmx\_guest\_id} }} 
-
-at the Domain0 console.
-
-\subsection{HVM window (X or VNC) Hot Key}
-If you are running in the X environment after creating a HVM guest, an X window is created. There are several hot keys for control of the HVM guest that can be used in the window.
- 
-{\bfseries Ctrl+Alt+2} switches from guest VGA window to the control window. Typing {\small {\tt help }} shows the control commands help. For example, 'q' is the command to destroy the HVM guest.\\
-{\bfseries Ctrl+Alt+1} switches back to HVM guest's VGA.\\
-{\bfseries Ctrl+Alt+3} switches to serial port output. It captures serial output from the HVM guest. It works only if the HVM guest was configured to use the serial port. \\
-
-
-%% Chapter Glossary of Terms moved to glossary.tex
-\chapter{Glossary of Terms}
-
-\begin{description}
-
-\item[Domain] A domain is the execution context that contains a
-  running {\bf virtual machine}.  The relationship between virtual
-  machines and domains on Xen is similar to that between programs and
-  processes in an operating system: a virtual machine is a persistent
-  entity that resides on disk (somewhat like a program).  When it is
-  loaded for execution, it runs in a domain.  Each domain has a {\bf
-    domain ID}.
-
-\item[Domain 0] The first domain to be started on a Xen machine.
-  Domain 0 is responsible for managing the system.
-
-\item[Domain ID] A unique identifier for a {\bf domain}, analogous to
-  a process ID in an operating system.
-
-\item[Full virtualization] An approach to virtualization which
-  requires no modifications to the hosted operating system, providing
-  the illusion of a complete system of real hardware devices.
-
-\item[Hypervisor] An alternative term for {\bf VMM}, used because it
-  means `beyond supervisor', since it is responsible for managing
-  multiple `supervisor' kernels.
-
-\item[Live migration] A technique for moving a running virtual machine
-  to another physical host, without stopping it or the services
-  running on it.
-
-\item[Paravirtualization] An approach to virtualization which requires
-  modifications to the operating system in order to run in a virtual
-  machine.  Xen uses paravirtualization but preserves binary
-  compatibility for user space applications.
-
-\item[Shadow pagetables] A technique for hiding the layout of machine
-  memory from a virtual machine's operating system.  Used in some {\bf
-  VMMs} to provide the illusion of contiguous physical memory, in
-  Xen this is used during {\bf live migration}.
-
-\item[Virtual Block Device] Persistent storage available to a virtual
-  machine, providing the abstraction of an actual block storage device.
-  {\bf VBD}s may be actual block devices, filesystem images, or
-  remote/network storage.
-
-\item[Virtual Machine] The environment in which a hosted operating
-  system runs, providing the abstraction of a dedicated machine.  A
-  virtual machine may be identical to the underlying hardware (as in
-  {\bf full virtualization}, or it may differ, as in {\bf
-  paravirtualization}).
-
-\item[VMM] Virtual Machine Monitor - the software that allows multiple
-  virtual machines to be multiplexed on a single physical machine.
-
-\item[Xen] Xen is a paravirtualizing virtual machine monitor,
-  developed primarily by the Systems Research Group at the University
-  of Cambridge Computer Laboratory.
-
-\item[XenLinux] A name for the port of the Linux kernel that
-  runs on Xen.
-
-\end{description}
-
-
-\end{document}
-
-
-%% Other stuff without a home
-
-%% Instructions Re Python API
-
-%% Other Control Tasks using Python
-%% ================================
-
-%% A Python module 'Xc' is installed as part of the tools-install
-%% process. This can be imported, and an 'xc object' instantiated, to
-%% provide access to privileged command operations:
-
-%% # import Xc
-%% # xc = Xc.new()
-%% # dir(xc)
-%% # help(xc.domain_create)
-
-%% In this way you can see that the class 'xc' contains useful
-%% documentation for you to consult.
-
-%% A further package of useful routines (xenctl) is also installed:
-
-%% # import xenctl.utils
-%% # help(xenctl.utils)
-
-%% You can use these modules to write your own custom scripts or you
-%% can customise the scripts supplied in the Xen distribution.
-
-
-
-% Explain about AGP GART
-
-
-%% If you're not intending to configure the new domain with an IP
-%% address on your LAN, then you'll probably want to use NAT. The
-%% 'xen_nat_enable' installs a few useful iptables rules into domain0
-%% to enable NAT. [NB: We plan to support RSIP in future]
-
-
-
-%% Installing the file systems from the CD
-%% =======================================
-
-%% If you haven't got an existing Linux installation onto which you
-%% can just drop down the Xen and Xenlinux images, then the file
-%% systems on the CD provide a quick way of doing an install. However,
-%% you would be better off in the long run doing a proper install of
-%% your preferred distro and installing Xen onto that, rather than
-%% just doing the hack described below:
-
-%% Choose one or two partitions, depending on whether you want a
-%% separate /usr or not. Make file systems on it/them e.g.:
-%% mkfs -t ext3 /dev/hda3
-%% [or mkfs -t ext2 /dev/hda3 && tune2fs -j /dev/hda3 if using an old
-%% version of mkfs]
-
-%% Next, mount the file system(s) e.g.:
-%%   mkdir /mnt/root && mount /dev/hda3 /mnt/root
-%%   [mkdir /mnt/usr && mount /dev/hda4 /mnt/usr]
-  
-%% To install the root file system, simply untar /usr/XenDemoCD/root.tar.gz:
-%%   cd /mnt/root && tar -zxpf /usr/XenDemoCD/root.tar.gz
-
-%% You'll need to edit /mnt/root/etc/fstab to reflect your file system
-%% configuration. Changing the password file (etc/shadow) is probably a
-%% good idea too.
-
-%% To install the usr file system, copy the file system from CD on
-%% /usr, though leaving out the "XenDemoCD" and "boot" directories:
-%%   cd /usr && cp -a X11R6 etc java libexec root src bin dict kerberos
-%%    local sbin tmp doc include lib man share /mnt/usr
-
-%% If you intend to boot off these file systems (i.e. use them for
-%% domain 0), then you probably want to copy the /usr/boot
-%% directory on the cd over the top of the current symlink to /boot
-%% on your root filesystem (after deleting the current symlink)
-%% i.e.:
-%%   cd /mnt/root ; rm boot ; cp -a /usr/boot .

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo8w-0000hw-K0; Fri, 27 Jan 2012 15:55:14 +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 1Rqo8u-0000hf-TA
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:13 +0000
Received: from [85.158.138.51:20568] by server-5.bemta-3.messagelabs.com id
	8A/B4-02363-0E8C22F4; Fri, 27 Jan 2012 15:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1327679710!9098966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22317 invoked from network); 27 Jan 2012 15:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:11 -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 1Rqo8r-0002Jk-CS
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8r-0008QH-76
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Message-Id: <E1Rqo8r-0008QH-76@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Make the escape code
	consistent across 32 and 64-bit xen
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327575830 0
# Node ID 1e27e827e6a80b9fe8d59bcd46dbe30ca9bc0692
# Parent  768c932ea8dadd966d58412cae478c4fe26cb9bf
xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 768c932ea8da -r 1e27e827e6a8 xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Thu Jan 26 11:03:23 2012 +0000
+++ b/xen/include/public/xenoprof.h	Thu Jan 26 11:03:50 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE ~0UL
+#define XENOPROF_ESCAPE_CODE (~0ULL)
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:19 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo8w-0000hw-K0; Fri, 27 Jan 2012 15:55:14 +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 1Rqo8u-0000hf-TA
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:13 +0000
Received: from [85.158.138.51:20568] by server-5.bemta-3.messagelabs.com id
	8A/B4-02363-0E8C22F4; Fri, 27 Jan 2012 15:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1327679710!9098966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22317 invoked from network); 27 Jan 2012 15:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:11 -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 1Rqo8r-0002Jk-CS
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8r-0008QH-76
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Message-Id: <E1Rqo8r-0008QH-76@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Make the escape code
	consistent across 32 and 64-bit xen
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327575830 0
# Node ID 1e27e827e6a80b9fe8d59bcd46dbe30ca9bc0692
# Parent  768c932ea8dadd966d58412cae478c4fe26cb9bf
xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 768c932ea8da -r 1e27e827e6a8 xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Thu Jan 26 11:03:23 2012 +0000
+++ b/xen/include/public/xenoprof.h	Thu Jan 26 11:03:50 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE ~0UL
+#define XENOPROF_ESCAPE_CODE (~0ULL)
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo8z-0000iP-MZ; Fri, 27 Jan 2012 15:55:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8y-0000i7-Cb
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327679664!52017689!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24038 invoked from network); 27 Jan 2012 15:54:25 -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;
	27 Jan 2012 15:54:25 -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 1Rqo8u-0002K2-VU
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8u-0008Rw-SX
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Message-Id: <E1Rqo8u-0008Rw-SX@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Add per-page locking for
	memory sharing, when audits are disabled
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 7e9b38097888ce31743815460e57791896b420ac
# Parent  96fdf927389c75d817c0d36dae55727845459cf6
x86/mm: Add per-page locking for memory sharing, when audits are disabled

With the removal of the hash table, all that is needed now is locking
of individual shared pages, as new (gfn,domain) pairs are removed or
added from the list of mappings.

We recycle PGT_locked and use it to lock individual pages. We ensure deadlock
is averted by locking pages in increasing order.

The global lock remains for the benefit of the auditing code, and is
thus enabled only as a compile-time option.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 96fdf927389c -r 7e9b38097888 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -1719,7 +1719,7 @@
 #define free_l4_table(page, preemptible) (-EINVAL)
 #endif
 
-static int page_lock(struct page_info *page)
+int page_lock(struct page_info *page)
 {
     unsigned long x, nx;
 
@@ -1736,7 +1736,7 @@
     return 1;
 }
 
-static void page_unlock(struct page_info *page)
+void page_unlock(struct page_info *page)
 {
     unsigned long x, nx, y = page->u.inuse.type_info;
 
@@ -4295,76 +4295,6 @@
     return -1;
 }
 
-int page_make_sharable(struct domain *d, 
-                       struct page_info *page, 
-                       int expected_refcnt)
-{
-    spin_lock(&d->page_alloc_lock);
-
-    /* Change page type and count atomically */
-    if ( !get_page_and_type(page, d, PGT_shared_page) )
-    {
-        spin_unlock(&d->page_alloc_lock);
-        return -EINVAL;
-    }
-
-    /* Check it wasn't already sharable and undo if it was */
-    if ( (page->u.inuse.type_info & PGT_count_mask) != 1 )
-    {
-        put_page_and_type(page);
-        spin_unlock(&d->page_alloc_lock);
-        return -EEXIST;
-    }
-
-    /* Check if the ref count is 2. The first from PGC_allocated, and
-     * the second from get_page_and_type at the top of this function */
-    if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
-    {
-        /* Return type count back to zero */
-        put_page_and_type(page);
-        spin_unlock(&d->page_alloc_lock);
-        return -E2BIG;
-    }
-
-    page_set_owner(page, dom_cow);
-    d->tot_pages--;
-    page_list_del(page, &d->page_list);
-    spin_unlock(&d->page_alloc_lock);
-    return 0;
-}
-
-int page_make_private(struct domain *d, struct page_info *page)
-{
-    if ( !get_page(page, dom_cow) )
-        return -EINVAL;
-    
-    spin_lock(&d->page_alloc_lock);
-
-    /* We can only change the type if count is one */
-    if ( (page->u.inuse.type_info & (PGT_type_mask | PGT_count_mask))
-         != (PGT_shared_page | 1) )
-    {
-        put_page(page);
-        spin_unlock(&d->page_alloc_lock);
-        return -EEXIST;
-    }
-
-    /* Drop the final typecount */
-    put_page_and_type(page);
-
-    /* Change the owner */
-    ASSERT(page_get_owner(page) == dom_cow);
-    page_set_owner(page, d);
-
-    d->tot_pages++;
-    page_list_add_tail(page, &d->page_list);
-    spin_unlock(&d->page_alloc_lock);
-
-    put_page(page);
-
-    return 0;
-}
-
 static int __do_update_va_mapping(
     unsigned long va, u64 val64, unsigned long flags, struct domain *pg_owner)
 {
diff -r 96fdf927389c -r 7e9b38097888 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -35,10 +35,21 @@
 
 #include "mm-locks.h"
 
+static shr_handle_t next_handle = 1;
+
 #if MEM_SHARING_AUDIT
+
+static mm_lock_t shr_lock;
+
+#define shr_lock()          _shr_lock()
+#define shr_unlock()        _shr_unlock()
+#define shr_locked_by_me()  _shr_locked_by_me()
+
 static void mem_sharing_audit(void);
+
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
+
 static struct list_head shr_audit_list;
 
 static inline void audit_add_list(struct page_info *page)
@@ -51,11 +62,53 @@
 {
     list_del(&page->shared_info->entry);
 }
+
+static inline int mem_sharing_page_lock(struct page_info *p)
+{
+    return 1;
+}
+#define mem_sharing_page_unlock(p)   ((void)0)
+
+#define get_next_handle()   next_handle++;
 #else
+
+#define shr_lock()          ((void)0)
+#define shr_unlock()        ((void)0)
+/* Only used inside audit code */
+//#define shr_locked_by_me()  ((void)0)
+
 #define mem_sharing_audit() ((void)0)
 
 #define audit_add_list(p)  ((void)0)
 #define audit_del_list(p)  ((void)0)
+
+static inline int mem_sharing_page_lock(struct page_info *pg)
+{
+    int rc;
+    rc = page_lock(pg);
+    if ( rc )
+    {
+        preempt_disable();
+    }
+    return rc;
+}
+
+static inline void mem_sharing_page_unlock(struct page_info *pg)
+{
+    preempt_enable();
+    page_unlock(pg);
+}
+
+static inline shr_handle_t get_next_handle(void)
+{
+    /* Get the next handle get_page style */ 
+    uint64_t x, y = next_handle;
+    do {
+        x = y;
+    }
+    while ( (y = cmpxchg(&next_handle, x, x + 1)) != x );
+    return x + 1;
+}
 #endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
@@ -68,7 +121,6 @@
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
-static shr_handle_t next_handle = 1;
 static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
 
 typedef struct gfn_info
@@ -78,8 +130,6 @@
     struct list_head list;
 } gfn_info_t;
 
-static mm_lock_t shr_lock;
-
 /* Returns true if list has only one entry. O(1) complexity. */
 static inline int list_has_one_entry(struct list_head *head)
 {
@@ -398,6 +448,113 @@
     return mem_sharing_debug_gfn(d, gfn); 
 }
 
+/* Functions that change a page's type and ownership */
+static int page_make_sharable(struct domain *d, 
+                       struct page_info *page, 
+                       int expected_refcnt)
+{
+    spin_lock(&d->page_alloc_lock);
+
+    /* Change page type and count atomically */
+    if ( !get_page_and_type(page, d, PGT_shared_page) )
+    {
+        spin_unlock(&d->page_alloc_lock);
+        return -EINVAL;
+    }
+
+    /* Check it wasn't already sharable and undo if it was */
+    if ( (page->u.inuse.type_info & PGT_count_mask) != 1 )
+    {
+        put_page_and_type(page);
+        spin_unlock(&d->page_alloc_lock);
+        return -EEXIST;
+    }
+
+    /* Check if the ref count is 2. The first from PGC_allocated, and
+     * the second from get_page_and_type at the top of this function */
+    if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
+    {
+        /* Return type count back to zero */
+        put_page_and_type(page);
+        spin_unlock(&d->page_alloc_lock);
+        return -E2BIG;
+    }
+
+    page_set_owner(page, dom_cow);
+    d->tot_pages--;
+    page_list_del(page, &d->page_list);
+    spin_unlock(&d->page_alloc_lock);
+    return 0;
+}
+
+static int page_make_private(struct domain *d, struct page_info *page)
+{
+    unsigned long expected_type;
+
+    if ( !get_page(page, dom_cow) )
+        return -EINVAL;
+    
+    spin_lock(&d->page_alloc_lock);
+
+    /* We can only change the type if count is one */
+    /* If we are locking pages individually, then we need to drop
+     * the lock here, while the page is typed. We cannot risk the 
+     * race of page_unlock and then put_page_type. */
+#if MEM_SHARING_AUDIT
+    expected_type = (PGT_shared_page | PGT_validated | 1);
+#else
+    expected_type = (PGT_shared_page | PGT_validated | PGT_locked | 2);
+#endif
+    if ( page->u.inuse.type_info != expected_type )
+    {
+        put_page(page);
+        spin_unlock(&d->page_alloc_lock);
+        return -EEXIST;
+    }
+
+    /* Drop the final typecount */
+    put_page_and_type(page);
+
+#ifndef MEM_SHARING_AUDIT
+    /* Now that we've dropped the type, we can unlock */
+    mem_sharing_page_unlock(page);
+#endif
+
+    /* Change the owner */
+    ASSERT(page_get_owner(page) == dom_cow);
+    page_set_owner(page, d);
+
+    d->tot_pages++;
+    page_list_add_tail(page, &d->page_list);
+    spin_unlock(&d->page_alloc_lock);
+
+    put_page(page);
+
+    return 0;
+}
+
+static inline struct page_info *__grab_shared_page(mfn_t mfn)
+{
+    struct page_info *pg = NULL;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+    pg = mfn_to_page(mfn);
+
+    /* If the page is not validated we can't lock it, and if it's  
+     * not validated it's obviously not shared. */
+    if ( !mem_sharing_page_lock(pg) )
+        return NULL;
+
+    if ( mem_sharing_lookup(mfn_x(mfn)) == NULL )
+    {
+        mem_sharing_page_unlock(pg);
+        return NULL;
+    }
+
+    return pg;
+}
+
 int mem_sharing_nominate_page(struct domain *d,
                               unsigned long gfn,
                               int expected_refcnt,
@@ -405,7 +562,7 @@
 {
     p2m_type_t p2mt;
     mfn_t mfn;
-    struct page_info *page;
+    struct page_info *page = NULL; /* gcc... */
     int ret;
     struct gfn_info *gfn_info;
 
@@ -420,10 +577,17 @@
         goto out;
 
     /* Return the handle if the page is already shared */
-    page = mfn_to_page(mfn);
     if ( p2m_is_shared(p2mt) ) {
-        *phandle = page->shared_info->handle;
+        struct page_info *pg = __grab_shared_page(mfn);
+        if ( !pg )
+        {
+            gdprintk(XENLOG_ERR, "Shared p2m entry gfn %lx, but could not "
+                        "grab page %lx dom %d\n", gfn, mfn_x(mfn), d->domain_id);
+            BUG();
+        }
+        *phandle = pg->shared_info->handle;
         ret = 0;
+        mem_sharing_page_unlock(pg);
         goto out;
     }
 
@@ -432,15 +596,24 @@
         goto out;
 
     /* Try to convert the mfn to the sharable type */
+    page = mfn_to_page(mfn);
     ret = page_make_sharable(d, page, expected_refcnt); 
     if ( ret ) 
         goto out;
 
+    /* Now that the page is validated, we can lock it. There is no 
+     * race because we're holding the p2m entry, so no one else 
+     * could be nominating this gfn */
+    ret = -ENOENT;
+    if ( !mem_sharing_page_lock(page) )
+        goto out;
+
     /* Initialize the shared state */
     ret = -ENOMEM;
     if ( (page->shared_info = 
             xmalloc(struct page_sharing_info)) == NULL )
     {
+        /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
@@ -448,7 +621,7 @@
     INIT_LIST_HEAD(&page->shared_info->gfns);
 
     /* Create the handle */
-    page->shared_info->handle = next_handle++;  
+    page->shared_info->handle = get_next_handle();  
 
     /* Create the local gfn info */
     if ( (gfn_info = mem_sharing_gfn_alloc(page, d, gfn)) == NULL )
@@ -479,6 +652,7 @@
 
     *phandle = page->shared_info->handle;
     audit_add_list(page);
+    mem_sharing_page_unlock(page);
     ret = 0;
 
 out:
@@ -490,7 +664,7 @@
 int mem_sharing_share_pages(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
                             struct domain *cd, unsigned long cgfn, shr_handle_t ch) 
 {
-    struct page_info *spage, *cpage;
+    struct page_info *spage, *cpage, *firstpg, *secondpg;
     struct list_head *le, *te;
     gfn_info_t *gfn;
     struct domain *d;
@@ -505,26 +679,63 @@
     smfn = get_gfn(sd, sgfn, &smfn_type);
     cmfn = get_gfn(cd, cgfn, &cmfn_type);
 
-    ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
-    spage = mem_sharing_lookup(mfn_x(smfn));
-    if ( spage == NULL )
+    /* This tricky business is to avoid two callers deadlocking if 
+     * grabbing pages in opposite client/source order */
+    if( mfn_x(smfn) == mfn_x(cmfn) )
+    {
+        /* The pages are already the same.  We could return some
+         * kind of error here, but no matter how you look at it,
+         * the pages are already 'shared'.  It possibly represents
+         * a big problem somewhere else, but as far as sharing is
+         * concerned: great success! */
+        ret = 0;
         goto err_out;
+    }
+    else if ( mfn_x(smfn) < mfn_x(cmfn) )
+    {
+        ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        spage = firstpg = __grab_shared_page(smfn);
+        if ( spage == NULL )
+            goto err_out;
+
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        cpage = secondpg = __grab_shared_page(cmfn);
+        if ( cpage == NULL )
+        {
+            mem_sharing_page_unlock(spage);
+            goto err_out;
+        }
+    } else {
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        cpage = firstpg = __grab_shared_page(cmfn);
+        if ( cpage == NULL )
+            goto err_out;
+
+        ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        spage = secondpg = __grab_shared_page(smfn);
+        if ( spage == NULL )
+        {
+            mem_sharing_page_unlock(cpage);
+            goto err_out;
+        }
+    }
+
     ASSERT(smfn_type == p2m_ram_shared);
-    ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
-    cpage = mem_sharing_lookup(mfn_x(cmfn));
-    if ( cpage == NULL )
-        goto err_out;
     ASSERT(cmfn_type == p2m_ram_shared);
 
     /* Check that the handles match */
     if ( spage->shared_info->handle != sh )
     {
         ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        mem_sharing_page_unlock(secondpg);
+        mem_sharing_page_unlock(firstpg);
         goto err_out;
     }
     if ( cpage->shared_info->handle != ch )
     {
         ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        mem_sharing_page_unlock(secondpg);
+        mem_sharing_page_unlock(firstpg);
         goto err_out;
     }
 
@@ -551,6 +762,9 @@
     xfree(cpage->shared_info);
     cpage->shared_info = NULL;
 
+    mem_sharing_page_unlock(secondpg);
+    mem_sharing_page_unlock(firstpg);
+
     /* Free the client page */
     if(test_and_clear_bit(_PGC_allocated, &cpage->count_info))
         put_page(cpage);
@@ -592,7 +806,7 @@
         return 0;
     }
 
-    page = mem_sharing_lookup(mfn_x(mfn));
+    page = __grab_shared_page(mfn);
     if ( page == NULL )
     {
         gdprintk(XENLOG_ERR, "Domain p2m is shared, but page is not: "
@@ -628,18 +842,20 @@
      * (possibly freeing the page), and exit early */
     if ( flags & MEM_SHARING_DESTROY_GFN )
     {
-        put_gfn(d, gfn);
-        shr_unlock();
         put_page_and_type(page);
+        mem_sharing_page_unlock(page);
         if ( last_gfn && 
             test_and_clear_bit(_PGC_allocated, &page->count_info) ) 
             put_page(page);
+        put_gfn(d, gfn);
+        shr_unlock();
 
         return 0;
     }
  
     if ( last_gfn )
     {
+        /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto private_page_found;
     }
@@ -648,6 +864,7 @@
     page = alloc_domheap_page(d, 0);
     if ( !page ) 
     {
+        mem_sharing_page_unlock(old_page);
         put_gfn(d, gfn);
         mem_sharing_notify_helper(d, gfn);
         shr_unlock();
@@ -661,6 +878,7 @@
     unmap_domain_page(t);
 
     BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
+    mem_sharing_page_unlock(old_page);
     put_page_and_type(old_page);
 
 private_page_found:    
@@ -678,6 +896,7 @@
     /* Now that the gfn<->mfn map is properly established,
      * marking dirty is feasible */
     paging_mark_dirty(d, mfn_x(page_to_mfn(page)));
+    /* We do not need to unlock a private page */
     put_gfn(d, gfn);
     shr_unlock();
     return 0;
@@ -826,8 +1045,8 @@
 void __init mem_sharing_init(void)
 {
     printk("Initing memory sharing.\n");
+#if MEM_SHARING_AUDIT
     mm_lock_init(&shr_lock);
-#if MEM_SHARING_AUDIT
     INIT_LIST_HEAD(&shr_audit_list);
 #endif
 }
diff -r 96fdf927389c -r 7e9b38097888 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
@@ -26,6 +26,8 @@
 #ifndef _MM_LOCKS_H
 #define _MM_LOCKS_H
 
+#include <asm/mem_sharing.h>
+
 /* Per-CPU variable for enforcing the lock ordering */
 DECLARE_PER_CPU(int, mm_lock_level);
 #define __get_lock_level()  (this_cpu(mm_lock_level))
@@ -141,15 +143,22 @@
  *                                                                      *
  ************************************************************************/
 
+#if MEM_SHARING_AUDIT
 /* Page-sharing lock (global) 
  *
  * A single global lock that protects the memory-sharing code's
  * hash tables. */
 
 declare_mm_lock(shr)
-#define shr_lock()         mm_lock(shr, &shr_lock)
-#define shr_unlock()       mm_unlock(&shr_lock)
-#define shr_locked_by_me() mm_locked_by_me(&shr_lock)
+#define _shr_lock()         mm_lock(shr, &shr_lock)
+#define _shr_unlock()       mm_unlock(&shr_lock)
+#define _shr_locked_by_me() mm_locked_by_me(&shr_lock)
+
+#else
+
+/* We use an efficient per-page lock when AUDIT is not enabled. */
+
+#endif /* MEM_SHARING_AUDIT */
 
 /* Nested P2M lock (per-domain)
  *
diff -r 96fdf927389c -r 7e9b38097888 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -337,6 +337,29 @@
 
 void clear_superpage_mark(struct page_info *page);
 
+/* Per page locks:
+ * page_lock() is used for two purposes: pte serialization, and memory sharing.
+ *
+ * All users of page lock for pte serialization live in mm.c, use it
+ * to lock a page table page during pte updates, do not take other locks within
+ * the critical section delimited by page_lock/unlock, and perform no
+ * nesting. 
+ *
+ * All users of page lock for memory sharing live in mm/mem_sharing.c. Page_lock
+ * is used in memory sharing to protect addition (share) and removal (unshare) 
+ * of (gfn,domain) tupples to a list of gfn's that the shared page is currently 
+ * backing. Nesting may happen when sharing (and locking) two pages -- deadlock 
+ * is avoided by locking pages in increasing order.
+ * Memory sharing may take the p2m_lock within a page_lock/unlock
+ * critical section. 
+ *
+ * These two users (pte serialization and memory sharing) do not collide, since
+ * sharing is only supported for hvm guests, which do not perform pv pte updates.
+ * 
+ */
+int page_lock(struct page_info *page);
+void page_unlock(struct page_info *page);
+
 struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
@@ -588,10 +611,6 @@
     struct domain *d, struct page_info *page, unsigned int memflags);
 int donate_page(
     struct domain *d, struct page_info *page, unsigned int memflags);
-int page_make_sharable(struct domain *d, 
-                       struct page_info *page, 
-                       int expected_refcnt);
-int page_make_private(struct domain *d, struct page_info *page);
 
 int map_ldt_shadow_page(unsigned int);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:21 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo8z-0000iP-MZ; Fri, 27 Jan 2012 15:55:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8y-0000i7-Cb
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1327679664!52017689!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24038 invoked from network); 27 Jan 2012 15:54:25 -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;
	27 Jan 2012 15:54:25 -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 1Rqo8u-0002K2-VU
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8u-0008Rw-SX
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Message-Id: <E1Rqo8u-0008Rw-SX@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Add per-page locking for
	memory sharing, when audits are disabled
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 7e9b38097888ce31743815460e57791896b420ac
# Parent  96fdf927389c75d817c0d36dae55727845459cf6
x86/mm: Add per-page locking for memory sharing, when audits are disabled

With the removal of the hash table, all that is needed now is locking
of individual shared pages, as new (gfn,domain) pairs are removed or
added from the list of mappings.

We recycle PGT_locked and use it to lock individual pages. We ensure deadlock
is averted by locking pages in increasing order.

The global lock remains for the benefit of the auditing code, and is
thus enabled only as a compile-time option.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 96fdf927389c -r 7e9b38097888 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -1719,7 +1719,7 @@
 #define free_l4_table(page, preemptible) (-EINVAL)
 #endif
 
-static int page_lock(struct page_info *page)
+int page_lock(struct page_info *page)
 {
     unsigned long x, nx;
 
@@ -1736,7 +1736,7 @@
     return 1;
 }
 
-static void page_unlock(struct page_info *page)
+void page_unlock(struct page_info *page)
 {
     unsigned long x, nx, y = page->u.inuse.type_info;
 
@@ -4295,76 +4295,6 @@
     return -1;
 }
 
-int page_make_sharable(struct domain *d, 
-                       struct page_info *page, 
-                       int expected_refcnt)
-{
-    spin_lock(&d->page_alloc_lock);
-
-    /* Change page type and count atomically */
-    if ( !get_page_and_type(page, d, PGT_shared_page) )
-    {
-        spin_unlock(&d->page_alloc_lock);
-        return -EINVAL;
-    }
-
-    /* Check it wasn't already sharable and undo if it was */
-    if ( (page->u.inuse.type_info & PGT_count_mask) != 1 )
-    {
-        put_page_and_type(page);
-        spin_unlock(&d->page_alloc_lock);
-        return -EEXIST;
-    }
-
-    /* Check if the ref count is 2. The first from PGC_allocated, and
-     * the second from get_page_and_type at the top of this function */
-    if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
-    {
-        /* Return type count back to zero */
-        put_page_and_type(page);
-        spin_unlock(&d->page_alloc_lock);
-        return -E2BIG;
-    }
-
-    page_set_owner(page, dom_cow);
-    d->tot_pages--;
-    page_list_del(page, &d->page_list);
-    spin_unlock(&d->page_alloc_lock);
-    return 0;
-}
-
-int page_make_private(struct domain *d, struct page_info *page)
-{
-    if ( !get_page(page, dom_cow) )
-        return -EINVAL;
-    
-    spin_lock(&d->page_alloc_lock);
-
-    /* We can only change the type if count is one */
-    if ( (page->u.inuse.type_info & (PGT_type_mask | PGT_count_mask))
-         != (PGT_shared_page | 1) )
-    {
-        put_page(page);
-        spin_unlock(&d->page_alloc_lock);
-        return -EEXIST;
-    }
-
-    /* Drop the final typecount */
-    put_page_and_type(page);
-
-    /* Change the owner */
-    ASSERT(page_get_owner(page) == dom_cow);
-    page_set_owner(page, d);
-
-    d->tot_pages++;
-    page_list_add_tail(page, &d->page_list);
-    spin_unlock(&d->page_alloc_lock);
-
-    put_page(page);
-
-    return 0;
-}
-
 static int __do_update_va_mapping(
     unsigned long va, u64 val64, unsigned long flags, struct domain *pg_owner)
 {
diff -r 96fdf927389c -r 7e9b38097888 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -35,10 +35,21 @@
 
 #include "mm-locks.h"
 
+static shr_handle_t next_handle = 1;
+
 #if MEM_SHARING_AUDIT
+
+static mm_lock_t shr_lock;
+
+#define shr_lock()          _shr_lock()
+#define shr_unlock()        _shr_unlock()
+#define shr_locked_by_me()  _shr_locked_by_me()
+
 static void mem_sharing_audit(void);
+
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
+
 static struct list_head shr_audit_list;
 
 static inline void audit_add_list(struct page_info *page)
@@ -51,11 +62,53 @@
 {
     list_del(&page->shared_info->entry);
 }
+
+static inline int mem_sharing_page_lock(struct page_info *p)
+{
+    return 1;
+}
+#define mem_sharing_page_unlock(p)   ((void)0)
+
+#define get_next_handle()   next_handle++;
 #else
+
+#define shr_lock()          ((void)0)
+#define shr_unlock()        ((void)0)
+/* Only used inside audit code */
+//#define shr_locked_by_me()  ((void)0)
+
 #define mem_sharing_audit() ((void)0)
 
 #define audit_add_list(p)  ((void)0)
 #define audit_del_list(p)  ((void)0)
+
+static inline int mem_sharing_page_lock(struct page_info *pg)
+{
+    int rc;
+    rc = page_lock(pg);
+    if ( rc )
+    {
+        preempt_disable();
+    }
+    return rc;
+}
+
+static inline void mem_sharing_page_unlock(struct page_info *pg)
+{
+    preempt_enable();
+    page_unlock(pg);
+}
+
+static inline shr_handle_t get_next_handle(void)
+{
+    /* Get the next handle get_page style */ 
+    uint64_t x, y = next_handle;
+    do {
+        x = y;
+    }
+    while ( (y = cmpxchg(&next_handle, x, x + 1)) != x );
+    return x + 1;
+}
 #endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
@@ -68,7 +121,6 @@
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
-static shr_handle_t next_handle = 1;
 static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
 
 typedef struct gfn_info
@@ -78,8 +130,6 @@
     struct list_head list;
 } gfn_info_t;
 
-static mm_lock_t shr_lock;
-
 /* Returns true if list has only one entry. O(1) complexity. */
 static inline int list_has_one_entry(struct list_head *head)
 {
@@ -398,6 +448,113 @@
     return mem_sharing_debug_gfn(d, gfn); 
 }
 
+/* Functions that change a page's type and ownership */
+static int page_make_sharable(struct domain *d, 
+                       struct page_info *page, 
+                       int expected_refcnt)
+{
+    spin_lock(&d->page_alloc_lock);
+
+    /* Change page type and count atomically */
+    if ( !get_page_and_type(page, d, PGT_shared_page) )
+    {
+        spin_unlock(&d->page_alloc_lock);
+        return -EINVAL;
+    }
+
+    /* Check it wasn't already sharable and undo if it was */
+    if ( (page->u.inuse.type_info & PGT_count_mask) != 1 )
+    {
+        put_page_and_type(page);
+        spin_unlock(&d->page_alloc_lock);
+        return -EEXIST;
+    }
+
+    /* Check if the ref count is 2. The first from PGC_allocated, and
+     * the second from get_page_and_type at the top of this function */
+    if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
+    {
+        /* Return type count back to zero */
+        put_page_and_type(page);
+        spin_unlock(&d->page_alloc_lock);
+        return -E2BIG;
+    }
+
+    page_set_owner(page, dom_cow);
+    d->tot_pages--;
+    page_list_del(page, &d->page_list);
+    spin_unlock(&d->page_alloc_lock);
+    return 0;
+}
+
+static int page_make_private(struct domain *d, struct page_info *page)
+{
+    unsigned long expected_type;
+
+    if ( !get_page(page, dom_cow) )
+        return -EINVAL;
+    
+    spin_lock(&d->page_alloc_lock);
+
+    /* We can only change the type if count is one */
+    /* If we are locking pages individually, then we need to drop
+     * the lock here, while the page is typed. We cannot risk the 
+     * race of page_unlock and then put_page_type. */
+#if MEM_SHARING_AUDIT
+    expected_type = (PGT_shared_page | PGT_validated | 1);
+#else
+    expected_type = (PGT_shared_page | PGT_validated | PGT_locked | 2);
+#endif
+    if ( page->u.inuse.type_info != expected_type )
+    {
+        put_page(page);
+        spin_unlock(&d->page_alloc_lock);
+        return -EEXIST;
+    }
+
+    /* Drop the final typecount */
+    put_page_and_type(page);
+
+#ifndef MEM_SHARING_AUDIT
+    /* Now that we've dropped the type, we can unlock */
+    mem_sharing_page_unlock(page);
+#endif
+
+    /* Change the owner */
+    ASSERT(page_get_owner(page) == dom_cow);
+    page_set_owner(page, d);
+
+    d->tot_pages++;
+    page_list_add_tail(page, &d->page_list);
+    spin_unlock(&d->page_alloc_lock);
+
+    put_page(page);
+
+    return 0;
+}
+
+static inline struct page_info *__grab_shared_page(mfn_t mfn)
+{
+    struct page_info *pg = NULL;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+    pg = mfn_to_page(mfn);
+
+    /* If the page is not validated we can't lock it, and if it's  
+     * not validated it's obviously not shared. */
+    if ( !mem_sharing_page_lock(pg) )
+        return NULL;
+
+    if ( mem_sharing_lookup(mfn_x(mfn)) == NULL )
+    {
+        mem_sharing_page_unlock(pg);
+        return NULL;
+    }
+
+    return pg;
+}
+
 int mem_sharing_nominate_page(struct domain *d,
                               unsigned long gfn,
                               int expected_refcnt,
@@ -405,7 +562,7 @@
 {
     p2m_type_t p2mt;
     mfn_t mfn;
-    struct page_info *page;
+    struct page_info *page = NULL; /* gcc... */
     int ret;
     struct gfn_info *gfn_info;
 
@@ -420,10 +577,17 @@
         goto out;
 
     /* Return the handle if the page is already shared */
-    page = mfn_to_page(mfn);
     if ( p2m_is_shared(p2mt) ) {
-        *phandle = page->shared_info->handle;
+        struct page_info *pg = __grab_shared_page(mfn);
+        if ( !pg )
+        {
+            gdprintk(XENLOG_ERR, "Shared p2m entry gfn %lx, but could not "
+                        "grab page %lx dom %d\n", gfn, mfn_x(mfn), d->domain_id);
+            BUG();
+        }
+        *phandle = pg->shared_info->handle;
         ret = 0;
+        mem_sharing_page_unlock(pg);
         goto out;
     }
 
@@ -432,15 +596,24 @@
         goto out;
 
     /* Try to convert the mfn to the sharable type */
+    page = mfn_to_page(mfn);
     ret = page_make_sharable(d, page, expected_refcnt); 
     if ( ret ) 
         goto out;
 
+    /* Now that the page is validated, we can lock it. There is no 
+     * race because we're holding the p2m entry, so no one else 
+     * could be nominating this gfn */
+    ret = -ENOENT;
+    if ( !mem_sharing_page_lock(page) )
+        goto out;
+
     /* Initialize the shared state */
     ret = -ENOMEM;
     if ( (page->shared_info = 
             xmalloc(struct page_sharing_info)) == NULL )
     {
+        /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
@@ -448,7 +621,7 @@
     INIT_LIST_HEAD(&page->shared_info->gfns);
 
     /* Create the handle */
-    page->shared_info->handle = next_handle++;  
+    page->shared_info->handle = get_next_handle();  
 
     /* Create the local gfn info */
     if ( (gfn_info = mem_sharing_gfn_alloc(page, d, gfn)) == NULL )
@@ -479,6 +652,7 @@
 
     *phandle = page->shared_info->handle;
     audit_add_list(page);
+    mem_sharing_page_unlock(page);
     ret = 0;
 
 out:
@@ -490,7 +664,7 @@
 int mem_sharing_share_pages(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
                             struct domain *cd, unsigned long cgfn, shr_handle_t ch) 
 {
-    struct page_info *spage, *cpage;
+    struct page_info *spage, *cpage, *firstpg, *secondpg;
     struct list_head *le, *te;
     gfn_info_t *gfn;
     struct domain *d;
@@ -505,26 +679,63 @@
     smfn = get_gfn(sd, sgfn, &smfn_type);
     cmfn = get_gfn(cd, cgfn, &cmfn_type);
 
-    ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
-    spage = mem_sharing_lookup(mfn_x(smfn));
-    if ( spage == NULL )
+    /* This tricky business is to avoid two callers deadlocking if 
+     * grabbing pages in opposite client/source order */
+    if( mfn_x(smfn) == mfn_x(cmfn) )
+    {
+        /* The pages are already the same.  We could return some
+         * kind of error here, but no matter how you look at it,
+         * the pages are already 'shared'.  It possibly represents
+         * a big problem somewhere else, but as far as sharing is
+         * concerned: great success! */
+        ret = 0;
         goto err_out;
+    }
+    else if ( mfn_x(smfn) < mfn_x(cmfn) )
+    {
+        ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        spage = firstpg = __grab_shared_page(smfn);
+        if ( spage == NULL )
+            goto err_out;
+
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        cpage = secondpg = __grab_shared_page(cmfn);
+        if ( cpage == NULL )
+        {
+            mem_sharing_page_unlock(spage);
+            goto err_out;
+        }
+    } else {
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        cpage = firstpg = __grab_shared_page(cmfn);
+        if ( cpage == NULL )
+            goto err_out;
+
+        ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        spage = secondpg = __grab_shared_page(smfn);
+        if ( spage == NULL )
+        {
+            mem_sharing_page_unlock(cpage);
+            goto err_out;
+        }
+    }
+
     ASSERT(smfn_type == p2m_ram_shared);
-    ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
-    cpage = mem_sharing_lookup(mfn_x(cmfn));
-    if ( cpage == NULL )
-        goto err_out;
     ASSERT(cmfn_type == p2m_ram_shared);
 
     /* Check that the handles match */
     if ( spage->shared_info->handle != sh )
     {
         ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        mem_sharing_page_unlock(secondpg);
+        mem_sharing_page_unlock(firstpg);
         goto err_out;
     }
     if ( cpage->shared_info->handle != ch )
     {
         ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        mem_sharing_page_unlock(secondpg);
+        mem_sharing_page_unlock(firstpg);
         goto err_out;
     }
 
@@ -551,6 +762,9 @@
     xfree(cpage->shared_info);
     cpage->shared_info = NULL;
 
+    mem_sharing_page_unlock(secondpg);
+    mem_sharing_page_unlock(firstpg);
+
     /* Free the client page */
     if(test_and_clear_bit(_PGC_allocated, &cpage->count_info))
         put_page(cpage);
@@ -592,7 +806,7 @@
         return 0;
     }
 
-    page = mem_sharing_lookup(mfn_x(mfn));
+    page = __grab_shared_page(mfn);
     if ( page == NULL )
     {
         gdprintk(XENLOG_ERR, "Domain p2m is shared, but page is not: "
@@ -628,18 +842,20 @@
      * (possibly freeing the page), and exit early */
     if ( flags & MEM_SHARING_DESTROY_GFN )
     {
-        put_gfn(d, gfn);
-        shr_unlock();
         put_page_and_type(page);
+        mem_sharing_page_unlock(page);
         if ( last_gfn && 
             test_and_clear_bit(_PGC_allocated, &page->count_info) ) 
             put_page(page);
+        put_gfn(d, gfn);
+        shr_unlock();
 
         return 0;
     }
  
     if ( last_gfn )
     {
+        /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto private_page_found;
     }
@@ -648,6 +864,7 @@
     page = alloc_domheap_page(d, 0);
     if ( !page ) 
     {
+        mem_sharing_page_unlock(old_page);
         put_gfn(d, gfn);
         mem_sharing_notify_helper(d, gfn);
         shr_unlock();
@@ -661,6 +878,7 @@
     unmap_domain_page(t);
 
     BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
+    mem_sharing_page_unlock(old_page);
     put_page_and_type(old_page);
 
 private_page_found:    
@@ -678,6 +896,7 @@
     /* Now that the gfn<->mfn map is properly established,
      * marking dirty is feasible */
     paging_mark_dirty(d, mfn_x(page_to_mfn(page)));
+    /* We do not need to unlock a private page */
     put_gfn(d, gfn);
     shr_unlock();
     return 0;
@@ -826,8 +1045,8 @@
 void __init mem_sharing_init(void)
 {
     printk("Initing memory sharing.\n");
+#if MEM_SHARING_AUDIT
     mm_lock_init(&shr_lock);
-#if MEM_SHARING_AUDIT
     INIT_LIST_HEAD(&shr_audit_list);
 #endif
 }
diff -r 96fdf927389c -r 7e9b38097888 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
@@ -26,6 +26,8 @@
 #ifndef _MM_LOCKS_H
 #define _MM_LOCKS_H
 
+#include <asm/mem_sharing.h>
+
 /* Per-CPU variable for enforcing the lock ordering */
 DECLARE_PER_CPU(int, mm_lock_level);
 #define __get_lock_level()  (this_cpu(mm_lock_level))
@@ -141,15 +143,22 @@
  *                                                                      *
  ************************************************************************/
 
+#if MEM_SHARING_AUDIT
 /* Page-sharing lock (global) 
  *
  * A single global lock that protects the memory-sharing code's
  * hash tables. */
 
 declare_mm_lock(shr)
-#define shr_lock()         mm_lock(shr, &shr_lock)
-#define shr_unlock()       mm_unlock(&shr_lock)
-#define shr_locked_by_me() mm_locked_by_me(&shr_lock)
+#define _shr_lock()         mm_lock(shr, &shr_lock)
+#define _shr_unlock()       mm_unlock(&shr_lock)
+#define _shr_locked_by_me() mm_locked_by_me(&shr_lock)
+
+#else
+
+/* We use an efficient per-page lock when AUDIT is not enabled. */
+
+#endif /* MEM_SHARING_AUDIT */
 
 /* Nested P2M lock (per-domain)
  *
diff -r 96fdf927389c -r 7e9b38097888 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -337,6 +337,29 @@
 
 void clear_superpage_mark(struct page_info *page);
 
+/* Per page locks:
+ * page_lock() is used for two purposes: pte serialization, and memory sharing.
+ *
+ * All users of page lock for pte serialization live in mm.c, use it
+ * to lock a page table page during pte updates, do not take other locks within
+ * the critical section delimited by page_lock/unlock, and perform no
+ * nesting. 
+ *
+ * All users of page lock for memory sharing live in mm/mem_sharing.c. Page_lock
+ * is used in memory sharing to protect addition (share) and removal (unshare) 
+ * of (gfn,domain) tupples to a list of gfn's that the shared page is currently 
+ * backing. Nesting may happen when sharing (and locking) two pages -- deadlock 
+ * is avoided by locking pages in increasing order.
+ * Memory sharing may take the p2m_lock within a page_lock/unlock
+ * critical section. 
+ *
+ * These two users (pte serialization and memory sharing) do not collide, since
+ * sharing is only supported for hvm guests, which do not perform pv pte updates.
+ * 
+ */
+int page_lock(struct page_info *page);
+void page_unlock(struct page_info *page);
+
 struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
@@ -588,10 +611,6 @@
     struct domain *d, struct page_info *page, unsigned int memflags);
 int donate_page(
     struct domain *d, struct page_info *page, unsigned int memflags);
-int page_make_sharable(struct domain *d, 
-                       struct page_info *page, 
-                       int expected_refcnt);
-int page_make_private(struct domain *d, struct page_info *page);
 
 int map_ldt_shadow_page(unsigned int);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo90-0000im-Sd; Fri, 27 Jan 2012 15:55:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0000hd-JM
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1327679593!61486045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4411 invoked from network); 27 Jan 2012 15:53:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:53:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8s-0002Jq-Cs
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8s-0008Qo-7I
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:10 +0000
Message-Id: <E1Rqo8s-0008Qo-7I@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: add upstream qemu dependecies
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327575966 0
# Node ID 2998b3dbad7e2a3c0003e97724c05335214a5471
# Parent  d5b70621461696b2592eb3d22fa47cd738a26c90
README: add upstream qemu dependecies

Upstream Qemu, just added to the Xen build system, needs GLib 2.0 and
pkg-config to compile.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d5b706214616 -r 2998b3dbad7e README
--- a/README	Thu Jan 26 11:04:59 2012 +0000
+++ b/README	Thu Jan 26 11:06:06 2012 +0000
@@ -50,6 +50,8 @@
     * Development install of yajl (e.g. libyajl-dev)
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
+    * Development install of GLib v2.0 (e.g. libglib2.0-dev)
+    * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
     * hotplug or udev

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo90-0000im-Sd; Fri, 27 Jan 2012 15:55:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0000hd-JM
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1327679593!61486045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4411 invoked from network); 27 Jan 2012 15:53:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:53:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8s-0002Jq-Cs
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8s-0008Qo-7I
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:10 +0000
Message-Id: <E1Rqo8s-0008Qo-7I@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: add upstream qemu dependecies
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1327575966 0
# Node ID 2998b3dbad7e2a3c0003e97724c05335214a5471
# Parent  d5b70621461696b2592eb3d22fa47cd738a26c90
README: add upstream qemu dependecies

Upstream Qemu, just added to the Xen build system, needs GLib 2.0 and
pkg-config to compile.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d5b706214616 -r 2998b3dbad7e README
--- a/README	Thu Jan 26 11:04:59 2012 +0000
+++ b/README	Thu Jan 26 11:06:06 2012 +0000
@@ -50,6 +50,8 @@
     * Development install of yajl (e.g. libyajl-dev)
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater. Set CONFIG_SYSTEM_LIBAIO in .config if this is not available.
+    * Development install of GLib v2.0 (e.g. libglib2.0-dev)
+    * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
     * hotplug or udev

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo90-0000ig-PA; Fri, 27 Jan 2012 15:55:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0000hc-B8
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327679709!5339575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 653 invoked from network); 27 Jan 2012 15:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:10 -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 1Rqo8r-0002Jh-3A
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8q-0008Py-LJ
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:08 +0000
Message-Id: <E1Rqo8q-0008Py-LJ@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Use uint64_t explicitly
	for internal calls
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327575803 0
# Node ID 768c932ea8dadd966d58412cae478c4fe26cb9bf
# Parent  4271634e4c86568b6bf2241ebf9be4a82ab430bf
xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 4271634e4c86 -r 768c932ea8da xen/arch/ia64/xen/oprofile/perfmon.c
--- a/xen/arch/ia64/xen/oprofile/perfmon.c	Wed Jan 25 15:52:47 2012 +0000
+++ b/xen/arch/ia64/xen/oprofile/perfmon.c	Thu Jan 26 11:03:23 2012 +0000
@@ -38,8 +38,6 @@
 #include <asm/vmx.h>    /* for vmx_user_mode() */
 
 // XXX move them to an appropriate header file
-extern void xenoprof_log_event(struct vcpu *vcpu, struct pt_regs * regs,
-                               unsigned long eip, int mode, int event);
 extern int is_active(struct domain *d);
 
 static int allow_virq;
diff -r 4271634e4c86 -r 768c932ea8da xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Wed Jan 25 15:52:47 2012 +0000
+++ b/xen/common/xenoprof.c	Thu Jan 26 11:03:23 2012 +0000
@@ -475,7 +475,7 @@
 
 /* Check for space and add a sample. Return 1 if successful, 0 otherwise. */
 static int xenoprof_add_sample(struct domain *d, xenoprof_buf_t *buf,
-                               unsigned long eip, int mode, int event)
+                               uint64_t eip, int mode, int event)
 {
     int head, tail, size;
 
@@ -512,7 +512,7 @@
 }
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
-                       unsigned long eip, int mode)
+                       uint64_t eip, int mode)
 {
     xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
 
@@ -527,7 +527,7 @@
 }
 
 void xenoprof_log_event(struct vcpu *vcpu, 
-                        struct cpu_user_regs * regs, unsigned long eip, 
+                        struct cpu_user_regs * regs, uint64_t eip, 
                         int mode, int event)
 {
     struct domain *d = vcpu->domain;
diff -r 4271634e4c86 -r 768c932ea8da xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Wed Jan 25 15:52:47 2012 +0000
+++ b/xen/include/xen/xenoprof.h	Thu Jan 26 11:03:23 2012 +0000
@@ -69,7 +69,7 @@
 void free_xenoprof_pages(struct domain *d);
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *v, 
-                       unsigned long eip, int mode);
+                       uint64_t eip, int mode);
 
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
@@ -78,7 +78,7 @@
 void release_pmu_ownship(int pmu_ownership);
 
 void xenoprof_log_event(struct vcpu *vcpu,
-                        struct cpu_user_regs * regs, unsigned long eip,
+                        struct cpu_user_regs * regs, uint64_t eip,
                         int mode, int event);
 
 #endif  /* __XEN__XENOPROF_H__ */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo93-0000jz-0w; Fri, 27 Jan 2012 15:55:21 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo90-0000hp-VI
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1327679711!12686724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14504 invoked from network); 27 Jan 2012 15:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:12 -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 1Rqo8t-0002Jt-0f
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8s-0008R4-OG
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:10 +0000
Message-Id: <E1Rqo8s-0008R4-OG@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] seabios: update to 1.6.3.1 release
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1327576000 0
# Node ID d8f280c785445856b2d6b8b9ff545d66917e7ba7
# Parent  2998b3dbad7e2a3c0003e97724c05335214a5471
seabios: update to 1.6.3.1 release

This is the latest seabios stable release.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2998b3dbad7e -r d8f280c78544 Config.mk
--- a/Config.mk	Thu Jan 26 11:06:06 2012 +0000
+++ b/Config.mk	Thu Jan 26 11:06:40 2012 +0000
@@ -215,7 +215,7 @@
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
+SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.1
 
 # 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.

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo90-0000ig-PA; Fri, 27 Jan 2012 15:55:18 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0000hc-B8
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327679709!5339575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 653 invoked from network); 27 Jan 2012 15:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:10 -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 1Rqo8r-0002Jh-3A
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8q-0008Py-LJ
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:08 +0000
Message-Id: <E1Rqo8q-0008Py-LJ@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenoprof: Use uint64_t explicitly
	for internal calls
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1327575803 0
# Node ID 768c932ea8dadd966d58412cae478c4fe26cb9bf
# Parent  4271634e4c86568b6bf2241ebf9be4a82ab430bf
xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 4271634e4c86 -r 768c932ea8da xen/arch/ia64/xen/oprofile/perfmon.c
--- a/xen/arch/ia64/xen/oprofile/perfmon.c	Wed Jan 25 15:52:47 2012 +0000
+++ b/xen/arch/ia64/xen/oprofile/perfmon.c	Thu Jan 26 11:03:23 2012 +0000
@@ -38,8 +38,6 @@
 #include <asm/vmx.h>    /* for vmx_user_mode() */
 
 // XXX move them to an appropriate header file
-extern void xenoprof_log_event(struct vcpu *vcpu, struct pt_regs * regs,
-                               unsigned long eip, int mode, int event);
 extern int is_active(struct domain *d);
 
 static int allow_virq;
diff -r 4271634e4c86 -r 768c932ea8da xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Wed Jan 25 15:52:47 2012 +0000
+++ b/xen/common/xenoprof.c	Thu Jan 26 11:03:23 2012 +0000
@@ -475,7 +475,7 @@
 
 /* Check for space and add a sample. Return 1 if successful, 0 otherwise. */
 static int xenoprof_add_sample(struct domain *d, xenoprof_buf_t *buf,
-                               unsigned long eip, int mode, int event)
+                               uint64_t eip, int mode, int event)
 {
     int head, tail, size;
 
@@ -512,7 +512,7 @@
 }
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
-                       unsigned long eip, int mode)
+                       uint64_t eip, int mode)
 {
     xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
 
@@ -527,7 +527,7 @@
 }
 
 void xenoprof_log_event(struct vcpu *vcpu, 
-                        struct cpu_user_regs * regs, unsigned long eip, 
+                        struct cpu_user_regs * regs, uint64_t eip, 
                         int mode, int event)
 {
     struct domain *d = vcpu->domain;
diff -r 4271634e4c86 -r 768c932ea8da xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Wed Jan 25 15:52:47 2012 +0000
+++ b/xen/include/xen/xenoprof.h	Thu Jan 26 11:03:23 2012 +0000
@@ -69,7 +69,7 @@
 void free_xenoprof_pages(struct domain *d);
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *v, 
-                       unsigned long eip, int mode);
+                       uint64_t eip, int mode);
 
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
@@ -78,7 +78,7 @@
 void release_pmu_ownship(int pmu_ownership);
 
 void xenoprof_log_event(struct vcpu *vcpu,
-                        struct cpu_user_regs * regs, unsigned long eip,
+                        struct cpu_user_regs * regs, uint64_t eip,
                         int mode, int event);
 
 #endif  /* __XEN__XENOPROF_H__ */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo93-0000jz-0w; Fri, 27 Jan 2012 15:55:21 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo90-0000hp-VI
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1327679711!12686724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14504 invoked from network); 27 Jan 2012 15:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:12 -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 1Rqo8t-0002Jt-0f
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8s-0008R4-OG
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:10 +0000
Message-Id: <E1Rqo8s-0008R4-OG@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] seabios: update to 1.6.3.1 release
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1327576000 0
# Node ID d8f280c785445856b2d6b8b9ff545d66917e7ba7
# Parent  2998b3dbad7e2a3c0003e97724c05335214a5471
seabios: update to 1.6.3.1 release

This is the latest seabios stable release.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2998b3dbad7e -r d8f280c78544 Config.mk
--- a/Config.mk	Thu Jan 26 11:06:06 2012 +0000
+++ b/Config.mk	Thu Jan 26 11:06:40 2012 +0000
@@ -215,7 +215,7 @@
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
+SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.1
 
 # 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.

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo93-0000k6-3O; Fri, 27 Jan 2012 15:55:21 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo91-0000ht-Na
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1327679668!57728505!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22212 invoked from network); 27 Jan 2012 15:54:29 -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;
	27 Jan 2012 15:54:29 -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 1Rqo8r-0002Jn-Sr
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8r-0008QX-ND
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Message-Id: <E1Rqo8r-0008QX-ND@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/libxc: fix error handling in
	xc_mem_paging_load
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1327575899 0
# Node ID d5b70621461696b2592eb3d22fa47cd738a26c90
# Parent  1e27e827e6a80b9fe8d59bcd46dbe30ca9bc0692
tools/libxc: fix error handling in xc_mem_paging_load

xc_mem_paging_load() does not pass errors in errno and the actual
errno from xc_mem_event_control() is overwritten by munlock().
xenpaging_populate_page() needs to check errno, but with the switch to
xc_mem_paging_load() it could not receive ENOMEM anymore.

Update xc_mem_paging_load() to return -1 and preserve errno during
munlock().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 1e27e827e6a8 -r d5b706214616 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Jan 26 11:03:50 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Jan 26 11:04:59 2012 +0000
@@ -68,23 +68,28 @@
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, 
                                 unsigned long gfn, void *buffer)
 {
-    int rc;
+    int rc, old_errno;
+
+    errno = -EINVAL;
 
     if ( !buffer )
-        return -EINVAL;
+        return -1;
 
     if ( ((unsigned long) buffer) & (XC_PAGE_SIZE - 1) )
-        return -EINVAL;
+        return -1;
 
     if ( mlock(buffer, XC_PAGE_SIZE) )
-        return -errno;
+        return -1;
         
     rc = xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
                                 buffer, NULL, gfn);
 
-    (void)munlock(buffer, XC_PAGE_SIZE);
+    old_errno = errno;
+    munlock(buffer, XC_PAGE_SIZE);
+    errno = old_errno;
+
     return rc;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo93-0000k6-3O; Fri, 27 Jan 2012 15:55:21 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo91-0000ht-Na
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1327679668!57728505!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22212 invoked from network); 27 Jan 2012 15:54:29 -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;
	27 Jan 2012 15:54:29 -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 1Rqo8r-0002Jn-Sr
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8r-0008QX-ND
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:09 +0000
Message-Id: <E1Rqo8r-0008QX-ND@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/libxc: fix error handling in
	xc_mem_paging_load
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1327575899 0
# Node ID d5b70621461696b2592eb3d22fa47cd738a26c90
# Parent  1e27e827e6a80b9fe8d59bcd46dbe30ca9bc0692
tools/libxc: fix error handling in xc_mem_paging_load

xc_mem_paging_load() does not pass errors in errno and the actual
errno from xc_mem_event_control() is overwritten by munlock().
xenpaging_populate_page() needs to check errno, but with the switch to
xc_mem_paging_load() it could not receive ENOMEM anymore.

Update xc_mem_paging_load() to return -1 and preserve errno during
munlock().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 1e27e827e6a8 -r d5b706214616 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Jan 26 11:03:50 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Jan 26 11:04:59 2012 +0000
@@ -68,23 +68,28 @@
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, 
                                 unsigned long gfn, void *buffer)
 {
-    int rc;
+    int rc, old_errno;
+
+    errno = -EINVAL;
 
     if ( !buffer )
-        return -EINVAL;
+        return -1;
 
     if ( ((unsigned long) buffer) & (XC_PAGE_SIZE - 1) )
-        return -EINVAL;
+        return -1;
 
     if ( mlock(buffer, XC_PAGE_SIZE) )
-        return -errno;
+        return -1;
         
     rc = xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
                                 buffer, NULL, gfn);
 
-    (void)munlock(buffer, XC_PAGE_SIZE);
+    old_errno = errno;
+    munlock(buffer, XC_PAGE_SIZE);
+    errno = old_errno;
+
     return rc;
 }
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo94-0000kx-6X; Fri, 27 Jan 2012 15:55:22 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0000i1-7b
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1327679712!2912913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17636 invoked from network); 27 Jan 2012 15:55:13 -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;
	27 Jan 2012 15:55:13 -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 1Rqo8u-0002Jz-DG
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8u-0008Rd-9J
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Message-Id: <E1Rqo8u-0008Rd-9J@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Update mem sharing interface
	to (re)allow sharing of grants
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 96fdf927389c75d817c0d36dae55727845459cf6
# Parent  7bb1ba3dccb205d9925608d549cc764fa79ad5f1
x86/mm: Update mem sharing interface to (re)allow sharing of grants

Previously, the mem sharing code would return an opaque handle to index shared
pages (and nominees) in its global hash table.  By removing the hash table, the
new interfaces requires a gfn and a version. However, when sharing grants, the
caller provides a grant ref and a version. Update interface to handle this
case.

The use case for grant sharing is when sharing from within a backend (e.g.
memshr + blktap2), in which case the backend is only exposed to grant
references.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Committed-by: Tim Deegan <tim@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
---


diff -r 7bb1ba3dccb2 -r 96fdf927389c xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -728,18 +728,57 @@
 
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE:
         {
-            unsigned long sgfn  = mec->u.share.source_gfn;
-            shr_handle_t sh     = mec->u.share.source_handle;
-            struct domain *cd   = get_domain_by_id(mec->u.share.client_domain);
-            if ( cd )
+            unsigned long sgfn, cgfn;
+            struct domain *cd;
+            shr_handle_t sh, ch;
+
+            if ( !mem_sharing_enabled(d) )
+                return -EINVAL;
+
+            cd = get_domain_by_id(mec->u.share.client_domain);
+            if ( !cd )
+                return -ESRCH;
+
+            if ( !mem_sharing_enabled(cd) )
             {
-                unsigned long cgfn  = mec->u.share.client_gfn;
-                shr_handle_t ch     = mec->u.share.client_handle;
-                rc = mem_sharing_share_pages(d, sgfn, sh, cd, cgfn, ch); 
                 put_domain(cd);
+                return -EINVAL;
             }
-            else
-                return -EEXIST;
+
+            if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.source_gfn) )
+            {
+                grant_ref_t gref = (grant_ref_t) 
+                                    (XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(
+                                        mec->u.share.source_gfn));
+                if ( mem_sharing_gref_to_gfn(d, gref, &sgfn) < 0 )
+                {
+                    put_domain(cd);
+                    return -EINVAL;
+                }
+            } else {
+                sgfn  = mec->u.share.source_gfn;
+            }
+
+            if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.client_gfn) )
+            {
+                grant_ref_t gref = (grant_ref_t) 
+                                    (XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(
+                                        mec->u.share.client_gfn));
+                if ( mem_sharing_gref_to_gfn(cd, gref, &cgfn) < 0 )
+                {
+                    put_domain(cd);
+                    return -EINVAL;
+                }
+            } else {
+                cgfn  = mec->u.share.client_gfn;
+            }
+
+            sh = mec->u.share.source_handle;
+            ch = mec->u.share.client_handle;
+
+            rc = mem_sharing_share_pages(d, sgfn, sh, cd, cgfn, ch); 
+
+            put_domain(cd);
         }
         break;
 
diff -r 7bb1ba3dccb2 -r 96fdf927389c xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -775,6 +775,19 @@
 #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
 #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)
 
+/* The following allows sharing of grant refs. This is useful
+ * for sharing utilities sitting as "filters" in IO backends
+ * (e.g. memshr + blktap(2)). The IO backend is only exposed 
+ * to grant references, and this allows sharing of the grefs */
+#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG   (1ULL << 62)
+
+#define XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(field, val)  \
+    (field) = (XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG | val)
+#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(field)         \
+    ((field) & XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG)
+#define XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(field)        \
+    ((field) & (~XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG))
+
 struct xen_domctl_mem_sharing_op {
     uint8_t op; /* XEN_DOMCTL_MEM_EVENT_OP_* */
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo94-0000kx-6X; Fri, 27 Jan 2012 15:55:22 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0000i1-7b
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1327679712!2912913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17636 invoked from network); 27 Jan 2012 15:55:13 -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;
	27 Jan 2012 15:55:13 -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 1Rqo8u-0002Jz-DG
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8u-0008Rd-9J
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:12 +0000
Message-Id: <E1Rqo8u-0008Rd-9J@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Update mem sharing interface
	to (re)allow sharing of grants
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 96fdf927389c75d817c0d36dae55727845459cf6
# Parent  7bb1ba3dccb205d9925608d549cc764fa79ad5f1
x86/mm: Update mem sharing interface to (re)allow sharing of grants

Previously, the mem sharing code would return an opaque handle to index shared
pages (and nominees) in its global hash table.  By removing the hash table, the
new interfaces requires a gfn and a version. However, when sharing grants, the
caller provides a grant ref and a version. Update interface to handle this
case.

The use case for grant sharing is when sharing from within a backend (e.g.
memshr + blktap2), in which case the backend is only exposed to grant
references.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Committed-by: Tim Deegan <tim@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
---


diff -r 7bb1ba3dccb2 -r 96fdf927389c xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -728,18 +728,57 @@
 
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE:
         {
-            unsigned long sgfn  = mec->u.share.source_gfn;
-            shr_handle_t sh     = mec->u.share.source_handle;
-            struct domain *cd   = get_domain_by_id(mec->u.share.client_domain);
-            if ( cd )
+            unsigned long sgfn, cgfn;
+            struct domain *cd;
+            shr_handle_t sh, ch;
+
+            if ( !mem_sharing_enabled(d) )
+                return -EINVAL;
+
+            cd = get_domain_by_id(mec->u.share.client_domain);
+            if ( !cd )
+                return -ESRCH;
+
+            if ( !mem_sharing_enabled(cd) )
             {
-                unsigned long cgfn  = mec->u.share.client_gfn;
-                shr_handle_t ch     = mec->u.share.client_handle;
-                rc = mem_sharing_share_pages(d, sgfn, sh, cd, cgfn, ch); 
                 put_domain(cd);
+                return -EINVAL;
             }
-            else
-                return -EEXIST;
+
+            if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.source_gfn) )
+            {
+                grant_ref_t gref = (grant_ref_t) 
+                                    (XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(
+                                        mec->u.share.source_gfn));
+                if ( mem_sharing_gref_to_gfn(d, gref, &sgfn) < 0 )
+                {
+                    put_domain(cd);
+                    return -EINVAL;
+                }
+            } else {
+                sgfn  = mec->u.share.source_gfn;
+            }
+
+            if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.client_gfn) )
+            {
+                grant_ref_t gref = (grant_ref_t) 
+                                    (XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(
+                                        mec->u.share.client_gfn));
+                if ( mem_sharing_gref_to_gfn(cd, gref, &cgfn) < 0 )
+                {
+                    put_domain(cd);
+                    return -EINVAL;
+                }
+            } else {
+                cgfn  = mec->u.share.client_gfn;
+            }
+
+            sh = mec->u.share.source_handle;
+            ch = mec->u.share.client_handle;
+
+            rc = mem_sharing_share_pages(d, sgfn, sh, cd, cgfn, ch); 
+
+            put_domain(cd);
         }
         break;
 
diff -r 7bb1ba3dccb2 -r 96fdf927389c xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -775,6 +775,19 @@
 #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
 #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)
 
+/* The following allows sharing of grant refs. This is useful
+ * for sharing utilities sitting as "filters" in IO backends
+ * (e.g. memshr + blktap(2)). The IO backend is only exposed 
+ * to grant references, and this allows sharing of the grefs */
+#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG   (1ULL << 62)
+
+#define XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(field, val)  \
+    (field) = (XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG | val)
+#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(field)         \
+    ((field) & XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG)
+#define XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(field)        \
+    ((field) & (~XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG))
+
 struct xen_domctl_mem_sharing_op {
     uint8_t op; /* XEN_DOMCTL_MEM_EVENT_OP_* */
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo94-0000lO-Fe; Fri, 27 Jan 2012 15:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0000i6-CJ
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1327679713!12850973!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2062 invoked from network); 27 Jan 2012 15:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8v-0002K5-GM
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8v-0008SB-FA
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:13 +0000
Message-Id: <E1Rqo8v-0008SB-FA@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Enforce lock ordering for
	sharing page locks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 823829bde70517ae047c10a71b808bc1419d7dff
# Parent  7e9b38097888ce31743815460e57791896b420ac
x86/mm: Enforce lock ordering for sharing page locks

Use the ordering constructs in mm-locks.h to enforce an order
for the p2m and page locks in the sharing code. Applies to either
the global sharing lock (in audit mode) or the per page locks.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scanneell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7e9b38097888 -r 823829bde705 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -37,6 +37,13 @@
 
 static shr_handle_t next_handle = 1;
 
+typedef struct pg_lock_data {
+    int mm_unlock_level;
+    unsigned short recurse_count;
+} pg_lock_data_t;
+
+DEFINE_PER_CPU(pg_lock_data_t, __pld);
+
 #if MEM_SHARING_AUDIT
 
 static mm_lock_t shr_lock;
@@ -85,16 +92,25 @@
 static inline int mem_sharing_page_lock(struct page_info *pg)
 {
     int rc;
+    pg_lock_data_t *pld = &(this_cpu(__pld));
+
+    page_sharing_mm_pre_lock();
     rc = page_lock(pg);
     if ( rc )
     {
         preempt_disable();
+        page_sharing_mm_post_lock(&pld->mm_unlock_level, 
+                                  &pld->recurse_count);
     }
     return rc;
 }
 
 static inline void mem_sharing_page_unlock(struct page_info *pg)
 {
+    pg_lock_data_t *pld = &(this_cpu(__pld));
+
+    page_sharing_mm_unlock(pld->mm_unlock_level, 
+                           &pld->recurse_count);
     preempt_enable();
     page_unlock(pg);
 }
diff -r 7e9b38097888 -r 823829bde705 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
@@ -156,7 +156,23 @@
 
 #else
 
-/* We use an efficient per-page lock when AUDIT is not enabled. */
+/* Sharing per page lock
+ *
+ * This is an external lock, not represented by an mm_lock_t. The memory
+ * sharing lock uses it to protect addition and removal of (gfn,domain)
+ * tuples to a shared page. We enforce order here against the p2m lock,
+ * which is taken after the page_lock to change the gfn's p2m entry.
+ *
+ * Note that in sharing audit mode, we use the global page lock above, 
+ * instead.
+ *
+ * The lock is recursive because during share we lock two pages. */
+
+declare_mm_order_constraint(per_page_sharing)
+#define page_sharing_mm_pre_lock()   mm_enforce_order_lock_pre_per_page_sharing()
+#define page_sharing_mm_post_lock(l, r) \
+        mm_enforce_order_lock_post_per_page_sharing((l), (r))
+#define page_sharing_mm_unlock(l, r) mm_enforce_order_unlock((l), (r))
 
 #endif /* MEM_SHARING_AUDIT */
 
diff -r 7e9b38097888 -r 823829bde705 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -351,7 +351,8 @@
  * backing. Nesting may happen when sharing (and locking) two pages -- deadlock 
  * is avoided by locking pages in increasing order.
  * Memory sharing may take the p2m_lock within a page_lock/unlock
- * critical section. 
+ * critical section. We enforce ordering between page_lock and p2m_lock using an
+ * mm-locks.h construct. 
  *
  * These two users (pte serialization and memory sharing) do not collide, since
  * sharing is only supported for hvm guests, which do not perform pv pte updates.

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo94-0000lO-Fe; Fri, 27 Jan 2012 15:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0000i6-CJ
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1327679713!12850973!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2062 invoked from network); 27 Jan 2012 15:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8v-0002K5-GM
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8v-0008SB-FA
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:13 +0000
Message-Id: <E1Rqo8v-0008SB-FA@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Enforce lock ordering for
	sharing page locks
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 823829bde70517ae047c10a71b808bc1419d7dff
# Parent  7e9b38097888ce31743815460e57791896b420ac
x86/mm: Enforce lock ordering for sharing page locks

Use the ordering constructs in mm-locks.h to enforce an order
for the p2m and page locks in the sharing code. Applies to either
the global sharing lock (in audit mode) or the per page locks.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scanneell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7e9b38097888 -r 823829bde705 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -37,6 +37,13 @@
 
 static shr_handle_t next_handle = 1;
 
+typedef struct pg_lock_data {
+    int mm_unlock_level;
+    unsigned short recurse_count;
+} pg_lock_data_t;
+
+DEFINE_PER_CPU(pg_lock_data_t, __pld);
+
 #if MEM_SHARING_AUDIT
 
 static mm_lock_t shr_lock;
@@ -85,16 +92,25 @@
 static inline int mem_sharing_page_lock(struct page_info *pg)
 {
     int rc;
+    pg_lock_data_t *pld = &(this_cpu(__pld));
+
+    page_sharing_mm_pre_lock();
     rc = page_lock(pg);
     if ( rc )
     {
         preempt_disable();
+        page_sharing_mm_post_lock(&pld->mm_unlock_level, 
+                                  &pld->recurse_count);
     }
     return rc;
 }
 
 static inline void mem_sharing_page_unlock(struct page_info *pg)
 {
+    pg_lock_data_t *pld = &(this_cpu(__pld));
+
+    page_sharing_mm_unlock(pld->mm_unlock_level, 
+                           &pld->recurse_count);
     preempt_enable();
     page_unlock(pg);
 }
diff -r 7e9b38097888 -r 823829bde705 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
@@ -156,7 +156,23 @@
 
 #else
 
-/* We use an efficient per-page lock when AUDIT is not enabled. */
+/* Sharing per page lock
+ *
+ * This is an external lock, not represented by an mm_lock_t. The memory
+ * sharing lock uses it to protect addition and removal of (gfn,domain)
+ * tuples to a shared page. We enforce order here against the p2m lock,
+ * which is taken after the page_lock to change the gfn's p2m entry.
+ *
+ * Note that in sharing audit mode, we use the global page lock above, 
+ * instead.
+ *
+ * The lock is recursive because during share we lock two pages. */
+
+declare_mm_order_constraint(per_page_sharing)
+#define page_sharing_mm_pre_lock()   mm_enforce_order_lock_pre_per_page_sharing()
+#define page_sharing_mm_post_lock(l, r) \
+        mm_enforce_order_lock_post_per_page_sharing((l), (r))
+#define page_sharing_mm_unlock(l, r) mm_enforce_order_unlock((l), (r))
 
 #endif /* MEM_SHARING_AUDIT */
 
diff -r 7e9b38097888 -r 823829bde705 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -351,7 +351,8 @@
  * backing. Nesting may happen when sharing (and locking) two pages -- deadlock 
  * is avoided by locking pages in increasing order.
  * Memory sharing may take the p2m_lock within a page_lock/unlock
- * critical section. 
+ * critical section. We enforce ordering between page_lock and p2m_lock using an
+ * mm-locks.h construct. 
  *
  * These two users (pte serialization and memory sharing) do not collide, since
  * sharing is only supported for hvm guests, which do not perform pv pte updates.

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo94-0000l9-A7; Fri, 27 Jan 2012 15:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0000i5-KI
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1327679712!12830756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16570 invoked from network); 27 Jan 2012 15:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:13 -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 1Rqo8t-0002Jw-KP
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8t-0008RN-Gp
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:11 +0000
Message-Id: <E1Rqo8t-0008RN-Gp@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Eliminate hash table in
	sharing code as index of shared mfns
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 7bb1ba3dccb205d9925608d549cc764fa79ad5f1
# Parent  d8f280c785445856b2d6b8b9ff545d66917e7ba7
x86/mm: Eliminate hash table in sharing code as index of shared mfns

Eliminate the sharing hastable mechanism by storing a list head directly in the
page info for the case when the page is shared.  This does not add any extra
space to the page_info and serves to remove significant complexity from
sharing.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -3,6 +3,7 @@
  *
  * Memory sharing support.
  *
+ * Copyright (c) 2011 GridCentric, Inc. (Adin Scannell & Andres Lagar-Cavilla)
  * Copyright (c) 2009 Citrix Systems, Inc. (Grzegorz Milos)
  *
  * This program is free software; you can redistribute it and/or modify
@@ -34,15 +35,27 @@
 
 #include "mm-locks.h"
 
-/* Auditing of memory sharing code? */
-#define MEM_SHARING_AUDIT 0
-
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void);
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
+static struct list_head shr_audit_list;
+
+static inline void audit_add_list(struct page_info *page)
+{
+    INIT_LIST_HEAD(&page->shared_info->entry);
+    list_add(&page->shared_info->entry, &shr_audit_list);
+}
+
+static inline void audit_del_list(struct page_info *page)
+{
+    list_del(&page->shared_info->entry);
+}
 #else
-#define mem_sharing_audit() do {} while(0)
+#define mem_sharing_audit() ((void)0)
+
+#define audit_add_list(p)  ((void)0)
+#define audit_del_list(p)  ((void)0)
 #endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
@@ -58,17 +71,6 @@
 static shr_handle_t next_handle = 1;
 static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
 
-typedef struct shr_hash_entry 
-{
-    shr_handle_t handle;
-    mfn_t mfn; 
-    struct shr_hash_entry *next;
-    struct list_head gfns;
-} shr_hash_entry_t;
-
-#define SHR_HASH_LENGTH 1000
-static shr_hash_entry_t *shr_hash[SHR_HASH_LENGTH];
-
 typedef struct gfn_info
 {
     unsigned long gfn;
@@ -89,164 +91,149 @@
     return list_entry(list->next, gfn_info_t, list);
 }
 
-static void __init mem_sharing_hash_init(void)
+static inline gfn_info_t *mem_sharing_gfn_alloc(struct page_info *page,
+                                                struct domain *d,
+                                                unsigned long gfn)
 {
-    int i;
+    gfn_info_t *gfn_info = xmalloc(gfn_info_t);
 
-    mm_lock_init(&shr_lock);
-    for(i=0; i<SHR_HASH_LENGTH; i++)
-        shr_hash[i] = NULL;
+    if ( gfn_info == NULL )
+        return NULL; 
+
+    gfn_info->gfn = gfn;
+    gfn_info->domain = d->domain_id;
+    INIT_LIST_HEAD(&gfn_info->list);
+    list_add(&gfn_info->list, &page->shared_info->gfns);
+
+    /* Increment our number of shared pges. */
+    atomic_inc(&d->shr_pages);
+
+    return gfn_info;
 }
 
-static shr_hash_entry_t *mem_sharing_hash_alloc(void)
+static inline void mem_sharing_gfn_destroy(struct domain *d,
+                                           gfn_info_t *gfn_info)
 {
-    return xmalloc(shr_hash_entry_t); 
+    /* Decrement the number of pages. */
+    atomic_dec(&d->shr_pages);
+
+    /* Free the gfn_info structure. */
+    list_del(&gfn_info->list);
+    xfree(gfn_info);
 }
 
-static void mem_sharing_hash_destroy(shr_hash_entry_t *e)
+static struct page_info* mem_sharing_lookup(unsigned long mfn)
 {
-    xfree(e);
-}
-
-static gfn_info_t *mem_sharing_gfn_alloc(void)
-{
-    return xmalloc(gfn_info_t); 
-}
-
-static void mem_sharing_gfn_destroy(gfn_info_t *gfn, int was_shared)
-{
-    /* Decrement the number of pages, if the gfn was shared before */
-    if ( was_shared )
+    if ( mfn_valid(_mfn(mfn)) )
     {
-        struct domain *d = get_domain_by_id(gfn->domain);
-        /* Domain may have been destroyed by now *
-         * (if we are called from p2m_teardown)  */
-        if ( d )
+        struct page_info* page = mfn_to_page(_mfn(mfn));
+        if ( page_get_owner(page) == dom_cow )
         {
-            atomic_dec(&d->shr_pages);
-            put_domain(d);
+            ASSERT(page->u.inuse.type_info & PGT_type_mask); 
+            ASSERT(get_gpfn_from_mfn(mfn) == SHARED_M2P_ENTRY); 
+            return page;
         }
     }
-    xfree(gfn);
-}
-
-static shr_hash_entry_t* mem_sharing_hash_lookup(shr_handle_t handle)
-{
-    shr_hash_entry_t *e;
-    
-    e = shr_hash[handle % SHR_HASH_LENGTH]; 
-    while(e != NULL)
-    {
-        if(e->handle == handle)
-            return e;
-        e = e->next;
-    }
 
     return NULL;
 }
 
-static shr_hash_entry_t* mem_sharing_hash_insert(shr_handle_t handle, mfn_t mfn)
-{
-    shr_hash_entry_t *e, **ee;
-    
-    e = mem_sharing_hash_alloc();
-    if(e == NULL) return NULL;
-    e->handle = handle;
-    e->mfn = mfn;
-    ee = &shr_hash[handle % SHR_HASH_LENGTH]; 
-    e->next = *ee;
-    *ee = e;
-    return e;
-}
-
-static void mem_sharing_hash_delete(shr_handle_t handle)
-{
-    shr_hash_entry_t **pprev, *e;  
-
-    pprev = &shr_hash[handle % SHR_HASH_LENGTH];
-    e = *pprev;
-    while(e != NULL)
-    {
-        if(e->handle == handle)
-        {
-            *pprev = e->next;
-            mem_sharing_hash_destroy(e);
-            return;
-        }
-        pprev = &e->next;
-        e = e->next;
-    }
-    printk("Could not find shr entry for handle %"PRIx64"\n", handle);
-    BUG();
-} 
-
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void)
 {
-    shr_hash_entry_t *e;
-    struct list_head *le;
-    gfn_info_t *g;
-    int bucket;
-    struct page_info *pg;
+    int errors = 0;
+    struct list_head *ae;
 
     ASSERT(shr_locked_by_me());
 
-    for(bucket=0; bucket < SHR_HASH_LENGTH; bucket++)
+    list_for_each(ae, &shr_audit_list)
     {
-        e = shr_hash[bucket];    
-        /* Loop over all shr_hash_entries */ 
-        while(e != NULL)
+        struct page_sharing_info *shared_info;
+        unsigned long nr_gfns = 0;
+        struct page_info *pg;
+        struct list_head *le;
+        mfn_t mfn;
+
+        shared_info = list_entry(ae, struct page_sharing_info, entry);
+        pg = shared_info->pg;
+        mfn = page_to_mfn(pg);
+
+        /* Check if the MFN has correct type, owner and handle. */ 
+        if ( !(pg->u.inuse.type_info & PGT_shared_page) )
         {
-            int nr_gfns=0;
+           MEM_SHARING_DEBUG("mfn %lx in audit list, but not PGT_shared_page (%lx)!\n",
+                              mfn_x(mfn), pg->u.inuse.type_info & PGT_type_mask);
+           errors++;
+           continue;
+        }
 
-            /* Check if the MFN has correct type, owner and handle */ 
-            pg = mfn_to_page(e->mfn);
-            if((pg->u.inuse.type_info & PGT_type_mask) != PGT_shared_page)
-                MEM_SHARING_DEBUG("mfn %lx not shared, but in the hash!\n",
-                                   mfn_x(e->mfn));
-            if(page_get_owner(pg) != dom_cow)
-                MEM_SHARING_DEBUG("mfn %lx shared, but wrong owner (%d)!\n",
-                                   mfn_x(e->mfn), 
-                                   page_get_owner(pg)->domain_id);
-            if(e->handle != pg->shr_handle)
-                MEM_SHARING_DEBUG("mfn %lx shared, but wrong handle "
-                                  "(%ld != %ld)!\n",
-                                   mfn_x(e->mfn), pg->shr_handle, e->handle);
-            /* Check if all GFNs map to the MFN, and the p2m types */
-            list_for_each(le, &e->gfns)
+        /* Check the page owner. */
+        if ( page_get_owner(pg) != dom_cow )
+        {
+           MEM_SHARING_DEBUG("mfn %lx shared, but wrong owner (%hu)!\n",
+                             mfn_x(mfn), page_get_owner(pg)->domain_id);
+           errors++;
+        }
+
+        /* Check the m2p entry */
+        if ( get_gpfn_from_mfn(mfn_x(mfn)) != SHARED_M2P_ENTRY )
+        {
+           MEM_SHARING_DEBUG("mfn %lx shared, but wrong m2p entry (%lx)!\n",
+                             mfn_x(mfn), get_gpfn_from_mfn(mfn_x(mfn)));
+           errors++;
+        }
+
+        /* Check we have a list */
+        if ( (!pg->shared_info) || (list_empty(&pg->shared_info->gfns)) )
+        {
+           MEM_SHARING_DEBUG("mfn %lx shared, but empty gfn list!\n",
+                             mfn_x(mfn));
+           errors++;
+           continue;
+        }
+
+        /* Check if all GFNs map to the MFN, and the p2m types */
+        list_for_each(le, &pg->shared_info->gfns)
+        {
+            struct domain *d;
+            p2m_type_t t;
+            mfn_t o_mfn;
+            gfn_info_t *g;
+
+            g = list_entry(le, gfn_info_t, list);
+            d = get_domain_by_id(g->domain);
+            if ( d == NULL )
             {
-                struct domain *d;
-                p2m_type_t t;
-                mfn_t mfn;
-
-                g = list_entry(le, struct gfn_info, list);
-                d = get_domain_by_id(g->domain);
-                if(d == NULL)
-                {
-                    MEM_SHARING_DEBUG("Unknow dom: %d, for PFN=%lx, MFN=%lx\n",
-                            g->domain, g->gfn, mfn_x(e->mfn));
-                    continue;
-                }
-                mfn = get_gfn_unlocked(d, g->gfn, &t); 
-                if(mfn_x(mfn) != mfn_x(e->mfn))
-                    MEM_SHARING_DEBUG("Incorrect P2M for d=%d, PFN=%lx."
-                                      "Expecting MFN=%ld, got %ld\n",
-                                      g->domain, g->gfn, mfn_x(e->mfn),
-                                      mfn_x(mfn));
-                if(t != p2m_ram_shared)
-                    MEM_SHARING_DEBUG("Incorrect P2M type for d=%d, PFN=%lx."
-                                      "Expecting t=%d, got %d\n",
-                                      g->domain, g->gfn, mfn_x(e->mfn),
-                                      p2m_ram_shared, t);
-                put_domain(d);
-                nr_gfns++;
-            } 
-            if(nr_gfns != (pg->u.inuse.type_info & PGT_count_mask))
-                MEM_SHARING_DEBUG("Mismatched counts for MFN=%lx."
-                                  "nr_gfns in hash %d, in type_info %d\n",
-                                  mfn_x(e->mfn), nr_gfns, 
-                                 (pg->u.inuse.type_info & PGT_count_mask));
-            e = e->next;
+                MEM_SHARING_DEBUG("Unknown dom: %hu, for PFN=%lx, MFN=%lx\n",
+                                  g->domain, g->gfn, mfn_x(mfn));
+                errors++;
+                continue;
+            }
+            o_mfn = get_gfn_query_unlocked(d, g->gfn, &t); 
+            if ( mfn_x(o_mfn) != mfn_x(mfn) )
+            {
+                MEM_SHARING_DEBUG("Incorrect P2M for d=%hu, PFN=%lx."
+                                  "Expecting MFN=%lx, got %lx\n",
+                                  g->domain, g->gfn, mfn_x(mfn), mfn_x(o_mfn));
+                errors++;
+            }
+            if ( t != p2m_ram_shared )
+            {
+                MEM_SHARING_DEBUG("Incorrect P2M type for d=%hu, PFN=%lx MFN=%lx."
+                                  "Expecting t=%d, got %d\n",
+                                  g->domain, g->gfn, mfn_x(mfn), p2m_ram_shared, t);
+                errors++;
+            }
+            put_domain(d);
+            nr_gfns++;
+        }
+        if ( nr_gfns != (pg->u.inuse.type_info & PGT_count_mask) )
+        {
+            MEM_SHARING_DEBUG("Mismatched counts for MFN=%lx."
+                              "nr_gfns in list %lu, in type_info %lx\n",
+                              mfn_x(mfn), nr_gfns, 
+                              (pg->u.inuse.type_info & PGT_count_mask));
+            errors++;
         }
     }
 }
@@ -383,36 +370,6 @@
     return 0;
 }
 
-/* Account for a GFN being shared/unshared.
- * When sharing this function needs to be called _before_ gfn lists are merged
- * together, but _after_ gfn is removed from the list when unsharing.
- */
-static int mem_sharing_gfn_account(struct gfn_info *gfn, int sharing)
-{
-    struct domain *d;
-
-    /* A) When sharing:
-     * if the gfn being shared is in > 1 long list, its already been 
-     * accounted for
-     * B) When unsharing:
-     * if the list is longer than > 1, we don't have to account yet. 
-     */
-    if(list_has_one_entry(&gfn->list))
-    {
-        d = get_domain_by_id(gfn->domain);
-        BUG_ON(!d);
-        if(sharing) 
-            atomic_inc(&d->shr_pages);
-        else
-            atomic_dec(&d->shr_pages);
-        put_domain(d);
-
-        return 1;
-    }
-    mem_sharing_audit();
-
-    return 0;
-}
 
 int mem_sharing_debug_gref(struct domain *d, grant_ref_t ref)
 {
@@ -450,8 +407,6 @@
     mfn_t mfn;
     struct page_info *page;
     int ret;
-    shr_handle_t handle;
-    shr_hash_entry_t *hash_entry;
     struct gfn_info *gfn_info;
 
     *phandle = 0UL;
@@ -467,7 +422,7 @@
     /* Return the handle if the page is already shared */
     page = mfn_to_page(mfn);
     if ( p2m_is_shared(p2mt) ) {
-        *phandle = page->shr_handle;
+        *phandle = page->shared_info->handle;
         ret = 0;
         goto out;
     }
@@ -481,16 +436,26 @@
     if ( ret ) 
         goto out;
 
-    /* Create the handle */
+    /* Initialize the shared state */
     ret = -ENOMEM;
-    handle = next_handle++;  
-    if((hash_entry = mem_sharing_hash_insert(handle, mfn)) == NULL)
+    if ( (page->shared_info = 
+            xmalloc(struct page_sharing_info)) == NULL )
     {
+        BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
-    if((gfn_info = mem_sharing_gfn_alloc()) == NULL)
+    page->shared_info->pg = page;
+    INIT_LIST_HEAD(&page->shared_info->gfns);
+
+    /* Create the handle */
+    page->shared_info->handle = next_handle++;  
+
+    /* Create the local gfn info */
+    if ( (gfn_info = mem_sharing_gfn_alloc(page, d, gfn)) == NULL )
     {
-        mem_sharing_hash_destroy(hash_entry);
+        xfree(page->shared_info);
+        page->shared_info = NULL;
+        BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
 
@@ -501,23 +466,19 @@
          * it a few lines above.
          * The mfn needs to revert back to rw type. This should never fail,
          * since no-one knew that the mfn was temporarily sharable */
+        mem_sharing_gfn_destroy(d, gfn_info);
+        xfree(page->shared_info);
+        page->shared_info = NULL;
+        /* NOTE: We haven't yet added this to the audit list. */
         BUG_ON(page_make_private(d, page) != 0);
-        mem_sharing_hash_destroy(hash_entry);
-        mem_sharing_gfn_destroy(gfn_info, 0);
         goto out;
     }
 
     /* Update m2p entry to SHARED_M2P_ENTRY */
     set_gpfn_from_mfn(mfn_x(mfn), SHARED_M2P_ENTRY);
 
-    INIT_LIST_HEAD(&hash_entry->gfns);
-    INIT_LIST_HEAD(&gfn_info->list);
-    list_add(&gfn_info->list, &hash_entry->gfns);
-    gfn_info->gfn = gfn;
-    gfn_info->domain = d->domain_id;
-    page->shr_handle = handle;
-    *phandle = handle;
-
+    *phandle = page->shared_info->handle;
+    audit_add_list(page);
     ret = 0;
 
 out:
@@ -526,54 +487,82 @@
     return ret;
 }
 
-int mem_sharing_share_pages(shr_handle_t sh, shr_handle_t ch) 
+int mem_sharing_share_pages(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
+                            struct domain *cd, unsigned long cgfn, shr_handle_t ch) 
 {
-    shr_hash_entry_t *se, *ce;
     struct page_info *spage, *cpage;
     struct list_head *le, *te;
-    struct gfn_info *gfn;
+    gfn_info_t *gfn;
     struct domain *d;
-    int ret;
+    int ret = -EINVAL;
+    mfn_t smfn, cmfn;
+    p2m_type_t smfn_type, cmfn_type;
 
     shr_lock();
 
+    /* XXX if sd == cd handle potential deadlock by ordering
+     * the get_ and put_gfn's */
+    smfn = get_gfn(sd, sgfn, &smfn_type);
+    cmfn = get_gfn(cd, cgfn, &cmfn_type);
+
     ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
-    se = mem_sharing_hash_lookup(sh);
-    if(se == NULL) goto err_out;
+    spage = mem_sharing_lookup(mfn_x(smfn));
+    if ( spage == NULL )
+        goto err_out;
+    ASSERT(smfn_type == p2m_ram_shared);
     ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
-    ce = mem_sharing_hash_lookup(ch);
-    if(ce == NULL) goto err_out;
-    spage = mfn_to_page(se->mfn); 
-    cpage = mfn_to_page(ce->mfn); 
-    /* gfn lists always have at least one entry => save to call list_entry */
-    mem_sharing_gfn_account(gfn_get_info(&ce->gfns), 1);
-    mem_sharing_gfn_account(gfn_get_info(&se->gfns), 1);
-    list_for_each_safe(le, te, &ce->gfns)
+    cpage = mem_sharing_lookup(mfn_x(cmfn));
+    if ( cpage == NULL )
+        goto err_out;
+    ASSERT(cmfn_type == p2m_ram_shared);
+
+    /* Check that the handles match */
+    if ( spage->shared_info->handle != sh )
     {
-        gfn = list_entry(le, struct gfn_info, list);
-        /* Get the source page and type, this should never fail 
-         * because we are under shr lock, and got non-null se */
+        ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        goto err_out;
+    }
+    if ( cpage->shared_info->handle != ch )
+    {
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        goto err_out;
+    }
+
+    /* Merge the lists together */
+    list_for_each_safe(le, te, &cpage->shared_info->gfns)
+    {
+        gfn = list_entry(le, gfn_info_t, list);
+        /* Get the source page and type, this should never fail: 
+         * we are under shr lock, and got a successful lookup */
         BUG_ON(!get_page_and_type(spage, dom_cow, PGT_shared_page));
-        /* Move the gfn_info from ce list to se list */
+        /* Move the gfn_info from client list to source list */
         list_del(&gfn->list);
+        list_add(&gfn->list, &spage->shared_info->gfns);
+        put_page_and_type(cpage);
         d = get_domain_by_id(gfn->domain);
         BUG_ON(!d);
-        BUG_ON(set_shared_p2m_entry(d, gfn->gfn, se->mfn) == 0);
+        BUG_ON(set_shared_p2m_entry(d, gfn->gfn, smfn) == 0);
         put_domain(d);
-        list_add(&gfn->list, &se->gfns);
-        put_page_and_type(cpage);
-    } 
-    ASSERT(list_empty(&ce->gfns));
-    mem_sharing_hash_delete(ch);
-    atomic_inc(&nr_saved_mfns);
+    }
+    ASSERT(list_empty(&cpage->shared_info->gfns));
+
+    /* Clear the rest of the shared state */
+    audit_del_list(cpage);
+    xfree(cpage->shared_info);
+    cpage->shared_info = NULL;
+
     /* Free the client page */
     if(test_and_clear_bit(_PGC_allocated, &cpage->count_info))
         put_page(cpage);
+
+    /* We managed to free a domain page. */
+    atomic_inc(&nr_saved_mfns);
     ret = 0;
     
 err_out:
+    put_gfn(cd, cgfn);
+    put_gfn(sd, sgfn);
     shr_unlock();
-
     return ret;
 }
 
@@ -585,13 +574,9 @@
     mfn_t mfn;
     struct page_info *page, *old_page;
     void *s, *t;
-    int ret, last_gfn;
-    shr_hash_entry_t *hash_entry;
-    struct gfn_info *gfn_info = NULL;
-    shr_handle_t handle;
+    int last_gfn;
+    gfn_info_t *gfn_info = NULL;
     struct list_head *le;
-
-    /* Remove the gfn_info from the list */
    
     /* This is one of the reasons why we can't enforce ordering
      * between shr_lock and p2m fine-grained locks in mm-lock. 
@@ -607,56 +592,62 @@
         return 0;
     }
 
-    page = mfn_to_page(mfn);
-    handle = page->shr_handle;
- 
-    hash_entry = mem_sharing_hash_lookup(handle); 
-    list_for_each(le, &hash_entry->gfns)
+    page = mem_sharing_lookup(mfn_x(mfn));
+    if ( page == NULL )
     {
-        gfn_info = list_entry(le, struct gfn_info, list);
+        gdprintk(XENLOG_ERR, "Domain p2m is shared, but page is not: "
+                                "%lx\n", gfn);
+        BUG();
+    }
+
+    list_for_each(le, &page->shared_info->gfns)
+    {
+        gfn_info = list_entry(le, gfn_info_t, list);
         if ( (gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id) )
             goto gfn_found;
     }
     gdprintk(XENLOG_ERR, "Could not find gfn_info for shared gfn: "
                             "%lx\n", gfn);
     BUG();
-gfn_found: 
-    /* Delete gfn_info from the list, but hold on to it, until we've allocated
-     * memory to make a copy */
-    list_del(&gfn_info->list);
-    last_gfn = list_empty(&hash_entry->gfns);
 
+gfn_found:
+    /* Do the accounting first. If anything fails below, we have bigger
+     * bigger fish to fry. First, remove the gfn from the list. */ 
+    last_gfn = list_has_one_entry(&page->shared_info->gfns);
+    mem_sharing_gfn_destroy(d, gfn_info);
+    if ( last_gfn )
+    {
+        /* Clean up shared state */
+        audit_del_list(page);
+        xfree(page->shared_info);
+        page->shared_info = NULL;
+    }
+    else
+        atomic_dec(&nr_saved_mfns);
     /* If the GFN is getting destroyed drop the references to MFN 
      * (possibly freeing the page), and exit early */
     if ( flags & MEM_SHARING_DESTROY_GFN )
     {
-        mem_sharing_gfn_destroy(gfn_info, !last_gfn);
-        if(last_gfn) 
-            mem_sharing_hash_delete(handle);
-        else 
-            /* Even though we don't allocate a private page, we have to account
-             * for the MFN that originally backed this PFN. */
-            atomic_dec(&nr_saved_mfns);
         put_gfn(d, gfn);
         shr_unlock();
         put_page_and_type(page);
-        if(last_gfn && 
-           test_and_clear_bit(_PGC_allocated, &page->count_info)) 
+        if ( last_gfn && 
+            test_and_clear_bit(_PGC_allocated, &page->count_info) ) 
             put_page(page);
+
         return 0;
     }
  
-    ret = page_make_private(d, page);
-    BUG_ON(last_gfn & ret);
-    if(ret == 0) goto private_page_found;
-        
+    if ( last_gfn )
+    {
+        BUG_ON(page_make_private(d, page) != 0);
+        goto private_page_found;
+    }
+
     old_page = page;
     page = alloc_domheap_page(d, 0);
-    if(!page) 
+    if ( !page ) 
     {
-        /* We've failed to obtain memory for private page. Need to re-add the
-         * gfn_info to relevant list */
-        list_add(&gfn_info->list, &hash_entry->gfns);
         put_gfn(d, gfn);
         mem_sharing_notify_helper(d, gfn);
         shr_unlock();
@@ -669,30 +660,18 @@
     unmap_domain_page(s);
     unmap_domain_page(t);
 
-    /* NOTE: set_shared_p2m_entry will switch the underlying mfn. If
-     * we do get_page withing get_gfn, the correct sequence here
-     * should be
-       get_page(page);
-       put_page(old_page);
-     * so that the ref to the old page is dropped, and a ref to
-     * the new page is obtained to later be dropped in put_gfn */
     BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
     put_page_and_type(old_page);
 
 private_page_found:    
-    /* We've got a private page, we can commit the gfn destruction */
-    mem_sharing_gfn_destroy(gfn_info, !last_gfn);
-    if(last_gfn) 
-        mem_sharing_hash_delete(handle);
-    else
-        atomic_dec(&nr_saved_mfns);
-
     if ( p2m_change_type(d, gfn, p2m_ram_shared, p2m_ram_rw) != 
                                                 p2m_ram_shared ) 
     {
-        printk("Could not change p2m type.\n");
+        gdprintk(XENLOG_ERR, "Could not change p2m type d %hu gfn %lx.\n", 
+                                d->domain_id, gfn);
         BUG();
     }
+
     /* Update m2p entry */
     set_gpfn_from_mfn(mfn_x(page_to_mfn(page)), gfn);
 
@@ -749,9 +728,18 @@
 
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE:
         {
-            shr_handle_t sh = mec->u.share.source_handle;
-            shr_handle_t ch = mec->u.share.client_handle;
-            rc = mem_sharing_share_pages(sh, ch); 
+            unsigned long sgfn  = mec->u.share.source_gfn;
+            shr_handle_t sh     = mec->u.share.source_handle;
+            struct domain *cd   = get_domain_by_id(mec->u.share.client_domain);
+            if ( cd )
+            {
+                unsigned long cgfn  = mec->u.share.client_gfn;
+                shr_handle_t ch     = mec->u.share.client_handle;
+                rc = mem_sharing_share_pages(d, sgfn, sh, cd, cgfn, ch); 
+                put_domain(cd);
+            }
+            else
+                return -EEXIST;
         }
         break;
 
@@ -799,6 +787,9 @@
 void __init mem_sharing_init(void)
 {
     printk("Initing memory sharing.\n");
-    mem_sharing_hash_init();
+    mm_lock_init(&shr_lock);
+#if MEM_SHARING_AUDIT
+    INIT_LIST_HEAD(&shr_audit_list);
+#endif
 }
 
diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
@@ -22,13 +22,28 @@
 #ifndef __MEM_SHARING_H__
 #define __MEM_SHARING_H__
 
+#include <public/domctl.h>
+
+/* Auditing of memory sharing code? */
+#define MEM_SHARING_AUDIT 0
+
+typedef uint64_t shr_handle_t; 
+
+struct page_sharing_info
+{
+    struct page_info *pg;   /* Back pointer to the page. */
+    shr_handle_t handle;    /* Globally unique version / handle. */
+#if MEM_SHARING_AUDIT
+    struct list_head entry; /* List of all shared pages (entry). */
+#endif
+    struct list_head gfns;  /* List of domains and gfns for this page (head). */
+};
+
 #ifdef __x86_64__
 
 #define sharing_supported(_d) \
     (is_hvm_domain(_d) && paging_mode_hap(_d)) 
 
-typedef uint64_t shr_handle_t; 
-
 unsigned int mem_sharing_get_nr_saved_mfns(void);
 int mem_sharing_nominate_page(struct domain *d, 
                               unsigned long gfn,
diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -31,6 +31,8 @@
     __pdx_t next, prev;
 };
 
+struct page_sharing_info;
+
 struct page_info
 {
     union {
@@ -49,8 +51,13 @@
         /* For non-pinnable single-page shadows, a higher entry that points
          * at us. */
         paddr_t up;
-        /* For shared/sharable pages the sharing handle */
-        uint64_t shr_handle; 
+        /* For shared/sharable pages, we use a doubly-linked list
+         * of all the {pfn,domain} pairs that map this page. We also include
+         * an opaque handle, which is effectively a version, so that clients
+         * of sharing share the version they expect to.
+         * This list is allocated and freed when a page is shared/unshared.
+         */
+        struct page_sharing_info *shared_info;
     };
 
     /* Reference count and various PGC_xxx flags and fields. */
diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -789,7 +789,10 @@
             uint64_aligned_t  handle;     /* OUT: the handle           */
         } nominate;
         struct mem_sharing_op_share {     /* OP_SHARE */
+            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
             uint64_aligned_t source_handle; /* IN: handle to the source page */
+            domid_t          client_domain; /* IN: the client domain id */
+            uint64_aligned_t client_gfn;    /* IN: the client gfn */
             uint64_aligned_t client_handle; /* IN: handle to the client page */
         } share; 
         struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo94-0000l9-A7; Fri, 27 Jan 2012 15:55:22 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0000i5-KI
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1327679712!12830756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16570 invoked from network); 27 Jan 2012 15:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:13 -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 1Rqo8t-0002Jw-KP
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8t-0008RN-Gp
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:11 +0000
Message-Id: <E1Rqo8t-0008RN-Gp@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Eliminate hash table in
	sharing code as index of shared mfns
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 7bb1ba3dccb205d9925608d549cc764fa79ad5f1
# Parent  d8f280c785445856b2d6b8b9ff545d66917e7ba7
x86/mm: Eliminate hash table in sharing code as index of shared mfns

Eliminate the sharing hastable mechanism by storing a list head directly in the
page info for the case when the page is shared.  This does not add any extra
space to the page_info and serves to remove significant complexity from
sharing.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -3,6 +3,7 @@
  *
  * Memory sharing support.
  *
+ * Copyright (c) 2011 GridCentric, Inc. (Adin Scannell & Andres Lagar-Cavilla)
  * Copyright (c) 2009 Citrix Systems, Inc. (Grzegorz Milos)
  *
  * This program is free software; you can redistribute it and/or modify
@@ -34,15 +35,27 @@
 
 #include "mm-locks.h"
 
-/* Auditing of memory sharing code? */
-#define MEM_SHARING_AUDIT 0
-
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void);
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
+static struct list_head shr_audit_list;
+
+static inline void audit_add_list(struct page_info *page)
+{
+    INIT_LIST_HEAD(&page->shared_info->entry);
+    list_add(&page->shared_info->entry, &shr_audit_list);
+}
+
+static inline void audit_del_list(struct page_info *page)
+{
+    list_del(&page->shared_info->entry);
+}
 #else
-#define mem_sharing_audit() do {} while(0)
+#define mem_sharing_audit() ((void)0)
+
+#define audit_add_list(p)  ((void)0)
+#define audit_del_list(p)  ((void)0)
 #endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
@@ -58,17 +71,6 @@
 static shr_handle_t next_handle = 1;
 static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
 
-typedef struct shr_hash_entry 
-{
-    shr_handle_t handle;
-    mfn_t mfn; 
-    struct shr_hash_entry *next;
-    struct list_head gfns;
-} shr_hash_entry_t;
-
-#define SHR_HASH_LENGTH 1000
-static shr_hash_entry_t *shr_hash[SHR_HASH_LENGTH];
-
 typedef struct gfn_info
 {
     unsigned long gfn;
@@ -89,164 +91,149 @@
     return list_entry(list->next, gfn_info_t, list);
 }
 
-static void __init mem_sharing_hash_init(void)
+static inline gfn_info_t *mem_sharing_gfn_alloc(struct page_info *page,
+                                                struct domain *d,
+                                                unsigned long gfn)
 {
-    int i;
+    gfn_info_t *gfn_info = xmalloc(gfn_info_t);
 
-    mm_lock_init(&shr_lock);
-    for(i=0; i<SHR_HASH_LENGTH; i++)
-        shr_hash[i] = NULL;
+    if ( gfn_info == NULL )
+        return NULL; 
+
+    gfn_info->gfn = gfn;
+    gfn_info->domain = d->domain_id;
+    INIT_LIST_HEAD(&gfn_info->list);
+    list_add(&gfn_info->list, &page->shared_info->gfns);
+
+    /* Increment our number of shared pges. */
+    atomic_inc(&d->shr_pages);
+
+    return gfn_info;
 }
 
-static shr_hash_entry_t *mem_sharing_hash_alloc(void)
+static inline void mem_sharing_gfn_destroy(struct domain *d,
+                                           gfn_info_t *gfn_info)
 {
-    return xmalloc(shr_hash_entry_t); 
+    /* Decrement the number of pages. */
+    atomic_dec(&d->shr_pages);
+
+    /* Free the gfn_info structure. */
+    list_del(&gfn_info->list);
+    xfree(gfn_info);
 }
 
-static void mem_sharing_hash_destroy(shr_hash_entry_t *e)
+static struct page_info* mem_sharing_lookup(unsigned long mfn)
 {
-    xfree(e);
-}
-
-static gfn_info_t *mem_sharing_gfn_alloc(void)
-{
-    return xmalloc(gfn_info_t); 
-}
-
-static void mem_sharing_gfn_destroy(gfn_info_t *gfn, int was_shared)
-{
-    /* Decrement the number of pages, if the gfn was shared before */
-    if ( was_shared )
+    if ( mfn_valid(_mfn(mfn)) )
     {
-        struct domain *d = get_domain_by_id(gfn->domain);
-        /* Domain may have been destroyed by now *
-         * (if we are called from p2m_teardown)  */
-        if ( d )
+        struct page_info* page = mfn_to_page(_mfn(mfn));
+        if ( page_get_owner(page) == dom_cow )
         {
-            atomic_dec(&d->shr_pages);
-            put_domain(d);
+            ASSERT(page->u.inuse.type_info & PGT_type_mask); 
+            ASSERT(get_gpfn_from_mfn(mfn) == SHARED_M2P_ENTRY); 
+            return page;
         }
     }
-    xfree(gfn);
-}
-
-static shr_hash_entry_t* mem_sharing_hash_lookup(shr_handle_t handle)
-{
-    shr_hash_entry_t *e;
-    
-    e = shr_hash[handle % SHR_HASH_LENGTH]; 
-    while(e != NULL)
-    {
-        if(e->handle == handle)
-            return e;
-        e = e->next;
-    }
 
     return NULL;
 }
 
-static shr_hash_entry_t* mem_sharing_hash_insert(shr_handle_t handle, mfn_t mfn)
-{
-    shr_hash_entry_t *e, **ee;
-    
-    e = mem_sharing_hash_alloc();
-    if(e == NULL) return NULL;
-    e->handle = handle;
-    e->mfn = mfn;
-    ee = &shr_hash[handle % SHR_HASH_LENGTH]; 
-    e->next = *ee;
-    *ee = e;
-    return e;
-}
-
-static void mem_sharing_hash_delete(shr_handle_t handle)
-{
-    shr_hash_entry_t **pprev, *e;  
-
-    pprev = &shr_hash[handle % SHR_HASH_LENGTH];
-    e = *pprev;
-    while(e != NULL)
-    {
-        if(e->handle == handle)
-        {
-            *pprev = e->next;
-            mem_sharing_hash_destroy(e);
-            return;
-        }
-        pprev = &e->next;
-        e = e->next;
-    }
-    printk("Could not find shr entry for handle %"PRIx64"\n", handle);
-    BUG();
-} 
-
 #if MEM_SHARING_AUDIT
 static void mem_sharing_audit(void)
 {
-    shr_hash_entry_t *e;
-    struct list_head *le;
-    gfn_info_t *g;
-    int bucket;
-    struct page_info *pg;
+    int errors = 0;
+    struct list_head *ae;
 
     ASSERT(shr_locked_by_me());
 
-    for(bucket=0; bucket < SHR_HASH_LENGTH; bucket++)
+    list_for_each(ae, &shr_audit_list)
     {
-        e = shr_hash[bucket];    
-        /* Loop over all shr_hash_entries */ 
-        while(e != NULL)
+        struct page_sharing_info *shared_info;
+        unsigned long nr_gfns = 0;
+        struct page_info *pg;
+        struct list_head *le;
+        mfn_t mfn;
+
+        shared_info = list_entry(ae, struct page_sharing_info, entry);
+        pg = shared_info->pg;
+        mfn = page_to_mfn(pg);
+
+        /* Check if the MFN has correct type, owner and handle. */ 
+        if ( !(pg->u.inuse.type_info & PGT_shared_page) )
         {
-            int nr_gfns=0;
+           MEM_SHARING_DEBUG("mfn %lx in audit list, but not PGT_shared_page (%lx)!\n",
+                              mfn_x(mfn), pg->u.inuse.type_info & PGT_type_mask);
+           errors++;
+           continue;
+        }
 
-            /* Check if the MFN has correct type, owner and handle */ 
-            pg = mfn_to_page(e->mfn);
-            if((pg->u.inuse.type_info & PGT_type_mask) != PGT_shared_page)
-                MEM_SHARING_DEBUG("mfn %lx not shared, but in the hash!\n",
-                                   mfn_x(e->mfn));
-            if(page_get_owner(pg) != dom_cow)
-                MEM_SHARING_DEBUG("mfn %lx shared, but wrong owner (%d)!\n",
-                                   mfn_x(e->mfn), 
-                                   page_get_owner(pg)->domain_id);
-            if(e->handle != pg->shr_handle)
-                MEM_SHARING_DEBUG("mfn %lx shared, but wrong handle "
-                                  "(%ld != %ld)!\n",
-                                   mfn_x(e->mfn), pg->shr_handle, e->handle);
-            /* Check if all GFNs map to the MFN, and the p2m types */
-            list_for_each(le, &e->gfns)
+        /* Check the page owner. */
+        if ( page_get_owner(pg) != dom_cow )
+        {
+           MEM_SHARING_DEBUG("mfn %lx shared, but wrong owner (%hu)!\n",
+                             mfn_x(mfn), page_get_owner(pg)->domain_id);
+           errors++;
+        }
+
+        /* Check the m2p entry */
+        if ( get_gpfn_from_mfn(mfn_x(mfn)) != SHARED_M2P_ENTRY )
+        {
+           MEM_SHARING_DEBUG("mfn %lx shared, but wrong m2p entry (%lx)!\n",
+                             mfn_x(mfn), get_gpfn_from_mfn(mfn_x(mfn)));
+           errors++;
+        }
+
+        /* Check we have a list */
+        if ( (!pg->shared_info) || (list_empty(&pg->shared_info->gfns)) )
+        {
+           MEM_SHARING_DEBUG("mfn %lx shared, but empty gfn list!\n",
+                             mfn_x(mfn));
+           errors++;
+           continue;
+        }
+
+        /* Check if all GFNs map to the MFN, and the p2m types */
+        list_for_each(le, &pg->shared_info->gfns)
+        {
+            struct domain *d;
+            p2m_type_t t;
+            mfn_t o_mfn;
+            gfn_info_t *g;
+
+            g = list_entry(le, gfn_info_t, list);
+            d = get_domain_by_id(g->domain);
+            if ( d == NULL )
             {
-                struct domain *d;
-                p2m_type_t t;
-                mfn_t mfn;
-
-                g = list_entry(le, struct gfn_info, list);
-                d = get_domain_by_id(g->domain);
-                if(d == NULL)
-                {
-                    MEM_SHARING_DEBUG("Unknow dom: %d, for PFN=%lx, MFN=%lx\n",
-                            g->domain, g->gfn, mfn_x(e->mfn));
-                    continue;
-                }
-                mfn = get_gfn_unlocked(d, g->gfn, &t); 
-                if(mfn_x(mfn) != mfn_x(e->mfn))
-                    MEM_SHARING_DEBUG("Incorrect P2M for d=%d, PFN=%lx."
-                                      "Expecting MFN=%ld, got %ld\n",
-                                      g->domain, g->gfn, mfn_x(e->mfn),
-                                      mfn_x(mfn));
-                if(t != p2m_ram_shared)
-                    MEM_SHARING_DEBUG("Incorrect P2M type for d=%d, PFN=%lx."
-                                      "Expecting t=%d, got %d\n",
-                                      g->domain, g->gfn, mfn_x(e->mfn),
-                                      p2m_ram_shared, t);
-                put_domain(d);
-                nr_gfns++;
-            } 
-            if(nr_gfns != (pg->u.inuse.type_info & PGT_count_mask))
-                MEM_SHARING_DEBUG("Mismatched counts for MFN=%lx."
-                                  "nr_gfns in hash %d, in type_info %d\n",
-                                  mfn_x(e->mfn), nr_gfns, 
-                                 (pg->u.inuse.type_info & PGT_count_mask));
-            e = e->next;
+                MEM_SHARING_DEBUG("Unknown dom: %hu, for PFN=%lx, MFN=%lx\n",
+                                  g->domain, g->gfn, mfn_x(mfn));
+                errors++;
+                continue;
+            }
+            o_mfn = get_gfn_query_unlocked(d, g->gfn, &t); 
+            if ( mfn_x(o_mfn) != mfn_x(mfn) )
+            {
+                MEM_SHARING_DEBUG("Incorrect P2M for d=%hu, PFN=%lx."
+                                  "Expecting MFN=%lx, got %lx\n",
+                                  g->domain, g->gfn, mfn_x(mfn), mfn_x(o_mfn));
+                errors++;
+            }
+            if ( t != p2m_ram_shared )
+            {
+                MEM_SHARING_DEBUG("Incorrect P2M type for d=%hu, PFN=%lx MFN=%lx."
+                                  "Expecting t=%d, got %d\n",
+                                  g->domain, g->gfn, mfn_x(mfn), p2m_ram_shared, t);
+                errors++;
+            }
+            put_domain(d);
+            nr_gfns++;
+        }
+        if ( nr_gfns != (pg->u.inuse.type_info & PGT_count_mask) )
+        {
+            MEM_SHARING_DEBUG("Mismatched counts for MFN=%lx."
+                              "nr_gfns in list %lu, in type_info %lx\n",
+                              mfn_x(mfn), nr_gfns, 
+                              (pg->u.inuse.type_info & PGT_count_mask));
+            errors++;
         }
     }
 }
@@ -383,36 +370,6 @@
     return 0;
 }
 
-/* Account for a GFN being shared/unshared.
- * When sharing this function needs to be called _before_ gfn lists are merged
- * together, but _after_ gfn is removed from the list when unsharing.
- */
-static int mem_sharing_gfn_account(struct gfn_info *gfn, int sharing)
-{
-    struct domain *d;
-
-    /* A) When sharing:
-     * if the gfn being shared is in > 1 long list, its already been 
-     * accounted for
-     * B) When unsharing:
-     * if the list is longer than > 1, we don't have to account yet. 
-     */
-    if(list_has_one_entry(&gfn->list))
-    {
-        d = get_domain_by_id(gfn->domain);
-        BUG_ON(!d);
-        if(sharing) 
-            atomic_inc(&d->shr_pages);
-        else
-            atomic_dec(&d->shr_pages);
-        put_domain(d);
-
-        return 1;
-    }
-    mem_sharing_audit();
-
-    return 0;
-}
 
 int mem_sharing_debug_gref(struct domain *d, grant_ref_t ref)
 {
@@ -450,8 +407,6 @@
     mfn_t mfn;
     struct page_info *page;
     int ret;
-    shr_handle_t handle;
-    shr_hash_entry_t *hash_entry;
     struct gfn_info *gfn_info;
 
     *phandle = 0UL;
@@ -467,7 +422,7 @@
     /* Return the handle if the page is already shared */
     page = mfn_to_page(mfn);
     if ( p2m_is_shared(p2mt) ) {
-        *phandle = page->shr_handle;
+        *phandle = page->shared_info->handle;
         ret = 0;
         goto out;
     }
@@ -481,16 +436,26 @@
     if ( ret ) 
         goto out;
 
-    /* Create the handle */
+    /* Initialize the shared state */
     ret = -ENOMEM;
-    handle = next_handle++;  
-    if((hash_entry = mem_sharing_hash_insert(handle, mfn)) == NULL)
+    if ( (page->shared_info = 
+            xmalloc(struct page_sharing_info)) == NULL )
     {
+        BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
-    if((gfn_info = mem_sharing_gfn_alloc()) == NULL)
+    page->shared_info->pg = page;
+    INIT_LIST_HEAD(&page->shared_info->gfns);
+
+    /* Create the handle */
+    page->shared_info->handle = next_handle++;  
+
+    /* Create the local gfn info */
+    if ( (gfn_info = mem_sharing_gfn_alloc(page, d, gfn)) == NULL )
     {
-        mem_sharing_hash_destroy(hash_entry);
+        xfree(page->shared_info);
+        page->shared_info = NULL;
+        BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
 
@@ -501,23 +466,19 @@
          * it a few lines above.
          * The mfn needs to revert back to rw type. This should never fail,
          * since no-one knew that the mfn was temporarily sharable */
+        mem_sharing_gfn_destroy(d, gfn_info);
+        xfree(page->shared_info);
+        page->shared_info = NULL;
+        /* NOTE: We haven't yet added this to the audit list. */
         BUG_ON(page_make_private(d, page) != 0);
-        mem_sharing_hash_destroy(hash_entry);
-        mem_sharing_gfn_destroy(gfn_info, 0);
         goto out;
     }
 
     /* Update m2p entry to SHARED_M2P_ENTRY */
     set_gpfn_from_mfn(mfn_x(mfn), SHARED_M2P_ENTRY);
 
-    INIT_LIST_HEAD(&hash_entry->gfns);
-    INIT_LIST_HEAD(&gfn_info->list);
-    list_add(&gfn_info->list, &hash_entry->gfns);
-    gfn_info->gfn = gfn;
-    gfn_info->domain = d->domain_id;
-    page->shr_handle = handle;
-    *phandle = handle;
-
+    *phandle = page->shared_info->handle;
+    audit_add_list(page);
     ret = 0;
 
 out:
@@ -526,54 +487,82 @@
     return ret;
 }
 
-int mem_sharing_share_pages(shr_handle_t sh, shr_handle_t ch) 
+int mem_sharing_share_pages(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
+                            struct domain *cd, unsigned long cgfn, shr_handle_t ch) 
 {
-    shr_hash_entry_t *se, *ce;
     struct page_info *spage, *cpage;
     struct list_head *le, *te;
-    struct gfn_info *gfn;
+    gfn_info_t *gfn;
     struct domain *d;
-    int ret;
+    int ret = -EINVAL;
+    mfn_t smfn, cmfn;
+    p2m_type_t smfn_type, cmfn_type;
 
     shr_lock();
 
+    /* XXX if sd == cd handle potential deadlock by ordering
+     * the get_ and put_gfn's */
+    smfn = get_gfn(sd, sgfn, &smfn_type);
+    cmfn = get_gfn(cd, cgfn, &cmfn_type);
+
     ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
-    se = mem_sharing_hash_lookup(sh);
-    if(se == NULL) goto err_out;
+    spage = mem_sharing_lookup(mfn_x(smfn));
+    if ( spage == NULL )
+        goto err_out;
+    ASSERT(smfn_type == p2m_ram_shared);
     ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
-    ce = mem_sharing_hash_lookup(ch);
-    if(ce == NULL) goto err_out;
-    spage = mfn_to_page(se->mfn); 
-    cpage = mfn_to_page(ce->mfn); 
-    /* gfn lists always have at least one entry => save to call list_entry */
-    mem_sharing_gfn_account(gfn_get_info(&ce->gfns), 1);
-    mem_sharing_gfn_account(gfn_get_info(&se->gfns), 1);
-    list_for_each_safe(le, te, &ce->gfns)
+    cpage = mem_sharing_lookup(mfn_x(cmfn));
+    if ( cpage == NULL )
+        goto err_out;
+    ASSERT(cmfn_type == p2m_ram_shared);
+
+    /* Check that the handles match */
+    if ( spage->shared_info->handle != sh )
     {
-        gfn = list_entry(le, struct gfn_info, list);
-        /* Get the source page and type, this should never fail 
-         * because we are under shr lock, and got non-null se */
+        ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+        goto err_out;
+    }
+    if ( cpage->shared_info->handle != ch )
+    {
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        goto err_out;
+    }
+
+    /* Merge the lists together */
+    list_for_each_safe(le, te, &cpage->shared_info->gfns)
+    {
+        gfn = list_entry(le, gfn_info_t, list);
+        /* Get the source page and type, this should never fail: 
+         * we are under shr lock, and got a successful lookup */
         BUG_ON(!get_page_and_type(spage, dom_cow, PGT_shared_page));
-        /* Move the gfn_info from ce list to se list */
+        /* Move the gfn_info from client list to source list */
         list_del(&gfn->list);
+        list_add(&gfn->list, &spage->shared_info->gfns);
+        put_page_and_type(cpage);
         d = get_domain_by_id(gfn->domain);
         BUG_ON(!d);
-        BUG_ON(set_shared_p2m_entry(d, gfn->gfn, se->mfn) == 0);
+        BUG_ON(set_shared_p2m_entry(d, gfn->gfn, smfn) == 0);
         put_domain(d);
-        list_add(&gfn->list, &se->gfns);
-        put_page_and_type(cpage);
-    } 
-    ASSERT(list_empty(&ce->gfns));
-    mem_sharing_hash_delete(ch);
-    atomic_inc(&nr_saved_mfns);
+    }
+    ASSERT(list_empty(&cpage->shared_info->gfns));
+
+    /* Clear the rest of the shared state */
+    audit_del_list(cpage);
+    xfree(cpage->shared_info);
+    cpage->shared_info = NULL;
+
     /* Free the client page */
     if(test_and_clear_bit(_PGC_allocated, &cpage->count_info))
         put_page(cpage);
+
+    /* We managed to free a domain page. */
+    atomic_inc(&nr_saved_mfns);
     ret = 0;
     
 err_out:
+    put_gfn(cd, cgfn);
+    put_gfn(sd, sgfn);
     shr_unlock();
-
     return ret;
 }
 
@@ -585,13 +574,9 @@
     mfn_t mfn;
     struct page_info *page, *old_page;
     void *s, *t;
-    int ret, last_gfn;
-    shr_hash_entry_t *hash_entry;
-    struct gfn_info *gfn_info = NULL;
-    shr_handle_t handle;
+    int last_gfn;
+    gfn_info_t *gfn_info = NULL;
     struct list_head *le;
-
-    /* Remove the gfn_info from the list */
    
     /* This is one of the reasons why we can't enforce ordering
      * between shr_lock and p2m fine-grained locks in mm-lock. 
@@ -607,56 +592,62 @@
         return 0;
     }
 
-    page = mfn_to_page(mfn);
-    handle = page->shr_handle;
- 
-    hash_entry = mem_sharing_hash_lookup(handle); 
-    list_for_each(le, &hash_entry->gfns)
+    page = mem_sharing_lookup(mfn_x(mfn));
+    if ( page == NULL )
     {
-        gfn_info = list_entry(le, struct gfn_info, list);
+        gdprintk(XENLOG_ERR, "Domain p2m is shared, but page is not: "
+                                "%lx\n", gfn);
+        BUG();
+    }
+
+    list_for_each(le, &page->shared_info->gfns)
+    {
+        gfn_info = list_entry(le, gfn_info_t, list);
         if ( (gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id) )
             goto gfn_found;
     }
     gdprintk(XENLOG_ERR, "Could not find gfn_info for shared gfn: "
                             "%lx\n", gfn);
     BUG();
-gfn_found: 
-    /* Delete gfn_info from the list, but hold on to it, until we've allocated
-     * memory to make a copy */
-    list_del(&gfn_info->list);
-    last_gfn = list_empty(&hash_entry->gfns);
 
+gfn_found:
+    /* Do the accounting first. If anything fails below, we have bigger
+     * bigger fish to fry. First, remove the gfn from the list. */ 
+    last_gfn = list_has_one_entry(&page->shared_info->gfns);
+    mem_sharing_gfn_destroy(d, gfn_info);
+    if ( last_gfn )
+    {
+        /* Clean up shared state */
+        audit_del_list(page);
+        xfree(page->shared_info);
+        page->shared_info = NULL;
+    }
+    else
+        atomic_dec(&nr_saved_mfns);
     /* If the GFN is getting destroyed drop the references to MFN 
      * (possibly freeing the page), and exit early */
     if ( flags & MEM_SHARING_DESTROY_GFN )
     {
-        mem_sharing_gfn_destroy(gfn_info, !last_gfn);
-        if(last_gfn) 
-            mem_sharing_hash_delete(handle);
-        else 
-            /* Even though we don't allocate a private page, we have to account
-             * for the MFN that originally backed this PFN. */
-            atomic_dec(&nr_saved_mfns);
         put_gfn(d, gfn);
         shr_unlock();
         put_page_and_type(page);
-        if(last_gfn && 
-           test_and_clear_bit(_PGC_allocated, &page->count_info)) 
+        if ( last_gfn && 
+            test_and_clear_bit(_PGC_allocated, &page->count_info) ) 
             put_page(page);
+
         return 0;
     }
  
-    ret = page_make_private(d, page);
-    BUG_ON(last_gfn & ret);
-    if(ret == 0) goto private_page_found;
-        
+    if ( last_gfn )
+    {
+        BUG_ON(page_make_private(d, page) != 0);
+        goto private_page_found;
+    }
+
     old_page = page;
     page = alloc_domheap_page(d, 0);
-    if(!page) 
+    if ( !page ) 
     {
-        /* We've failed to obtain memory for private page. Need to re-add the
-         * gfn_info to relevant list */
-        list_add(&gfn_info->list, &hash_entry->gfns);
         put_gfn(d, gfn);
         mem_sharing_notify_helper(d, gfn);
         shr_unlock();
@@ -669,30 +660,18 @@
     unmap_domain_page(s);
     unmap_domain_page(t);
 
-    /* NOTE: set_shared_p2m_entry will switch the underlying mfn. If
-     * we do get_page withing get_gfn, the correct sequence here
-     * should be
-       get_page(page);
-       put_page(old_page);
-     * so that the ref to the old page is dropped, and a ref to
-     * the new page is obtained to later be dropped in put_gfn */
     BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
     put_page_and_type(old_page);
 
 private_page_found:    
-    /* We've got a private page, we can commit the gfn destruction */
-    mem_sharing_gfn_destroy(gfn_info, !last_gfn);
-    if(last_gfn) 
-        mem_sharing_hash_delete(handle);
-    else
-        atomic_dec(&nr_saved_mfns);
-
     if ( p2m_change_type(d, gfn, p2m_ram_shared, p2m_ram_rw) != 
                                                 p2m_ram_shared ) 
     {
-        printk("Could not change p2m type.\n");
+        gdprintk(XENLOG_ERR, "Could not change p2m type d %hu gfn %lx.\n", 
+                                d->domain_id, gfn);
         BUG();
     }
+
     /* Update m2p entry */
     set_gpfn_from_mfn(mfn_x(page_to_mfn(page)), gfn);
 
@@ -749,9 +728,18 @@
 
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE:
         {
-            shr_handle_t sh = mec->u.share.source_handle;
-            shr_handle_t ch = mec->u.share.client_handle;
-            rc = mem_sharing_share_pages(sh, ch); 
+            unsigned long sgfn  = mec->u.share.source_gfn;
+            shr_handle_t sh     = mec->u.share.source_handle;
+            struct domain *cd   = get_domain_by_id(mec->u.share.client_domain);
+            if ( cd )
+            {
+                unsigned long cgfn  = mec->u.share.client_gfn;
+                shr_handle_t ch     = mec->u.share.client_handle;
+                rc = mem_sharing_share_pages(d, sgfn, sh, cd, cgfn, ch); 
+                put_domain(cd);
+            }
+            else
+                return -EEXIST;
         }
         break;
 
@@ -799,6 +787,9 @@
 void __init mem_sharing_init(void)
 {
     printk("Initing memory sharing.\n");
-    mem_sharing_hash_init();
+    mm_lock_init(&shr_lock);
+#if MEM_SHARING_AUDIT
+    INIT_LIST_HEAD(&shr_audit_list);
+#endif
 }
 
diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
@@ -22,13 +22,28 @@
 #ifndef __MEM_SHARING_H__
 #define __MEM_SHARING_H__
 
+#include <public/domctl.h>
+
+/* Auditing of memory sharing code? */
+#define MEM_SHARING_AUDIT 0
+
+typedef uint64_t shr_handle_t; 
+
+struct page_sharing_info
+{
+    struct page_info *pg;   /* Back pointer to the page. */
+    shr_handle_t handle;    /* Globally unique version / handle. */
+#if MEM_SHARING_AUDIT
+    struct list_head entry; /* List of all shared pages (entry). */
+#endif
+    struct list_head gfns;  /* List of domains and gfns for this page (head). */
+};
+
 #ifdef __x86_64__
 
 #define sharing_supported(_d) \
     (is_hvm_domain(_d) && paging_mode_hap(_d)) 
 
-typedef uint64_t shr_handle_t; 
-
 unsigned int mem_sharing_get_nr_saved_mfns(void);
 int mem_sharing_nominate_page(struct domain *d, 
                               unsigned long gfn,
diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -31,6 +31,8 @@
     __pdx_t next, prev;
 };
 
+struct page_sharing_info;
+
 struct page_info
 {
     union {
@@ -49,8 +51,13 @@
         /* For non-pinnable single-page shadows, a higher entry that points
          * at us. */
         paddr_t up;
-        /* For shared/sharable pages the sharing handle */
-        uint64_t shr_handle; 
+        /* For shared/sharable pages, we use a doubly-linked list
+         * of all the {pfn,domain} pairs that map this page. We also include
+         * an opaque handle, which is effectively a version, so that clients
+         * of sharing share the version they expect to.
+         * This list is allocated and freed when a page is shared/unshared.
+         */
+        struct page_sharing_info *shared_info;
     };
 
     /* Reference count and various PGC_xxx flags and fields. */
diff -r d8f280c78544 -r 7bb1ba3dccb2 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Jan 26 11:06:40 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -789,7 +789,10 @@
             uint64_aligned_t  handle;     /* OUT: the handle           */
         } nominate;
         struct mem_sharing_op_share {     /* OP_SHARE */
+            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
             uint64_aligned_t source_handle; /* IN: handle to the source page */
+            domid_t          client_domain; /* IN: the client domain id */
+            uint64_aligned_t client_gfn;    /* IN: the client gfn */
             uint64_aligned_t client_handle; /* IN: handle to the client page */
         } share; 
         struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo95-0000nG-Ir; Fri, 27 Jan 2012 15:55:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0000iA-UP
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1327679714!12256982!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19554 invoked from network); 27 Jan 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:15 -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 1Rqo8w-0002K8-1u
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8w-0008SS-0a
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Message-Id: <E1Rqo8w-0008SS-0a@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Check how many mfns are
	shared, in addition to how many are saved
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 17c4c25a473bc25233ba224ebe4721c086b39847
# Parent  823829bde70517ae047c10a71b808bc1419d7dff
x86/mm: Check how many mfns are shared, in addition to how many are saved

This patch also moves the existing sharing-related memory op to the
correct location, and adds logic to the audit() method that uses the
new information.

This patch only provides the Xen implementation of the domctls.

Signed-off-by: Andres Lagar-Cavilla <andres@scannell.ca>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -119,7 +119,6 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
-#include <asm/mem_sharing.h>
 
 /*
  * Mapping of first 2 or 4 megabytes of memory. This is mapped with 4kB
@@ -5023,11 +5022,6 @@
         return rc;
     }
 
-#ifdef __x86_64__
-    case XENMEM_get_sharing_freed_pages:
-        return mem_sharing_get_nr_saved_mfns();
-#endif
-
     default:
         return subarch_memory_op(op, arg);
     }
diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -138,6 +138,7 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
+static atomic_t nr_shared_mfns  = ATOMIC_INIT(0);
 
 typedef struct gfn_info
 {
@@ -208,9 +209,12 @@
 static void mem_sharing_audit(void)
 {
     int errors = 0;
+    unsigned long count_expected;
+    unsigned long count_found = 0;
     struct list_head *ae;
 
     ASSERT(shr_locked_by_me());
+    count_expected = atomic_read(&nr_shared_mfns);
 
     list_for_each(ae, &shr_audit_list)
     {
@@ -258,6 +262,9 @@
            continue;
         }
 
+        /* We've found a page that is shared */
+        count_found++;
+
         /* Check if all GFNs map to the MFN, and the p2m types */
         list_for_each(le, &pg->shared_info->gfns)
         {
@@ -302,6 +309,14 @@
             errors++;
         }
     }
+
+    if ( count_found != count_expected )
+    {
+        MEM_SHARING_DEBUG("Expected %ld shared mfns, found %ld.",
+                          count_expected, count_found);
+        errors++;
+    }
+
 }
 #endif
 
@@ -342,6 +357,11 @@
     return ((unsigned int)atomic_read(&nr_saved_mfns));
 }
 
+unsigned int mem_sharing_get_nr_shared_mfns(void)
+{
+    return (unsigned int)atomic_read(&nr_shared_mfns);
+}
+
 int mem_sharing_sharing_resume(struct domain *d)
 {
     mem_event_response_t rsp;
@@ -663,6 +683,9 @@
         goto out;
     }
 
+    /* Account for this page. */
+    atomic_inc(&nr_shared_mfns);
+
     /* Update m2p entry to SHARED_M2P_ENTRY */
     set_gpfn_from_mfn(mfn_x(mfn), SHARED_M2P_ENTRY);
 
@@ -786,6 +809,7 @@
         put_page(cpage);
 
     /* We managed to free a domain page. */
+    atomic_dec(&nr_shared_mfns);
     atomic_inc(&nr_saved_mfns);
     ret = 0;
     
@@ -851,6 +875,7 @@
         audit_del_list(page);
         xfree(page->shared_info);
         page->shared_info = NULL;
+        atomic_dec(&nr_shared_mfns);
     }
     else
         atomic_dec(&nr_saved_mfns);
diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -205,6 +205,12 @@
         break;
     }
 
+    case XENMEM_get_sharing_freed_pages:
+        return mem_sharing_get_nr_saved_mfns();
+
+    case XENMEM_get_sharing_shared_pages:
+        return mem_sharing_get_nr_shared_mfns();
+
     default:
         rc = -ENOSYS;
         break;
diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/x86_64/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -34,6 +34,7 @@
 #include <asm/msr.h>
 #include <asm/setup.h>
 #include <asm/numa.h>
+#include <asm/mem_sharing.h>
 #include <public/memory.h>
 
 /* Parameters for PFN/MADDR compression. */
@@ -1093,6 +1094,12 @@
 
         break;
 
+    case XENMEM_get_sharing_freed_pages:
+        return mem_sharing_get_nr_saved_mfns();
+
+    case XENMEM_get_sharing_shared_pages:
+        return mem_sharing_get_nr_shared_mfns();
+
     default:
         rc = -ENOSYS;
         break;
diff -r 823829bde705 -r 17c4c25a473b xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
@@ -45,6 +45,7 @@
     (is_hvm_domain(_d) && paging_mode_hap(_d)) 
 
 unsigned int mem_sharing_get_nr_saved_mfns(void);
+unsigned int mem_sharing_get_nr_shared_mfns(void);
 int mem_sharing_nominate_page(struct domain *d, 
                               unsigned long gfn,
                               int expected_refcnt,
diff -r 823829bde705 -r 17c4c25a473b xen/include/public/memory.h
--- a/xen/include/public/memory.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/public/memory.h	Thu Jan 26 12:46:26 2012 +0000
@@ -294,6 +294,7 @@
  * The call never fails. 
  */
 #define XENMEM_get_sharing_freed_pages    18
+#define XENMEM_get_sharing_shared_pages   19
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo95-0000nG-Ir; Fri, 27 Jan 2012 15:55:23 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0000iA-UP
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1327679714!12256982!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19554 invoked from network); 27 Jan 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:15 -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 1Rqo8w-0002K8-1u
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8w-0008SS-0a
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Message-Id: <E1Rqo8w-0008SS-0a@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Check how many mfns are
	shared, in addition to how many are saved
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 17c4c25a473bc25233ba224ebe4721c086b39847
# Parent  823829bde70517ae047c10a71b808bc1419d7dff
x86/mm: Check how many mfns are shared, in addition to how many are saved

This patch also moves the existing sharing-related memory op to the
correct location, and adds logic to the audit() method that uses the
new information.

This patch only provides the Xen implementation of the domctls.

Signed-off-by: Andres Lagar-Cavilla <andres@scannell.ca>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -119,7 +119,6 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
-#include <asm/mem_sharing.h>
 
 /*
  * Mapping of first 2 or 4 megabytes of memory. This is mapped with 4kB
@@ -5023,11 +5022,6 @@
         return rc;
     }
 
-#ifdef __x86_64__
-    case XENMEM_get_sharing_freed_pages:
-        return mem_sharing_get_nr_saved_mfns();
-#endif
-
     default:
         return subarch_memory_op(op, arg);
     }
diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -138,6 +138,7 @@
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
 static atomic_t nr_saved_mfns   = ATOMIC_INIT(0); 
+static atomic_t nr_shared_mfns  = ATOMIC_INIT(0);
 
 typedef struct gfn_info
 {
@@ -208,9 +209,12 @@
 static void mem_sharing_audit(void)
 {
     int errors = 0;
+    unsigned long count_expected;
+    unsigned long count_found = 0;
     struct list_head *ae;
 
     ASSERT(shr_locked_by_me());
+    count_expected = atomic_read(&nr_shared_mfns);
 
     list_for_each(ae, &shr_audit_list)
     {
@@ -258,6 +262,9 @@
            continue;
         }
 
+        /* We've found a page that is shared */
+        count_found++;
+
         /* Check if all GFNs map to the MFN, and the p2m types */
         list_for_each(le, &pg->shared_info->gfns)
         {
@@ -302,6 +309,14 @@
             errors++;
         }
     }
+
+    if ( count_found != count_expected )
+    {
+        MEM_SHARING_DEBUG("Expected %ld shared mfns, found %ld.",
+                          count_expected, count_found);
+        errors++;
+    }
+
 }
 #endif
 
@@ -342,6 +357,11 @@
     return ((unsigned int)atomic_read(&nr_saved_mfns));
 }
 
+unsigned int mem_sharing_get_nr_shared_mfns(void)
+{
+    return (unsigned int)atomic_read(&nr_shared_mfns);
+}
+
 int mem_sharing_sharing_resume(struct domain *d)
 {
     mem_event_response_t rsp;
@@ -663,6 +683,9 @@
         goto out;
     }
 
+    /* Account for this page. */
+    atomic_inc(&nr_shared_mfns);
+
     /* Update m2p entry to SHARED_M2P_ENTRY */
     set_gpfn_from_mfn(mfn_x(mfn), SHARED_M2P_ENTRY);
 
@@ -786,6 +809,7 @@
         put_page(cpage);
 
     /* We managed to free a domain page. */
+    atomic_dec(&nr_shared_mfns);
     atomic_inc(&nr_saved_mfns);
     ret = 0;
     
@@ -851,6 +875,7 @@
         audit_del_list(page);
         xfree(page->shared_info);
         page->shared_info = NULL;
+        atomic_dec(&nr_shared_mfns);
     }
     else
         atomic_dec(&nr_saved_mfns);
diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -205,6 +205,12 @@
         break;
     }
 
+    case XENMEM_get_sharing_freed_pages:
+        return mem_sharing_get_nr_saved_mfns();
+
+    case XENMEM_get_sharing_shared_pages:
+        return mem_sharing_get_nr_shared_mfns();
+
     default:
         rc = -ENOSYS;
         break;
diff -r 823829bde705 -r 17c4c25a473b xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/x86_64/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -34,6 +34,7 @@
 #include <asm/msr.h>
 #include <asm/setup.h>
 #include <asm/numa.h>
+#include <asm/mem_sharing.h>
 #include <public/memory.h>
 
 /* Parameters for PFN/MADDR compression. */
@@ -1093,6 +1094,12 @@
 
         break;
 
+    case XENMEM_get_sharing_freed_pages:
+        return mem_sharing_get_nr_saved_mfns();
+
+    case XENMEM_get_sharing_shared_pages:
+        return mem_sharing_get_nr_shared_mfns();
+
     default:
         rc = -ENOSYS;
         break;
diff -r 823829bde705 -r 17c4c25a473b xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
@@ -45,6 +45,7 @@
     (is_hvm_domain(_d) && paging_mode_hap(_d)) 
 
 unsigned int mem_sharing_get_nr_saved_mfns(void);
+unsigned int mem_sharing_get_nr_shared_mfns(void);
 int mem_sharing_nominate_page(struct domain *d, 
                               unsigned long gfn,
                               int expected_refcnt,
diff -r 823829bde705 -r 17c4c25a473b xen/include/public/memory.h
--- a/xen/include/public/memory.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/public/memory.h	Thu Jan 26 12:46:26 2012 +0000
@@ -294,6 +294,7 @@
  * The call never fails. 
  */
 #define XENMEM_get_sharing_freed_pages    18
+#define XENMEM_get_sharing_shared_pages   19
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo96-0000pB-R8; Fri, 27 Jan 2012 15:55:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-0000iV-4l
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1327679715!12850977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2099 invoked from network); 27 Jan 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:15 -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 1Rqo8w-0002KB-JI
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8w-0008Sh-HD
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Message-Id: <E1Rqo8w-0008Sh-HD@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: New domctl: add a shared
	page to the physmap
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 5ff03ebd32cc6cceed7fa931f826f0b6bcde8e41
# Parent  17c4c25a473bc25233ba224ebe4721c086b39847
x86/mm: New domctl: add a shared page to the physmap

This domctl is useful to, for example, populate parts of a domain's physmap
with shared frames, directly.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 17c4c25a473b -r 5ff03ebd32cc xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -820,6 +820,73 @@
     return ret;
 }
 
+int mem_sharing_add_to_physmap(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
+                            struct domain *cd, unsigned long cgfn) 
+{
+    struct page_info *spage;
+    int ret = -EINVAL;
+    mfn_t smfn, cmfn;
+    p2m_type_t smfn_type, cmfn_type;
+    struct gfn_info *gfn_info;
+    struct p2m_domain *p2m = p2m_get_hostp2m(cd);
+    p2m_access_t a;
+    
+    /* XXX if sd == cd handle potential deadlock by ordering
+     * the get_ and put_gfn's */
+    smfn = get_gfn_query(sd, sgfn, &smfn_type);
+    cmfn = get_gfn_type_access(p2m, cgfn, &cmfn_type, &a, p2m_query, NULL);
+
+    /* Get the source shared page, check and lock */
+    ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+    spage = __grab_shared_page(smfn);
+    if ( spage == NULL )
+        goto err_out;
+    ASSERT(smfn_type == p2m_ram_shared);
+
+    /* Check that the handles match */
+    if ( spage->shared_info->handle != sh )
+        goto err_unlock;
+
+    /* Make sure the target page is a hole in the physmap */
+    if ( mfn_valid(cmfn) ||
+         (!(p2m_is_ram(cmfn_type))) )
+    {
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        goto err_unlock;
+    }
+
+    /* This is simpler than regular sharing */
+    BUG_ON(!get_page_and_type(spage, dom_cow, PGT_shared_page));
+    if ( (gfn_info = mem_sharing_gfn_alloc(spage, cd, cgfn)) == NULL )
+    {
+        put_page_and_type(spage);
+        ret = -ENOMEM;
+        goto err_unlock;
+    }
+
+    p2m_lock(p2m);
+    ret = set_p2m_entry(p2m, cgfn, smfn, PAGE_ORDER_4K, p2m_ram_shared, a);
+    p2m_unlock(p2m);
+
+    /* Tempted to turn this into an assert */
+    if ( !ret )
+    {
+        ret = -ENOENT;
+        mem_sharing_gfn_destroy(cd, gfn_info);
+        put_page_and_type(spage);
+    } else
+        ret = 0;
+
+    atomic_inc(&nr_saved_mfns);
+
+err_unlock:
+    mem_sharing_page_unlock(spage);
+err_out:
+    put_gfn(cd, cgfn);
+    put_gfn(sd, sgfn);
+    return ret;
+}
+
 int mem_sharing_unshare_page(struct domain *d,
                              unsigned long gfn, 
                              uint16_t flags)
@@ -1042,6 +1109,42 @@
         }
         break;
 
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP:
+        {
+            unsigned long sgfn, cgfn;
+            struct domain *cd;
+            shr_handle_t sh;
+
+            if ( !mem_sharing_enabled(d) )
+                return -EINVAL;
+
+            cd = get_domain_by_id(mec->u.share.client_domain);
+            if ( !cd )
+                return -ESRCH;
+
+            if ( !mem_sharing_enabled(cd) )
+            {
+                put_domain(cd);
+                return -EINVAL;
+            }
+
+            if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.source_gfn) )
+            {
+                /* Cannot add a gref to the physmap */
+                put_domain(cd);
+                return -EINVAL;
+            }
+
+            sgfn    = mec->u.share.source_gfn;
+            sh      = mec->u.share.source_handle;
+            cgfn    = mec->u.share.client_gfn;
+
+            rc = mem_sharing_add_to_physmap(d, sgfn, sh, cd, cgfn); 
+
+            put_domain(cd);
+        }
+        break;
+
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME:
         {
             if ( !mem_sharing_enabled(d) )
diff -r 17c4c25a473b -r 5ff03ebd32cc xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -771,6 +771,7 @@
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN      5
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN      6
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF     7
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP    8
 
 #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
 #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)
@@ -801,7 +802,7 @@
             } u;
             uint64_aligned_t  handle;     /* OUT: the handle           */
         } nominate;
-        struct mem_sharing_op_share {     /* OP_SHARE */
+        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
             uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
             uint64_aligned_t source_handle; /* IN: handle to the source page */
             domid_t          client_domain; /* IN: the client domain id */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo96-0000pB-R8; Fri, 27 Jan 2012 15:55:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-0000iV-4l
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1327679715!12850977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2099 invoked from network); 27 Jan 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:15 -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 1Rqo8w-0002KB-JI
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8w-0008Sh-HD
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:14 +0000
Message-Id: <E1Rqo8w-0008Sh-HD@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: New domctl: add a shared
	page to the physmap
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 5ff03ebd32cc6cceed7fa931f826f0b6bcde8e41
# Parent  17c4c25a473bc25233ba224ebe4721c086b39847
x86/mm: New domctl: add a shared page to the physmap

This domctl is useful to, for example, populate parts of a domain's physmap
with shared frames, directly.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 17c4c25a473b -r 5ff03ebd32cc xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -820,6 +820,73 @@
     return ret;
 }
 
+int mem_sharing_add_to_physmap(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
+                            struct domain *cd, unsigned long cgfn) 
+{
+    struct page_info *spage;
+    int ret = -EINVAL;
+    mfn_t smfn, cmfn;
+    p2m_type_t smfn_type, cmfn_type;
+    struct gfn_info *gfn_info;
+    struct p2m_domain *p2m = p2m_get_hostp2m(cd);
+    p2m_access_t a;
+    
+    /* XXX if sd == cd handle potential deadlock by ordering
+     * the get_ and put_gfn's */
+    smfn = get_gfn_query(sd, sgfn, &smfn_type);
+    cmfn = get_gfn_type_access(p2m, cgfn, &cmfn_type, &a, p2m_query, NULL);
+
+    /* Get the source shared page, check and lock */
+    ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
+    spage = __grab_shared_page(smfn);
+    if ( spage == NULL )
+        goto err_out;
+    ASSERT(smfn_type == p2m_ram_shared);
+
+    /* Check that the handles match */
+    if ( spage->shared_info->handle != sh )
+        goto err_unlock;
+
+    /* Make sure the target page is a hole in the physmap */
+    if ( mfn_valid(cmfn) ||
+         (!(p2m_is_ram(cmfn_type))) )
+    {
+        ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
+        goto err_unlock;
+    }
+
+    /* This is simpler than regular sharing */
+    BUG_ON(!get_page_and_type(spage, dom_cow, PGT_shared_page));
+    if ( (gfn_info = mem_sharing_gfn_alloc(spage, cd, cgfn)) == NULL )
+    {
+        put_page_and_type(spage);
+        ret = -ENOMEM;
+        goto err_unlock;
+    }
+
+    p2m_lock(p2m);
+    ret = set_p2m_entry(p2m, cgfn, smfn, PAGE_ORDER_4K, p2m_ram_shared, a);
+    p2m_unlock(p2m);
+
+    /* Tempted to turn this into an assert */
+    if ( !ret )
+    {
+        ret = -ENOENT;
+        mem_sharing_gfn_destroy(cd, gfn_info);
+        put_page_and_type(spage);
+    } else
+        ret = 0;
+
+    atomic_inc(&nr_saved_mfns);
+
+err_unlock:
+    mem_sharing_page_unlock(spage);
+err_out:
+    put_gfn(cd, cgfn);
+    put_gfn(sd, sgfn);
+    return ret;
+}
+
 int mem_sharing_unshare_page(struct domain *d,
                              unsigned long gfn, 
                              uint16_t flags)
@@ -1042,6 +1109,42 @@
         }
         break;
 
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP:
+        {
+            unsigned long sgfn, cgfn;
+            struct domain *cd;
+            shr_handle_t sh;
+
+            if ( !mem_sharing_enabled(d) )
+                return -EINVAL;
+
+            cd = get_domain_by_id(mec->u.share.client_domain);
+            if ( !cd )
+                return -ESRCH;
+
+            if ( !mem_sharing_enabled(cd) )
+            {
+                put_domain(cd);
+                return -EINVAL;
+            }
+
+            if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.source_gfn) )
+            {
+                /* Cannot add a gref to the physmap */
+                put_domain(cd);
+                return -EINVAL;
+            }
+
+            sgfn    = mec->u.share.source_gfn;
+            sh      = mec->u.share.source_handle;
+            cgfn    = mec->u.share.client_gfn;
+
+            rc = mem_sharing_add_to_physmap(d, sgfn, sh, cd, cgfn); 
+
+            put_domain(cd);
+        }
+        break;
+
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME:
         {
             if ( !mem_sharing_enabled(d) )
diff -r 17c4c25a473b -r 5ff03ebd32cc xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -771,6 +771,7 @@
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN      5
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN      6
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF     7
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP    8
 
 #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
 #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)
@@ -801,7 +802,7 @@
             } u;
             uint64_aligned_t  handle;     /* OUT: the handle           */
         } nominate;
-        struct mem_sharing_op_share {     /* OP_SHARE */
+        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
             uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
             uint64_aligned_t source_handle; /* IN: handle to the source page */
             domid_t          client_domain; /* IN: the client domain id */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo97-0000pU-0S; Fri, 27 Jan 2012 15:55:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-0000if-T1
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1327679716!10264724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21228 invoked from network); 27 Jan 2012 15:55:17 -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;
	27 Jan 2012 15:55:17 -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 1Rqo8y-0002KN-Jp
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8y-0008Th-Ii
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Message-Id: <E1Rqo8y-0008Th-Ii@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: Expose to libxc the total
	number of shared frames and space saved
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 1a3e534cd11e7ed93ccd98b892a8c255c2d05287
# Parent  3822ed1804623555f9e05ba7e8bf5fa2430cebcb
Tools: Expose to libxc the total number of shared frames and space saved

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 3822ed180462 -r 1a3e534cd11e tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
@@ -225,3 +225,13 @@
     return do_domctl(xch, &domctl);
 }
 
+long xc_sharing_freed_pages(xc_interface *xch)
+{
+    return do_memory_op(xch, XENMEM_get_sharing_freed_pages, NULL, 0);
+}
+
+long xc_sharing_used_frames(xc_interface *xch)
+{
+    return do_memory_op(xch, XENMEM_get_sharing_shared_pages, NULL, 0);
+}
+
diff -r 3822ed180462 -r 1a3e534cd11e tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -1228,6 +1228,23 @@
 /* System wide memory properties */
 long xc_maximum_ram_page(xc_interface *xch);
 
+/**
+ * This function returns the total number of pages freed by using sharing
+ * on the system.  For example, if two domains contain a single entry in
+ * their p2m map that points to the same shared page (and no other pages
+ * in the system are shared), then this function should return 1.
+ */
+long xc_sharing_freed_pages(xc_interface *xch);
+
+/**
+ * This function returns the total number of frames occupied by shared
+ * pages on the system.  This is independent of the number of domains
+ * pointing at these frames.  For example, in the above scenario this
+ * should return 1. The following should hold:
+ *  memory usage without sharing = freed_pages + used_frames
+ */
+long xc_sharing_used_frames(xc_interface *xch);
+
 /* Get current total pages allocated to a domain. */
 long xc_get_tot_pages(xc_interface *xch, uint32_t domid);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo97-0000pU-0S; Fri, 27 Jan 2012 15:55:25 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-0000if-T1
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1327679716!10264724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21228 invoked from network); 27 Jan 2012 15:55:17 -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;
	27 Jan 2012 15:55:17 -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 1Rqo8y-0002KN-Jp
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8y-0008Th-Ii
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Message-Id: <E1Rqo8y-0008Th-Ii@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: Expose to libxc the total
	number of shared frames and space saved
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 1a3e534cd11e7ed93ccd98b892a8c255c2d05287
# Parent  3822ed1804623555f9e05ba7e8bf5fa2430cebcb
Tools: Expose to libxc the total number of shared frames and space saved

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 3822ed180462 -r 1a3e534cd11e tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
@@ -225,3 +225,13 @@
     return do_domctl(xch, &domctl);
 }
 
+long xc_sharing_freed_pages(xc_interface *xch)
+{
+    return do_memory_op(xch, XENMEM_get_sharing_freed_pages, NULL, 0);
+}
+
+long xc_sharing_used_frames(xc_interface *xch)
+{
+    return do_memory_op(xch, XENMEM_get_sharing_shared_pages, NULL, 0);
+}
+
diff -r 3822ed180462 -r 1a3e534cd11e tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -1228,6 +1228,23 @@
 /* System wide memory properties */
 long xc_maximum_ram_page(xc_interface *xch);
 
+/**
+ * This function returns the total number of pages freed by using sharing
+ * on the system.  For example, if two domains contain a single entry in
+ * their p2m map that points to the same shared page (and no other pages
+ * in the system are shared), then this function should return 1.
+ */
+long xc_sharing_freed_pages(xc_interface *xch);
+
+/**
+ * This function returns the total number of frames occupied by shared
+ * pages on the system.  This is independent of the number of domains
+ * pointing at these frames.  For example, in the above scenario this
+ * should return 1. The following should hold:
+ *  memory usage without sharing = freed_pages + used_frames
+ */
+long xc_sharing_used_frames(xc_interface *xch);
+
 /* Get current total pages allocated to a domain. */
 long xc_get_tot_pages(xc_interface *xch, uint32_t domid);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo95-0000nQ-Lc; Fri, 27 Jan 2012 15:55:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-0000iG-Ap
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1327679679!50072354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2802 invoked from network); 27 Jan 2012 15:54:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:54:40 -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 1Rqo8x-0002KE-3V
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8x-0008Sw-2I
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Message-Id: <E1Rqo8x-0008Sw-2I@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add the ability to poll stats about
	shared memory via the console
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID cdeb8a70e4ed82877c0f75b3e131783e5b714ccc
# Parent  5ff03ebd32cc6cceed7fa931f826f0b6bcde8e41
Add the ability to poll stats about shared memory via the console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/ia64/xen/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -3574,6 +3574,11 @@
     return 0;
 }
 
+/* Simple no-op */
+void arch_dump_shared_mem_info(void)
+{
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -113,6 +113,7 @@
 #include <asm/e820.h>
 #include <asm/hypercall.h>
 #include <asm/shared.h>
+#include <asm/mem_sharing.h>
 #include <public/memory.h>
 #include <public/sched.h>
 #include <xsm/xsm.h>
@@ -5831,6 +5832,19 @@
     memguard_unguard_range(p, PAGE_SIZE);
 }
 
+#if defined(__x86_64__)
+void arch_dump_shared_mem_info(void)
+{
+    printk("Shared frames %u -- Saved frames %u\n",
+            mem_sharing_get_nr_shared_mfns(),
+            mem_sharing_get_nr_saved_mfns());
+}
+#else
+void arch_dump_shared_mem_info(void)
+{
+}
+#endif
+
 /*
  * Local variables:
  * mode: C
diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/common/keyhandler.c	Thu Jan 26 12:46:26 2012 +0000
@@ -15,6 +15,7 @@
 #include <xen/compat.h>
 #include <xen/ctype.h>
 #include <xen/perfc.h>
+#include <xen/mm.h>
 #include <xen/init.h>
 #include <asm/debugger.h>
 #include <asm/div64.h>
@@ -249,8 +250,8 @@
         printk("    refcnt=%d dying=%d pause_count=%d\n",
                atomic_read(&d->refcnt), d->is_dying,
                atomic_read(&d->pause_count));
-        printk("    nr_pages=%d xenheap_pages=%d dirty_cpus=%s max_pages=%u\n",
-               d->tot_pages, d->xenheap_pages, tmpstr, d->max_pages);
+        printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u dirty_cpus=%s max_pages=%u\n",
+               d->tot_pages, d->xenheap_pages, atomic_read(&d->shr_pages), tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
                d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
@@ -309,6 +310,8 @@
         }
     }
 
+    arch_dump_shared_mem_info();
+
     rcu_read_unlock(&domlist_read_lock);
 #undef tmpstr
 }
diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/xen/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -72,6 +72,9 @@
     unsigned int order,
     unsigned int memflags);
 
+/* Dump info to serial console */
+void arch_dump_shared_mem_info(void);
+
 /* memflags: */
 #define _MEMF_no_refcount 0
 #define  MEMF_no_refcount (1U<<_MEMF_no_refcount)

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo95-0000nQ-Lc; Fri, 27 Jan 2012 15:55:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-0000iG-Ap
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1327679679!50072354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2802 invoked from network); 27 Jan 2012 15:54:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:54:40 -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 1Rqo8x-0002KE-3V
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8x-0008Sw-2I
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Message-Id: <E1Rqo8x-0008Sw-2I@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add the ability to poll stats about
	shared memory via the console
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID cdeb8a70e4ed82877c0f75b3e131783e5b714ccc
# Parent  5ff03ebd32cc6cceed7fa931f826f0b6bcde8e41
Add the ability to poll stats about shared memory via the console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/ia64/xen/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -3574,6 +3574,11 @@
     return 0;
 }
 
+/* Simple no-op */
+void arch_dump_shared_mem_info(void)
+{
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 12:46:26 2012 +0000
@@ -113,6 +113,7 @@
 #include <asm/e820.h>
 #include <asm/hypercall.h>
 #include <asm/shared.h>
+#include <asm/mem_sharing.h>
 #include <public/memory.h>
 #include <public/sched.h>
 #include <xsm/xsm.h>
@@ -5831,6 +5832,19 @@
     memguard_unguard_range(p, PAGE_SIZE);
 }
 
+#if defined(__x86_64__)
+void arch_dump_shared_mem_info(void)
+{
+    printk("Shared frames %u -- Saved frames %u\n",
+            mem_sharing_get_nr_shared_mfns(),
+            mem_sharing_get_nr_saved_mfns());
+}
+#else
+void arch_dump_shared_mem_info(void)
+{
+}
+#endif
+
 /*
  * Local variables:
  * mode: C
diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/common/keyhandler.c	Thu Jan 26 12:46:26 2012 +0000
@@ -15,6 +15,7 @@
 #include <xen/compat.h>
 #include <xen/ctype.h>
 #include <xen/perfc.h>
+#include <xen/mm.h>
 #include <xen/init.h>
 #include <asm/debugger.h>
 #include <asm/div64.h>
@@ -249,8 +250,8 @@
         printk("    refcnt=%d dying=%d pause_count=%d\n",
                atomic_read(&d->refcnt), d->is_dying,
                atomic_read(&d->pause_count));
-        printk("    nr_pages=%d xenheap_pages=%d dirty_cpus=%s max_pages=%u\n",
-               d->tot_pages, d->xenheap_pages, tmpstr, d->max_pages);
+        printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u dirty_cpus=%s max_pages=%u\n",
+               d->tot_pages, d->xenheap_pages, atomic_read(&d->shr_pages), tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
                d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
@@ -309,6 +310,8 @@
         }
     }
 
+    arch_dump_shared_mem_info();
+
     rcu_read_unlock(&domlist_read_lock);
 #undef tmpstr
 }
diff -r 5ff03ebd32cc -r cdeb8a70e4ed xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/xen/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -72,6 +72,9 @@
     unsigned int order,
     unsigned int memflags);
 
+/* Dump info to serial console */
+void arch_dump_shared_mem_info(void);
+
 /* memflags: */
 #define _MEMF_no_refcount 0
 #define  MEMF_no_refcount (1U<<_MEMF_no_refcount)

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo96-0000pM-UB; Fri, 27 Jan 2012 15:55:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-0000jT-7h
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327679587!50340244!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9970 invoked from network); 27 Jan 2012 15:53:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:53:08 -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 1Rqo8z-0002KT-K9
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0008UB-Ix
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Message-Id: <E1Rqo8z-0008UB-Ix@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Sharing overhaul style
	improvements
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 89fdabcf315fdaabeebf05c51a6b3b6dd4c20e85
# Parent  aadccbbbb84664a907d3c5287ca39cbceb4e3fa3
x86/mm: Sharing overhaul style improvements

The name 'shared_info' for the list of shared pages backed by a share frame
collided with the identifier also used for a domain's shared info page. To
avoid grep/cscope/etc aliasing, rename the shared memory token to 'sharing.

This patch only addresses style, and performs no functional changes. To ease
reviwing, the patch was left as a stand-alone last-slot addition to the queue
to avoid propagating changes throughout the whole series.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r aadccbbbb846 -r 89fdabcf315f xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -64,19 +64,19 @@
 
 static inline void audit_add_list(struct page_info *page)
 {
-    INIT_LIST_HEAD(&page->shared_info->entry);
+    INIT_LIST_HEAD(&page->sharing->entry);
     spin_lock(&shr_audit_lock);
-    list_add_rcu(&page->shared_info->entry, &shr_audit_list);
+    list_add_rcu(&page->sharing->entry, &shr_audit_list);
     spin_unlock(&shr_audit_lock);
 }
 
 static inline void audit_del_list(struct page_info *page)
 {
     spin_lock(&shr_audit_lock);
-    list_del_rcu(&page->shared_info->entry);
+    list_del_rcu(&page->sharing->entry);
     spin_unlock(&shr_audit_lock);
-    INIT_RCU_HEAD(&page->shared_info->rcu_head);
-    call_rcu(&page->shared_info->rcu_head, _free_pg_shared_info);
+    INIT_RCU_HEAD(&page->sharing->rcu_head);
+    call_rcu(&page->sharing->rcu_head, _free_pg_shared_info);
 }
 
 #else
@@ -86,7 +86,7 @@
 #define audit_add_list(p)  ((void)0)
 static inline void audit_del_list(struct page_info *page)
 {
-    xfree(page->shared_info);
+    xfree(page->sharing);
 }
 
 #endif /* MEM_SHARING_AUDIT */
@@ -171,7 +171,7 @@
     gfn_info->gfn = gfn;
     gfn_info->domain = d->domain_id;
     INIT_LIST_HEAD(&gfn_info->list);
-    list_add(&gfn_info->list, &page->shared_info->gfns);
+    list_add(&gfn_info->list, &page->sharing->gfns);
 
     /* Increment our number of shared pges. */
     atomic_inc(&d->shr_pages);
@@ -220,14 +220,14 @@
 
     list_for_each_rcu(ae, &shr_audit_list)
     {
-        struct page_sharing_info *shared_info;
+        struct page_sharing_info *pg_shared_info;
         unsigned long nr_gfns = 0;
         struct page_info *pg;
         struct list_head *le;
         mfn_t mfn;
 
-        shared_info = list_entry(ae, struct page_sharing_info, entry);
-        pg = shared_info->pg;
+        pg_shared_info = list_entry(ae, struct page_sharing_info, entry);
+        pg = pg_shared_info->pg;
         mfn = page_to_mfn(pg);
 
         /* If we can't lock it, it's definitely not a shared page */
@@ -265,7 +265,7 @@
         }
 
         /* Check we have a list */
-        if ( (!pg->shared_info) || (list_empty(&pg->shared_info->gfns)) )
+        if ( (!pg->sharing) || (list_empty(&pg->sharing->gfns)) )
         {
            MEM_SHARING_DEBUG("mfn %lx shared, but empty gfn list!\n",
                              mfn_x(mfn));
@@ -277,7 +277,7 @@
         count_found++;
 
         /* Check if all GFNs map to the MFN, and the p2m types */
-        list_for_each(le, &pg->shared_info->gfns)
+        list_for_each(le, &pg->sharing->gfns)
         {
             struct domain *d;
             p2m_type_t t;
@@ -630,7 +630,7 @@
                         "grab page %lx dom %d\n", gfn, mfn_x(mfn), d->domain_id);
             BUG();
         }
-        *phandle = pg->shared_info->handle;
+        *phandle = pg->sharing->handle;
         ret = 0;
         mem_sharing_page_unlock(pg);
         goto out;
@@ -655,24 +655,24 @@
 
     /* Initialize the shared state */
     ret = -ENOMEM;
-    if ( (page->shared_info = 
+    if ( (page->sharing = 
             xmalloc(struct page_sharing_info)) == NULL )
     {
         /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
-    page->shared_info->pg = page;
-    INIT_LIST_HEAD(&page->shared_info->gfns);
+    page->sharing->pg = page;
+    INIT_LIST_HEAD(&page->sharing->gfns);
 
     /* Create the handle */
-    page->shared_info->handle = get_next_handle();  
+    page->sharing->handle = get_next_handle();  
 
     /* Create the local gfn info */
     if ( (gfn_info = mem_sharing_gfn_alloc(page, d, gfn)) == NULL )
     {
-        xfree(page->shared_info);
-        page->shared_info = NULL;
+        xfree(page->sharing);
+        page->sharing = NULL;
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
@@ -685,8 +685,8 @@
          * The mfn needs to revert back to rw type. This should never fail,
          * since no-one knew that the mfn was temporarily sharable */
         mem_sharing_gfn_destroy(d, gfn_info);
-        xfree(page->shared_info);
-        page->shared_info = NULL;
+        xfree(page->sharing);
+        page->sharing = NULL;
         /* NOTE: We haven't yet added this to the audit list. */
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
@@ -698,7 +698,7 @@
     /* Update m2p entry to SHARED_M2P_ENTRY */
     set_gpfn_from_mfn(mfn_x(mfn), SHARED_M2P_ENTRY);
 
-    *phandle = page->shared_info->handle;
+    *phandle = page->sharing->handle;
     audit_add_list(page);
     mem_sharing_page_unlock(page);
     ret = 0;
@@ -769,14 +769,14 @@
     ASSERT(cmfn_type == p2m_ram_shared);
 
     /* Check that the handles match */
-    if ( spage->shared_info->handle != sh )
+    if ( spage->sharing->handle != sh )
     {
         ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
         mem_sharing_page_unlock(secondpg);
         mem_sharing_page_unlock(firstpg);
         goto err_out;
     }
-    if ( cpage->shared_info->handle != ch )
+    if ( cpage->sharing->handle != ch )
     {
         ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
         mem_sharing_page_unlock(secondpg);
@@ -785,7 +785,7 @@
     }
 
     /* Merge the lists together */
-    list_for_each_safe(le, te, &cpage->shared_info->gfns)
+    list_for_each_safe(le, te, &cpage->sharing->gfns)
     {
         gfn = list_entry(le, gfn_info_t, list);
         /* Get the source page and type, this should never fail: 
@@ -793,18 +793,18 @@
         BUG_ON(!get_page_and_type(spage, dom_cow, PGT_shared_page));
         /* Move the gfn_info from client list to source list */
         list_del(&gfn->list);
-        list_add(&gfn->list, &spage->shared_info->gfns);
+        list_add(&gfn->list, &spage->sharing->gfns);
         put_page_and_type(cpage);
         d = get_domain_by_id(gfn->domain);
         BUG_ON(!d);
         BUG_ON(set_shared_p2m_entry(d, gfn->gfn, smfn) == 0);
         put_domain(d);
     }
-    ASSERT(list_empty(&cpage->shared_info->gfns));
+    ASSERT(list_empty(&cpage->sharing->gfns));
 
     /* Clear the rest of the shared state */
     audit_del_list(cpage);
-    cpage->shared_info = NULL;
+    cpage->sharing = NULL;
 
     mem_sharing_page_unlock(secondpg);
     mem_sharing_page_unlock(firstpg);
@@ -848,7 +848,7 @@
     ASSERT(smfn_type == p2m_ram_shared);
 
     /* Check that the handles match */
-    if ( spage->shared_info->handle != sh )
+    if ( spage->sharing->handle != sh )
         goto err_unlock;
 
     /* Make sure the target page is a hole in the physmap */
@@ -920,7 +920,7 @@
         BUG();
     }
 
-    list_for_each(le, &page->shared_info->gfns)
+    list_for_each(le, &page->sharing->gfns)
     {
         gfn_info = list_entry(le, gfn_info_t, list);
         if ( (gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id) )
@@ -933,13 +933,13 @@
 gfn_found:
     /* Do the accounting first. If anything fails below, we have bigger
      * bigger fish to fry. First, remove the gfn from the list. */ 
-    last_gfn = list_has_one_entry(&page->shared_info->gfns);
+    last_gfn = list_has_one_entry(&page->sharing->gfns);
     mem_sharing_gfn_destroy(d, gfn_info);
     if ( last_gfn )
     {
         /* Clean up shared state */
         audit_del_list(page);
-        page->shared_info = NULL;
+        page->sharing = NULL;
         atomic_dec(&nr_shared_mfns);
     }
     else
diff -r aadccbbbb846 -r 89fdabcf315f xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -57,7 +57,7 @@
          * of sharing share the version they expect to.
          * This list is allocated and freed when a page is shared/unshared.
          */
-        struct page_sharing_info *shared_info;
+        struct page_sharing_info *sharing;
     };
 
     /* Reference count and various PGC_xxx flags and fields. */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:25 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo96-0000pM-UB; Fri, 27 Jan 2012 15:55:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-0000jT-7h
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1327679587!50340244!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9970 invoked from network); 27 Jan 2012 15:53:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:53:08 -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 1Rqo8z-0002KT-K9
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0008UB-Ix
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Message-Id: <E1Rqo8z-0008UB-Ix@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Sharing overhaul style
	improvements
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 89fdabcf315fdaabeebf05c51a6b3b6dd4c20e85
# Parent  aadccbbbb84664a907d3c5287ca39cbceb4e3fa3
x86/mm: Sharing overhaul style improvements

The name 'shared_info' for the list of shared pages backed by a share frame
collided with the identifier also used for a domain's shared info page. To
avoid grep/cscope/etc aliasing, rename the shared memory token to 'sharing.

This patch only addresses style, and performs no functional changes. To ease
reviwing, the patch was left as a stand-alone last-slot addition to the queue
to avoid propagating changes throughout the whole series.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r aadccbbbb846 -r 89fdabcf315f xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -64,19 +64,19 @@
 
 static inline void audit_add_list(struct page_info *page)
 {
-    INIT_LIST_HEAD(&page->shared_info->entry);
+    INIT_LIST_HEAD(&page->sharing->entry);
     spin_lock(&shr_audit_lock);
-    list_add_rcu(&page->shared_info->entry, &shr_audit_list);
+    list_add_rcu(&page->sharing->entry, &shr_audit_list);
     spin_unlock(&shr_audit_lock);
 }
 
 static inline void audit_del_list(struct page_info *page)
 {
     spin_lock(&shr_audit_lock);
-    list_del_rcu(&page->shared_info->entry);
+    list_del_rcu(&page->sharing->entry);
     spin_unlock(&shr_audit_lock);
-    INIT_RCU_HEAD(&page->shared_info->rcu_head);
-    call_rcu(&page->shared_info->rcu_head, _free_pg_shared_info);
+    INIT_RCU_HEAD(&page->sharing->rcu_head);
+    call_rcu(&page->sharing->rcu_head, _free_pg_shared_info);
 }
 
 #else
@@ -86,7 +86,7 @@
 #define audit_add_list(p)  ((void)0)
 static inline void audit_del_list(struct page_info *page)
 {
-    xfree(page->shared_info);
+    xfree(page->sharing);
 }
 
 #endif /* MEM_SHARING_AUDIT */
@@ -171,7 +171,7 @@
     gfn_info->gfn = gfn;
     gfn_info->domain = d->domain_id;
     INIT_LIST_HEAD(&gfn_info->list);
-    list_add(&gfn_info->list, &page->shared_info->gfns);
+    list_add(&gfn_info->list, &page->sharing->gfns);
 
     /* Increment our number of shared pges. */
     atomic_inc(&d->shr_pages);
@@ -220,14 +220,14 @@
 
     list_for_each_rcu(ae, &shr_audit_list)
     {
-        struct page_sharing_info *shared_info;
+        struct page_sharing_info *pg_shared_info;
         unsigned long nr_gfns = 0;
         struct page_info *pg;
         struct list_head *le;
         mfn_t mfn;
 
-        shared_info = list_entry(ae, struct page_sharing_info, entry);
-        pg = shared_info->pg;
+        pg_shared_info = list_entry(ae, struct page_sharing_info, entry);
+        pg = pg_shared_info->pg;
         mfn = page_to_mfn(pg);
 
         /* If we can't lock it, it's definitely not a shared page */
@@ -265,7 +265,7 @@
         }
 
         /* Check we have a list */
-        if ( (!pg->shared_info) || (list_empty(&pg->shared_info->gfns)) )
+        if ( (!pg->sharing) || (list_empty(&pg->sharing->gfns)) )
         {
            MEM_SHARING_DEBUG("mfn %lx shared, but empty gfn list!\n",
                              mfn_x(mfn));
@@ -277,7 +277,7 @@
         count_found++;
 
         /* Check if all GFNs map to the MFN, and the p2m types */
-        list_for_each(le, &pg->shared_info->gfns)
+        list_for_each(le, &pg->sharing->gfns)
         {
             struct domain *d;
             p2m_type_t t;
@@ -630,7 +630,7 @@
                         "grab page %lx dom %d\n", gfn, mfn_x(mfn), d->domain_id);
             BUG();
         }
-        *phandle = pg->shared_info->handle;
+        *phandle = pg->sharing->handle;
         ret = 0;
         mem_sharing_page_unlock(pg);
         goto out;
@@ -655,24 +655,24 @@
 
     /* Initialize the shared state */
     ret = -ENOMEM;
-    if ( (page->shared_info = 
+    if ( (page->sharing = 
             xmalloc(struct page_sharing_info)) == NULL )
     {
         /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
-    page->shared_info->pg = page;
-    INIT_LIST_HEAD(&page->shared_info->gfns);
+    page->sharing->pg = page;
+    INIT_LIST_HEAD(&page->sharing->gfns);
 
     /* Create the handle */
-    page->shared_info->handle = get_next_handle();  
+    page->sharing->handle = get_next_handle();  
 
     /* Create the local gfn info */
     if ( (gfn_info = mem_sharing_gfn_alloc(page, d, gfn)) == NULL )
     {
-        xfree(page->shared_info);
-        page->shared_info = NULL;
+        xfree(page->sharing);
+        page->sharing = NULL;
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
     }
@@ -685,8 +685,8 @@
          * The mfn needs to revert back to rw type. This should never fail,
          * since no-one knew that the mfn was temporarily sharable */
         mem_sharing_gfn_destroy(d, gfn_info);
-        xfree(page->shared_info);
-        page->shared_info = NULL;
+        xfree(page->sharing);
+        page->sharing = NULL;
         /* NOTE: We haven't yet added this to the audit list. */
         BUG_ON(page_make_private(d, page) != 0);
         goto out;
@@ -698,7 +698,7 @@
     /* Update m2p entry to SHARED_M2P_ENTRY */
     set_gpfn_from_mfn(mfn_x(mfn), SHARED_M2P_ENTRY);
 
-    *phandle = page->shared_info->handle;
+    *phandle = page->sharing->handle;
     audit_add_list(page);
     mem_sharing_page_unlock(page);
     ret = 0;
@@ -769,14 +769,14 @@
     ASSERT(cmfn_type == p2m_ram_shared);
 
     /* Check that the handles match */
-    if ( spage->shared_info->handle != sh )
+    if ( spage->sharing->handle != sh )
     {
         ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID;
         mem_sharing_page_unlock(secondpg);
         mem_sharing_page_unlock(firstpg);
         goto err_out;
     }
-    if ( cpage->shared_info->handle != ch )
+    if ( cpage->sharing->handle != ch )
     {
         ret = XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID;
         mem_sharing_page_unlock(secondpg);
@@ -785,7 +785,7 @@
     }
 
     /* Merge the lists together */
-    list_for_each_safe(le, te, &cpage->shared_info->gfns)
+    list_for_each_safe(le, te, &cpage->sharing->gfns)
     {
         gfn = list_entry(le, gfn_info_t, list);
         /* Get the source page and type, this should never fail: 
@@ -793,18 +793,18 @@
         BUG_ON(!get_page_and_type(spage, dom_cow, PGT_shared_page));
         /* Move the gfn_info from client list to source list */
         list_del(&gfn->list);
-        list_add(&gfn->list, &spage->shared_info->gfns);
+        list_add(&gfn->list, &spage->sharing->gfns);
         put_page_and_type(cpage);
         d = get_domain_by_id(gfn->domain);
         BUG_ON(!d);
         BUG_ON(set_shared_p2m_entry(d, gfn->gfn, smfn) == 0);
         put_domain(d);
     }
-    ASSERT(list_empty(&cpage->shared_info->gfns));
+    ASSERT(list_empty(&cpage->sharing->gfns));
 
     /* Clear the rest of the shared state */
     audit_del_list(cpage);
-    cpage->shared_info = NULL;
+    cpage->sharing = NULL;
 
     mem_sharing_page_unlock(secondpg);
     mem_sharing_page_unlock(firstpg);
@@ -848,7 +848,7 @@
     ASSERT(smfn_type == p2m_ram_shared);
 
     /* Check that the handles match */
-    if ( spage->shared_info->handle != sh )
+    if ( spage->sharing->handle != sh )
         goto err_unlock;
 
     /* Make sure the target page is a hole in the physmap */
@@ -920,7 +920,7 @@
         BUG();
     }
 
-    list_for_each(le, &page->shared_info->gfns)
+    list_for_each(le, &page->sharing->gfns)
     {
         gfn_info = list_entry(le, gfn_info_t, list);
         if ( (gfn_info->gfn == gfn) && (gfn_info->domain == d->domain_id) )
@@ -933,13 +933,13 @@
 gfn_found:
     /* Do the accounting first. If anything fails below, we have bigger
      * bigger fish to fry. First, remove the gfn from the list. */ 
-    last_gfn = list_has_one_entry(&page->shared_info->gfns);
+    last_gfn = list_has_one_entry(&page->sharing->gfns);
     mem_sharing_gfn_destroy(d, gfn_info);
     if ( last_gfn )
     {
         /* Clean up shared state */
         audit_del_list(page);
-        page->shared_info = NULL;
+        page->sharing = NULL;
         atomic_dec(&nr_shared_mfns);
     }
     else
diff -r aadccbbbb846 -r 89fdabcf315f xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Jan 26 12:46:26 2012 +0000
@@ -57,7 +57,7 @@
          * of sharing share the version they expect to.
          * This list is allocated and freed when a page is shared/unshared.
          */
-        struct page_sharing_info *shared_info;
+        struct page_sharing_info *sharing;
     };
 
     /* Reference count and various PGC_xxx flags and fields. */

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo95-0000nc-OI; Fri, 27 Jan 2012 15:55:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-0000ko-AR
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327679699!63573143!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12450 invoked from network); 27 Jan 2012 15:55:00 -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;
	27 Jan 2012 15:55:00 -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 1Rqo92-0002Ki-5M
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0008VQ-49
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Message-Id: <E1Rqo92-0008VQ-49@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Remove stale variable from
	debugtrace printk in p2m audit
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID cdceeb86ae08a03553a68bf4729ae9db38cbe821
# Parent  1397cac56d09dc74368fdc5671a145f89cac3702
x86/mm: Remove stale variable from debugtrace printk in p2m audit

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 1397cac56d09 -r cdceeb86ae08 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -1534,8 +1534,8 @@
         }
         __put_gfn(p2m, gfn);
 
-        P2M_PRINTK("OK: mfn=%#lx, gfn=%#lx, p2mfn=%#lx, lp2mfn=%#lx\n",
-                       mfn, gfn, mfn_x(p2mfn), lp2mfn);
+        P2M_PRINTK("OK: mfn=%#lx, gfn=%#lx, p2mfn=%#lx\n",
+                       mfn, gfn, mfn_x(p2mfn));
     }
     spin_unlock(&d->page_alloc_lock);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo95-0000nc-OI; Fri, 27 Jan 2012 15:55:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-0000ko-AR
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1327679699!63573143!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12450 invoked from network); 27 Jan 2012 15:55:00 -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;
	27 Jan 2012 15:55:00 -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 1Rqo92-0002Ki-5M
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0008VQ-49
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Message-Id: <E1Rqo92-0008VQ-49@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Remove stale variable from
	debugtrace printk in p2m audit
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID cdceeb86ae08a03553a68bf4729ae9db38cbe821
# Parent  1397cac56d09dc74368fdc5671a145f89cac3702
x86/mm: Remove stale variable from debugtrace printk in p2m audit

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 1397cac56d09 -r cdceeb86ae08 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -1534,8 +1534,8 @@
         }
         __put_gfn(p2m, gfn);
 
-        P2M_PRINTK("OK: mfn=%#lx, gfn=%#lx, p2mfn=%#lx, lp2mfn=%#lx\n",
-                       mfn, gfn, mfn_x(p2mfn), lp2mfn);
+        P2M_PRINTK("OK: mfn=%#lx, gfn=%#lx, p2mfn=%#lx\n",
+                       mfn, gfn, mfn_x(p2mfn));
     }
     spin_unlock(&d->page_alloc_lock);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo98-0000s7-6Q; Fri, 27 Jan 2012 15:55:26 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo96-0000io-Eb
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1327679716!12664736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15476 invoked from network); 27 Jan 2012 15:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:17 -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 1Rqo8x-0002KH-Pz
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8x-0008TD-IQ
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Message-Id: <E1Rqo8x-0008TD-IQ@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: use RCU in mem sharing audit
	list, eliminate global lock completely
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 4653d1e939a91a00a5b115c968a6e03530516e54
# Parent  cdeb8a70e4ed82877c0f75b3e131783e5b714ccc
x86/mm: use RCU in mem sharing audit list, eliminate global lock completely

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r cdeb8a70e4ed -r 4653d1e939a9 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -32,6 +32,7 @@
 #include <asm/p2m.h>
 #include <asm/mem_event.h>
 #include <asm/atomic.h>
+#include <xen/rcupdate.h>
 
 #include "mm-locks.h"
 
@@ -46,48 +47,49 @@
 
 #if MEM_SHARING_AUDIT
 
-static mm_lock_t shr_lock;
-
-#define shr_lock()          _shr_lock()
-#define shr_unlock()        _shr_unlock()
-#define shr_locked_by_me()  _shr_locked_by_me()
-
 static void mem_sharing_audit(void);
 
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
 
 static struct list_head shr_audit_list;
+static spinlock_t shr_audit_lock;
+DEFINE_RCU_READ_LOCK(shr_audit_read_lock);
+
+/* RCU delayed free of audit list entry */
+static void _free_pg_shared_info(struct rcu_head *head)
+{
+    xfree(container_of(head, struct page_sharing_info, rcu_head));
+}
 
 static inline void audit_add_list(struct page_info *page)
 {
     INIT_LIST_HEAD(&page->shared_info->entry);
-    list_add(&page->shared_info->entry, &shr_audit_list);
+    spin_lock(&shr_audit_lock);
+    list_add_rcu(&page->shared_info->entry, &shr_audit_list);
+    spin_unlock(&shr_audit_lock);
 }
 
 static inline void audit_del_list(struct page_info *page)
 {
-    list_del(&page->shared_info->entry);
+    spin_lock(&shr_audit_lock);
+    list_del_rcu(&page->shared_info->entry);
+    spin_unlock(&shr_audit_lock);
+    INIT_RCU_HEAD(&page->shared_info->rcu_head);
+    call_rcu(&page->shared_info->rcu_head, _free_pg_shared_info);
 }
 
-static inline int mem_sharing_page_lock(struct page_info *p)
-{
-    return 1;
-}
-#define mem_sharing_page_unlock(p)   ((void)0)
-
-#define get_next_handle()   next_handle++;
 #else
 
-#define shr_lock()          ((void)0)
-#define shr_unlock()        ((void)0)
-/* Only used inside audit code */
-//#define shr_locked_by_me()  ((void)0)
-
 #define mem_sharing_audit() ((void)0)
 
 #define audit_add_list(p)  ((void)0)
-#define audit_del_list(p)  ((void)0)
+static inline void audit_del_list(struct page_info *page)
+{
+    xfree(page->shared_info);
+}
+
+#endif /* MEM_SHARING_AUDIT */
 
 static inline int mem_sharing_page_lock(struct page_info *pg)
 {
@@ -125,7 +127,6 @@
     while ( (y = cmpxchg(&next_handle, x, x + 1)) != x );
     return x + 1;
 }
-#endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
     (is_hvm_domain(d) && (d)->arch.hvm_domain.mem_sharing_enabled)
@@ -213,10 +214,11 @@
     unsigned long count_found = 0;
     struct list_head *ae;
 
-    ASSERT(shr_locked_by_me());
     count_expected = atomic_read(&nr_shared_mfns);
 
-    list_for_each(ae, &shr_audit_list)
+    rcu_read_lock(&shr_audit_read_lock);
+
+    list_for_each_rcu(ae, &shr_audit_list)
     {
         struct page_sharing_info *shared_info;
         unsigned long nr_gfns = 0;
@@ -228,6 +230,15 @@
         pg = shared_info->pg;
         mfn = page_to_mfn(pg);
 
+        /* If we can't lock it, it's definitely not a shared page */
+        if ( !mem_sharing_page_lock(pg) )
+        {
+           MEM_SHARING_DEBUG("mfn %lx in audit list, but cannot be locked (%lx)!\n",
+                              mfn_x(mfn), pg->u.inuse.type_info);
+           errors++;
+           continue;
+        }
+
         /* Check if the MFN has correct type, owner and handle. */ 
         if ( !(pg->u.inuse.type_info & PGT_shared_page) )
         {
@@ -300,7 +311,8 @@
             put_domain(d);
             nr_gfns++;
         }
-        if ( nr_gfns != (pg->u.inuse.type_info & PGT_count_mask) )
+        /* The type count has an extra ref because we have locked the page */
+        if ( (nr_gfns + 1) != (pg->u.inuse.type_info & PGT_count_mask) )
         {
             MEM_SHARING_DEBUG("Mismatched counts for MFN=%lx."
                               "nr_gfns in list %lu, in type_info %lx\n",
@@ -308,8 +320,12 @@
                               (pg->u.inuse.type_info & PGT_count_mask));
             errors++;
         }
+
+        mem_sharing_page_unlock(pg);
     }
 
+    rcu_read_unlock(&shr_audit_read_lock);
+
     if ( count_found != count_expected )
     {
         MEM_SHARING_DEBUG("Expected %ld shared mfns, found %ld.",
@@ -533,14 +549,10 @@
     spin_lock(&d->page_alloc_lock);
 
     /* We can only change the type if count is one */
-    /* If we are locking pages individually, then we need to drop
+    /* Because we are locking pages individually, we need to drop
      * the lock here, while the page is typed. We cannot risk the 
      * race of page_unlock and then put_page_type. */
-#if MEM_SHARING_AUDIT
-    expected_type = (PGT_shared_page | PGT_validated | 1);
-#else
     expected_type = (PGT_shared_page | PGT_validated | PGT_locked | 2);
-#endif
     if ( page->u.inuse.type_info != expected_type )
     {
         put_page(page);
@@ -551,10 +563,8 @@
     /* Drop the final typecount */
     put_page_and_type(page);
 
-#ifndef MEM_SHARING_AUDIT
     /* Now that we've dropped the type, we can unlock */
     mem_sharing_page_unlock(page);
-#endif
 
     /* Change the owner */
     ASSERT(page_get_owner(page) == dom_cow);
@@ -604,7 +614,6 @@
 
     *phandle = 0UL;
 
-    shr_lock(); 
     mfn = get_gfn(d, gfn, &p2mt);
 
     /* Check if mfn is valid */
@@ -696,7 +705,6 @@
 
 out:
     put_gfn(d, gfn);
-    shr_unlock();
     return ret;
 }
 
@@ -711,8 +719,6 @@
     mfn_t smfn, cmfn;
     p2m_type_t smfn_type, cmfn_type;
 
-    shr_lock();
-
     /* XXX if sd == cd handle potential deadlock by ordering
      * the get_ and put_gfn's */
     smfn = get_gfn(sd, sgfn, &smfn_type);
@@ -798,7 +804,6 @@
 
     /* Clear the rest of the shared state */
     audit_del_list(cpage);
-    xfree(cpage->shared_info);
     cpage->shared_info = NULL;
 
     mem_sharing_page_unlock(secondpg);
@@ -816,7 +821,6 @@
 err_out:
     put_gfn(cd, cgfn);
     put_gfn(sd, sgfn);
-    shr_unlock();
     return ret;
 }
 
@@ -899,17 +903,12 @@
     gfn_info_t *gfn_info = NULL;
     struct list_head *le;
    
-    /* This is one of the reasons why we can't enforce ordering
-     * between shr_lock and p2m fine-grained locks in mm-lock. 
-     * Callers may walk in here already holding the lock for this gfn */
-    shr_lock();
     mem_sharing_audit();
     mfn = get_gfn(d, gfn, &p2mt);
     
     /* Has someone already unshared it? */
     if ( !p2m_is_shared(p2mt) ) {
         put_gfn(d, gfn);
-        shr_unlock();
         return 0;
     }
 
@@ -940,7 +939,6 @@
     {
         /* Clean up shared state */
         audit_del_list(page);
-        xfree(page->shared_info);
         page->shared_info = NULL;
         atomic_dec(&nr_shared_mfns);
     }
@@ -956,7 +954,6 @@
             test_and_clear_bit(_PGC_allocated, &page->count_info) ) 
             put_page(page);
         put_gfn(d, gfn);
-        shr_unlock();
 
         return 0;
     }
@@ -975,7 +972,6 @@
         mem_sharing_page_unlock(old_page);
         put_gfn(d, gfn);
         mem_sharing_notify_helper(d, gfn);
-        shr_unlock();
         return -ENOMEM;
     }
 
@@ -1006,7 +1002,6 @@
     paging_mark_dirty(d, mfn_x(page_to_mfn(page)));
     /* We do not need to unlock a private page */
     put_gfn(d, gfn);
-    shr_unlock();
     return 0;
 }
 
@@ -1179,9 +1174,7 @@
             break;
     }
 
-    shr_lock();
     mem_sharing_audit();
-    shr_unlock();
 
     return rc;
 }
@@ -1190,7 +1183,7 @@
 {
     printk("Initing memory sharing.\n");
 #if MEM_SHARING_AUDIT
-    mm_lock_init(&shr_lock);
+    spin_lock_init(&shr_audit_lock);
     INIT_LIST_HEAD(&shr_audit_list);
 #endif
 }
diff -r cdeb8a70e4ed -r 4653d1e939a9 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
@@ -143,19 +143,6 @@
  *                                                                      *
  ************************************************************************/
 
-#if MEM_SHARING_AUDIT
-/* Page-sharing lock (global) 
- *
- * A single global lock that protects the memory-sharing code's
- * hash tables. */
-
-declare_mm_lock(shr)
-#define _shr_lock()         mm_lock(shr, &shr_lock)
-#define _shr_unlock()       mm_unlock(&shr_lock)
-#define _shr_locked_by_me() mm_locked_by_me(&shr_lock)
-
-#else
-
 /* Sharing per page lock
  *
  * This is an external lock, not represented by an mm_lock_t. The memory
@@ -163,9 +150,6 @@
  * tuples to a shared page. We enforce order here against the p2m lock,
  * which is taken after the page_lock to change the gfn's p2m entry.
  *
- * Note that in sharing audit mode, we use the global page lock above, 
- * instead.
- *
  * The lock is recursive because during share we lock two pages. */
 
 declare_mm_order_constraint(per_page_sharing)
@@ -174,8 +158,6 @@
         mm_enforce_order_lock_post_per_page_sharing((l), (r))
 #define page_sharing_mm_unlock(l, r) mm_enforce_order_unlock((l), (r))
 
-#endif /* MEM_SHARING_AUDIT */
-
 /* Nested P2M lock (per-domain)
  *
  * A per-domain lock that protects the mapping from nested-CR3 to 
diff -r cdeb8a70e4ed -r 4653d1e939a9 xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
@@ -35,6 +35,7 @@
     shr_handle_t handle;    /* Globally unique version / handle. */
 #if MEM_SHARING_AUDIT
     struct list_head entry; /* List of all shared pages (entry). */
+    struct rcu_head rcu_head; /* List of all shared pages (entry). */
 #endif
     struct list_head gfns;  /* List of domains and gfns for this page (head). */
 };

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo98-0000s7-6Q; Fri, 27 Jan 2012 15:55:26 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo96-0000io-Eb
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1327679716!12664736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15476 invoked from network); 27 Jan 2012 15:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:17 -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 1Rqo8x-0002KH-Pz
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8x-0008TD-IQ
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:15 +0000
Message-Id: <E1Rqo8x-0008TD-IQ@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: use RCU in mem sharing audit
	list, eliminate global lock completely
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 4653d1e939a91a00a5b115c968a6e03530516e54
# Parent  cdeb8a70e4ed82877c0f75b3e131783e5b714ccc
x86/mm: use RCU in mem sharing audit list, eliminate global lock completely

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r cdeb8a70e4ed -r 4653d1e939a9 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 12:46:26 2012 +0000
@@ -32,6 +32,7 @@
 #include <asm/p2m.h>
 #include <asm/mem_event.h>
 #include <asm/atomic.h>
+#include <xen/rcupdate.h>
 
 #include "mm-locks.h"
 
@@ -46,48 +47,49 @@
 
 #if MEM_SHARING_AUDIT
 
-static mm_lock_t shr_lock;
-
-#define shr_lock()          _shr_lock()
-#define shr_unlock()        _shr_unlock()
-#define shr_locked_by_me()  _shr_locked_by_me()
-
 static void mem_sharing_audit(void);
 
 #define MEM_SHARING_DEBUG(_f, _a...)                                  \
     debugtrace_printk("mem_sharing_debug: %s(): " _f, __func__, ##_a)
 
 static struct list_head shr_audit_list;
+static spinlock_t shr_audit_lock;
+DEFINE_RCU_READ_LOCK(shr_audit_read_lock);
+
+/* RCU delayed free of audit list entry */
+static void _free_pg_shared_info(struct rcu_head *head)
+{
+    xfree(container_of(head, struct page_sharing_info, rcu_head));
+}
 
 static inline void audit_add_list(struct page_info *page)
 {
     INIT_LIST_HEAD(&page->shared_info->entry);
-    list_add(&page->shared_info->entry, &shr_audit_list);
+    spin_lock(&shr_audit_lock);
+    list_add_rcu(&page->shared_info->entry, &shr_audit_list);
+    spin_unlock(&shr_audit_lock);
 }
 
 static inline void audit_del_list(struct page_info *page)
 {
-    list_del(&page->shared_info->entry);
+    spin_lock(&shr_audit_lock);
+    list_del_rcu(&page->shared_info->entry);
+    spin_unlock(&shr_audit_lock);
+    INIT_RCU_HEAD(&page->shared_info->rcu_head);
+    call_rcu(&page->shared_info->rcu_head, _free_pg_shared_info);
 }
 
-static inline int mem_sharing_page_lock(struct page_info *p)
-{
-    return 1;
-}
-#define mem_sharing_page_unlock(p)   ((void)0)
-
-#define get_next_handle()   next_handle++;
 #else
 
-#define shr_lock()          ((void)0)
-#define shr_unlock()        ((void)0)
-/* Only used inside audit code */
-//#define shr_locked_by_me()  ((void)0)
-
 #define mem_sharing_audit() ((void)0)
 
 #define audit_add_list(p)  ((void)0)
-#define audit_del_list(p)  ((void)0)
+static inline void audit_del_list(struct page_info *page)
+{
+    xfree(page->shared_info);
+}
+
+#endif /* MEM_SHARING_AUDIT */
 
 static inline int mem_sharing_page_lock(struct page_info *pg)
 {
@@ -125,7 +127,6 @@
     while ( (y = cmpxchg(&next_handle, x, x + 1)) != x );
     return x + 1;
 }
-#endif /* MEM_SHARING_AUDIT */
 
 #define mem_sharing_enabled(d) \
     (is_hvm_domain(d) && (d)->arch.hvm_domain.mem_sharing_enabled)
@@ -213,10 +214,11 @@
     unsigned long count_found = 0;
     struct list_head *ae;
 
-    ASSERT(shr_locked_by_me());
     count_expected = atomic_read(&nr_shared_mfns);
 
-    list_for_each(ae, &shr_audit_list)
+    rcu_read_lock(&shr_audit_read_lock);
+
+    list_for_each_rcu(ae, &shr_audit_list)
     {
         struct page_sharing_info *shared_info;
         unsigned long nr_gfns = 0;
@@ -228,6 +230,15 @@
         pg = shared_info->pg;
         mfn = page_to_mfn(pg);
 
+        /* If we can't lock it, it's definitely not a shared page */
+        if ( !mem_sharing_page_lock(pg) )
+        {
+           MEM_SHARING_DEBUG("mfn %lx in audit list, but cannot be locked (%lx)!\n",
+                              mfn_x(mfn), pg->u.inuse.type_info);
+           errors++;
+           continue;
+        }
+
         /* Check if the MFN has correct type, owner and handle. */ 
         if ( !(pg->u.inuse.type_info & PGT_shared_page) )
         {
@@ -300,7 +311,8 @@
             put_domain(d);
             nr_gfns++;
         }
-        if ( nr_gfns != (pg->u.inuse.type_info & PGT_count_mask) )
+        /* The type count has an extra ref because we have locked the page */
+        if ( (nr_gfns + 1) != (pg->u.inuse.type_info & PGT_count_mask) )
         {
             MEM_SHARING_DEBUG("Mismatched counts for MFN=%lx."
                               "nr_gfns in list %lu, in type_info %lx\n",
@@ -308,8 +320,12 @@
                               (pg->u.inuse.type_info & PGT_count_mask));
             errors++;
         }
+
+        mem_sharing_page_unlock(pg);
     }
 
+    rcu_read_unlock(&shr_audit_read_lock);
+
     if ( count_found != count_expected )
     {
         MEM_SHARING_DEBUG("Expected %ld shared mfns, found %ld.",
@@ -533,14 +549,10 @@
     spin_lock(&d->page_alloc_lock);
 
     /* We can only change the type if count is one */
-    /* If we are locking pages individually, then we need to drop
+    /* Because we are locking pages individually, we need to drop
      * the lock here, while the page is typed. We cannot risk the 
      * race of page_unlock and then put_page_type. */
-#if MEM_SHARING_AUDIT
-    expected_type = (PGT_shared_page | PGT_validated | 1);
-#else
     expected_type = (PGT_shared_page | PGT_validated | PGT_locked | 2);
-#endif
     if ( page->u.inuse.type_info != expected_type )
     {
         put_page(page);
@@ -551,10 +563,8 @@
     /* Drop the final typecount */
     put_page_and_type(page);
 
-#ifndef MEM_SHARING_AUDIT
     /* Now that we've dropped the type, we can unlock */
     mem_sharing_page_unlock(page);
-#endif
 
     /* Change the owner */
     ASSERT(page_get_owner(page) == dom_cow);
@@ -604,7 +614,6 @@
 
     *phandle = 0UL;
 
-    shr_lock(); 
     mfn = get_gfn(d, gfn, &p2mt);
 
     /* Check if mfn is valid */
@@ -696,7 +705,6 @@
 
 out:
     put_gfn(d, gfn);
-    shr_unlock();
     return ret;
 }
 
@@ -711,8 +719,6 @@
     mfn_t smfn, cmfn;
     p2m_type_t smfn_type, cmfn_type;
 
-    shr_lock();
-
     /* XXX if sd == cd handle potential deadlock by ordering
      * the get_ and put_gfn's */
     smfn = get_gfn(sd, sgfn, &smfn_type);
@@ -798,7 +804,6 @@
 
     /* Clear the rest of the shared state */
     audit_del_list(cpage);
-    xfree(cpage->shared_info);
     cpage->shared_info = NULL;
 
     mem_sharing_page_unlock(secondpg);
@@ -816,7 +821,6 @@
 err_out:
     put_gfn(cd, cgfn);
     put_gfn(sd, sgfn);
-    shr_unlock();
     return ret;
 }
 
@@ -899,17 +903,12 @@
     gfn_info_t *gfn_info = NULL;
     struct list_head *le;
    
-    /* This is one of the reasons why we can't enforce ordering
-     * between shr_lock and p2m fine-grained locks in mm-lock. 
-     * Callers may walk in here already holding the lock for this gfn */
-    shr_lock();
     mem_sharing_audit();
     mfn = get_gfn(d, gfn, &p2mt);
     
     /* Has someone already unshared it? */
     if ( !p2m_is_shared(p2mt) ) {
         put_gfn(d, gfn);
-        shr_unlock();
         return 0;
     }
 
@@ -940,7 +939,6 @@
     {
         /* Clean up shared state */
         audit_del_list(page);
-        xfree(page->shared_info);
         page->shared_info = NULL;
         atomic_dec(&nr_shared_mfns);
     }
@@ -956,7 +954,6 @@
             test_and_clear_bit(_PGC_allocated, &page->count_info) ) 
             put_page(page);
         put_gfn(d, gfn);
-        shr_unlock();
 
         return 0;
     }
@@ -975,7 +972,6 @@
         mem_sharing_page_unlock(old_page);
         put_gfn(d, gfn);
         mem_sharing_notify_helper(d, gfn);
-        shr_unlock();
         return -ENOMEM;
     }
 
@@ -1006,7 +1002,6 @@
     paging_mark_dirty(d, mfn_x(page_to_mfn(page)));
     /* We do not need to unlock a private page */
     put_gfn(d, gfn);
-    shr_unlock();
     return 0;
 }
 
@@ -1179,9 +1174,7 @@
             break;
     }
 
-    shr_lock();
     mem_sharing_audit();
-    shr_unlock();
 
     return rc;
 }
@@ -1190,7 +1183,7 @@
 {
     printk("Initing memory sharing.\n");
 #if MEM_SHARING_AUDIT
-    mm_lock_init(&shr_lock);
+    spin_lock_init(&shr_audit_lock);
     INIT_LIST_HEAD(&shr_audit_list);
 #endif
 }
diff -r cdeb8a70e4ed -r 4653d1e939a9 xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 12:46:26 2012 +0000
@@ -143,19 +143,6 @@
  *                                                                      *
  ************************************************************************/
 
-#if MEM_SHARING_AUDIT
-/* Page-sharing lock (global) 
- *
- * A single global lock that protects the memory-sharing code's
- * hash tables. */
-
-declare_mm_lock(shr)
-#define _shr_lock()         mm_lock(shr, &shr_lock)
-#define _shr_unlock()       mm_unlock(&shr_lock)
-#define _shr_locked_by_me() mm_locked_by_me(&shr_lock)
-
-#else
-
 /* Sharing per page lock
  *
  * This is an external lock, not represented by an mm_lock_t. The memory
@@ -163,9 +150,6 @@
  * tuples to a shared page. We enforce order here against the p2m lock,
  * which is taken after the page_lock to change the gfn's p2m entry.
  *
- * Note that in sharing audit mode, we use the global page lock above, 
- * instead.
- *
  * The lock is recursive because during share we lock two pages. */
 
 declare_mm_order_constraint(per_page_sharing)
@@ -174,8 +158,6 @@
         mm_enforce_order_lock_post_per_page_sharing((l), (r))
 #define page_sharing_mm_unlock(l, r) mm_enforce_order_unlock((l), (r))
 
-#endif /* MEM_SHARING_AUDIT */
-
 /* Nested P2M lock (per-domain)
  *
  * A per-domain lock that protects the mapping from nested-CR3 to 
diff -r cdeb8a70e4ed -r 4653d1e939a9 xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Jan 26 12:46:26 2012 +0000
@@ -35,6 +35,7 @@
     shr_handle_t handle;    /* Globally unique version / handle. */
 #if MEM_SHARING_AUDIT
     struct list_head entry; /* List of all shared pages (entry). */
+    struct rcu_head rcu_head; /* List of all shared pages (entry). */
 #endif
     struct list_head gfns;  /* List of domains and gfns for this page (head). */
 };

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo98-0000sR-Ae; Fri, 27 Jan 2012 15:55:26 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000om-10
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1327679663!58694910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18256 invoked from network); 27 Jan 2012 15:54:24 -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;
	27 Jan 2012 15:54:24 -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 1Rqo94-0002L0-Rq
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-00004z-PM
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Message-Id: <E1Rqo94-00004z-PM@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Bring OpenBSD stdarg handling in
	line with FreeBSD case
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327592136 0
# Node ID a08043a997ea550e351ee87cd205f87562c67fcb
# Parent  266a12304601226213a57e39cc11aa075acdfb58
Bring OpenBSD stdarg handling in line with FreeBSD case

Having an absolute path in a #include confuses distcc's pump mode
so get rid ofit by using the same runes for both BSDs.

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r 266a12304601 -r a08043a997ea xen/include/xen/stdarg.h
--- a/xen/include/xen/stdarg.h	Thu Jan 26 15:05:15 2012 +0000
+++ b/xen/include/xen/stdarg.h	Thu Jan 26 15:35:36 2012 +0000
@@ -1,9 +1,7 @@
 #ifndef __XEN_STDARG_H__
 #define __XEN_STDARG_H__
 
-#if defined(__OpenBSD__)
-#  include "/usr/include/stdarg.h"
-#elif defined (__NetBSD__)
+#if defined(__OpenBSD__) || defined (__NetBSD__)
    typedef __builtin_va_list va_list;
 #  ifdef __GNUC__
 #    define __GNUC_PREREQ__(x, y)                                       \

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:26 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo98-0000sR-Ae; Fri, 27 Jan 2012 15:55:26 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000om-10
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1327679663!58694910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18256 invoked from network); 27 Jan 2012 15:54:24 -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;
	27 Jan 2012 15:54:24 -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 1Rqo94-0002L0-Rq
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-00004z-PM
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Message-Id: <E1Rqo94-00004z-PM@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Bring OpenBSD stdarg handling in
	line with FreeBSD case
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327592136 0
# Node ID a08043a997ea550e351ee87cd205f87562c67fcb
# Parent  266a12304601226213a57e39cc11aa075acdfb58
Bring OpenBSD stdarg handling in line with FreeBSD case

Having an absolute path in a #include confuses distcc's pump mode
so get rid ofit by using the same runes for both BSDs.

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r 266a12304601 -r a08043a997ea xen/include/xen/stdarg.h
--- a/xen/include/xen/stdarg.h	Thu Jan 26 15:05:15 2012 +0000
+++ b/xen/include/xen/stdarg.h	Thu Jan 26 15:35:36 2012 +0000
@@ -1,9 +1,7 @@
 #ifndef __XEN_STDARG_H__
 #define __XEN_STDARG_H__
 
-#if defined(__OpenBSD__)
-#  include "/usr/include/stdarg.h"
-#elif defined (__NetBSD__)
+#if defined(__OpenBSD__) || defined (__NetBSD__)
    typedef __builtin_va_list va_list;
 #  ifdef __GNUC__
 #    define __GNUC_PREREQ__(x, y)                                       \

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo99-0000uE-DS; Fri, 27 Jan 2012 15:55:27 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000jR-45
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1327679716!12686732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14652 invoked from network); 27 Jan 2012 15:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:17 -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 1Rqo8y-0002KK-3n
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8y-0008TS-2Z
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Message-Id: <E1Rqo8y-0008TS-2Z@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update memshr API and tools
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 3822ed1804623555f9e05ba7e8bf5fa2430cebcb
# Parent  4653d1e939a91a00a5b115c968a6e03530516e54
Update memshr API and tools

This patch is the folded version of API updates, along with the associated tool
changes to ensure that the build is always consistent.

API updates:
- The source domain in the sharing calls is no longer assumed to be dom0.
- Previously, the mem sharing code would return an opaque handle to index
  shared pages (and nominees) in its global hash table.  By removing the hash
  table, the handle becomes a version, to avoid sharing a stale version of a
  page. Thus, libxc wrappers and tools need to be updated to recall the share
  functions with the information needed to fetch the page (which they readily
  have).

Tool updates:
The only (in-tree, that we know of) consumer of the mem sharing API is the
memshr tool. This is updated to use the new API.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4653d1e939a9 -r 3822ed180462 tools/blktap2/drivers/tapdisk-vbd.c
--- a/tools/blktap2/drivers/tapdisk-vbd.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk-vbd.c	Thu Jan 26 12:46:26 2012 +0000
@@ -1218,14 +1218,14 @@
 #ifdef MEMSHR
 		if (treq.op == TD_OP_READ
 		   && td_flag_test(image->flags, TD_OPEN_RDONLY)) {
-			uint64_t hnd  = treq.memshr_hnd;
+			share_tuple_t hnd = treq.memshr_hnd;
 			uint16_t uid  = image->memshr_id;
 			blkif_request_t *breq = &vreq->req;
 			uint64_t sec  = tapdisk_vbd_breq_get_sector(breq, treq);
 			int secs = breq->seg[treq.sidx].last_sect -
 			    breq->seg[treq.sidx].first_sect + 1;
 
-			if (hnd != 0)
+			if (hnd.handle != 0)
 				memshr_vbd_complete_ro_request(hnd, uid,
 								sec, secs);
 		}
@@ -1297,7 +1297,7 @@
 				/* Reset memshr handle. This'll prevent
 				 * memshr_vbd_complete_ro_request being called
 				 */
-				treq.memshr_hnd = 0;
+				treq.memshr_hnd.handle = 0;
 				td_complete_request(treq, 0);
 			} else
 				td_queue_read(parent, treq);
diff -r 4653d1e939a9 -r 3822ed180462 tools/blktap2/drivers/tapdisk.h
--- a/tools/blktap2/drivers/tapdisk.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk.h	Thu Jan 26 12:46:26 2012 +0000
@@ -140,7 +140,7 @@
 	void                        *private;
     
 #ifdef MEMSHR
-	uint64_t                     memshr_hnd;
+	share_tuple_t                memshr_hnd;
 #endif
 };
 
diff -r 4653d1e939a9 -r 3822ed180462 tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
@@ -86,24 +86,79 @@
     return ret;
 }
 
-int xc_memshr_share(xc_interface *xch,
-                    uint64_t source_handle,
-                    uint64_t client_handle)
+int xc_memshr_share_gfns(xc_interface *xch,
+                         domid_t source_domain,
+                         unsigned long source_gfn,
+                         uint64_t source_handle,
+                         domid_t client_domain,
+                         unsigned long client_gfn,
+                         uint64_t client_handle)
 {
     DECLARE_DOMCTL;
     struct xen_domctl_mem_sharing_op *op;
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = 0;
+    domctl.domain = source_domain;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE;
     op->u.share.source_handle = source_handle;
+    op->u.share.source_gfn    = source_gfn;
+    op->u.share.client_domain = client_domain;
+    op->u.share.client_gfn    = client_gfn;
     op->u.share.client_handle = client_handle;
 
     return do_domctl(xch, &domctl);
 }
 
+int xc_memshr_share_grefs(xc_interface *xch,
+                          domid_t source_domain,
+                          grant_ref_t source_gref,
+                          uint64_t source_handle,
+                          domid_t client_domain,
+                          grant_ref_t client_gref,
+                          uint64_t client_handle)
+{
+    DECLARE_DOMCTL;
+    struct xen_domctl_mem_sharing_op *op;
+
+    domctl.cmd = XEN_DOMCTL_mem_sharing_op;
+    domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
+    domctl.domain = source_domain;
+    op = &(domctl.u.mem_sharing_op);
+    op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE;
+    op->u.share.source_handle = source_handle;
+    XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(op->u.share.source_gfn, source_gref);
+    op->u.share.client_domain = client_domain;
+    XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(op->u.share.client_gfn, client_gref);
+    op->u.share.client_handle = client_handle;
+
+    return do_domctl(xch, &domctl);
+}
+
+int xc_memshr_add_to_physmap(xc_interface *xch,
+                    domid_t source_domain,
+                    unsigned long source_gfn,
+                    uint64_t source_handle,
+                    domid_t client_domain,
+                    unsigned long client_gfn)
+{
+    DECLARE_DOMCTL;
+    struct xen_domctl_mem_sharing_op *op;
+
+    domctl.cmd                  = XEN_DOMCTL_mem_sharing_op;
+    domctl.interface_version    = XEN_DOMCTL_INTERFACE_VERSION;
+    domctl.domain               = source_domain;
+    op = &(domctl.u.mem_sharing_op);
+    op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP;
+    op->u.share.source_gfn      = source_gfn;
+    op->u.share.source_handle   = source_handle;
+    op->u.share.client_gfn      = client_gfn;
+    op->u.share.client_domain   = client_domain;
+
+    return do_domctl(xch, &domctl);
+}
+
 int xc_memshr_domain_resume(xc_interface *xch,
                             domid_t domid)
 {
diff -r 4653d1e939a9 -r 3822ed180462 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -1892,9 +1892,26 @@
                             domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle);
-int xc_memshr_share(xc_interface *xch,
+int xc_memshr_share_gfns(xc_interface *xch,
+                    domid_t source_domain,
+                    unsigned long source_gfn,
                     uint64_t source_handle,
+                    domid_t client_domain,
+                    unsigned long client_gfn,
                     uint64_t client_handle);
+int xc_memshr_share_grefs(xc_interface *xch,
+                    domid_t source_domain,
+                    grant_ref_t source_gref,
+                    uint64_t source_handle,
+                    domid_t client_domain,
+                    grant_ref_t client_gref,
+                    uint64_t client_handle);
+int xc_memshr_add_to_physmap(xc_interface *xch,
+                    domid_t source_domain,
+                    unsigned long source_gfn,
+                    uint64_t source_handle,
+                    domid_t client_domain,
+                    unsigned long client_gfn);
 int xc_memshr_domain_resume(xc_interface *xch,
                             domid_t domid);
 int xc_memshr_debug_gfn(xc_interface *xch,
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/bidir-daemon.c
--- a/tools/memshr/bidir-daemon.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/bidir-daemon.c	Thu Jan 26 12:46:26 2012 +0000
@@ -19,16 +19,25 @@
 #include <pthread.h>
 #include <inttypes.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "bidir-hash.h"
 #include "memshr-priv.h"
 
 static struct blockshr_hash *blks_hash;
 
+/* Callback in the iterator, remember this value, and leave */
+int find_one(vbdblk_t k, share_tuple_t v, void *priv)
+{
+    share_tuple_t *rv = (share_tuple_t *) priv;
+    *rv = v;
+    /* Break out of iterator loop */
+    return 1;
+}
+
 void* bidir_daemon(void *unused)
 {
     uint32_t nr_ent, max_nr_ent, tab_size, max_load, min_load;
-    static uint64_t shrhnd = 1;
 
     while(1)
     {
@@ -41,20 +50,30 @@
         /* Remove some hints as soon as we get to 90% capacity */ 
         if(10 * nr_ent > 9 * max_nr_ent)
         {
-            uint64_t next_remove = shrhnd;
+            share_tuple_t next_remove;
             int to_remove;
             int ret;
 
             to_remove = 0.1 * max_nr_ent; 
             while(to_remove > 0) 
             {
-                ret = blockshr_shrhnd_remove(blks_hash, next_remove, NULL);
-                if(ret < 0)
+                /* We use the iterator to get one entry */
+                next_remove.handle = 0;
+                ret = blockshr_hash_iterator(blks_hash, find_one, &next_remove);
+
+                if ( !ret )
+                    if ( next_remove.handle == 0 )
+                        ret = -ESRCH;
+
+                if ( !ret )
+                    ret = blockshr_shrhnd_remove(blks_hash, next_remove, NULL);
+
+                if(ret <= 0)
                 {
                     /* We failed to remove an entry, because of a serious hash
                      * table error */
                     DPRINTF("Could not remove handle %"PRId64", error: %d\n",
-                            next_remove, ret);
+                            next_remove.handle, ret);
                     /* Force to exit the loop early */
                     to_remove = 0;
                 } else 
@@ -62,12 +81,7 @@
                 {
                     /* Managed to remove the entry. Note next_remove not
                      * incremented, in case there are duplicates */
-                    shrhnd = next_remove;
                     to_remove--;
-                } else
-                {
-                    /* Failed to remove, because there is no such handle */
-                    next_remove++;
                 }
             }
         }
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/bidir-hash.h
--- a/tools/memshr/bidir-hash.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/bidir-hash.h	Thu Jan 26 12:46:26 2012 +0000
@@ -20,6 +20,7 @@
 #define __BIDIR_HASH_H__
 
 #include <stdint.h>
+#include <string.h>
 #include "memshr-priv.h"
 
 typedef struct vbdblk {
@@ -81,15 +82,16 @@
 #undef BIDIR_VALUE
 #undef BIDIR_KEY_T
 #undef BIDIR_VALUE_T
+
 /* TODO better hashes! */
 static inline uint32_t blockshr_block_hash(vbdblk_t block)
 {
     return (uint32_t)(block.sec) ^ (uint32_t)(block.disk_id);
 }
 
-static inline uint32_t blockshr_shrhnd_hash(uint64_t shrhnd)
+static inline uint32_t blockshr_shrhnd_hash(share_tuple_t shrhnd)
 {
-    return (uint32_t)shrhnd;
+    return ((uint32_t) shrhnd.handle);
 }
 
 static inline int blockshr_block_cmp(vbdblk_t b1, vbdblk_t b2)
@@ -97,15 +99,15 @@
     return (b1.sec == b2.sec) && (b1.disk_id == b2.disk_id);
 }
 
-static inline int blockshr_shrhnd_cmp(uint64_t h1, uint64_t h2)
+static inline int blockshr_shrhnd_cmp(share_tuple_t h1, share_tuple_t h2)
 {
-    return (h1 == h2);
+    return ( !memcmp(&h1, &h2, sizeof(share_tuple_t)) );
 }
 #define BIDIR_NAME_PREFIX       blockshr
 #define BIDIR_KEY               block
 #define BIDIR_VALUE             shrhnd
 #define BIDIR_KEY_T             vbdblk_t
-#define BIDIR_VALUE_T           uint64_t
+#define BIDIR_VALUE_T           share_tuple_t
 #include "bidir-namedefs.h"
 
 #endif /* BLOCK_MAP */
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/interface.c
--- a/tools/memshr/interface.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/interface.c	Thu Jan 26 12:46:26 2012 +0000
@@ -145,16 +145,17 @@
     
 int memshr_vbd_issue_ro_request(char *buf,
                                 grant_ref_t gref,
-                                uint16_t file_id, 
+                                uint16_t file_id,
                                 uint64_t sec, 
                                 int secs,
-                                uint64_t *hnd)
+                                share_tuple_t *hnd)
 {
     vbdblk_t blk;
-    uint64_t s_hnd, c_hnd;
+    share_tuple_t source_st, client_st;
+    uint64_t c_hnd;
     int ret;
 
-    *hnd = 0;
+    *hnd = (share_tuple_t){ 0, 0, 0 };
     if(!vbd_info.enabled) 
         return -1;
 
@@ -169,26 +170,31 @@
     /* If page couldn't be made sharable, we cannot do anything about it */
     if(ret != 0)
         return -3;
-    *hnd = c_hnd;
+
+    client_st = (share_tuple_t){ vbd_info.domid, gref, c_hnd };
+    *hnd = client_st;
 
     /* Check if we've read matching disk block previously */
     blk.sec     = sec;
     blk.disk_id = file_id;
-    if(blockshr_block_lookup(memshr.blks, blk, &s_hnd) > 0)
+    if(blockshr_block_lookup(memshr.blks, blk, &source_st) > 0)
     {
-        ret = xc_memshr_share(vbd_info.xc_handle, s_hnd, c_hnd);
+        ret = xc_memshr_share_grefs(vbd_info.xc_handle, source_st.domain, source_st.frame, 
+                                    source_st.handle, vbd_info.domid, gref, c_hnd);
         if(!ret) return 0;
         /* Handles failed to be shared => at least one of them must be invalid,
            remove the relevant ones from the map */
         switch(ret)
         {
             case XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID:
-                ret = blockshr_shrhnd_remove(memshr.blks, s_hnd, NULL);
-                if(ret) DPRINTF("Could not rm invl s_hnd: %"PRId64"\n", s_hnd);
+                ret = blockshr_shrhnd_remove(memshr.blks, source_st, NULL);
+                if(ret) DPRINTF("Could not rm invl s_hnd: %u %"PRId64" %"PRId64"\n", 
+                                    source_st.domain, source_st.frame, source_st.handle);
                 break;
             case XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID:
-                ret = blockshr_shrhnd_remove(memshr.blks, c_hnd, NULL);
-                if(ret) DPRINTF("Could not rm invl c_hnd: %"PRId64"\n", c_hnd);
+                ret = blockshr_shrhnd_remove(memshr.blks, client_st, NULL);
+                if(ret) DPRINTF("Could not rm invl c_hnd: %u %"PRId64" %"PRId64"\n", 
+                                    client_st.domain, client_st.frame, client_st.handle);
                 break;
             default:
                 break;
@@ -199,7 +205,7 @@
     return -4;
 }
 
-void memshr_vbd_complete_ro_request(uint64_t hnd,
+void memshr_vbd_complete_ro_request(share_tuple_t hnd,
                                     uint16_t file_id, 
                                     uint64_t sec, 
                                     int secs)
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/memshr.h
--- a/tools/memshr/memshr.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/memshr.h	Thu Jan 26 12:46:26 2012 +0000
@@ -25,6 +25,13 @@
 
 typedef uint64_t xen_mfn_t;
 
+typedef struct share_tuple 
+{
+    uint32_t domain;
+    uint64_t frame;
+    uint64_t handle;
+} share_tuple_t;
+
 extern void memshr_set_domid(int domid);
 extern void memshr_daemon_initialize(void);
 extern void memshr_vbd_initialize(void);
@@ -35,9 +42,9 @@
                                        uint16_t file_id, 
                                        uint64_t sec, 
                                        int secs,
-                                       uint64_t *hnd);
+                                       share_tuple_t *hnd);
 extern void memshr_vbd_complete_ro_request(
-                                       uint64_t hnd,
+                                       share_tuple_t hnd,
                                        uint16_t file_id, 
                                        uint64_t sec, 
                                        int secs);

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo99-0000uE-DS; Fri, 27 Jan 2012 15:55:27 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000jR-45
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1327679716!12686732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14652 invoked from network); 27 Jan 2012 15:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:17 -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 1Rqo8y-0002KK-3n
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8y-0008TS-2Z
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:16 +0000
Message-Id: <E1Rqo8y-0008TS-2Z@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update memshr API and tools
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID 3822ed1804623555f9e05ba7e8bf5fa2430cebcb
# Parent  4653d1e939a91a00a5b115c968a6e03530516e54
Update memshr API and tools

This patch is the folded version of API updates, along with the associated tool
changes to ensure that the build is always consistent.

API updates:
- The source domain in the sharing calls is no longer assumed to be dom0.
- Previously, the mem sharing code would return an opaque handle to index
  shared pages (and nominees) in its global hash table.  By removing the hash
  table, the handle becomes a version, to avoid sharing a stale version of a
  page. Thus, libxc wrappers and tools need to be updated to recall the share
  functions with the information needed to fetch the page (which they readily
  have).

Tool updates:
The only (in-tree, that we know of) consumer of the mem sharing API is the
memshr tool. This is updated to use the new API.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4653d1e939a9 -r 3822ed180462 tools/blktap2/drivers/tapdisk-vbd.c
--- a/tools/blktap2/drivers/tapdisk-vbd.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk-vbd.c	Thu Jan 26 12:46:26 2012 +0000
@@ -1218,14 +1218,14 @@
 #ifdef MEMSHR
 		if (treq.op == TD_OP_READ
 		   && td_flag_test(image->flags, TD_OPEN_RDONLY)) {
-			uint64_t hnd  = treq.memshr_hnd;
+			share_tuple_t hnd = treq.memshr_hnd;
 			uint16_t uid  = image->memshr_id;
 			blkif_request_t *breq = &vreq->req;
 			uint64_t sec  = tapdisk_vbd_breq_get_sector(breq, treq);
 			int secs = breq->seg[treq.sidx].last_sect -
 			    breq->seg[treq.sidx].first_sect + 1;
 
-			if (hnd != 0)
+			if (hnd.handle != 0)
 				memshr_vbd_complete_ro_request(hnd, uid,
 								sec, secs);
 		}
@@ -1297,7 +1297,7 @@
 				/* Reset memshr handle. This'll prevent
 				 * memshr_vbd_complete_ro_request being called
 				 */
-				treq.memshr_hnd = 0;
+				treq.memshr_hnd.handle = 0;
 				td_complete_request(treq, 0);
 			} else
 				td_queue_read(parent, treq);
diff -r 4653d1e939a9 -r 3822ed180462 tools/blktap2/drivers/tapdisk.h
--- a/tools/blktap2/drivers/tapdisk.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk.h	Thu Jan 26 12:46:26 2012 +0000
@@ -140,7 +140,7 @@
 	void                        *private;
     
 #ifdef MEMSHR
-	uint64_t                     memshr_hnd;
+	share_tuple_t                memshr_hnd;
 #endif
 };
 
diff -r 4653d1e939a9 -r 3822ed180462 tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Thu Jan 26 12:46:26 2012 +0000
@@ -86,24 +86,79 @@
     return ret;
 }
 
-int xc_memshr_share(xc_interface *xch,
-                    uint64_t source_handle,
-                    uint64_t client_handle)
+int xc_memshr_share_gfns(xc_interface *xch,
+                         domid_t source_domain,
+                         unsigned long source_gfn,
+                         uint64_t source_handle,
+                         domid_t client_domain,
+                         unsigned long client_gfn,
+                         uint64_t client_handle)
 {
     DECLARE_DOMCTL;
     struct xen_domctl_mem_sharing_op *op;
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = 0;
+    domctl.domain = source_domain;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE;
     op->u.share.source_handle = source_handle;
+    op->u.share.source_gfn    = source_gfn;
+    op->u.share.client_domain = client_domain;
+    op->u.share.client_gfn    = client_gfn;
     op->u.share.client_handle = client_handle;
 
     return do_domctl(xch, &domctl);
 }
 
+int xc_memshr_share_grefs(xc_interface *xch,
+                          domid_t source_domain,
+                          grant_ref_t source_gref,
+                          uint64_t source_handle,
+                          domid_t client_domain,
+                          grant_ref_t client_gref,
+                          uint64_t client_handle)
+{
+    DECLARE_DOMCTL;
+    struct xen_domctl_mem_sharing_op *op;
+
+    domctl.cmd = XEN_DOMCTL_mem_sharing_op;
+    domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
+    domctl.domain = source_domain;
+    op = &(domctl.u.mem_sharing_op);
+    op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE;
+    op->u.share.source_handle = source_handle;
+    XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(op->u.share.source_gfn, source_gref);
+    op->u.share.client_domain = client_domain;
+    XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(op->u.share.client_gfn, client_gref);
+    op->u.share.client_handle = client_handle;
+
+    return do_domctl(xch, &domctl);
+}
+
+int xc_memshr_add_to_physmap(xc_interface *xch,
+                    domid_t source_domain,
+                    unsigned long source_gfn,
+                    uint64_t source_handle,
+                    domid_t client_domain,
+                    unsigned long client_gfn)
+{
+    DECLARE_DOMCTL;
+    struct xen_domctl_mem_sharing_op *op;
+
+    domctl.cmd                  = XEN_DOMCTL_mem_sharing_op;
+    domctl.interface_version    = XEN_DOMCTL_INTERFACE_VERSION;
+    domctl.domain               = source_domain;
+    op = &(domctl.u.mem_sharing_op);
+    op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP;
+    op->u.share.source_gfn      = source_gfn;
+    op->u.share.source_handle   = source_handle;
+    op->u.share.client_gfn      = client_gfn;
+    op->u.share.client_domain   = client_domain;
+
+    return do_domctl(xch, &domctl);
+}
+
 int xc_memshr_domain_resume(xc_interface *xch,
                             domid_t domid)
 {
diff -r 4653d1e939a9 -r 3822ed180462 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -1892,9 +1892,26 @@
                             domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle);
-int xc_memshr_share(xc_interface *xch,
+int xc_memshr_share_gfns(xc_interface *xch,
+                    domid_t source_domain,
+                    unsigned long source_gfn,
                     uint64_t source_handle,
+                    domid_t client_domain,
+                    unsigned long client_gfn,
                     uint64_t client_handle);
+int xc_memshr_share_grefs(xc_interface *xch,
+                    domid_t source_domain,
+                    grant_ref_t source_gref,
+                    uint64_t source_handle,
+                    domid_t client_domain,
+                    grant_ref_t client_gref,
+                    uint64_t client_handle);
+int xc_memshr_add_to_physmap(xc_interface *xch,
+                    domid_t source_domain,
+                    unsigned long source_gfn,
+                    uint64_t source_handle,
+                    domid_t client_domain,
+                    unsigned long client_gfn);
 int xc_memshr_domain_resume(xc_interface *xch,
                             domid_t domid);
 int xc_memshr_debug_gfn(xc_interface *xch,
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/bidir-daemon.c
--- a/tools/memshr/bidir-daemon.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/bidir-daemon.c	Thu Jan 26 12:46:26 2012 +0000
@@ -19,16 +19,25 @@
 #include <pthread.h>
 #include <inttypes.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "bidir-hash.h"
 #include "memshr-priv.h"
 
 static struct blockshr_hash *blks_hash;
 
+/* Callback in the iterator, remember this value, and leave */
+int find_one(vbdblk_t k, share_tuple_t v, void *priv)
+{
+    share_tuple_t *rv = (share_tuple_t *) priv;
+    *rv = v;
+    /* Break out of iterator loop */
+    return 1;
+}
+
 void* bidir_daemon(void *unused)
 {
     uint32_t nr_ent, max_nr_ent, tab_size, max_load, min_load;
-    static uint64_t shrhnd = 1;
 
     while(1)
     {
@@ -41,20 +50,30 @@
         /* Remove some hints as soon as we get to 90% capacity */ 
         if(10 * nr_ent > 9 * max_nr_ent)
         {
-            uint64_t next_remove = shrhnd;
+            share_tuple_t next_remove;
             int to_remove;
             int ret;
 
             to_remove = 0.1 * max_nr_ent; 
             while(to_remove > 0) 
             {
-                ret = blockshr_shrhnd_remove(blks_hash, next_remove, NULL);
-                if(ret < 0)
+                /* We use the iterator to get one entry */
+                next_remove.handle = 0;
+                ret = blockshr_hash_iterator(blks_hash, find_one, &next_remove);
+
+                if ( !ret )
+                    if ( next_remove.handle == 0 )
+                        ret = -ESRCH;
+
+                if ( !ret )
+                    ret = blockshr_shrhnd_remove(blks_hash, next_remove, NULL);
+
+                if(ret <= 0)
                 {
                     /* We failed to remove an entry, because of a serious hash
                      * table error */
                     DPRINTF("Could not remove handle %"PRId64", error: %d\n",
-                            next_remove, ret);
+                            next_remove.handle, ret);
                     /* Force to exit the loop early */
                     to_remove = 0;
                 } else 
@@ -62,12 +81,7 @@
                 {
                     /* Managed to remove the entry. Note next_remove not
                      * incremented, in case there are duplicates */
-                    shrhnd = next_remove;
                     to_remove--;
-                } else
-                {
-                    /* Failed to remove, because there is no such handle */
-                    next_remove++;
                 }
             }
         }
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/bidir-hash.h
--- a/tools/memshr/bidir-hash.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/bidir-hash.h	Thu Jan 26 12:46:26 2012 +0000
@@ -20,6 +20,7 @@
 #define __BIDIR_HASH_H__
 
 #include <stdint.h>
+#include <string.h>
 #include "memshr-priv.h"
 
 typedef struct vbdblk {
@@ -81,15 +82,16 @@
 #undef BIDIR_VALUE
 #undef BIDIR_KEY_T
 #undef BIDIR_VALUE_T
+
 /* TODO better hashes! */
 static inline uint32_t blockshr_block_hash(vbdblk_t block)
 {
     return (uint32_t)(block.sec) ^ (uint32_t)(block.disk_id);
 }
 
-static inline uint32_t blockshr_shrhnd_hash(uint64_t shrhnd)
+static inline uint32_t blockshr_shrhnd_hash(share_tuple_t shrhnd)
 {
-    return (uint32_t)shrhnd;
+    return ((uint32_t) shrhnd.handle);
 }
 
 static inline int blockshr_block_cmp(vbdblk_t b1, vbdblk_t b2)
@@ -97,15 +99,15 @@
     return (b1.sec == b2.sec) && (b1.disk_id == b2.disk_id);
 }
 
-static inline int blockshr_shrhnd_cmp(uint64_t h1, uint64_t h2)
+static inline int blockshr_shrhnd_cmp(share_tuple_t h1, share_tuple_t h2)
 {
-    return (h1 == h2);
+    return ( !memcmp(&h1, &h2, sizeof(share_tuple_t)) );
 }
 #define BIDIR_NAME_PREFIX       blockshr
 #define BIDIR_KEY               block
 #define BIDIR_VALUE             shrhnd
 #define BIDIR_KEY_T             vbdblk_t
-#define BIDIR_VALUE_T           uint64_t
+#define BIDIR_VALUE_T           share_tuple_t
 #include "bidir-namedefs.h"
 
 #endif /* BLOCK_MAP */
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/interface.c
--- a/tools/memshr/interface.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/interface.c	Thu Jan 26 12:46:26 2012 +0000
@@ -145,16 +145,17 @@
     
 int memshr_vbd_issue_ro_request(char *buf,
                                 grant_ref_t gref,
-                                uint16_t file_id, 
+                                uint16_t file_id,
                                 uint64_t sec, 
                                 int secs,
-                                uint64_t *hnd)
+                                share_tuple_t *hnd)
 {
     vbdblk_t blk;
-    uint64_t s_hnd, c_hnd;
+    share_tuple_t source_st, client_st;
+    uint64_t c_hnd;
     int ret;
 
-    *hnd = 0;
+    *hnd = (share_tuple_t){ 0, 0, 0 };
     if(!vbd_info.enabled) 
         return -1;
 
@@ -169,26 +170,31 @@
     /* If page couldn't be made sharable, we cannot do anything about it */
     if(ret != 0)
         return -3;
-    *hnd = c_hnd;
+
+    client_st = (share_tuple_t){ vbd_info.domid, gref, c_hnd };
+    *hnd = client_st;
 
     /* Check if we've read matching disk block previously */
     blk.sec     = sec;
     blk.disk_id = file_id;
-    if(blockshr_block_lookup(memshr.blks, blk, &s_hnd) > 0)
+    if(blockshr_block_lookup(memshr.blks, blk, &source_st) > 0)
     {
-        ret = xc_memshr_share(vbd_info.xc_handle, s_hnd, c_hnd);
+        ret = xc_memshr_share_grefs(vbd_info.xc_handle, source_st.domain, source_st.frame, 
+                                    source_st.handle, vbd_info.domid, gref, c_hnd);
         if(!ret) return 0;
         /* Handles failed to be shared => at least one of them must be invalid,
            remove the relevant ones from the map */
         switch(ret)
         {
             case XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID:
-                ret = blockshr_shrhnd_remove(memshr.blks, s_hnd, NULL);
-                if(ret) DPRINTF("Could not rm invl s_hnd: %"PRId64"\n", s_hnd);
+                ret = blockshr_shrhnd_remove(memshr.blks, source_st, NULL);
+                if(ret) DPRINTF("Could not rm invl s_hnd: %u %"PRId64" %"PRId64"\n", 
+                                    source_st.domain, source_st.frame, source_st.handle);
                 break;
             case XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID:
-                ret = blockshr_shrhnd_remove(memshr.blks, c_hnd, NULL);
-                if(ret) DPRINTF("Could not rm invl c_hnd: %"PRId64"\n", c_hnd);
+                ret = blockshr_shrhnd_remove(memshr.blks, client_st, NULL);
+                if(ret) DPRINTF("Could not rm invl c_hnd: %u %"PRId64" %"PRId64"\n", 
+                                    client_st.domain, client_st.frame, client_st.handle);
                 break;
             default:
                 break;
@@ -199,7 +205,7 @@
     return -4;
 }
 
-void memshr_vbd_complete_ro_request(uint64_t hnd,
+void memshr_vbd_complete_ro_request(share_tuple_t hnd,
                                     uint16_t file_id, 
                                     uint64_t sec, 
                                     int secs)
diff -r 4653d1e939a9 -r 3822ed180462 tools/memshr/memshr.h
--- a/tools/memshr/memshr.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/memshr/memshr.h	Thu Jan 26 12:46:26 2012 +0000
@@ -25,6 +25,13 @@
 
 typedef uint64_t xen_mfn_t;
 
+typedef struct share_tuple 
+{
+    uint32_t domain;
+    uint64_t frame;
+    uint64_t handle;
+} share_tuple_t;
+
 extern void memshr_set_domid(int domid);
 extern void memshr_daemon_initialize(void);
 extern void memshr_vbd_initialize(void);
@@ -35,9 +42,9 @@
                                        uint16_t file_id, 
                                        uint64_t sec, 
                                        int secs,
-                                       uint64_t *hnd);
+                                       share_tuple_t *hnd);
 extern void memshr_vbd_complete_ro_request(
-                                       uint64_t hnd,
+                                       share_tuple_t hnd,
                                        uint16_t file_id, 
                                        uint64_t sec, 
                                        int secs);

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo99-0000uZ-JL; Fri, 27 Jan 2012 15:55:27 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000je-LK
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1327679718!8426336!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6571 invoked from network); 27 Jan 2012 15:55:19 -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;
	27 Jan 2012 15:55:19 -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 1Rqo90-0002KW-4I
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo90-0008US-38
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Message-Id: <E1Rqo90-0008US-38@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix paging_load
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 4e52d39fdb25914ac15aef62129e95b645166b24
# Parent  89fdabcf315fdaabeebf05c51a6b3b6dd4c20e85
x86/mm: Fix paging_load

When restoring a p2m entry in the paging_load path, we were not updating the
m2p entry correctly.

Also take advantage of this to act on an old suggestion: once done with the
load, promote the p2m entry to the final guest accessible type. This simplifies
logic.

Tested to work with xenpaging.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 89fdabcf315f -r 4e52d39fdb25 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -975,7 +975,7 @@
 int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
 {
     struct page_info *page;
-    p2m_type_t p2mt, target_p2mt;
+    p2m_type_t p2mt;
     p2m_access_t a;
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -1033,15 +1033,13 @@
         }
     }
 
-    target_p2mt = (p2mt == p2m_ram_paging_in_start) ?
-        /* If we kicked the pager with a populate event, the pager will send
-         * a resume event back */
-        p2m_ram_paging_in :
-        /* If this was called asynchronously by the pager, then we can 
-         * transition directly to the final guest-accessible type */
-        (paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw);
-    /* Fix p2m mapping */
-    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, target_p2mt, a);
+    /* Make the page already guest-accessible. If the pager still has a
+     * pending resume operation, it will be idempotent p2m entry-wise,
+     * but will unpause the vcpu */
+    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, 
+                    paging_mode_log_dirty(d) ? p2m_ram_logdirty : 
+                    p2m_ram_rw, a);
+    set_gpfn_from_mfn(mfn_x(mfn), gfn);
 
     atomic_dec(&d->paged_pages);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:27 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo99-0000uZ-JL; Fri, 27 Jan 2012 15:55:27 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000je-LK
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1327679718!8426336!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6571 invoked from network); 27 Jan 2012 15:55:19 -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;
	27 Jan 2012 15:55:19 -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 1Rqo90-0002KW-4I
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo90-0008US-38
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Message-Id: <E1Rqo90-0008US-38@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix paging_load
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 4e52d39fdb25914ac15aef62129e95b645166b24
# Parent  89fdabcf315fdaabeebf05c51a6b3b6dd4c20e85
x86/mm: Fix paging_load

When restoring a p2m entry in the paging_load path, we were not updating the
m2p entry correctly.

Also take advantage of this to act on an old suggestion: once done with the
load, promote the p2m entry to the final guest accessible type. This simplifies
logic.

Tested to work with xenpaging.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 89fdabcf315f -r 4e52d39fdb25 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -975,7 +975,7 @@
 int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
 {
     struct page_info *page;
-    p2m_type_t p2mt, target_p2mt;
+    p2m_type_t p2mt;
     p2m_access_t a;
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -1033,15 +1033,13 @@
         }
     }
 
-    target_p2mt = (p2mt == p2m_ram_paging_in_start) ?
-        /* If we kicked the pager with a populate event, the pager will send
-         * a resume event back */
-        p2m_ram_paging_in :
-        /* If this was called asynchronously by the pager, then we can 
-         * transition directly to the final guest-accessible type */
-        (paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw);
-    /* Fix p2m mapping */
-    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, target_p2mt, a);
+    /* Make the page already guest-accessible. If the pager still has a
+     * pending resume operation, it will be idempotent p2m entry-wise,
+     * but will unpause the vcpu */
+    set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, 
+                    paging_mode_log_dirty(d) ? p2m_ram_logdirty : 
+                    p2m_ram_rw, a);
+    set_gpfn_from_mfn(mfn_x(mfn), gfn);
 
     atomic_dec(&d->paged_pages);
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo99-0000uM-Fz; Fri, 27 Jan 2012 15:55:27 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000jV-8V
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327679717!3380651!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30648 invoked from network); 27 Jan 2012 15:55:18 -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;
	27 Jan 2012 15:55:18 -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 1Rqo8z-0002KQ-7b
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0008Tw-32
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Message-Id: <E1Rqo8z-0008Tw-32@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: Add a sharing command to xl
	for information about shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID aadccbbbb84664a907d3c5287ca39cbceb4e3fa3
# Parent  1a3e534cd11e7ed93ccd98b892a8c255c2d05287
Tools: Add a sharing command to xl for information about shared pages

Also add the global sharing statistics to the libxl physinfo.  This is a slight
departure from libxc, but there's no reason libxl physinfo can't include extra
bits of useful and relevant information.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 1a3e534cd11e -r aadccbbbb846 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Jan 26 12:46:26 2012 +0000
+++ b/docs/man/xl.pod.1	Thu Jan 26 12:46:26 2012 +0000
@@ -410,6 +410,19 @@
 
 =back
 
+=item B<sharing> [I<domain-id>]
+
+List count of shared pages. 
+
+B<OPTIONS>
+
+=over 4
+
+=item I<domain_id>
+
+List specifically for that domain. Otherwise, list for all domains.
+
+=back
 
 =item B<shutdown> [I<OPTIONS>] I<domain-id>
 
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Jan 26 12:46:26 2012 +0000
@@ -2507,6 +2507,8 @@
     physinfo->total_pages = xcphysinfo.total_pages;
     physinfo->free_pages = xcphysinfo.free_pages;
     physinfo->scrub_pages = xcphysinfo.scrub_pages;
+    physinfo->sharing_freed_pages = xc_sharing_freed_pages(ctx->xch);
+    physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
     physinfo->phys_cap = xcphysinfo.capabilities;
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Jan 26 12:46:26 2012 +0000
@@ -367,6 +367,8 @@
     ("total_pages", uint64),
     ("free_pages", uint64),
     ("scrub_pages", uint64),
+    ("sharing_freed_pages", uint64),
+    ("sharing_used_frames", uint64),
 
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/xl.h
--- a/tools/libxl/xl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/xl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -28,6 +28,7 @@
 
 int main_vcpulist(int argc, char **argv);
 int main_info(int argc, char **argv);
+int main_sharing(int argc, char **argv);
 int main_cd_eject(int argc, char **argv);
 int main_cd_insert(int argc, char **argv);
 int main_console(int argc, char **argv);
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Jan 26 12:46:26 2012 +0000
@@ -3701,6 +3701,8 @@
         i = (1 << 20) / vinfo->pagesize;
         printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
         printf("free_memory            : %"PRIu64"\n", info.free_pages / i);
+        printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
+        printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
     }
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_cpu(i, cpumap)
@@ -3784,6 +3786,70 @@
     return 0;
 }
 
+static void sharing(const libxl_dominfo *info, int nb_domain)
+{
+    int i;
+
+    printf("Name                                        ID   Mem Shared\n");
+
+    for (i = 0; i < nb_domain; i++) {
+        char *domname;
+        unsigned shutdown_reason;
+        domname = libxl_domid_to_name(ctx, info[i].domid);
+        shutdown_reason = info[i].shutdown ? info[i].shutdown_reason : 0;
+        printf("%-40s %5d %5lu  %5lu\n",
+                domname,
+                info[i].domid,
+                (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) (info[i].shared_memkb / 1024));
+        free(domname);
+    }
+}
+
+int main_sharing(int argc, char **argv)
+{
+    int opt = 0;
+    libxl_dominfo info_buf;
+    libxl_dominfo *info, *info_free = NULL;
+    int nb_domain, rc;
+
+    if ((opt = def_getopt(argc, argv, "", "sharing", 0)) != -1)
+        return opt;
+
+    if (optind >= argc) {
+        info = libxl_list_domain(ctx, &nb_domain);
+        if (!info) {
+            fprintf(stderr, "libxl_domain_infolist failed.\n");
+            return 1;
+        }
+        info_free = info;
+    } else if (optind == argc-1) {
+        find_domain(argv[optind]);
+        rc = libxl_domain_info(ctx, &info_buf, domid);
+        if (rc == ERROR_INVAL) {
+            fprintf(stderr, "Error: Domain \'%s\' does not exist.\n",
+                argv[optind]);
+            return -rc;
+        }
+        if (rc) {
+            fprintf(stderr, "libxl_domain_info failed (code %d).\n", rc);
+            return -rc;
+        }
+        info = &info_buf;
+        nb_domain = 1;
+    } else {
+        help("sharing");
+        return 2;
+    }
+
+    sharing(info, nb_domain);
+
+    if (info_free)
+        free(info_free);
+
+    return 0;
+}
+
 static int sched_credit_domain_get(
     int domid, libxl_sched_credit *scinfo)
 {
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/xl_cmdtable.c	Thu Jan 26 12:46:26 2012 +0000
@@ -189,6 +189,11 @@
       "Get information about Xen host",
       "-n, --numa         List host NUMA topology information",
     },
+    { "sharing",
+      &main_sharing, 0,
+      "Get information about page sharing",
+      "[Domain]", 
+    },
     { "sched-credit",
       &main_sched_credit, 0,
       "Get/set credit scheduler parameters",

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:28 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo99-0000uM-Fz; Fri, 27 Jan 2012 15:55:27 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo97-0000jV-8V
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327679717!3380651!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30648 invoked from network); 27 Jan 2012 15:55:18 -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;
	27 Jan 2012 15:55:18 -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 1Rqo8z-0002KQ-7b
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo8z-0008Tw-32
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:17 +0000
Message-Id: <E1Rqo8z-0008Tw-32@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: Add a sharing command to xl
	for information about shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327581986 0
# Node ID aadccbbbb84664a907d3c5287ca39cbceb4e3fa3
# Parent  1a3e534cd11e7ed93ccd98b892a8c255c2d05287
Tools: Add a sharing command to xl for information about shared pages

Also add the global sharing statistics to the libxl physinfo.  This is a slight
departure from libxc, but there's no reason libxl physinfo can't include extra
bits of useful and relevant information.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 1a3e534cd11e -r aadccbbbb846 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Jan 26 12:46:26 2012 +0000
+++ b/docs/man/xl.pod.1	Thu Jan 26 12:46:26 2012 +0000
@@ -410,6 +410,19 @@
 
 =back
 
+=item B<sharing> [I<domain-id>]
+
+List count of shared pages. 
+
+B<OPTIONS>
+
+=over 4
+
+=item I<domain_id>
+
+List specifically for that domain. Otherwise, list for all domains.
+
+=back
 
 =item B<shutdown> [I<OPTIONS>] I<domain-id>
 
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Jan 26 12:46:26 2012 +0000
@@ -2507,6 +2507,8 @@
     physinfo->total_pages = xcphysinfo.total_pages;
     physinfo->free_pages = xcphysinfo.free_pages;
     physinfo->scrub_pages = xcphysinfo.scrub_pages;
+    physinfo->sharing_freed_pages = xc_sharing_freed_pages(ctx->xch);
+    physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
     physinfo->phys_cap = xcphysinfo.capabilities;
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Jan 26 12:46:26 2012 +0000
@@ -367,6 +367,8 @@
     ("total_pages", uint64),
     ("free_pages", uint64),
     ("scrub_pages", uint64),
+    ("sharing_freed_pages", uint64),
+    ("sharing_used_frames", uint64),
 
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/xl.h
--- a/tools/libxl/xl.h	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/xl.h	Thu Jan 26 12:46:26 2012 +0000
@@ -28,6 +28,7 @@
 
 int main_vcpulist(int argc, char **argv);
 int main_info(int argc, char **argv);
+int main_sharing(int argc, char **argv);
 int main_cd_eject(int argc, char **argv);
 int main_cd_insert(int argc, char **argv);
 int main_console(int argc, char **argv);
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Jan 26 12:46:26 2012 +0000
@@ -3701,6 +3701,8 @@
         i = (1 << 20) / vinfo->pagesize;
         printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
         printf("free_memory            : %"PRIu64"\n", info.free_pages / i);
+        printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
+        printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
     }
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_cpu(i, cpumap)
@@ -3784,6 +3786,70 @@
     return 0;
 }
 
+static void sharing(const libxl_dominfo *info, int nb_domain)
+{
+    int i;
+
+    printf("Name                                        ID   Mem Shared\n");
+
+    for (i = 0; i < nb_domain; i++) {
+        char *domname;
+        unsigned shutdown_reason;
+        domname = libxl_domid_to_name(ctx, info[i].domid);
+        shutdown_reason = info[i].shutdown ? info[i].shutdown_reason : 0;
+        printf("%-40s %5d %5lu  %5lu\n",
+                domname,
+                info[i].domid,
+                (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) (info[i].shared_memkb / 1024));
+        free(domname);
+    }
+}
+
+int main_sharing(int argc, char **argv)
+{
+    int opt = 0;
+    libxl_dominfo info_buf;
+    libxl_dominfo *info, *info_free = NULL;
+    int nb_domain, rc;
+
+    if ((opt = def_getopt(argc, argv, "", "sharing", 0)) != -1)
+        return opt;
+
+    if (optind >= argc) {
+        info = libxl_list_domain(ctx, &nb_domain);
+        if (!info) {
+            fprintf(stderr, "libxl_domain_infolist failed.\n");
+            return 1;
+        }
+        info_free = info;
+    } else if (optind == argc-1) {
+        find_domain(argv[optind]);
+        rc = libxl_domain_info(ctx, &info_buf, domid);
+        if (rc == ERROR_INVAL) {
+            fprintf(stderr, "Error: Domain \'%s\' does not exist.\n",
+                argv[optind]);
+            return -rc;
+        }
+        if (rc) {
+            fprintf(stderr, "libxl_domain_info failed (code %d).\n", rc);
+            return -rc;
+        }
+        info = &info_buf;
+        nb_domain = 1;
+    } else {
+        help("sharing");
+        return 2;
+    }
+
+    sharing(info, nb_domain);
+
+    if (info_free)
+        free(info_free);
+
+    return 0;
+}
+
 static int sched_credit_domain_get(
     int domid, libxl_sched_credit *scinfo)
 {
diff -r 1a3e534cd11e -r aadccbbbb846 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Jan 26 12:46:26 2012 +0000
+++ b/tools/libxl/xl_cmdtable.c	Thu Jan 26 12:46:26 2012 +0000
@@ -189,6 +189,11 @@
       "Get information about Xen host",
       "-n, --numa         List host NUMA topology information",
     },
+    { "sharing",
+      &main_sharing, 0,
+      "Get information about page sharing",
+      "[Domain]", 
+    },
     { "sched-credit",
       &main_sched_credit, 0,
       "Get/set credit scheduler parameters",

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9A-0000x3-Rr; Fri, 27 Jan 2012 15:55:28 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo98-0000kA-JP
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1327679719!12124009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31534 invoked from network); 27 Jan 2012 15:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:20 -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 1Rqo91-0002Kc-4q
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo91-0008Uw-3c
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Message-Id: <E1Rqo91-0008Uw-3c@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Allow foreign read-only
	mappings of shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 1aa50ddb605a179b7321844d8e31b6ea29cbd0f7
# Parent  f6c33cfe7333a12f6792e6ce15ddf70818508cea
x86/mm: Allow foreign read-only mappings of shared pages

Because shared pages are owned by dom_cow, the ownership test
while foreign mapping fails.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f6c33cfe7333 -r 1aa50ddb605a xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 13:21:27 2012 +0000
@@ -878,7 +878,8 @@
         return 1;
     }
 
-    if ( unlikely(real_pg_owner != pg_owner) )
+    if ( unlikely( (real_pg_owner != pg_owner) &&
+                   (real_pg_owner != dom_cow) ) )
     {
         /*
          * Let privileged domains transfer the right to map their target
@@ -892,6 +893,11 @@
         pg_owner = real_pg_owner;
     }
 
+    /* Extra paranoid check for shared memory. Writable mappings 
+     * disallowed (unshare first!) */
+    if ( (l1f & _PAGE_RW) && (real_pg_owner == dom_cow) )
+        goto could_not_pin;
+
     /* Foreign mappings into guests in shadow external mode don't
      * contribute to writeable mapping refcounts.  (This allows the
      * qemu-dm helper process in dom0 to map the domain's memory without

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9A-0000x3-Rr; Fri, 27 Jan 2012 15:55:28 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo98-0000kA-JP
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1327679719!12124009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31534 invoked from network); 27 Jan 2012 15:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:20 -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 1Rqo91-0002Kc-4q
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo91-0008Uw-3c
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Message-Id: <E1Rqo91-0008Uw-3c@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Allow foreign read-only
	mappings of shared pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 1aa50ddb605a179b7321844d8e31b6ea29cbd0f7
# Parent  f6c33cfe7333a12f6792e6ce15ddf70818508cea
x86/mm: Allow foreign read-only mappings of shared pages

Because shared pages are owned by dom_cow, the ownership test
while foreign mapping fails.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r f6c33cfe7333 -r 1aa50ddb605a xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Jan 26 13:21:27 2012 +0000
@@ -878,7 +878,8 @@
         return 1;
     }
 
-    if ( unlikely(real_pg_owner != pg_owner) )
+    if ( unlikely( (real_pg_owner != pg_owner) &&
+                   (real_pg_owner != dom_cow) ) )
     {
         /*
          * Let privileged domains transfer the right to map their target
@@ -892,6 +893,11 @@
         pg_owner = real_pg_owner;
     }
 
+    /* Extra paranoid check for shared memory. Writable mappings 
+     * disallowed (unshare first!) */
+    if ( (l1f & _PAGE_RW) && (real_pg_owner == dom_cow) )
+        goto could_not_pin;
+
     /* Foreign mappings into guests in shadow external mode don't
      * contribute to writeable mapping refcounts.  (This allows the
      * qemu-dm helper process in dom0 to map the domain's memory without

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9A-0000wo-Od; Fri, 27 Jan 2012 15:55:28 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo98-0000jy-Dz
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327679718!12680564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31345 invoked from network); 27 Jan 2012 15:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:20 -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 1Rqo90-0002KZ-KE
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo90-0008Uh-J2
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Message-Id: <E1Rqo90-0008Uh-J2@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix p2m teardown locking
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID f6c33cfe7333a12f6792e6ce15ddf70818508cea
# Parent  4e52d39fdb25914ac15aef62129e95b645166b24
x86/mm: Fix p2m teardown locking

Holding the p2m lock during a p2m teardown, while unsharing entries pointing to
shared frames, causes a locking inversion and deadlock panic.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4e52d39fdb25 -r f6c33cfe7333 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -343,8 +343,6 @@
     if (p2m == NULL)
         return;
 
-    p2m_lock(p2m);
-
 #ifdef __x86_64__
     for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
     {
@@ -358,6 +356,8 @@
     }
 #endif
 
+    p2m_lock(p2m);
+
     p2m->phys_table = pagetable_null();
 
     while ( (pg = page_list_remove_head(&p2m->pages)) )

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9A-0000wo-Od; Fri, 27 Jan 2012 15:55:28 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo98-0000jy-Dz
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1327679718!12680564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31345 invoked from network); 27 Jan 2012 15:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:20 -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 1Rqo90-0002KZ-KE
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo90-0008Uh-J2
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:18 +0000
Message-Id: <E1Rqo90-0008Uh-J2@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix p2m teardown locking
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID f6c33cfe7333a12f6792e6ce15ddf70818508cea
# Parent  4e52d39fdb25914ac15aef62129e95b645166b24
x86/mm: Fix p2m teardown locking

Holding the p2m lock during a p2m teardown, while unsharing entries pointing to
shared frames, causes a locking inversion and deadlock panic.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4e52d39fdb25 -r f6c33cfe7333 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -343,8 +343,6 @@
     if (p2m == NULL)
         return;
 
-    p2m_lock(p2m);
-
 #ifdef __x86_64__
     for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
     {
@@ -358,6 +356,8 @@
     }
 #endif
 
+    p2m_lock(p2m);
+
     p2m->phys_table = pagetable_null();
 
     while ( (pg = page_list_remove_head(&p2m->pages)) )

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9A-0000xC-Up; Fri, 27 Jan 2012 15:55:28 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo99-0000kv-Fs
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1327679719!3947831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14811 invoked from network); 27 Jan 2012 15:55:20 -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;
	27 Jan 2012 15:55:20 -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 1Rqo91-0002Kf-LW
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo91-0008VB-Jx
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Message-Id: <E1Rqo91-0008VB-Jx@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Output domain count of paged
	pages in console
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 1397cac56d09dc74368fdc5671a145f89cac3702
# Parent  1aa50ddb605a179b7321844d8e31b6ea29cbd0f7
x86/mm: Output domain count of paged pages in console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 1aa50ddb605a -r 1397cac56d09 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/common/keyhandler.c	Thu Jan 26 13:21:27 2012 +0000
@@ -250,8 +250,10 @@
         printk("    refcnt=%d dying=%d pause_count=%d\n",
                atomic_read(&d->refcnt), d->is_dying,
                atomic_read(&d->pause_count));
-        printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u dirty_cpus=%s max_pages=%u\n",
-               d->tot_pages, d->xenheap_pages, atomic_read(&d->shr_pages), tmpstr, d->max_pages);
+        printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u paged_pages=%u "
+               "dirty_cpus=%s max_pages=%u\n", d->tot_pages, d->xenheap_pages, 
+                atomic_read(&d->shr_pages), atomic_read(&d->paged_pages), 
+                tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
                d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:29 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9A-0000xC-Up; Fri, 27 Jan 2012 15:55:28 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo99-0000kv-Fs
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1327679719!3947831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14811 invoked from network); 27 Jan 2012 15:55:20 -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;
	27 Jan 2012 15:55:20 -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 1Rqo91-0002Kf-LW
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo91-0008VB-Jx
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:19 +0000
Message-Id: <E1Rqo91-0008VB-Jx@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Output domain count of paged
	pages in console
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 1397cac56d09dc74368fdc5671a145f89cac3702
# Parent  1aa50ddb605a179b7321844d8e31b6ea29cbd0f7
x86/mm: Output domain count of paged pages in console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 1aa50ddb605a -r 1397cac56d09 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/common/keyhandler.c	Thu Jan 26 13:21:27 2012 +0000
@@ -250,8 +250,10 @@
         printk("    refcnt=%d dying=%d pause_count=%d\n",
                atomic_read(&d->refcnt), d->is_dying,
                atomic_read(&d->pause_count));
-        printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u dirty_cpus=%s max_pages=%u\n",
-               d->tot_pages, d->xenheap_pages, atomic_read(&d->shr_pages), tmpstr, d->max_pages);
+        printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u paged_pages=%u "
+               "dirty_cpus=%s max_pages=%u\n", d->tot_pages, d->xenheap_pages, 
+                atomic_read(&d->shr_pages), atomic_read(&d->paged_pages), 
+                tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
                d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9C-0000za-1n; Fri, 27 Jan 2012 15:55:30 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9A-0000n1-T9
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327679721!3380660!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30947 invoked from network); 27 Jan 2012 15:55:22 -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;
	27 Jan 2012 15:55:22 -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 1Rqo92-0002Kl-MX
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0008Vf-LH
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Message-Id: <E1Rqo92-0008Vf-LH@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Properly account for paged
	out pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 7a28b8b2d3ea01bb7c1a9e50b0af3c1709e36f2d
# Parent  cdceeb86ae08a03553a68bf4729ae9db38cbe821
x86/mm: Properly account for paged out pages

If we hit the page after nominate but before paging it out, don't decrement the
domain count of paged out pages.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r cdceeb86ae08 -r 7a28b8b2d3ea xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -1041,7 +1041,8 @@
                     p2m_ram_rw, a);
     set_gpfn_from_mfn(mfn_x(mfn), gfn);
 
-    atomic_dec(&d->paged_pages);
+    if ( !page_extant )
+        atomic_dec(&d->paged_pages);
 
     ret = 0;
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9C-0000za-1n; Fri, 27 Jan 2012 15:55:30 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9A-0000n1-T9
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1327679721!3380660!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30947 invoked from network); 27 Jan 2012 15:55:22 -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;
	27 Jan 2012 15:55:22 -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 1Rqo92-0002Kl-MX
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo92-0008Vf-LH
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:20 +0000
Message-Id: <E1Rqo92-0008Vf-LH@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Properly account for paged
	out pages
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 7a28b8b2d3ea01bb7c1a9e50b0af3c1709e36f2d
# Parent  cdceeb86ae08a03553a68bf4729ae9db38cbe821
x86/mm: Properly account for paged out pages

If we hit the page after nominate but before paging it out, don't decrement the
domain count of paged out pages.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r cdceeb86ae08 -r 7a28b8b2d3ea xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Jan 26 13:21:27 2012 +0000
@@ -1041,7 +1041,8 @@
                     p2m_ram_rw, a);
     set_gpfn_from_mfn(mfn_x(mfn), gfn);
 
-    atomic_dec(&d->paged_pages);
+    if ( !page_extant )
+        atomic_dec(&d->paged_pages);
 
     ret = 0;
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9C-0000zi-4a; Fri, 27 Jan 2012 15:55:30 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9A-0000nA-TN
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1327679721!12659668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12916 invoked from network); 27 Jan 2012 15:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:22 -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 1Rqo93-0002Kp-9E
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0008Vw-7e
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Message-Id: <E1Rqo93-0008Vw-7e@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: clean use of p2m unlocked
	queries
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 496a9874d08ec9234693452e527ad1454d113676
# Parent  7a28b8b2d3ea01bb7c1a9e50b0af3c1709e36f2d
x86/mm: clean use of p2m unlocked queries

Limit such queries only to p2m_query types. This is more compatible
with the name and intended semantics: perform only a lookup, and explicitly
in an unlocked way.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Thu Jan 26 13:21:27 2012 +0000
@@ -660,7 +660,7 @@
 {
     struct hvm_emulate_ctxt *hvmemul_ctxt =
         container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
-    unsigned long saddr, daddr, bytes;
+    unsigned long saddr, daddr, bytes, sgfn, dgfn;
     paddr_t sgpa, dgpa;
     uint32_t pfec = PFEC_page_present;
     p2m_type_t p2mt;
@@ -693,17 +693,28 @@
     if ( rc != X86EMUL_OKAY )
         return rc;
 
-    /* Unlocked works here because we get_gfn for real in whatever
-     * we call later. */
-    (void)get_gfn_unlocked(current->domain, sgpa >> PAGE_SHIFT, &p2mt);
+    /* XXX In a fine-grained p2m locking scenario, we need to sort this
+     * get_gfn's, or else we might deadlock */
+    sgfn = sgpa >> PAGE_SHIFT;
+    (void)get_gfn(current->domain, sgfn, &p2mt);
     if ( !p2m_is_ram(p2mt) && !p2m_is_grant(p2mt) )
-        return hvmemul_do_mmio(
+    {
+        rc = hvmemul_do_mmio(
             sgpa, reps, bytes_per_rep, dgpa, IOREQ_READ, df, NULL);
+        put_gfn(current->domain, sgfn);
+        return rc;
+    }
 
-    (void)get_gfn_unlocked(current->domain, dgpa >> PAGE_SHIFT, &p2mt);
+    dgfn = dgpa >> PAGE_SHIFT;
+    (void)get_gfn(current->domain, dgfn, &p2mt);
     if ( !p2m_is_ram(p2mt) && !p2m_is_grant(p2mt) )
-        return hvmemul_do_mmio(
+    {
+        rc = hvmemul_do_mmio(
             dgpa, reps, bytes_per_rep, sgpa, IOREQ_WRITE, df, NULL);
+        put_gfn(current->domain, sgfn);
+        put_gfn(current->domain, dgfn);
+        return rc;
+    }
 
     /* RAM-to-RAM copy: emulate as equivalent of memmove(dgpa, sgpa, bytes). */
     bytes = *reps * bytes_per_rep;
@@ -718,7 +729,11 @@
      * can be emulated by a source-to-buffer-to-destination block copy.
      */
     if ( ((dgpa + bytes_per_rep) > sgpa) && (dgpa < (sgpa + bytes)) )
+    {
+        put_gfn(current->domain, sgfn);
+        put_gfn(current->domain, dgfn);
         return X86EMUL_UNHANDLEABLE;
+    }
 
     /* Adjust destination address for reverse copy. */
     if ( df )
@@ -727,7 +742,11 @@
     /* Allocate temporary buffer. Fall back to slow emulation if this fails. */
     buf = xmalloc_bytes(bytes);
     if ( buf == NULL )
+    {
+        put_gfn(current->domain, sgfn);
+        put_gfn(current->domain, dgfn);
         return X86EMUL_UNHANDLEABLE;
+    }
 
     /*
      * We do a modicum of checking here, just for paranoia's sake and to
@@ -738,6 +757,8 @@
         rc = hvm_copy_to_guest_phys(dgpa, buf, bytes);
 
     xfree(buf);
+    put_gfn(current->domain, sgfn);
+    put_gfn(current->domain, dgfn);
 
     if ( rc == HVMCOPY_gfn_paged_out )
         return X86EMUL_RETRY;
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Jan 26 13:21:27 2012 +0000
@@ -3975,7 +3975,10 @@
         rc = -EINVAL;
         if ( is_hvm_domain(d) )
         {
-            get_gfn_unshare_unlocked(d, a.pfn, &t);
+            /* Use get_gfn query as we are interested in the current 
+             * type, not in allocating or unsharing. That'll happen 
+             * on access. */
+            get_gfn_query_unlocked(d, a.pfn, &t);
             if ( p2m_is_mmio(t) )
                 a.mem_type =  HVMMEM_mmio_dm;
             else if ( p2m_is_readonly(t) )
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/stdvga.c	Thu Jan 26 13:21:27 2012 +0000
@@ -482,15 +482,19 @@
                 if ( hvm_copy_to_guest_phys(data, &tmp, p->size) !=
                      HVMCOPY_okay )
                 {
-                    (void)get_gfn_unlocked(d, data >> PAGE_SHIFT, &p2mt);
+                    (void)get_gfn(d, data >> PAGE_SHIFT, &p2mt);
                     /*
                      * The only case we handle is vga_mem <-> vga_mem.
                      * Anything else disables caching and leaves it to qemu-dm.
                      */
                     if ( (p2mt != p2m_mmio_dm) || (data < VGA_MEM_BASE) ||
                          ((data + p->size) > (VGA_MEM_BASE + VGA_MEM_SIZE)) )
+                    {
+                        put_gfn(d, data >> PAGE_SHIFT);
                         return 0;
+                    }
                     stdvga_mem_write(data, tmp, p->size);
+                    put_gfn(d, data >> PAGE_SHIFT);
                 }
                 data += sign * p->size;
                 addr += sign * p->size;
@@ -504,11 +508,15 @@
                 if ( hvm_copy_from_guest_phys(&tmp, data, p->size) !=
                      HVMCOPY_okay )
                 {
-                    (void)get_gfn_unlocked(d, data >> PAGE_SHIFT, &p2mt);
+                    (void)get_gfn(d, data >> PAGE_SHIFT, &p2mt);
                     if ( (p2mt != p2m_mmio_dm) || (data < VGA_MEM_BASE) ||
                          ((data + p->size) > (VGA_MEM_BASE + VGA_MEM_SIZE)) )
+                    {
+                        put_gfn(d, data >> PAGE_SHIFT);
                         return 0;
+                    }
                     tmp = stdvga_mem_read(data, p->size);
+                    put_gfn(d, data >> PAGE_SHIFT);
                 }
                 stdvga_mem_write(addr, tmp, p->size);
                 data += sign * p->size;
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Jan 26 13:21:27 2012 +0000
@@ -2112,7 +2112,7 @@
         return;
 
     /* Everything else is an error. */
-    mfn = get_gfn_guest_unlocked(d, gfn, &p2mt);
+    mfn = get_gfn_query_unlocked(d, gfn, &p2mt);
     gdprintk(XENLOG_ERR, "EPT violation %#lx (%c%c%c/%c%c%c), "
              "gpa %#"PRIpaddr", mfn %#lx, type %i.\n", 
              qualification, 
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 13:21:27 2012 +0000
@@ -421,7 +421,7 @@
     p2m_type_t p2mt;
     mfn_t mfn;
 
-    mfn = get_gfn_unlocked(d, gfn, &p2mt);
+    mfn = get_gfn_query_unlocked(d, gfn, &p2mt);
 
     gdprintk(XENLOG_DEBUG, "Debug for domain=%d, gfn=%lx, ", 
                d->domain_id, 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9C-0000zi-4a; Fri, 27 Jan 2012 15:55:30 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9A-0000nA-TN
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1327679721!12659668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12916 invoked from network); 27 Jan 2012 15:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:22 -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 1Rqo93-0002Kp-9E
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0008Vw-7e
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Message-Id: <E1Rqo93-0008Vw-7e@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: clean use of p2m unlocked
	queries
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 496a9874d08ec9234693452e527ad1454d113676
# Parent  7a28b8b2d3ea01bb7c1a9e50b0af3c1709e36f2d
x86/mm: clean use of p2m unlocked queries

Limit such queries only to p2m_query types. This is more compatible
with the name and intended semantics: perform only a lookup, and explicitly
in an unlocked way.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Thu Jan 26 13:21:27 2012 +0000
@@ -660,7 +660,7 @@
 {
     struct hvm_emulate_ctxt *hvmemul_ctxt =
         container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
-    unsigned long saddr, daddr, bytes;
+    unsigned long saddr, daddr, bytes, sgfn, dgfn;
     paddr_t sgpa, dgpa;
     uint32_t pfec = PFEC_page_present;
     p2m_type_t p2mt;
@@ -693,17 +693,28 @@
     if ( rc != X86EMUL_OKAY )
         return rc;
 
-    /* Unlocked works here because we get_gfn for real in whatever
-     * we call later. */
-    (void)get_gfn_unlocked(current->domain, sgpa >> PAGE_SHIFT, &p2mt);
+    /* XXX In a fine-grained p2m locking scenario, we need to sort this
+     * get_gfn's, or else we might deadlock */
+    sgfn = sgpa >> PAGE_SHIFT;
+    (void)get_gfn(current->domain, sgfn, &p2mt);
     if ( !p2m_is_ram(p2mt) && !p2m_is_grant(p2mt) )
-        return hvmemul_do_mmio(
+    {
+        rc = hvmemul_do_mmio(
             sgpa, reps, bytes_per_rep, dgpa, IOREQ_READ, df, NULL);
+        put_gfn(current->domain, sgfn);
+        return rc;
+    }
 
-    (void)get_gfn_unlocked(current->domain, dgpa >> PAGE_SHIFT, &p2mt);
+    dgfn = dgpa >> PAGE_SHIFT;
+    (void)get_gfn(current->domain, dgfn, &p2mt);
     if ( !p2m_is_ram(p2mt) && !p2m_is_grant(p2mt) )
-        return hvmemul_do_mmio(
+    {
+        rc = hvmemul_do_mmio(
             dgpa, reps, bytes_per_rep, sgpa, IOREQ_WRITE, df, NULL);
+        put_gfn(current->domain, sgfn);
+        put_gfn(current->domain, dgfn);
+        return rc;
+    }
 
     /* RAM-to-RAM copy: emulate as equivalent of memmove(dgpa, sgpa, bytes). */
     bytes = *reps * bytes_per_rep;
@@ -718,7 +729,11 @@
      * can be emulated by a source-to-buffer-to-destination block copy.
      */
     if ( ((dgpa + bytes_per_rep) > sgpa) && (dgpa < (sgpa + bytes)) )
+    {
+        put_gfn(current->domain, sgfn);
+        put_gfn(current->domain, dgfn);
         return X86EMUL_UNHANDLEABLE;
+    }
 
     /* Adjust destination address for reverse copy. */
     if ( df )
@@ -727,7 +742,11 @@
     /* Allocate temporary buffer. Fall back to slow emulation if this fails. */
     buf = xmalloc_bytes(bytes);
     if ( buf == NULL )
+    {
+        put_gfn(current->domain, sgfn);
+        put_gfn(current->domain, dgfn);
         return X86EMUL_UNHANDLEABLE;
+    }
 
     /*
      * We do a modicum of checking here, just for paranoia's sake and to
@@ -738,6 +757,8 @@
         rc = hvm_copy_to_guest_phys(dgpa, buf, bytes);
 
     xfree(buf);
+    put_gfn(current->domain, sgfn);
+    put_gfn(current->domain, dgfn);
 
     if ( rc == HVMCOPY_gfn_paged_out )
         return X86EMUL_RETRY;
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Jan 26 13:21:27 2012 +0000
@@ -3975,7 +3975,10 @@
         rc = -EINVAL;
         if ( is_hvm_domain(d) )
         {
-            get_gfn_unshare_unlocked(d, a.pfn, &t);
+            /* Use get_gfn query as we are interested in the current 
+             * type, not in allocating or unsharing. That'll happen 
+             * on access. */
+            get_gfn_query_unlocked(d, a.pfn, &t);
             if ( p2m_is_mmio(t) )
                 a.mem_type =  HVMMEM_mmio_dm;
             else if ( p2m_is_readonly(t) )
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/stdvga.c	Thu Jan 26 13:21:27 2012 +0000
@@ -482,15 +482,19 @@
                 if ( hvm_copy_to_guest_phys(data, &tmp, p->size) !=
                      HVMCOPY_okay )
                 {
-                    (void)get_gfn_unlocked(d, data >> PAGE_SHIFT, &p2mt);
+                    (void)get_gfn(d, data >> PAGE_SHIFT, &p2mt);
                     /*
                      * The only case we handle is vga_mem <-> vga_mem.
                      * Anything else disables caching and leaves it to qemu-dm.
                      */
                     if ( (p2mt != p2m_mmio_dm) || (data < VGA_MEM_BASE) ||
                          ((data + p->size) > (VGA_MEM_BASE + VGA_MEM_SIZE)) )
+                    {
+                        put_gfn(d, data >> PAGE_SHIFT);
                         return 0;
+                    }
                     stdvga_mem_write(data, tmp, p->size);
+                    put_gfn(d, data >> PAGE_SHIFT);
                 }
                 data += sign * p->size;
                 addr += sign * p->size;
@@ -504,11 +508,15 @@
                 if ( hvm_copy_from_guest_phys(&tmp, data, p->size) !=
                      HVMCOPY_okay )
                 {
-                    (void)get_gfn_unlocked(d, data >> PAGE_SHIFT, &p2mt);
+                    (void)get_gfn(d, data >> PAGE_SHIFT, &p2mt);
                     if ( (p2mt != p2m_mmio_dm) || (data < VGA_MEM_BASE) ||
                          ((data + p->size) > (VGA_MEM_BASE + VGA_MEM_SIZE)) )
+                    {
+                        put_gfn(d, data >> PAGE_SHIFT);
                         return 0;
+                    }
                     tmp = stdvga_mem_read(data, p->size);
+                    put_gfn(d, data >> PAGE_SHIFT);
                 }
                 stdvga_mem_write(addr, tmp, p->size);
                 data += sign * p->size;
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Jan 26 13:21:27 2012 +0000
@@ -2112,7 +2112,7 @@
         return;
 
     /* Everything else is an error. */
-    mfn = get_gfn_guest_unlocked(d, gfn, &p2mt);
+    mfn = get_gfn_query_unlocked(d, gfn, &p2mt);
     gdprintk(XENLOG_ERR, "EPT violation %#lx (%c%c%c/%c%c%c), "
              "gpa %#"PRIpaddr", mfn %#lx, type %i.\n", 
              qualification, 
diff -r 7a28b8b2d3ea -r 496a9874d08e xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Jan 26 13:21:27 2012 +0000
@@ -421,7 +421,7 @@
     p2m_type_t p2mt;
     mfn_t mfn;
 
-    mfn = get_gfn_unlocked(d, gfn, &p2mt);
+    mfn = get_gfn_query_unlocked(d, gfn, &p2mt);
 
     gdprintk(XENLOG_DEBUG, "Debug for domain=%d, gfn=%lx, ", 
                d->domain_id, 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9C-0000zx-7N; Fri, 27 Jan 2012 15:55:30 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9A-0000nF-UB
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1327679721!8636835!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10862 invoked from network); 27 Jan 2012 15:55:22 -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;
	27 Jan 2012 15:55:22 -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 1Rqo93-0002Ku-PL
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0008WB-O8
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Message-Id: <E1Rqo93-0008WB-O8@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Avoid spurious deadlock
	panic trigger
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 570d0ea0ad2fbcc4e7ba21c1dce92b7b5811c3ae
# Parent  496a9874d08ec9234693452e527ad1454d113676
x86/mm: Avoid spurious deadlock panic trigger

In the mm layer, if we take lock A, then lock B, and the recursively lock A,
the deadlock detector panics. This is not a deadlock risk because we
already 'own' the outer lock (A), so we will not contend for that resource.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 496a9874d08e -r 570d0ea0ad2f xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 13:21:27 2012 +0000
@@ -61,7 +61,8 @@
 
 static inline void _mm_lock(mm_lock_t *l, const char *func, int level, int rec)
 {
-    __check_lock_level(level);
+    if ( !((mm_locked_by_me(l)) && rec) ) 
+        __check_lock_level(level);
     spin_lock_recursive(&l->lock);
     if ( l->lock.recurse_cnt == 1 )
     {

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:30 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15:55: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.xensource.com>)
	id 1Rqo9C-0000zx-7N; Fri, 27 Jan 2012 15:55:30 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9A-0000nF-UB
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1327679721!8636835!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10862 invoked from network); 27 Jan 2012 15:55:22 -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;
	27 Jan 2012 15:55:22 -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 1Rqo93-0002Ku-PL
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo93-0008WB-O8
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:21 +0000
Message-Id: <E1Rqo93-0008WB-O8@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Avoid spurious deadlock
	panic trigger
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1327584087 0
# Node ID 570d0ea0ad2fbcc4e7ba21c1dce92b7b5811c3ae
# Parent  496a9874d08ec9234693452e527ad1454d113676
x86/mm: Avoid spurious deadlock panic trigger

In the mm layer, if we take lock A, then lock B, and the recursively lock A,
the deadlock detector panics. This is not a deadlock risk because we
already 'own' the outer lock (A), so we will not contend for that resource.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 496a9874d08e -r 570d0ea0ad2f xen/arch/x86/mm/mm-locks.h
--- a/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 13:21:27 2012 +0000
+++ b/xen/arch/x86/mm/mm-locks.h	Thu Jan 26 13:21:27 2012 +0000
@@ -61,7 +61,8 @@
 
 static inline void _mm_lock(mm_lock_t *l, const char *func, int level, int rec)
 {
-    __check_lock_level(level);
+    if ( !((mm_locked_by_me(l)) && rec) ) 
+        __check_lock_level(level);
     spin_lock_recursive(&l->lock);
     if ( l->lock.recurse_cnt == 1 )
     {

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9D-00012s-G3; Fri, 27 Jan 2012 15:55:31 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9C-0000pi-GE
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327679723!5339614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1253 invoked from network); 27 Jan 2012 15:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:24 -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 1Rqo95-0002L4-CB
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-00005G-Az
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Message-Id: <E1Rqo95-00005G-Az@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Get rid of non-static 'inline'
	modifiers (gcc 4.2.1 complains)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327592560 0
# Node ID dba361080715baf5ec2c493190bb69ba04cc633c
# Parent  a08043a997ea550e351ee87cd205f87562c67fcb
Get rid of non-static 'inline' modifiers (gcc 4.2.1 complains)

They seem to have been introduced by accident in 23311:f4585056b9ae
when some 'static inline' functions were moved out of a header

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r a08043a997ea -r dba361080715 xen/arch/x86/xstate.c
--- a/xen/arch/x86/xstate.c	Thu Jan 26 15:35:36 2012 +0000
+++ b/xen/arch/x86/xstate.c	Thu Jan 26 15:42:40 2012 +0000
@@ -40,13 +40,13 @@
             "a" (lo), "d" (hi));
 }
 
-inline void set_xcr0(u64 xfeatures)
+void set_xcr0(u64 xfeatures)
 {
     this_cpu(xcr0) = xfeatures;
     xsetbv(XCR_XFEATURE_ENABLED_MASK, xfeatures);
 }
 
-inline uint64_t get_xcr0(void)
+uint64_t get_xcr0(void)
 {
     return this_cpu(xcr0);
 }

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9D-00012s-G3; Fri, 27 Jan 2012 15:55:31 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9C-0000pi-GE
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1327679723!5339614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1253 invoked from network); 27 Jan 2012 15:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:24 -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 1Rqo95-0002L4-CB
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-00005G-Az
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Message-Id: <E1Rqo95-00005G-Az@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Get rid of non-static 'inline'
	modifiers (gcc 4.2.1 complains)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327592560 0
# Node ID dba361080715baf5ec2c493190bb69ba04cc633c
# Parent  a08043a997ea550e351ee87cd205f87562c67fcb
Get rid of non-static 'inline' modifiers (gcc 4.2.1 complains)

They seem to have been introduced by accident in 23311:f4585056b9ae
when some 'static inline' functions were moved out of a header

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r a08043a997ea -r dba361080715 xen/arch/x86/xstate.c
--- a/xen/arch/x86/xstate.c	Thu Jan 26 15:35:36 2012 +0000
+++ b/xen/arch/x86/xstate.c	Thu Jan 26 15:42:40 2012 +0000
@@ -40,13 +40,13 @@
             "a" (lo), "d" (hi));
 }
 
-inline void set_xcr0(u64 xfeatures)
+void set_xcr0(u64 xfeatures)
 {
     this_cpu(xcr0) = xfeatures;
     xsetbv(XCR_XFEATURE_ENABLED_MASK, xfeatures);
 }
 
-inline uint64_t get_xcr0(void)
+uint64_t get_xcr0(void)
 {
     return this_cpu(xcr0);
 }

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9D-00012b-Ck; Fri, 27 Jan 2012 15:55:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9C-0000p8-5N
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1327679722!2912945!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19842 invoked from network); 27 Jan 2012 15:55:23 -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;
	27 Jan 2012 15:55:23 -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 1Rqo94-0002Kx-Cz
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-0008WQ-8d
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Message-Id: <E1Rqo94-0008WQ-8d@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix build.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327590315 0
# Node ID 266a12304601226213a57e39cc11aa075acdfb58
# Parent  570d0ea0ad2fbcc4e7ba21c1dce92b7b5811c3ae
Fix build.

Bring xc_mem_paging.c in line with other users of munlock in libxc.
Otherwise it trips over -Werror=unused-value

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r 570d0ea0ad2f -r 266a12304601 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Jan 26 15:05:15 2012 +0000
@@ -87,7 +87,7 @@
                                 buffer, NULL, gfn);
 
     old_errno = errno;
-    munlock(buffer, XC_PAGE_SIZE);
+    (void) munlock(buffer, XC_PAGE_SIZE);
     errno = old_errno;
 
     return rc;

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:31 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9D-00012b-Ck; Fri, 27 Jan 2012 15:55:31 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9C-0000p8-5N
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1327679722!2912945!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19842 invoked from network); 27 Jan 2012 15:55:23 -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;
	27 Jan 2012 15:55:23 -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 1Rqo94-0002Kx-Cz
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo94-0008WQ-8d
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:22 +0000
Message-Id: <E1Rqo94-0008WQ-8d@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix build.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1327590315 0
# Node ID 266a12304601226213a57e39cc11aa075acdfb58
# Parent  570d0ea0ad2fbcc4e7ba21c1dce92b7b5811c3ae
Fix build.

Bring xc_mem_paging.c in line with other users of munlock in libxc.
Otherwise it trips over -Werror=unused-value

Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r 570d0ea0ad2f -r 266a12304601 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Jan 26 13:21:27 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Jan 26 15:05:15 2012 +0000
@@ -87,7 +87,7 @@
                                 buffer, NULL, gfn);
 
     old_errno = errno;
-    munlock(buffer, XC_PAGE_SIZE);
+    (void) munlock(buffer, XC_PAGE_SIZE);
     errno = old_errno;
 
     return rc;

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9E-000157-Iy; Fri, 27 Jan 2012 15:55:32 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9D-0000rs-F7
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1327679724!12807004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9929 invoked from network); 27 Jan 2012 15:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:25 -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 1Rqo95-0002L7-Tf
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-00005Y-R1
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Message-Id: <E1Rqo95-00005Y-R1@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix parse_backend_path and
	device_backend_path to be mutual
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1327599485 0
# Node ID c9abfdcae28d1924666e0bef44e62ce61100e8e8
# Parent  dba361080715baf5ec2c493190bb69ba04cc633c
libxl: fix parse_backend_path and device_backend_path to be mutual

Currently if libxl__parse_backend_path is used and then you try to get
the original path again with libxl__device_backend_path the
result is wrong. This patch fixes the issue, so transformation from
path to libxl__device and back is reciprocal.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r dba361080715 -r c9abfdcae28d tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Thu Jan 26 15:42:40 2012 +0000
+++ b/tools/libxl/libxl_device.c	Thu Jan 26 17:38:05 2012 +0000
@@ -46,12 +46,11 @@
 {
     /* /local/domain/<domid>/backend/<kind>/<domid>/<devid> */
     char strkind[16]; /* Longest is actually "console" */
-    uint32_t domain;
-    int rc = sscanf(path, "/local/domain/%d/backend/%15[^/]/%d/%d",
+    int rc = sscanf(path, "/local/domain/%d/backend/%15[^/]/%u/%d",
                     &dev->backend_domid,
                     strkind,
-                    &domain,
-                    &dev->backend_devid);
+                    &dev->domid,
+                    &dev->devid);
 
     if (rc != 4)
         return ERROR_FAIL;

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9E-000157-Iy; Fri, 27 Jan 2012 15:55:32 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9D-0000rs-F7
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1327679724!12807004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9929 invoked from network); 27 Jan 2012 15:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:25 -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 1Rqo95-0002L7-Tf
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo95-00005Y-R1
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:23 +0000
Message-Id: <E1Rqo95-00005Y-R1@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix parse_backend_path and
	device_backend_path to be mutual
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1327599485 0
# Node ID c9abfdcae28d1924666e0bef44e62ce61100e8e8
# Parent  dba361080715baf5ec2c493190bb69ba04cc633c
libxl: fix parse_backend_path and device_backend_path to be mutual

Currently if libxl__parse_backend_path is used and then you try to get
the original path again with libxl__device_backend_path the
result is wrong. This patch fixes the issue, so transformation from
path to libxl__device and back is reciprocal.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r dba361080715 -r c9abfdcae28d tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Thu Jan 26 15:42:40 2012 +0000
+++ b/tools/libxl/libxl_device.c	Thu Jan 26 17:38:05 2012 +0000
@@ -46,12 +46,11 @@
 {
     /* /local/domain/<domid>/backend/<kind>/<domid>/<devid> */
     char strkind[16]; /* Longest is actually "console" */
-    uint32_t domain;
-    int rc = sscanf(path, "/local/domain/%d/backend/%15[^/]/%d/%d",
+    int rc = sscanf(path, "/local/domain/%d/backend/%15[^/]/%u/%d",
                     &dev->backend_domid,
                     strkind,
-                    &domain,
-                    &dev->backend_devid);
+                    &dev->domid,
+                    &dev->devid);
 
     if (rc != 4)
         return ERROR_FAIL;

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9F-00016l-M7; Fri, 27 Jan 2012 15:55:33 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9D-0000s8-Il
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1327679724!12648277!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4598 invoked from network); 27 Jan 2012 15:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:25 -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 1Rqo96-0002LE-D0
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo96-00005o-Br
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
Message-Id: <E1Rqo96-00005o-Br@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: xencommons init script: Fix
	setting XENSTORED_ROOTDIR
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jim Fehlig <jfehlig@suse.com>
# Date 1327599811 0
# Node ID e2722b24dc0962de37215320b05d1bb7c4c42864
# Parent  c9abfdcae28d1924666e0bef44e62ce61100e8e8
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r c9abfdcae28d -r e2722b24dc09 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Thu Jan 26 17:38:05 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Thu Jan 26 17:43:31 2012 +0000
@@ -61,7 +61,7 @@
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then
-		test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
+		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
 		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
 

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

From xen-changelog-bounces@lists.xensource.com Fri Jan 27 15:55:33 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jan 2012 15: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.xensource.com>)
	id 1Rqo9F-00016l-M7; Fri, 27 Jan 2012 15:55:33 +0000
Received: from mail182.messagelabs.com ([85.158.139.83])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo9D-0000s8-Il
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1327679724!12648277!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4598 invoked from network); 27 Jan 2012 15:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2012 15:55:25 -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 1Rqo96-0002LE-D0
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Rqo96-00005o-Br
	for xen-changelog@lists.xensource.com; Fri, 27 Jan 2012 15:55:24 +0000
Message-Id: <E1Rqo96-00005o-Br@xenbits.xen.org>
Date: Fri, 27 Jan 2012 15:55:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: xencommons init script: Fix
	setting XENSTORED_ROOTDIR
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Jim Fehlig <jfehlig@suse.com>
# Date 1327599811 0
# Node ID e2722b24dc0962de37215320b05d1bb7c4c42864
# Parent  c9abfdcae28d1924666e0bef44e62ce61100e8e8
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r c9abfdcae28d -r e2722b24dc09 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Thu Jan 26 17:38:05 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Thu Jan 26 17:43:31 2012 +0000
@@ -61,7 +61,7 @@
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then
-		test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
+		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
 		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 16:55:12 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 16:55: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.xensource.com>)
	id 1RsGz7-000290-H3; Tue, 31 Jan 2012 16:55:09 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RsGz6-00028k-9J
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 16:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1328028881!50998612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19151 invoked from network); 31 Jan 2012 16:54:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jan 2012 16:54: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 1RsGz1-00078h-4U
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 16:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RsGz0-0004yj-Rv
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 16:55:02 +0000
Date: Tue, 31 Jan 2012 16:55:02 +0000
Message-Id: <E1RsGz0-0004yj-Rv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vbd: update to new
	mini-os wait queue API (new linked list API)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit de05447400930da4be216e4fb0fe52b8be81490e
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Tue Jan 31 15:42:38 2012 +0000

    block-vbd: update to new mini-os wait queue API (new linked list API)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 block-vbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vbd.c b/block-vbd.c
index 56794f6..71f1731 100644
--- a/block-vbd.c
+++ b/block-vbd.c
@@ -144,7 +144,7 @@ void qemu_aio_wait(void)
 	    break;
 	schedule();
     }
-    remove_waiter(w);
+    remove_waiter(w, blkfront_queue);
 }
 
 static void vbd_do_aio(struct blkfront_aiocb *aiocbp, int ret) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 16:55:12 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 16:55: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.xensource.com>)
	id 1RsGz7-000290-H3; Tue, 31 Jan 2012 16:55:09 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RsGz6-00028k-9J
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 16:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1328028881!50998612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19151 invoked from network); 31 Jan 2012 16:54:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jan 2012 16:54: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 1RsGz1-00078h-4U
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 16:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1RsGz0-0004yj-Rv
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 16:55:02 +0000
Date: Tue, 31 Jan 2012 16:55:02 +0000
Message-Id: <E1RsGz0-0004yj-Rv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vbd: update to new
	mini-os wait queue API (new linked list API)
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

commit de05447400930da4be216e4fb0fe52b8be81490e
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Tue Jan 31 15:42:38 2012 +0000

    block-vbd: update to new mini-os wait queue API (new linked list API)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 block-vbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vbd.c b/block-vbd.c
index 56794f6..71f1731 100644
--- a/block-vbd.c
+++ b/block-vbd.c
@@ -144,7 +144,7 @@ void qemu_aio_wait(void)
 	    break;
 	schedule();
     }
-    remove_waiter(w);
+    remove_waiter(w, blkfront_queue);
 }
 
 static void vbd_do_aio(struct blkfront_aiocb *aiocbp, int ret) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19: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.xensource.com>)
	id 1RsJS4-0006cM-Cf; Tue, 31 Jan 2012 19:33:12 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS2-0006cH-AH
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1328038351!50532371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20822 invoked from network); 31 Jan 2012 19:32:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jan 2012 19:32:32 -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 1RsJS0-0000XM-2P
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJRz-0005Q3-R6
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:07 +0000
Message-Id: <E1RsJRz-0005Q3-R6@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/hvm: Remove unnecessary
	packed attribute from hvm_hw_cpu_xsave struct.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1328010297 0
# Node ID 37ef45fe9f97238eb6845ac0b874a81026cc48c9
# Parent  49bf114c23f50e459b76e29d8882a2e0ad4d2a87
x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24528:3d58058fc7a2
xen-unstable date:        Fri Jan 20 10:26:57 2012 +0000
---


diff -r 49bf114c23f5 -r 37ef45fe9f97 xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Fri Jan 20 10:22:17 2012 +0000
+++ b/xen/include/public/arch-x86/hvm/save.h	Tue Jan 31 11:44:57 2012 +0000
@@ -576,7 +576,7 @@
 
         struct { char x[0]; } ymm;    /* YMM */
     } save_area;
-} __attribute__((packed));
+};
 
 #define CPU_XSAVE_CODE  16
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:17 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19: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.xensource.com>)
	id 1RsJS4-0006cM-Cf; Tue, 31 Jan 2012 19:33:12 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS2-0006cH-AH
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1328038351!50532371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20822 invoked from network); 31 Jan 2012 19:32:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jan 2012 19:32:32 -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 1RsJS0-0000XM-2P
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJRz-0005Q3-R6
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:07 +0000
Message-Id: <E1RsJRz-0005Q3-R6@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/hvm: Remove unnecessary
	packed attribute from hvm_hw_cpu_xsave struct.
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1328010297 0
# Node ID 37ef45fe9f97238eb6845ac0b874a81026cc48c9
# Parent  49bf114c23f50e459b76e29d8882a2e0ad4d2a87
x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24528:3d58058fc7a2
xen-unstable date:        Fri Jan 20 10:26:57 2012 +0000
---


diff -r 49bf114c23f5 -r 37ef45fe9f97 xen/include/public/arch-x86/hvm/save.h
--- a/xen/include/public/arch-x86/hvm/save.h	Fri Jan 20 10:22:17 2012 +0000
+++ b/xen/include/public/arch-x86/hvm/save.h	Tue Jan 31 11:44:57 2012 +0000
@@ -576,7 +576,7 @@
 
         struct { char x[0]; } ymm;    /* YMM */
     } save_area;
-} __attribute__((packed));
+};
 
 #define CPU_XSAVE_CODE  16
 

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19:33: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.xensource.com>)
	id 1RsJSB-0006d0-Fq; Tue, 31 Jan 2012 19:33:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJSA-0006cR-7m
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1328038389!3446012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 974 invoked from network); 31 Jan 2012 19:33:10 -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;
	31 Jan 2012 19:33:10 -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 1RsJS0-0000XP-Ha
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS0-0005QT-DD
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Message-Id: <E1RsJS0-0005QT-DD@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Console: introduce console=none
	command line parameter
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1328010337 0
# Node ID 31be3984d9272a2bf8dae6c54ac5a0be016a195c
# Parent  37ef45fe9f97238eb6845ac0b874a81026cc48c9
Console: introduce console=none command line parameter

Currenty, not specifying 'console=<foo>' on the command line causes
Xen to default to 'vga'.  Alternativly, the user can explicitly
specifiy 'console=vga|com1|com2'.

However, there is no way to specify that neither vga nor serial should
be used.  Specifying 'console=' does have the effect that neither vga
nor serial is set up, but at the cost of an "Bad console= option ''"
warning.

Therefore, expliticly support a 'console=none' option which does not
set up vga and does not set up serial, but does not trigger the bad
console warning.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24614:f8c2cf24a26c
xen-unstable date:        Sat Jan 28 13:41:42 2012 +0000
---


diff -r 37ef45fe9f97 -r 31be3984d927 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Tue Jan 31 11:44:57 2012 +0000
+++ b/xen/drivers/char/console.c	Tue Jan 31 11:45:37 2012 +0000
@@ -559,6 +559,8 @@
             p++;
         if ( !strncmp(p, "vga", 3) )
             vga_init();
+        else if ( !strncmp(p, "none", 4) )
+            continue;
         else if ( strncmp(p, "com", 3) ||
                   (sercon_handle = serial_parse_handle(p)) == -1 )
         {

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:22 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19:33: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.xensource.com>)
	id 1RsJSB-0006d0-Fq; Tue, 31 Jan 2012 19:33:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJSA-0006cR-7m
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1328038389!3446012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 974 invoked from network); 31 Jan 2012 19:33:10 -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;
	31 Jan 2012 19:33:10 -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 1RsJS0-0000XP-Ha
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS0-0005QT-DD
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Message-Id: <E1RsJS0-0005QT-DD@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Console: introduce console=none
	command line parameter
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1328010337 0
# Node ID 31be3984d9272a2bf8dae6c54ac5a0be016a195c
# Parent  37ef45fe9f97238eb6845ac0b874a81026cc48c9
Console: introduce console=none command line parameter

Currenty, not specifying 'console=<foo>' on the command line causes
Xen to default to 'vga'.  Alternativly, the user can explicitly
specifiy 'console=vga|com1|com2'.

However, there is no way to specify that neither vga nor serial should
be used.  Specifying 'console=' does have the effect that neither vga
nor serial is set up, but at the cost of an "Bad console= option ''"
warning.

Therefore, expliticly support a 'console=none' option which does not
set up vga and does not set up serial, but does not trigger the bad
console warning.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24614:f8c2cf24a26c
xen-unstable date:        Sat Jan 28 13:41:42 2012 +0000
---


diff -r 37ef45fe9f97 -r 31be3984d927 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Tue Jan 31 11:44:57 2012 +0000
+++ b/xen/drivers/char/console.c	Tue Jan 31 11:45:37 2012 +0000
@@ -559,6 +559,8 @@
             p++;
         if ( !strncmp(p, "vga", 3) )
             vga_init();
+        else if ( !strncmp(p, "none", 4) )
+            continue;
         else if ( strncmp(p, "com", 3) ||
                   (sercon_handle = serial_parse_handle(p)) == -1 )
         {

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19:33: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.xensource.com>)
	id 1RsJSD-0006dO-LC; Tue, 31 Jan 2012 19:33:21 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJSB-0006cY-Jt
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1328038390!12919516!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27025 invoked from network); 31 Jan 2012 19:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jan 2012 19:33:11 -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 1RsJS0-0000XS-VS
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS0-0005Qr-T8
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Message-Id: <E1RsJS0-0005Qr-T8@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] vesa: flush lfb after zeroing
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1328010357 0
# Node ID 69610d3a7ba7daab47919c1a63162c0ff1e33e37
# Parent  31be3984d9272a2bf8dae6c54ac5a0be016a195c
vesa: flush lfb after zeroing

If Xen is going to relinquish the VGA console, flush the linear frame
buffer after zeroing it in vesa_endboot().

Failing to do so in some circumstances leads to the actual linear
framebuffer on the graphics card still containing the output of the
Xen boot console can lead to ugly graphics output when dom0 is setting
up the graphics card for its own use.

While the patch is quite large, it is mostly just code motion to
prevent having to forward declare lfb_flush().  The only functional
change to vesa_endboot() is to insert a call to lbf_flush().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24615:ac9f32525376
xen-unstable date:        Sat Jan 28 13:42:25 2012 +0000
---


diff -r 31be3984d927 -r 69610d3a7ba7 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c	Tue Jan 31 11:45:37 2012 +0000
+++ b/xen/drivers/video/vesa.c	Tue Jan 31 11:45:57 2012 +0000
@@ -153,24 +153,6 @@
     xfree(line_len);
 }
 
-void __init vesa_endboot(bool_t keep)
-{
-    if ( keep )
-    {
-        xpos = 0;
-        vga_puts = vesa_scroll_puts;
-    }
-    else
-    {
-        unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3;
-        for ( i = 0; i < vlfb_info.height; i++ )
-            memset(lfb + i * vlfb_info.bytes_per_line, 0,
-                   vlfb_info.width * bpp);
-    }
-
-    xfree(line_len);
-}
-
 #if defined(CONFIG_X86)
 
 #include <asm/mtrr.h>
@@ -217,6 +199,25 @@
 
 #endif
 
+void __init vesa_endboot(bool_t keep)
+{
+    if ( keep )
+    {
+        xpos = 0;
+        vga_puts = vesa_scroll_puts;
+    }
+    else
+    {
+        unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3;
+        for ( i = 0; i < vlfb_info.height; i++ )
+            memset(lfb + i * vlfb_info.bytes_per_line, 0,
+                   vlfb_info.width * bpp);
+        lfb_flush();
+    }
+
+    xfree(line_len);
+}
+
 /* Render one line of text to given linear framebuffer line. */
 static void vesa_show_line(
     const unsigned char *text_line,

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:23 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19:33: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.xensource.com>)
	id 1RsJSD-0006dO-LC; Tue, 31 Jan 2012 19:33:21 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJSB-0006cY-Jt
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1328038390!12919516!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27025 invoked from network); 31 Jan 2012 19:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Jan 2012 19:33:11 -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 1RsJS0-0000XS-VS
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS0-0005Qr-T8
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:08 +0000
Message-Id: <E1RsJS0-0005Qr-T8@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] vesa: flush lfb after zeroing
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1328010357 0
# Node ID 69610d3a7ba7daab47919c1a63162c0ff1e33e37
# Parent  31be3984d9272a2bf8dae6c54ac5a0be016a195c
vesa: flush lfb after zeroing

If Xen is going to relinquish the VGA console, flush the linear frame
buffer after zeroing it in vesa_endboot().

Failing to do so in some circumstances leads to the actual linear
framebuffer on the graphics card still containing the output of the
Xen boot console can lead to ugly graphics output when dom0 is setting
up the graphics card for its own use.

While the patch is quite large, it is mostly just code motion to
prevent having to forward declare lfb_flush().  The only functional
change to vesa_endboot() is to insert a call to lbf_flush().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24615:ac9f32525376
xen-unstable date:        Sat Jan 28 13:42:25 2012 +0000
---


diff -r 31be3984d927 -r 69610d3a7ba7 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c	Tue Jan 31 11:45:37 2012 +0000
+++ b/xen/drivers/video/vesa.c	Tue Jan 31 11:45:57 2012 +0000
@@ -153,24 +153,6 @@
     xfree(line_len);
 }
 
-void __init vesa_endboot(bool_t keep)
-{
-    if ( keep )
-    {
-        xpos = 0;
-        vga_puts = vesa_scroll_puts;
-    }
-    else
-    {
-        unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3;
-        for ( i = 0; i < vlfb_info.height; i++ )
-            memset(lfb + i * vlfb_info.bytes_per_line, 0,
-                   vlfb_info.width * bpp);
-    }
-
-    xfree(line_len);
-}
-
 #if defined(CONFIG_X86)
 
 #include <asm/mtrr.h>
@@ -217,6 +199,25 @@
 
 #endif
 
+void __init vesa_endboot(bool_t keep)
+{
+    if ( keep )
+    {
+        xpos = 0;
+        vga_puts = vesa_scroll_puts;
+    }
+    else
+    {
+        unsigned int i, bpp = (vlfb_info.bits_per_pixel + 7) >> 3;
+        for ( i = 0; i < vlfb_info.height; i++ )
+            memset(lfb + i * vlfb_info.bytes_per_line, 0,
+                   vlfb_info.width * bpp);
+        lfb_flush();
+    }
+
+    xfree(line_len);
+}
+
 /* Render one line of text to given linear framebuffer line. */
 static void vesa_show_line(
     const unsigned char *text_line,

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19:33: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.xensource.com>)
	id 1RsJSC-0006dE-IP; Tue, 31 Jan 2012 19:33:20 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJSB-0006cX-8v
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1328038390!4860570!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17192 invoked from network); 31 Jan 2012 19:33:11 -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;
	31 Jan 2012 19:33:11 -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 1RsJS1-0000XV-Hp
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS1-0005RG-Dc
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:09 +0000
Message-Id: <E1RsJS1-0005RG-Dc@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: do not remap pirqs if
	!is_hvm_pv_evtchn_domain
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1328010449 0
# Node ID 00c4b19f264811d14c83b4d0fa7eac80fd55d26e
# Parent  69610d3a7ba7daab47919c1a63162c0ff1e33e37
xen: do not remap pirqs if !is_hvm_pv_evtchn_domain

If the guest is an HVM guest and it is not using the vector callback
mechanism, refuse to remap pirqs onto event channels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Paulian Bogdan Marinca <paulian@marinca.net>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24629:6c9a73817770
xen-unstable date:        Tue Jan 31 11:39:37 2012 +0000
---


diff -r 69610d3a7ba7 -r 00c4b19f2648 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Tue Jan 31 11:45:57 2012 +0000
+++ b/xen/arch/x86/physdev.c	Tue Jan 31 11:47:29 2012 +0000
@@ -93,6 +93,15 @@
 
     if ( map->domid == DOMID_SELF && is_hvm_domain(d) )
     {
+        /*
+         * Only makes sense for vector-based callback, else HVM-IRQ logic
+         * calls back into itself and deadlocks on hvm_domain.irq_lock.
+         */
+        if ( !is_hvm_pv_evtchn_domain(d) )
+        {
+            ret = -EINVAL;
+            goto free_domain;
+        }
         ret = physdev_hvm_map_pirq(d, map);
         goto free_domain;
     }

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

From xen-changelog-bounces@lists.xensource.com Tue Jan 31 19:33:24 2012
Return-path: <xen-changelog-bounces@lists.xensource.com>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 31 Jan 2012 19:33: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.xensource.com>)
	id 1RsJSC-0006dE-IP; Tue, 31 Jan 2012 19:33:20 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJSB-0006cX-8v
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1328038390!4860570!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17192 invoked from network); 31 Jan 2012 19:33:11 -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;
	31 Jan 2012 19:33:11 -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 1RsJS1-0000XV-Hp
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1RsJS1-0005RG-Dc
	for xen-changelog@lists.xensource.com; Tue, 31 Jan 2012 19:33:09 +0000
Message-Id: <E1RsJS1-0005RG-Dc@xenbits.xen.org>
Date: Tue, 31 Jan 2012 19:33:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: do not remap pirqs if
	!is_hvm_pv_evtchn_domain
X-BeenThere: xen-changelog@lists.xensource.com
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xensource.com>
List-Unsubscribe: <http://lists.xensource.com/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xensource.com>
List-Help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>,
	<mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xensource.com
Errors-To: xen-changelog-bounces@lists.xensource.com

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1328010449 0
# Node ID 00c4b19f264811d14c83b4d0fa7eac80fd55d26e
# Parent  69610d3a7ba7daab47919c1a63162c0ff1e33e37
xen: do not remap pirqs if !is_hvm_pv_evtchn_domain

If the guest is an HVM guest and it is not using the vector callback
mechanism, refuse to remap pirqs onto event channels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Paulian Bogdan Marinca <paulian@marinca.net>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24629:6c9a73817770
xen-unstable date:        Tue Jan 31 11:39:37 2012 +0000
---


diff -r 69610d3a7ba7 -r 00c4b19f2648 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Tue Jan 31 11:45:57 2012 +0000
+++ b/xen/arch/x86/physdev.c	Tue Jan 31 11:47:29 2012 +0000
@@ -93,6 +93,15 @@
 
     if ( map->domid == DOMID_SELF && is_hvm_domain(d) )
     {
+        /*
+         * Only makes sense for vector-based callback, else HVM-IRQ logic
+         * calls back into itself and deadlocks on hvm_domain.irq_lock.
+         */
+        if ( !is_hvm_pv_evtchn_domain(d) )
+        {
+            ret = -EINVAL;
+            goto free_domain;
+        }
         ret = physdev_hvm_map_pirq(d, map);
         goto free_domain;
     }

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

